mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
/WALLCHOPS are now printed to screen. Receiving notices for @#channel
are printed like receiving wall messages. /ACTION @#channel didn't work properly. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2169 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
444f329b5f
commit
5d52832efd
@ -94,7 +94,14 @@ static void event_notice(IRC_SERVER_REC *server, const char *data,
|
|||||||
server->real_address;
|
server->real_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
signal_emit("message irc notice", 5, server, msg, nick, addr, target);
|
if (*target == '@' && ischannel(target[1])) {
|
||||||
|
/* /WALLCHOPS received */
|
||||||
|
signal_emit("message irc op_public", 5,
|
||||||
|
server, msg, nick, addr, target+1);
|
||||||
|
} else {
|
||||||
|
signal_emit("message irc notice", 5,
|
||||||
|
server, msg, nick, addr, target);
|
||||||
|
}
|
||||||
g_free(params);
|
g_free(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
fe-irc-commands.c : irssi
|
fe-irc-commands.c : irssi
|
||||||
|
|
||||||
Copyright (C) 1999-2000 Timo Sirainen
|
Copyright (C) 1999-2001 Timo Sirainen
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -83,10 +83,10 @@ static void cmd_action(const char *data, IRC_SERVER_REC *server)
|
|||||||
if (*target == '\0' || *text == '\0')
|
if (*target == '\0' || *text == '\0')
|
||||||
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||||
|
|
||||||
signal_emit("message irc own_action", 3, server, text, target);
|
irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, text);
|
||||||
|
|
||||||
target = skip_target(target);
|
target = skip_target(target);
|
||||||
irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, text);
|
signal_emit("message irc own_action", 3, server, text, target);
|
||||||
cmd_params_free(free_arg);
|
cmd_params_free(free_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,6 +186,24 @@ static void cmd_wall(const char *data, IRC_SERVER_REC *server,
|
|||||||
cmd_params_free(free_arg);
|
cmd_params_free(free_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void cmd_wallchops(const char *data, IRC_SERVER_REC *server,
|
||||||
|
WI_ITEM_REC *item)
|
||||||
|
{
|
||||||
|
char *channame, *msg;
|
||||||
|
void *free_arg;
|
||||||
|
|
||||||
|
CMD_IRC_SERVER(server);
|
||||||
|
|
||||||
|
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTCHAN |
|
||||||
|
PARAM_FLAG_GETREST, item, &channame, &msg))
|
||||||
|
return;
|
||||||
|
if (*msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||||
|
|
||||||
|
signal_emit("message irc own_wall", 3, server, msg, channame);
|
||||||
|
|
||||||
|
cmd_params_free(free_arg);
|
||||||
|
}
|
||||||
|
|
||||||
static void bans_ask_channel(const char *channel, IRC_SERVER_REC *server,
|
static void bans_ask_channel(const char *channel, IRC_SERVER_REC *server,
|
||||||
WI_ITEM_REC *item)
|
WI_ITEM_REC *item)
|
||||||
{
|
{
|
||||||
@ -444,6 +462,7 @@ void fe_irc_commands_init(void)
|
|||||||
command_bind_irc("ctcp", NULL, (SIGNAL_FUNC) cmd_ctcp);
|
command_bind_irc("ctcp", NULL, (SIGNAL_FUNC) cmd_ctcp);
|
||||||
command_bind_irc("nctcp", NULL, (SIGNAL_FUNC) cmd_nctcp);
|
command_bind_irc("nctcp", NULL, (SIGNAL_FUNC) cmd_nctcp);
|
||||||
command_bind_irc("wall", NULL, (SIGNAL_FUNC) cmd_wall);
|
command_bind_irc("wall", NULL, (SIGNAL_FUNC) cmd_wall);
|
||||||
|
command_bind_irc("wallchops", NULL, (SIGNAL_FUNC) cmd_wallchops);
|
||||||
command_bind_irc("ban", NULL, (SIGNAL_FUNC) cmd_ban);
|
command_bind_irc("ban", NULL, (SIGNAL_FUNC) cmd_ban);
|
||||||
command_bind_irc("invitelist", NULL, (SIGNAL_FUNC) cmd_invitelist);
|
command_bind_irc("invitelist", NULL, (SIGNAL_FUNC) cmd_invitelist);
|
||||||
command_bind_irc("ver", NULL, (SIGNAL_FUNC) cmd_ver);
|
command_bind_irc("ver", NULL, (SIGNAL_FUNC) cmd_ver);
|
||||||
@ -461,6 +480,7 @@ void fe_irc_commands_deinit(void)
|
|||||||
command_unbind("ctcp", (SIGNAL_FUNC) cmd_ctcp);
|
command_unbind("ctcp", (SIGNAL_FUNC) cmd_ctcp);
|
||||||
command_unbind("nctcp", (SIGNAL_FUNC) cmd_nctcp);
|
command_unbind("nctcp", (SIGNAL_FUNC) cmd_nctcp);
|
||||||
command_unbind("wall", (SIGNAL_FUNC) cmd_wall);
|
command_unbind("wall", (SIGNAL_FUNC) cmd_wall);
|
||||||
|
command_unbind("wallchops", (SIGNAL_FUNC) cmd_wallchops);
|
||||||
command_unbind("ban", (SIGNAL_FUNC) cmd_ban);
|
command_unbind("ban", (SIGNAL_FUNC) cmd_ban);
|
||||||
command_unbind("invitelist", (SIGNAL_FUNC) cmd_invitelist);
|
command_unbind("invitelist", (SIGNAL_FUNC) cmd_invitelist);
|
||||||
command_unbind("ver", (SIGNAL_FUNC) cmd_ver);
|
command_unbind("ver", (SIGNAL_FUNC) cmd_ver);
|
||||||
|
@ -631,6 +631,24 @@ static void cmd_wall(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item
|
|||||||
cmd_params_free(free_arg);
|
cmd_params_free(free_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* SYNTAX: WALLCHOPS <channel> <message> */
|
||||||
|
static void cmd_wallchops(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
|
||||||
|
{
|
||||||
|
char *channame, *msg;
|
||||||
|
void *free_arg;
|
||||||
|
|
||||||
|
CMD_IRC_SERVER(server);
|
||||||
|
|
||||||
|
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTCHAN |
|
||||||
|
PARAM_FLAG_GETREST, item, &channame, &msg))
|
||||||
|
return;
|
||||||
|
if (*msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||||
|
|
||||||
|
irc_send_cmdv(server, "WALLCHOPS %s :%s", channame, msg);
|
||||||
|
|
||||||
|
cmd_params_free(free_arg);
|
||||||
|
}
|
||||||
|
|
||||||
/* SYNTAX: KICKBAN [<channel>] <nicks> <reason> */
|
/* SYNTAX: KICKBAN [<channel>] <nicks> <reason> */
|
||||||
static void cmd_kickban(const char *data, IRC_SERVER_REC *server,
|
static void cmd_kickban(const char *data, IRC_SERVER_REC *server,
|
||||||
WI_ITEM_REC *item)
|
WI_ITEM_REC *item)
|
||||||
@ -975,11 +993,10 @@ void irc_commands_init(void)
|
|||||||
command_bind_irc("quote", NULL, (SIGNAL_FUNC) cmd_quote);
|
command_bind_irc("quote", NULL, (SIGNAL_FUNC) cmd_quote);
|
||||||
command_bind_irc("rawquote", NULL, (SIGNAL_FUNC) cmd_rawquote);
|
command_bind_irc("rawquote", NULL, (SIGNAL_FUNC) cmd_rawquote);
|
||||||
command_bind_irc("wall", NULL, (SIGNAL_FUNC) cmd_wall);
|
command_bind_irc("wall", NULL, (SIGNAL_FUNC) cmd_wall);
|
||||||
|
command_bind_irc("wallchops", NULL, (SIGNAL_FUNC) cmd_wallchops);
|
||||||
command_bind_irc("wait", NULL, (SIGNAL_FUNC) cmd_wait);
|
command_bind_irc("wait", NULL, (SIGNAL_FUNC) cmd_wait);
|
||||||
/* SYNTAX: WALLOPS <message> */
|
/* SYNTAX: WALLOPS <message> */
|
||||||
command_bind_irc("wallops", NULL, (SIGNAL_FUNC) command_1self);
|
command_bind_irc("wallops", NULL, (SIGNAL_FUNC) command_1self);
|
||||||
/* SYNTAX: WALLCHOPS <channel> <message> */
|
|
||||||
command_bind_irc("wallchops", NULL, (SIGNAL_FUNC) command_2self);
|
|
||||||
command_bind_irc("kickban", NULL, (SIGNAL_FUNC) cmd_kickban);
|
command_bind_irc("kickban", NULL, (SIGNAL_FUNC) cmd_kickban);
|
||||||
command_bind_irc("knockout", NULL, (SIGNAL_FUNC) cmd_knockout);
|
command_bind_irc("knockout", NULL, (SIGNAL_FUNC) cmd_knockout);
|
||||||
command_bind_irc("server purge", NULL, (SIGNAL_FUNC) cmd_server_purge);
|
command_bind_irc("server purge", NULL, (SIGNAL_FUNC) cmd_server_purge);
|
||||||
@ -1047,9 +1064,9 @@ void irc_commands_deinit(void)
|
|||||||
command_unbind("quote", (SIGNAL_FUNC) cmd_quote);
|
command_unbind("quote", (SIGNAL_FUNC) cmd_quote);
|
||||||
command_unbind("rawquote", (SIGNAL_FUNC) cmd_rawquote);
|
command_unbind("rawquote", (SIGNAL_FUNC) cmd_rawquote);
|
||||||
command_unbind("wall", (SIGNAL_FUNC) cmd_wall);
|
command_unbind("wall", (SIGNAL_FUNC) cmd_wall);
|
||||||
|
command_unbind("wallchops", (SIGNAL_FUNC) cmd_wallchops);
|
||||||
command_unbind("wait", (SIGNAL_FUNC) cmd_wait);
|
command_unbind("wait", (SIGNAL_FUNC) cmd_wait);
|
||||||
command_unbind("wallops", (SIGNAL_FUNC) command_1self);
|
command_unbind("wallops", (SIGNAL_FUNC) command_1self);
|
||||||
command_unbind("wallchops", (SIGNAL_FUNC) command_2self);
|
|
||||||
command_unbind("kickban", (SIGNAL_FUNC) cmd_kickban);
|
command_unbind("kickban", (SIGNAL_FUNC) cmd_kickban);
|
||||||
command_unbind("knockout", (SIGNAL_FUNC) cmd_knockout);
|
command_unbind("knockout", (SIGNAL_FUNC) cmd_knockout);
|
||||||
command_unbind("server purge", (SIGNAL_FUNC) cmd_server_purge);
|
command_unbind("server purge", (SIGNAL_FUNC) cmd_server_purge);
|
||||||
|
Loading…
Reference in New Issue
Block a user