1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-08 10:43:13 +02:00

- added IRC::get_info function for Perl scripts

- cleanup code in main() function of weechat.c
- fixed bug when unloading all Perl scripts (now end and restart Perl interpreter)
This commit is contained in:
Sebastien Helleu
2003-11-30 19:18:06 +00:00
parent c8c5ff3d68
commit a1f09df80f
20 changed files with 498 additions and 288 deletions
+2 -2
View File
@@ -268,8 +268,8 @@ t_irc_command irc_commands[] =
{ "301", N_("away message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
{ "302", N_("userhost"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_reply },
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_reply },
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
+50
View File
@@ -1333,6 +1333,56 @@ irc_cmd_recv_303 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_305: '305' command (unaway)
*/
int
irc_cmd_recv_305 (t_irc_server *server, char *host, char *arguments)
{
/* make gcc happy */
(void) host;
arguments = strchr (arguments, ' ');
if (arguments)
{
while (arguments[0] == ' ')
arguments++;
if (arguments[0] == ':')
arguments++;
irc_display_prefix (server->window, PREFIX_SERVER);
gui_printf_color (server->window,
COLOR_WIN_CHAT, "%s\n", arguments);
}
server->is_away = 0;
return 0;
}
/*
* irc_cmd_recv_306: '306' command (now away)
*/
int
irc_cmd_recv_306 (t_irc_server *server, char *host, char *arguments)
{
/* make gcc happy */
(void) host;
arguments = strchr (arguments, ' ');
if (arguments)
{
while (arguments[0] == ' ')
arguments++;
if (arguments[0] == ':')
arguments++;
irc_display_prefix (server->window, PREFIX_SERVER);
gui_printf_color (server->window,
COLOR_WIN_CHAT, "%s\n", arguments);
}
server->is_away = 1;
return 0;
}
/*
* irc_cmd_recv_311: '311' command (whois, user)
*/
+22 -1
View File
@@ -467,7 +467,7 @@ server_recv (t_irc_server *server)
}
/*
* server_connect: connect to an irc server
* server_connect: connect to an IRC server
*/
int
@@ -571,6 +571,27 @@ server_connect (t_irc_server *server)
return 1;
}
/*
* server_auto_connect: auto-connect to servers (called at startup)
*/
void
server_auto_connect ()
{
t_irc_server *ptr_server;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->autoconnect)
{
gui_window_new (ptr_server, NULL);
if (server_connect (ptr_server))
irc_login (ptr_server);
}
}
}
/*
* server_disconnect: disconnect from an irc server
*/
+4 -1
View File
@@ -32,7 +32,7 @@
#define PREFIX_PART "<--"
#define PREFIX_QUIT "<--"
#define PREFIX_ERROR "=!="
#define PREFIX_PLUGIN "=P="
#define PREFIX_PLUGIN "-P-"
#define CHANNEL_PREFIX "#&+!"
@@ -152,6 +152,7 @@ extern int server_send (t_irc_server *, char *, int);
extern int server_sendf (t_irc_server *, char *, ...);
extern void server_recv (t_irc_server *);
extern int server_connect ();
extern void server_auto_connect ();
extern void server_disconnect (t_irc_server *);
extern void server_disconnect_all ();
extern t_irc_server *server_search (char *);
@@ -256,6 +257,8 @@ extern int irc_cmd_recv_004 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_301 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_302 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_303 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_305 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_306 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_311 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_312 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_313 (t_irc_server *, char *, char *);