diff options
author | LemonBoy <thatlemon@gmail.com> | 2015-05-15 16:42:51 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2015-05-15 17:07:30 +0200 |
commit | 16c71cf1fbc1e7987fdde821813005b87237e951 (patch) | |
tree | d5af65015c8f3acd5c9c0fe3ac3d8950ebf85637 | |
parent | c122a2a226363114e11f32072395e2f06ad6a450 (diff) | |
download | irssi-16c71cf1fbc1e7987fdde821813005b87237e951.zip |
Implement CHANTYPES support
-rw-r--r-- | src/core/servers.h | 2 | ||||
-rw-r--r-- | src/fe-common/irc/dcc/fe-dcc-chat.c | 2 | ||||
-rw-r--r-- | src/fe-common/irc/dcc/fe-dcc-get.c | 5 | ||||
-rw-r--r-- | src/fe-common/irc/fe-ctcp.c | 8 | ||||
-rw-r--r-- | src/fe-common/irc/fe-events-numeric.c | 4 | ||||
-rw-r--r-- | src/fe-common/irc/fe-events.c | 6 | ||||
-rw-r--r-- | src/fe-common/irc/fe-irc-channels.c | 2 | ||||
-rw-r--r-- | src/fe-common/irc/fe-irc-messages.c | 20 | ||||
-rw-r--r-- | src/fe-common/irc/fe-irc-queries.c | 2 | ||||
-rw-r--r-- | src/fe-common/irc/fe-modes.c | 2 | ||||
-rw-r--r-- | src/fe-common/irc/fe-netjoin.c | 2 | ||||
-rw-r--r-- | src/irc/core/bans.c | 2 | ||||
-rw-r--r-- | src/irc/core/channel-rejoin.c | 2 | ||||
-rw-r--r-- | src/irc/core/irc-channels.c | 4 | ||||
-rw-r--r-- | src/irc/core/irc-commands.c | 2 | ||||
-rw-r--r-- | src/irc/core/irc-nicklist.c | 2 | ||||
-rw-r--r-- | src/irc/core/irc-queries.c | 4 | ||||
-rw-r--r-- | src/irc/core/irc-servers.c | 21 | ||||
-rw-r--r-- | src/irc/core/irc.h | 6 | ||||
-rw-r--r-- | src/irc/core/modes.c | 6 | ||||
-rw-r--r-- | src/irc/dcc/dcc-autoget.c | 2 | ||||
-rw-r--r-- | src/irc/flood/flood.c | 4 | ||||
-rw-r--r-- | src/irc/proxy/listen.c | 2 |
23 files changed, 57 insertions, 55 deletions
diff --git a/src/core/servers.h b/src/core/servers.h index d6afbdf5..f39c650b 100644 --- a/src/core/servers.h +++ b/src/core/servers.h @@ -18,7 +18,7 @@ (SERVER_CONNECT(conn) ? TRUE : FALSE) #define server_ischannel(server, channel) \ - (server)->ischannel(server, channel) + ((server)->ischannel(server, channel)) /* all strings should be either NULL or dynamically allocated */ /* address and nick are mandatory, rest are optional */ diff --git a/src/fe-common/irc/dcc/fe-dcc-chat.c b/src/fe-common/irc/dcc/fe-dcc-chat.c index e2706ba3..5bcb3475 100644 --- a/src/fe-common/irc/dcc/fe-dcc-chat.c +++ b/src/fe-common/irc/dcc/fe-dcc-chat.c @@ -44,7 +44,7 @@ static void dcc_request(CHAT_DCC_REC *dcc) if (!IS_DCC_CHAT(dcc)) return; printformat(dcc->server, NULL, MSGLEVEL_DCC, - ischannel(*dcc->target) ? IRCTXT_DCC_CHAT_CHANNEL : + server_ischannel(SERVER(dcc->server), dcc->target) ? IRCTXT_DCC_CHAT_CHANNEL : IRCTXT_DCC_CHAT, dcc->id, dcc->addrstr, dcc->port, dcc->target); } diff --git a/src/fe-common/irc/dcc/fe-dcc-get.c b/src/fe-common/irc/dcc/fe-dcc-get.c index 451463f9..675cab65 100644 --- a/src/fe-common/irc/dcc/fe-dcc-get.c +++ b/src/fe-common/irc/dcc/fe-dcc-get.c @@ -21,6 +21,7 @@ #include "module.h" #include "signals.h" #include "levels.h" +#include "servers.h" #include "irc.h" #include "dcc-file.h" @@ -35,12 +36,12 @@ static void dcc_request(GET_DCC_REC *dcc) { char *sizestr; - if (!IS_DCC_GET(dcc)) return; + if (!IS_DCC_GET(dcc)) return; sizestr = dcc_get_size_str(dcc->size); printformat(dcc->server, NULL, MSGLEVEL_DCC, - ischannel(*dcc->target) ? IRCTXT_DCC_SEND_CHANNEL : + server_ischannel(SERVER(dcc->server), dcc->target) ? IRCTXT_DCC_SEND_CHANNEL : IRCTXT_DCC_SEND, dcc->nick, dcc->addrstr, dcc->port, dcc->arg, sizestr, dcc->target); diff --git a/src/fe-common/irc/fe-ctcp.c b/src/fe-common/irc/fe-ctcp.c index 2321bb7a..cbb591ba 100644 --- a/src/fe-common/irc/fe-ctcp.c +++ b/src/fe-common/irc/fe-ctcp.c @@ -49,7 +49,7 @@ static void ctcp_default_msg(IRC_SERVER_REC *server, const char *data, data = p+1; } - printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS, + printformat(server, server_ischannel(SERVER(server), target) ? target : nick, MSGLEVEL_CTCPS, IRCTXT_CTCP_REQUESTED_UNKNOWN, nick, addr, cmd, data, target); g_free(cmd); @@ -113,8 +113,8 @@ static void ctcp_default_reply(IRC_SERVER_REC *server, const char *data, ctcpdata = ptr+1; } - printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS, - ischannel(*target) ? IRCTXT_CTCP_REPLY_CHANNEL : + printformat(server, server_ischannel(SERVER(server), target) ? target : nick, MSGLEVEL_CTCPS, + server_ischannel(SERVER(server), target) ? IRCTXT_CTCP_REPLY_CHANNEL : IRCTXT_CTCP_REPLY, ctcp, nick, ctcpdata, target); g_free(ctcp); } @@ -137,7 +137,7 @@ static void ctcp_ping_reply(IRC_SERVER_REC *server, const char *data, g_get_current_time(&tv); usecs = get_timeval_diff(&tv, &tv2); - printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS, + printformat(server, server_ischannel(SERVER(server), target) ? target : nick, MSGLEVEL_CTCPS, IRCTXT_CTCP_PING_REPLY, nick, usecs/1000, usecs%1000); } diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index ec7669ab..3eb124fc 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -400,7 +400,7 @@ static void event_target_unavailable(IRC_SERVER_REC *server, const char *data, g_return_if_fail(data != NULL); params = event_get_params(data, 2, NULL, &target); - if (!ischannel(*target)) { + if (!server_ischannel(SERVER(server), target)) { /* nick unavailable */ printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_NICK_UNAVAILABLE, target); @@ -583,7 +583,7 @@ static void print_event_received(IRC_SERVER_REC *server, const char *data, return; ptr++; - if (ischannel(*data)) /* directed at channel */ + if (server_ischannel(SERVER(server), data)) /* directed at channel */ target = g_strndup(data, (int)(ptr - data - 1)); else if (!target_param || *ptr == ':' || (ptr2 = strchr(ptr, ' ')) == NULL) target = NULL; diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c index 5cde9e4b..ad5e7559 100644 --- a/src/fe-common/irc/fe-events.c +++ b/src/fe-common/irc/fe-events.c @@ -52,15 +52,15 @@ static void event_privmsg(IRC_SERVER_REC *server, const char *data, params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &msg); if (nick == NULL) nick = server->real_address; if (addr == NULL) addr = ""; - if (*target == '@' && ischannel(target[1])) { + if (*target == '@' && server_ischannel(SERVER(server), &target[1])) { /* Hybrid 6 feature, send msg to all ops in channel */ recoded = recode_in(SERVER(server), msg, target+1); signal_emit("message irc op_public", 5, server, recoded, nick, addr, get_visible_target(server, target+1)); } else { - recoded = recode_in(SERVER(server), msg, ischannel(*target) ? target : nick); - signal_emit(ischannel(*target) ? + recoded = recode_in(SERVER(server), msg, server_ischannel(SERVER(server), target) ? target : nick); + signal_emit(server_ischannel(SERVER(server), target) ? "message public" : "message private", 5, server, recoded, nick, addr, get_visible_target(server, target)); diff --git a/src/fe-common/irc/fe-irc-channels.c b/src/fe-common/irc/fe-irc-channels.c index e884aef4..9129e451 100644 --- a/src/fe-common/irc/fe-irc-channels.c +++ b/src/fe-common/irc/fe-irc-channels.c @@ -46,7 +46,7 @@ static void sig_event_forward(SERVER_REC *server, const char *data, char *params, *from, *to; params = event_get_params(data, 3, NULL, &from, &to); - if (from != NULL && to != NULL && ischannel(*from) && ischannel(*to)) { + if (from != NULL && to != NULL && server_ischannel(server, *from) && server_ischannel(server, *to)) { channel = irc_channel_find(server, from); if (channel != NULL && irc_channel_find(server, to) == NULL) { window_bind_add(window_item_window(channel), diff --git a/src/fe-common/irc/fe-irc-messages.c b/src/fe-common/irc/fe-irc-messages.c index 94d1ad4a..780c0b7e 100644 --- a/src/fe-common/irc/fe-irc-messages.c +++ b/src/fe-common/irc/fe-irc-messages.c @@ -57,7 +57,7 @@ static const char *skip_target(IRC_SERVER_REC *server, const char *target) break; }; - if(ischannel(target[i])) + if(server_ischannel(SERVER(server), &target[i])) target += i; return target; @@ -136,7 +136,7 @@ static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg, oldtarget = target; target = skip_target(IRC_SERVER(server), target); - if (ischannel(*target)) + if (server_ischannel(SERVER(server), target)) item = irc_channel_find(server, target); else item = irc_query_find(server, target); @@ -146,7 +146,7 @@ static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg, printformat(server, target, MSGLEVEL_ACTIONS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT | - (ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS), + (server_ischannel(SERVER(server), target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS), item != NULL && oldtarget == target ? IRCTXT_OWN_ACTION : IRCTXT_OWN_ACTION_TARGET, server->nick, msg, oldtarget); g_free_not_null(freemsg); @@ -166,7 +166,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, target = skip_target(IRC_SERVER(server), target); level = MSGLEVEL_ACTIONS | - (ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS); + (server_ischannel(SERVER(server), target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS); if (ignore_check(SERVER(server), nick, address, target, msg, level)) return; @@ -175,7 +175,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, level | MSGLEVEL_NO_ACT)) level |= MSGLEVEL_NO_ACT; - if (ischannel(*target)) { + if (server_ischannel(SERVER(server), target)) { item = irc_channel_find(server, target); } else { own = (!g_strcmp0(nick, server->nick)); @@ -185,7 +185,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, if (settings_get_bool("emphasis")) msg = freemsg = expand_emphasis(item, msg); - if (ischannel(*target)) { + if (server_ischannel(SERVER(server), target)) { /* channel action */ if (window_item_is_active(item) && target == oldtarget) { /* message to active channel in window */ @@ -245,16 +245,16 @@ static void sig_message_irc_notice(SERVER_REC *server, const char *msg, } if (ignore_check(server, nick, address, - ischannel(*target) ? target : NULL, + server_ischannel(SERVER(server), target) ? target : NULL, msg, level)) return; if (ignore_check(server, nick, address, - ischannel(*target) ? target : NULL, + server_ischannel(SERVER(server), target) ? target : NULL, msg, level | MSGLEVEL_NO_ACT)) level |= MSGLEVEL_NO_ACT; - if (ischannel(*target)) { + if (server_ischannel(SERVER(server), target)) { /* notice in some channel */ printformat(server, target, level, IRCTXT_NOTICE_PUBLIC, nick, oldtarget, msg); @@ -283,7 +283,7 @@ static void sig_message_irc_ctcp(IRC_SERVER_REC *server, const char *cmd, oldtarget = target; target = skip_target(server, target); - printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS, + printformat(server, server_ischannel(SERVER(server), target) ? target : nick, MSGLEVEL_CTCPS, IRCTXT_CTCP_REQUESTED, nick, addr, cmd, data, oldtarget); } diff --git a/src/fe-common/irc/fe-irc-queries.c b/src/fe-common/irc/fe-irc-queries.c index 0861c9e4..b2faefbc 100644 --- a/src/fe-common/irc/fe-irc-queries.c +++ b/src/fe-common/irc/fe-irc-queries.c @@ -63,7 +63,7 @@ static void event_privmsg(SERVER_REC *server, const char *data, g_return_if_fail(data != NULL); - if (nick == NULL || address == NULL || ischannel(*data) || + if (nick == NULL || address == NULL || server_ischannel(server, data) || !settings_get_bool("query_track_nick_changes")) return; diff --git a/src/fe-common/irc/fe-modes.c b/src/fe-common/irc/fe-modes.c index e5317c0f..53e56c97 100644 --- a/src/fe-common/irc/fe-modes.c +++ b/src/fe-common/irc/fe-modes.c @@ -168,7 +168,7 @@ static void sig_message_mode(IRC_SERVER_REC *server, const char *channel, mode, MSGLEVEL_MODES)) return; - if (!ischannel(*channel)) { + if (!server_ischannel(SERVER(server), channel)) { /* user mode change */ printformat(server, NULL, MSGLEVEL_MODES, IRCTXT_USERMODE_CHANGE, mode, channel); diff --git a/src/fe-common/irc/fe-netjoin.c b/src/fe-common/irc/fe-netjoin.c index 35c463e4..f5cb081e 100644 --- a/src/fe-common/irc/fe-netjoin.c +++ b/src/fe-common/irc/fe-netjoin.c @@ -400,7 +400,7 @@ static void msg_mode(IRC_SERVER_REC *server, const char *channel, int show; g_return_if_fail(data != NULL); - if (!ischannel(*channel) || addr != NULL) + if (!server_ischannel(SERVER(server), channel) || addr != NULL) return; params = event_get_params(data, 2 | PARAM_FLAG_GETREST, diff --git a/src/irc/core/bans.c b/src/irc/core/bans.c index b60e681b..68dd45c0 100644 --- a/src/irc/core/bans.c +++ b/src/irc/core/bans.c @@ -186,7 +186,7 @@ static void command_set_ban(const char *data, IRC_SERVER_REC *server, if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTCHAN | PARAM_FLAG_GETREST, item, &channel, &nicks)) return; - if (!ischannel(*channel)) cmd_param_error(CMDERR_NOT_JOINED); + if (!server_ischannel(SERVER(server), channel)) cmd_param_error(CMDERR_NOT_JOINED); if (*nicks == '\0') { if (g_strcmp0(data, "*") != 0) cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); diff --git a/src/irc/core/channel-rejoin.c b/src/irc/core/channel-rejoin.c index 68a1dee1..154035ae 100644 --- a/src/irc/core/channel-rejoin.c +++ b/src/irc/core/channel-rejoin.c @@ -149,7 +149,7 @@ static void event_target_unavailable(IRC_SERVER_REC *server, const char *data) g_return_if_fail(data != NULL); params = event_get_params(data, 2, NULL, &channel); - if (ischannel(*channel)) { + if (server_ischannel(SERVER(server), channel)) { chanrec = irc_channel_find(server, channel); if (chanrec != NULL && chanrec->joined) { /* dalnet event - can't change nick while diff --git a/src/irc/core/irc-channels.c b/src/irc/core/irc-channels.c index e38cb98b..add18acf 100644 --- a/src/irc/core/irc-channels.c +++ b/src/irc/core/irc-channels.c @@ -99,7 +99,7 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data, tmp = chanlist; for (;; tmp++) { if (*tmp != NULL) { - channel = ischannel(**tmp) ? g_strdup(*tmp) : + channel = server_ischannel(SERVER(server), *tmp) ? g_strdup(*tmp) : g_strdup_printf("#%s", *tmp); chanrec = irc_channel_find(server, channel); @@ -134,7 +134,7 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data, if (use_keys) cmdlen += outkeys->len; if (*tmpstr != NULL) - cmdlen += ischannel(**tmpstr) ? strlen(*tmpstr) : + cmdlen += server_ischannel(SERVER(server), *tmpstr) ? strlen(*tmpstr) : strlen(*tmpstr)+1; if (*tmpkey != NULL) cmdlen += strlen(*tmpkey); diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index e7fb5067..f2cd49c0 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -191,7 +191,7 @@ static void cmd_kick(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item return; if (*channame == '\0' || *nicks == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); - if (!ischannel(*channame)) cmd_param_error(CMDERR_NOT_JOINED); + if (!server_ischannel(SERVER(server), channame)) cmd_param_error(CMDERR_NOT_JOINED); recoded = recode_out(SERVER(server), reason, channame); g_string_printf(tmpstr, "KICK %s %s :%s", channame, nicks, recoded); diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index 5438509e..667016aa 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -394,7 +394,7 @@ static void event_target_unavailable(IRC_SERVER_REC *server, const char *data) g_return_if_fail(data != NULL); params = event_get_params(data, 2, NULL, &channel); - if (!ischannel(*channel)) { + if (!server_ischannel(SERVER(server), channel)) { /* nick is unavailable. */ event_nick_in_use(server, data); } diff --git a/src/irc/core/irc-queries.c b/src/irc/core/irc-queries.c index 72c17df1..12861744 100644 --- a/src/irc/core/irc-queries.c +++ b/src/irc/core/irc-queries.c @@ -60,8 +60,8 @@ static void check_query_changes(IRC_SERVER_REC *server, const char *nick, { QUERY_REC *query; - if (ischannel(*target)) - return; + if (server_ischannel(SERVER(server), target)) + return; query = irc_query_find(server, nick); if (query == NULL) diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index d7122eae..c04c4318 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -71,13 +71,20 @@ static int isnickflag_func(SERVER_REC *server, char flag) static int ischannel_func(SERVER_REC *server, const char *data) { - if (*data == '@') { - /* @#channel, @+#channel */ - data++; - if (*data == '+' && ischannel(data[1])) - return 1; - } - return ischannel(*data); + IRC_SERVER_REC *irc_server = (IRC_SERVER_REC *) server; + char *chantypes; + + chantypes = g_hash_table_lookup(irc_server->isupport, "chantypes"); + if (chantypes == NULL) + chantypes = "#&!+"; /* normal, local, secure, modeless */ + + /* @#channel, @+#channel */ + if (data[0] == '@' && data[1] == '+') + data += 2; + else if (data[0] == '@') + data += 1; + + return strchr(chantypes, *data) != NULL; } static char **split_line(const SERVER_REC *server, const char *line, diff --git a/src/irc/core/irc.h b/src/irc/core/irc.h index de19e084..b5bd833a 100644 --- a/src/irc/core/irc.h +++ b/src/irc/core/irc.h @@ -22,12 +22,6 @@ typedef struct _REDIRECT_REC REDIRECT_REC; #define isnickflag(server, a) \ (server->prefix[(int)(unsigned char) a] != '\0') -#define ischannel(a) \ - ((a) == '#' || /* normal */ \ - (a) == '&' || /* local */ \ - (a) == '!' || /* secure */ \ - (a) == '+') /* modeless */ - #define IS_IRC_ITEM(rec) (IS_IRC_CHANNEL(rec) || IS_IRC_QUERY(rec)) #define IRC_PROTOCOL (chat_protocol_lookup("IRC")) diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c index a812691c..32a0c169 100644 --- a/src/irc/core/modes.c +++ b/src/irc/core/modes.c @@ -488,7 +488,7 @@ static void event_mode(IRC_SERVER_REC *server, const char *data, params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &channel, &mode); - if (!ischannel(*channel)) { + if (!server_ischannel(SERVER(server), channel)) { /* user mode change */ parse_user_mode(server, mode); } else { @@ -536,7 +536,7 @@ static void sig_req_usermode_change(IRC_SERVER_REC *server, const char *data, params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &mode); - if (!ischannel(*target)) { + if (!server_ischannel(SERVER(server), target)) { /* we requested a user mode change, save this */ mode = modes_join(NULL, server->wanted_usermode, mode, FALSE); g_free_not_null(server->wanted_usermode); @@ -856,7 +856,7 @@ static void cmd_mode(const char *data, IRC_SERVER_REC *server, target = chanrec->name; irc_send_cmdv(server, "MODE %s", target); - } else if (ischannel(*target)) + } else if (server_ischannel(SERVER(server), target)) channel_set_mode(server, target, mode); else { if (g_ascii_strcasecmp(target, server->nick) == 0) { diff --git a/src/irc/dcc/dcc-autoget.c b/src/irc/dcc/dcc-autoget.c index 38170c56..de23a5d1 100644 --- a/src/irc/dcc/dcc-autoget.c +++ b/src/irc/dcc/dcc-autoget.c @@ -51,7 +51,7 @@ static void sig_dcc_request(GET_DCC_REC *dcc, const char *nickaddr) /* Unless specifically said in dcc_autoget_masks, don't do autogets sent to channels. */ - if (*masks == '\0' && dcc->target != NULL && ischannel(*dcc->target)) + if (*masks == '\0' && dcc->target != NULL && server_ischannel(SERVER(dcc->server), dcc->target)) return; /* don't autoget files beginning with a dot, if download dir is diff --git a/src/irc/flood/flood.c b/src/irc/flood/flood.c index 29502ca6..0944a6eb 100644 --- a/src/irc/flood/flood.c +++ b/src/irc/flood/flood.c @@ -250,7 +250,7 @@ static void flood_privmsg(IRC_SERVER_REC *server, const char *data, params = event_get_params(data, 2, &target, &text); - level = ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS; + level = server_ischannel(SERVER(server), target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS; if (addr != NULL && !ignore_check(SERVER(server), nick, addr, target, text, level)) flood_newmsg(server, level, nick, addr, target); @@ -287,7 +287,7 @@ static void flood_ctcp(IRC_SERVER_REC *server, const char *data, return; level = g_ascii_strncasecmp(data, "ACTION ", 7) != 0 ? MSGLEVEL_CTCPS : - (ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS); + (server_ischannel(SERVER(server), target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS); if (!ignore_check(SERVER(server), nick, addr, target, data, level)) flood_newmsg(server, level, nick, addr, target); } diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c index 4c3bcf68..c334e698 100644 --- a/src/irc/proxy/listen.c +++ b/src/irc/proxy/listen.c @@ -262,7 +262,7 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args, ignore_next = TRUE; if (*msg != '\001' || msg[strlen(msg)-1] != '\001') { - signal_emit(ischannel(*target) ? + signal_emit(server_ischannel(SERVER(client->server), target) ? "message own_public" : "message own_private", 4, client->server, msg, target, target); } else if (strncmp(msg+1, "ACTION ", 7) == 0) { |