mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
Actions are now sent in "ctcp action" signal which is never ignored. "ctcp
msg action" doesn't work anymore nor does it show in "ctcp msg"s. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2303 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
7131ceb909
commit
9fffa58c20
4 changed files with 37 additions and 24 deletions
|
|
@ -40,15 +40,10 @@ QUERY_REC *irc_query_create(const char *server_tag,
|
|||
return rec;
|
||||
}
|
||||
|
||||
static void event_privmsg(IRC_SERVER_REC *server, const char *data,
|
||||
const char *nick, const char *address)
|
||||
static void check_address_change(IRC_SERVER_REC *server, const char *nick,
|
||||
const char *address, const char *target)
|
||||
{
|
||||
QUERY_REC *query;
|
||||
char *params, *target, *msg;
|
||||
|
||||
g_return_if_fail(data != NULL);
|
||||
|
||||
params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &msg);
|
||||
|
||||
if (address != NULL && !ischannel(*target)) {
|
||||
/* save nick's address to query */
|
||||
|
|
@ -57,10 +52,28 @@ static void event_privmsg(IRC_SERVER_REC *server, const char *data,
|
|||
strcmp(query->address, address) != 0))
|
||||
query_change_address(query, address);
|
||||
}
|
||||
}
|
||||
|
||||
static void event_privmsg(IRC_SERVER_REC *server, const char *data,
|
||||
const char *nick, const char *address)
|
||||
{
|
||||
char *params, *target, *msg;
|
||||
|
||||
g_return_if_fail(data != NULL);
|
||||
|
||||
params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &msg);
|
||||
check_address_change(server, nick, address, target);
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
static void ctcp_action(IRC_SERVER_REC *server, const char *msg,
|
||||
const char *nick, const char *address,
|
||||
const char *target)
|
||||
{
|
||||
check_address_change(server, nick, address, target);
|
||||
}
|
||||
|
||||
|
||||
static void event_nick(SERVER_REC *server, const char *data,
|
||||
const char *orignick)
|
||||
{
|
||||
|
|
@ -78,11 +91,13 @@ static void event_nick(SERVER_REC *server, const char *data,
|
|||
void irc_queries_init(void)
|
||||
{
|
||||
signal_add_last("event privmsg", (SIGNAL_FUNC) event_privmsg);
|
||||
signal_add_last("ctcp action", (SIGNAL_FUNC) ctcp_action);
|
||||
signal_add("event nick", (SIGNAL_FUNC) event_nick);
|
||||
}
|
||||
|
||||
void irc_queries_deinit(void)
|
||||
{
|
||||
signal_remove("event privmsg", (SIGNAL_FUNC) event_privmsg);
|
||||
signal_remove("ctcp action", (SIGNAL_FUNC) ctcp_action);
|
||||
signal_remove("event nick", (SIGNAL_FUNC) event_nick);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue