mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 16:12:30 +02:00
CTCP msgs/replies stops the "event privmsg" or "event notice" signals now
so you don't have to check for them anymore (unless you use signal_add_first()..). /WINDOW MOVE command had some bugs. CTCP reply to some channel didn't display the channel name. Several code cleanups. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@327 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
919abb2c6f
commit
18f3c74d68
19 changed files with 231 additions and 229 deletions
|
|
@ -195,7 +195,7 @@ static void flood_privmsg(const char *data, IRC_SERVER_REC *server, const char *
|
|||
g_return_if_fail(data != NULL);
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (nick == NULL) {
|
||||
if (nick == NULL || addr == NULL) {
|
||||
/* don't try to ignore server messages.. */
|
||||
return;
|
||||
}
|
||||
|
|
@ -223,18 +223,32 @@ static void flood_notice(const char *data, IRC_SERVER_REC *server, const char *n
|
|||
g_return_if_fail(data != NULL);
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (nick == NULL) {
|
||||
if (nick == NULL || addr == NULL) {
|
||||
/* don't try to ignore server messages.. */
|
||||
return;
|
||||
}
|
||||
|
||||
params = event_get_params(data, 2, &target, &text);
|
||||
if (addr != NULL && !ignore_check(server, nick, addr, target, text, MSGLEVEL_NOTICES))
|
||||
flood_newmsg(server, MSGLEVEL_NOTICES | ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS, nick, addr, target);
|
||||
if (!ignore_check(server, nick, addr, target, text, MSGLEVEL_NOTICES))
|
||||
flood_newmsg(server, MSGLEVEL_NOTICES, nick, addr, target);
|
||||
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
static void flood_ctcp(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target)
|
||||
{
|
||||
g_return_if_fail(data != NULL);
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (nick == NULL || addr == NULL) {
|
||||
/* don't try to ignore server messages.. */
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ignore_check(server, nick, addr, target, data, MSGLEVEL_CTCPS))
|
||||
flood_newmsg(server, MSGLEVEL_CTCPS, nick, addr, target);
|
||||
}
|
||||
|
||||
static void read_settings(void)
|
||||
{
|
||||
int time;
|
||||
|
|
@ -255,6 +269,8 @@ static void read_settings(void)
|
|||
flood_tag = g_timeout_add(time, (GSourceFunc) flood_timeout, NULL);
|
||||
signal_add("event privmsg", (SIGNAL_FUNC) flood_privmsg);
|
||||
signal_add("event notice", (SIGNAL_FUNC) flood_notice);
|
||||
signal_add("ctcp msg", (SIGNAL_FUNC) flood_ctcp);
|
||||
signal_add("ctcp reply", (SIGNAL_FUNC) flood_ctcp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -280,6 +296,8 @@ void irc_flood_deinit(void)
|
|||
g_source_remove(flood_tag);
|
||||
signal_remove("event privmsg", (SIGNAL_FUNC) flood_privmsg);
|
||||
signal_remove("event notice", (SIGNAL_FUNC) flood_notice);
|
||||
signal_remove("ctcp msg", (SIGNAL_FUNC) flood_ctcp);
|
||||
signal_remove("ctcp reply", (SIGNAL_FUNC) flood_ctcp);
|
||||
}
|
||||
|
||||
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue