mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 09:13:14 +02:00
Added commands: die, summon, users, wallops, userhost, ison ; fixed display bug (blinking text when scrolling)
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2003-10-10
|
||||
ChangeLog - 2003-10-11
|
||||
|
||||
|
||||
Version 0.0.3 (under dev!):
|
||||
* fixed display bug (text was blinking when scrolling)
|
||||
* new IRC command: /stats, /service, /squit, /motd, /lusers, /links, /time,
|
||||
/trace, /admin, /info, /servlist, /squery, /who, /whowas
|
||||
/trace, /admin, /info, /servlist, /squery, /who, /whowas, /die, /summon,
|
||||
/users, /wallops, /userhost, /ison
|
||||
* french translation
|
||||
|
||||
Version 0.0.2 (2003-10-05):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2003-10-08
|
||||
TODO - 2003-10-11
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -14,7 +14,7 @@ v0.0.3:
|
||||
------
|
||||
|
||||
* IRC protocol:
|
||||
+ implement RFC 2812
|
||||
# implement RFC 2812
|
||||
+ "/mode" command: change the user/channels modes
|
||||
|
||||
* WeeChat commands:
|
||||
|
||||
@@ -411,11 +411,13 @@ gui_display_end_of_line (t_gui_window *window, t_gui_line *line, int count)
|
||||
if (!ptr_message ||
|
||||
(window->win_chat_cursor_x > (window->win_chat_width - 1)))
|
||||
{
|
||||
window->win_chat_cursor_x = 0;
|
||||
if (lines_displayed >= num_lines - count)
|
||||
{
|
||||
if (window->win_chat_cursor_x <= window->win_chat_width - 1)
|
||||
wclrtoeol (window->win_chat);
|
||||
window->win_chat_cursor_y++;
|
||||
}
|
||||
window->win_chat_cursor_x = 0;
|
||||
lines_displayed++;
|
||||
}
|
||||
}
|
||||
@@ -503,7 +505,11 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int stop_at_end)
|
||||
if (!ptr_message ||
|
||||
((window->win_chat_cursor_y <= window->win_chat_height - 1) &&
|
||||
(window->win_chat_cursor_x > window->win_chat_width - 1)))
|
||||
{
|
||||
if (window->win_chat_cursor_x <= window->win_chat_width - 1)
|
||||
wclrtoeol (window->win_chat);
|
||||
window->win_chat_cursor_y++;
|
||||
}
|
||||
window->win_chat_cursor_x = 0;
|
||||
}
|
||||
}
|
||||
@@ -589,7 +595,7 @@ gui_redraw_window_chat (t_gui_window *window)
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
gui_curses_window_clear (window->win_chat);
|
||||
//gui_curses_window_clear (window->win_chat);
|
||||
gui_draw_window_chat (window);
|
||||
}
|
||||
|
||||
@@ -625,7 +631,7 @@ gui_draw_window_nick (t_gui_window *window)
|
||||
window->win_nick_width,
|
||||
window->win_nick_y,
|
||||
window->win_nick_x);
|
||||
gui_redraw_window_chat (window);
|
||||
gui_draw_window_chat (window);
|
||||
}
|
||||
sprintf (format, "%%-%ds", max_length);
|
||||
|
||||
@@ -1692,7 +1698,7 @@ gui_add_message (t_gui_window *window, int type, int color, char *message)
|
||||
if ((window->win_chat_cursor_y
|
||||
+ gui_get_line_num_splits (window, window->last_line)) >
|
||||
(window->win_chat_height - 1))
|
||||
gui_redraw_window_chat (window);
|
||||
gui_draw_window_chat (window);
|
||||
else
|
||||
gui_display_line (window, window->last_line, 1);
|
||||
}
|
||||
|
||||
+26
-2
@@ -49,6 +49,9 @@ t_irc_command irc_commands[] =
|
||||
{ "devoice", N_("removes voice from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, 1, 1, irc_cmd_send_devoice, NULL, NULL },
|
||||
{ "die", N_("shutdown the server"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, irc_cmd_send_die, NULL },
|
||||
{ "error", N_("error received from IRC server"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "info", N_("get information describing the server"),
|
||||
N_("[target]"),
|
||||
@@ -58,6 +61,10 @@ t_irc_command irc_commands[] =
|
||||
N_("nickname channel"),
|
||||
N_("nickname: nick to invite\nchannel: channel to invite"),
|
||||
2, 2, 1, NULL, irc_cmd_send_invite, NULL },
|
||||
{ "ison", N_("check if a nickname is currently on IRC"),
|
||||
N_("nickname [nickname ...]"),
|
||||
N_("nickname: nickname"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
|
||||
{ "join", N_("join a channel"),
|
||||
N_("channel[,channel] [key[,key]]"),
|
||||
N_("channel: channel name to join\nkey: key to join the channel"),
|
||||
@@ -180,9 +187,14 @@ t_irc_command irc_commands[] =
|
||||
N_("server commnent"), N_("server: server name\ncomment: comment for quit"),
|
||||
2, 2, 1, NULL, irc_cmd_send_squit, NULL },
|
||||
{ "stats", N_("query statistics about server"),
|
||||
"[query [server]]",
|
||||
"query: c/h/i/k/l/m/o/y/u (see RFC1459)\nserver: server name",
|
||||
N_("[query [server]]"),
|
||||
N_("query: c/h/i/k/l/m/o/y/u (see RFC1459)\nserver: server name"),
|
||||
0, 2, 1, NULL, irc_cmd_send_stats, NULL },
|
||||
{ "summon", N_("give users who are on a host running an IRC server a message "
|
||||
"asking them to please join IRC"),
|
||||
N_("user [target [channel]]"),
|
||||
N_("user: username\ntarget: server name\nchannel: channel name"),
|
||||
1, 3, 1, NULL, irc_cmd_send_summon, NULL },
|
||||
{ "time", N_("query local time from server"),
|
||||
N_("[target]"), N_("target: query time from specified server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_time, NULL },
|
||||
@@ -193,12 +205,22 @@ t_irc_command irc_commands[] =
|
||||
{ "trace", N_("find the route to specific server"),
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_trace, NULL },
|
||||
{ "userhost", N_("return a list of information about nicknames"),
|
||||
N_("nickname [nickname ...]"), N_("nickname: nickname"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
|
||||
{ "users", N_("list of users logged into the server"),
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_users, NULL },
|
||||
{ "version", N_("gives the version info of nick or server (current or specified)"),
|
||||
N_("[server | nickname]"), N_("server: server name\nnickname: nickname"),
|
||||
0, 1, 1, NULL, irc_cmd_send_version, NULL },
|
||||
{ "voice", N_("gives voice to nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, 1, 1, irc_cmd_send_voice, NULL, NULL },
|
||||
{ "wallops", N_("send a message to all currently connected users who have "
|
||||
"set the 'w' user mode for themselves"),
|
||||
N_("text"), N_("text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
|
||||
{ "who", N_("generate a query which returns a list of information"),
|
||||
N_("[mask [\"o\"]]"), N_("mask: only information which match this mask\n"
|
||||
"o: only operators are returned according to the mask supplied\n"),
|
||||
@@ -241,6 +263,8 @@ t_irc_command irc_commands[] =
|
||||
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "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 },
|
||||
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
|
||||
|
||||
+99
-1
@@ -1109,7 +1109,7 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *arguments)
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_311: '311' command (away message)
|
||||
* irc_cmd_recv_301: '301' command (away message)
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1146,6 +1146,104 @@ irc_cmd_recv_301 (t_irc_server *server, char *host, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_302: '302' command (userhost)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_recv_302 (t_irc_server *server, char *host, char *arguments)
|
||||
{
|
||||
char *pos_host, *ptr_next;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
|
||||
arguments = strchr (arguments, ' ');
|
||||
if (arguments)
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (arguments[0] == ':')
|
||||
arguments++;
|
||||
while (arguments)
|
||||
{
|
||||
pos_host = strchr (arguments, '=');
|
||||
if (pos_host)
|
||||
{
|
||||
pos_host[0] = '\0';
|
||||
pos_host++;
|
||||
|
||||
ptr_next = strchr (pos_host, ' ');
|
||||
if (ptr_next)
|
||||
{
|
||||
ptr_next[0] = '\0';
|
||||
ptr_next++;
|
||||
while (ptr_next[0] == ' ')
|
||||
ptr_next++;
|
||||
}
|
||||
|
||||
irc_display_prefix (server->window, PREFIX_SERVER);
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT_NICK, "%s", arguments);
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT, "=");
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT_HOST, "%s\n", pos_host);
|
||||
}
|
||||
else
|
||||
ptr_next = NULL;
|
||||
arguments = ptr_next;
|
||||
if (arguments && !arguments[0])
|
||||
arguments = NULL;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_303: '303' command (ison)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_recv_303 (t_irc_server *server, char *host, char *arguments)
|
||||
{
|
||||
char *ptr_next;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
|
||||
irc_display_prefix (server->window, PREFIX_SERVER);
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT, _("Users online: "));
|
||||
|
||||
arguments = strchr (arguments, ' ');
|
||||
if (arguments)
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (arguments[0] == ':')
|
||||
arguments++;
|
||||
while (arguments)
|
||||
{
|
||||
ptr_next = strchr (arguments, ' ');
|
||||
if (ptr_next)
|
||||
{
|
||||
ptr_next[0] = '\0';
|
||||
ptr_next++;
|
||||
while (ptr_next[0] == ' ')
|
||||
ptr_next++;
|
||||
}
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT_NICK, "%s ", arguments);
|
||||
arguments = ptr_next;
|
||||
if (arguments && !arguments[0])
|
||||
arguments = NULL;
|
||||
}
|
||||
}
|
||||
gui_printf (server->window, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_311: '311' command (whois, user)
|
||||
*/
|
||||
|
||||
@@ -217,6 +217,20 @@ irc_cmd_send_devoice (t_irc_server *server, int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_die: shotdown the server
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_die (t_irc_server *server, char *arguments)
|
||||
{
|
||||
/* make gcc happy */
|
||||
(void) arguments;
|
||||
|
||||
server_sendf (server, "DIE\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_info: get information describing the server
|
||||
*/
|
||||
@@ -242,6 +256,17 @@ irc_cmd_send_invite (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_ison: check if a nickname is currently on IRC
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_ison (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "ISON %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_join: join a new channel
|
||||
*/
|
||||
@@ -797,6 +822,18 @@ irc_cmd_send_stats (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_summon: give users who are on a host running an IRC server
|
||||
* a message asking them to please join IRC
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_summon (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "SUMMON %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_time: query local time from server
|
||||
*/
|
||||
@@ -881,6 +918,31 @@ irc_cmd_send_trace (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_userhost: return a list of information about nicknames
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_userhost (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "USERHOST %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_users: list of users logged into the server
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_users (t_irc_server *server, char *arguments)
|
||||
{
|
||||
if (arguments)
|
||||
server_sendf (server, "USERS %s\r\n", arguments);
|
||||
else
|
||||
server_sendf (server, "USERS\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_version: gives the version info of nick or server (current or specified)
|
||||
*/
|
||||
@@ -935,6 +997,18 @@ irc_cmd_send_voice (t_irc_server *server, int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_wallops: send a message to all currently connected users who
|
||||
* have set the 'w' user mode for themselves
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_wallops (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "WALLOPS %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_who: generate a query which returns a list of information
|
||||
*/
|
||||
|
||||
@@ -193,8 +193,10 @@ extern int irc_cmd_send_away (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ctcp (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_deop (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_devoice (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_die (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_info (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_invite (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ison (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_join (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_kick (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_kill (t_irc_server *, char *);
|
||||
@@ -222,11 +224,15 @@ extern int irc_cmd_send_servlist (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_squery (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_squit (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_stats (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_summon (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_time (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_topic (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_trace (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_userhost (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_users (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_version (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_voice (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_wallops (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_who (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_whois (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_whowas (t_irc_server *, char *);
|
||||
@@ -247,6 +253,8 @@ extern int irc_cmd_recv_topic (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_001 (t_irc_server *, char *, char *);
|
||||
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_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 *);
|
||||
|
||||
+4
-2
@@ -1,12 +1,14 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2003-10-10
|
||||
ChangeLog - 2003-10-11
|
||||
|
||||
|
||||
Version 0.0.3 (under dev!):
|
||||
* fixed display bug (text was blinking when scrolling)
|
||||
* new IRC command: /stats, /service, /squit, /motd, /lusers, /links, /time,
|
||||
/trace, /admin, /info, /servlist, /squery, /who, /whowas
|
||||
/trace, /admin, /info, /servlist, /squery, /who, /whowas, /die, /summon,
|
||||
/users, /wallops, /userhost, /ison
|
||||
* french translation
|
||||
|
||||
Version 0.0.2 (2003-10-05):
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2003-10-08
|
||||
TODO - 2003-10-11
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -14,7 +14,7 @@ v0.0.3:
|
||||
------
|
||||
|
||||
* IRC protocol:
|
||||
+ implement RFC 2812
|
||||
# implement RFC 2812
|
||||
+ "/mode" command: change the user/channels modes
|
||||
|
||||
* WeeChat commands:
|
||||
|
||||
@@ -411,11 +411,13 @@ gui_display_end_of_line (t_gui_window *window, t_gui_line *line, int count)
|
||||
if (!ptr_message ||
|
||||
(window->win_chat_cursor_x > (window->win_chat_width - 1)))
|
||||
{
|
||||
window->win_chat_cursor_x = 0;
|
||||
if (lines_displayed >= num_lines - count)
|
||||
{
|
||||
if (window->win_chat_cursor_x <= window->win_chat_width - 1)
|
||||
wclrtoeol (window->win_chat);
|
||||
window->win_chat_cursor_y++;
|
||||
}
|
||||
window->win_chat_cursor_x = 0;
|
||||
lines_displayed++;
|
||||
}
|
||||
}
|
||||
@@ -503,7 +505,11 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int stop_at_end)
|
||||
if (!ptr_message ||
|
||||
((window->win_chat_cursor_y <= window->win_chat_height - 1) &&
|
||||
(window->win_chat_cursor_x > window->win_chat_width - 1)))
|
||||
{
|
||||
if (window->win_chat_cursor_x <= window->win_chat_width - 1)
|
||||
wclrtoeol (window->win_chat);
|
||||
window->win_chat_cursor_y++;
|
||||
}
|
||||
window->win_chat_cursor_x = 0;
|
||||
}
|
||||
}
|
||||
@@ -589,7 +595,7 @@ gui_redraw_window_chat (t_gui_window *window)
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
gui_curses_window_clear (window->win_chat);
|
||||
//gui_curses_window_clear (window->win_chat);
|
||||
gui_draw_window_chat (window);
|
||||
}
|
||||
|
||||
@@ -625,7 +631,7 @@ gui_draw_window_nick (t_gui_window *window)
|
||||
window->win_nick_width,
|
||||
window->win_nick_y,
|
||||
window->win_nick_x);
|
||||
gui_redraw_window_chat (window);
|
||||
gui_draw_window_chat (window);
|
||||
}
|
||||
sprintf (format, "%%-%ds", max_length);
|
||||
|
||||
@@ -1692,7 +1698,7 @@ gui_add_message (t_gui_window *window, int type, int color, char *message)
|
||||
if ((window->win_chat_cursor_y
|
||||
+ gui_get_line_num_splits (window, window->last_line)) >
|
||||
(window->win_chat_height - 1))
|
||||
gui_redraw_window_chat (window);
|
||||
gui_draw_window_chat (window);
|
||||
else
|
||||
gui_display_line (window, window->last_line, 1);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@ t_irc_command irc_commands[] =
|
||||
{ "devoice", N_("removes voice from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, 1, 1, irc_cmd_send_devoice, NULL, NULL },
|
||||
{ "die", N_("shutdown the server"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, irc_cmd_send_die, NULL },
|
||||
{ "error", N_("error received from IRC server"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "info", N_("get information describing the server"),
|
||||
N_("[target]"),
|
||||
@@ -58,6 +61,10 @@ t_irc_command irc_commands[] =
|
||||
N_("nickname channel"),
|
||||
N_("nickname: nick to invite\nchannel: channel to invite"),
|
||||
2, 2, 1, NULL, irc_cmd_send_invite, NULL },
|
||||
{ "ison", N_("check if a nickname is currently on IRC"),
|
||||
N_("nickname [nickname ...]"),
|
||||
N_("nickname: nickname"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
|
||||
{ "join", N_("join a channel"),
|
||||
N_("channel[,channel] [key[,key]]"),
|
||||
N_("channel: channel name to join\nkey: key to join the channel"),
|
||||
@@ -180,9 +187,14 @@ t_irc_command irc_commands[] =
|
||||
N_("server commnent"), N_("server: server name\ncomment: comment for quit"),
|
||||
2, 2, 1, NULL, irc_cmd_send_squit, NULL },
|
||||
{ "stats", N_("query statistics about server"),
|
||||
"[query [server]]",
|
||||
"query: c/h/i/k/l/m/o/y/u (see RFC1459)\nserver: server name",
|
||||
N_("[query [server]]"),
|
||||
N_("query: c/h/i/k/l/m/o/y/u (see RFC1459)\nserver: server name"),
|
||||
0, 2, 1, NULL, irc_cmd_send_stats, NULL },
|
||||
{ "summon", N_("give users who are on a host running an IRC server a message "
|
||||
"asking them to please join IRC"),
|
||||
N_("user [target [channel]]"),
|
||||
N_("user: username\ntarget: server name\nchannel: channel name"),
|
||||
1, 3, 1, NULL, irc_cmd_send_summon, NULL },
|
||||
{ "time", N_("query local time from server"),
|
||||
N_("[target]"), N_("target: query time from specified server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_time, NULL },
|
||||
@@ -193,12 +205,22 @@ t_irc_command irc_commands[] =
|
||||
{ "trace", N_("find the route to specific server"),
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_trace, NULL },
|
||||
{ "userhost", N_("return a list of information about nicknames"),
|
||||
N_("nickname [nickname ...]"), N_("nickname: nickname"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
|
||||
{ "users", N_("list of users logged into the server"),
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_users, NULL },
|
||||
{ "version", N_("gives the version info of nick or server (current or specified)"),
|
||||
N_("[server | nickname]"), N_("server: server name\nnickname: nickname"),
|
||||
0, 1, 1, NULL, irc_cmd_send_version, NULL },
|
||||
{ "voice", N_("gives voice to nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, 1, 1, irc_cmd_send_voice, NULL, NULL },
|
||||
{ "wallops", N_("send a message to all currently connected users who have "
|
||||
"set the 'w' user mode for themselves"),
|
||||
N_("text"), N_("text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
|
||||
{ "who", N_("generate a query which returns a list of information"),
|
||||
N_("[mask [\"o\"]]"), N_("mask: only information which match this mask\n"
|
||||
"o: only operators are returned according to the mask supplied\n"),
|
||||
@@ -241,6 +263,8 @@ t_irc_command irc_commands[] =
|
||||
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "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 },
|
||||
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
|
||||
|
||||
@@ -1109,7 +1109,7 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *arguments)
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_311: '311' command (away message)
|
||||
* irc_cmd_recv_301: '301' command (away message)
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1146,6 +1146,104 @@ irc_cmd_recv_301 (t_irc_server *server, char *host, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_302: '302' command (userhost)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_recv_302 (t_irc_server *server, char *host, char *arguments)
|
||||
{
|
||||
char *pos_host, *ptr_next;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
|
||||
arguments = strchr (arguments, ' ');
|
||||
if (arguments)
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (arguments[0] == ':')
|
||||
arguments++;
|
||||
while (arguments)
|
||||
{
|
||||
pos_host = strchr (arguments, '=');
|
||||
if (pos_host)
|
||||
{
|
||||
pos_host[0] = '\0';
|
||||
pos_host++;
|
||||
|
||||
ptr_next = strchr (pos_host, ' ');
|
||||
if (ptr_next)
|
||||
{
|
||||
ptr_next[0] = '\0';
|
||||
ptr_next++;
|
||||
while (ptr_next[0] == ' ')
|
||||
ptr_next++;
|
||||
}
|
||||
|
||||
irc_display_prefix (server->window, PREFIX_SERVER);
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT_NICK, "%s", arguments);
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT, "=");
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT_HOST, "%s\n", pos_host);
|
||||
}
|
||||
else
|
||||
ptr_next = NULL;
|
||||
arguments = ptr_next;
|
||||
if (arguments && !arguments[0])
|
||||
arguments = NULL;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_303: '303' command (ison)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_recv_303 (t_irc_server *server, char *host, char *arguments)
|
||||
{
|
||||
char *ptr_next;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
|
||||
irc_display_prefix (server->window, PREFIX_SERVER);
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT, _("Users online: "));
|
||||
|
||||
arguments = strchr (arguments, ' ');
|
||||
if (arguments)
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (arguments[0] == ':')
|
||||
arguments++;
|
||||
while (arguments)
|
||||
{
|
||||
ptr_next = strchr (arguments, ' ');
|
||||
if (ptr_next)
|
||||
{
|
||||
ptr_next[0] = '\0';
|
||||
ptr_next++;
|
||||
while (ptr_next[0] == ' ')
|
||||
ptr_next++;
|
||||
}
|
||||
gui_printf_color (server->window,
|
||||
COLOR_WIN_CHAT_NICK, "%s ", arguments);
|
||||
arguments = ptr_next;
|
||||
if (arguments && !arguments[0])
|
||||
arguments = NULL;
|
||||
}
|
||||
}
|
||||
gui_printf (server->window, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_311: '311' command (whois, user)
|
||||
*/
|
||||
|
||||
@@ -217,6 +217,20 @@ irc_cmd_send_devoice (t_irc_server *server, int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_die: shotdown the server
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_die (t_irc_server *server, char *arguments)
|
||||
{
|
||||
/* make gcc happy */
|
||||
(void) arguments;
|
||||
|
||||
server_sendf (server, "DIE\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_info: get information describing the server
|
||||
*/
|
||||
@@ -242,6 +256,17 @@ irc_cmd_send_invite (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_ison: check if a nickname is currently on IRC
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_ison (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "ISON %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_join: join a new channel
|
||||
*/
|
||||
@@ -797,6 +822,18 @@ irc_cmd_send_stats (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_summon: give users who are on a host running an IRC server
|
||||
* a message asking them to please join IRC
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_summon (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "SUMMON %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_time: query local time from server
|
||||
*/
|
||||
@@ -881,6 +918,31 @@ irc_cmd_send_trace (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_userhost: return a list of information about nicknames
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_userhost (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "USERHOST %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_users: list of users logged into the server
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_users (t_irc_server *server, char *arguments)
|
||||
{
|
||||
if (arguments)
|
||||
server_sendf (server, "USERS %s\r\n", arguments);
|
||||
else
|
||||
server_sendf (server, "USERS\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_version: gives the version info of nick or server (current or specified)
|
||||
*/
|
||||
@@ -935,6 +997,18 @@ irc_cmd_send_voice (t_irc_server *server, int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_wallops: send a message to all currently connected users who
|
||||
* have set the 'w' user mode for themselves
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_wallops (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "WALLOPS %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_who: generate a query which returns a list of information
|
||||
*/
|
||||
|
||||
@@ -193,8 +193,10 @@ extern int irc_cmd_send_away (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ctcp (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_deop (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_devoice (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_die (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_info (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_invite (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ison (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_join (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_kick (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_kill (t_irc_server *, char *);
|
||||
@@ -222,11 +224,15 @@ extern int irc_cmd_send_servlist (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_squery (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_squit (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_stats (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_summon (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_time (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_topic (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_trace (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_userhost (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_users (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_version (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_voice (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_wallops (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_who (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_whois (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_whowas (t_irc_server *, char *);
|
||||
@@ -247,6 +253,8 @@ extern int irc_cmd_recv_topic (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_001 (t_irc_server *, char *, char *);
|
||||
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_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 *);
|
||||
|
||||
Reference in New Issue
Block a user