@@ 93,21 93,9 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
server *serv = sess->server;
char outbuf[1024];
int ctcp_offset = 2;
-
- /* consider DCC to be different from other CTCPs */
- if (!g_ascii_strncasecmp (msg, "DCC", 3))
- {
- /* but still let CTCP replies override it */
- if (!ctcp_check (sess, nick, word, word_eol, word[4] + ctcp_offset))
- {
- if (!ignore_check (word[1], IG_DCC))
- handle_dcc (sess, nick, word, word_eol, tags_data);
- }
- return;
- }
-
+
/* consider ACTION to be different from other CTCPs. Check
- ignore as if it was a PRIV/CHAN. */
+ ignore as if it was a PRIV/CHAN. */
if (!g_ascii_strncasecmp (msg, "ACTION ", 7))
{
if (is_channel (serv, to))
@@ 129,6 117,23 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
inbound_action (sess, to, nick, ip, msg + 7, FALSE, tags_data->identified, tags_data);
return;
}
+
+ // ignore CTCPs if they're from us
+ // FIXME: this might fuck with plugins that care about CTCPs, especially custom ones
+ if (g_ascii_strcasecmp(to, serv->nick) != 0 && g_ascii_strcasecmp(nick, serv->nick) == 0)
+ return;
+
+ /* consider DCC to be different from other CTCPs */
+ if (!g_ascii_strncasecmp (msg, "DCC", 3))
+ {
+ /* but still let CTCP replies override it */
+ if (!ctcp_check (sess, nick, word, word_eol, word[4] + ctcp_offset))
+ {
+ if (!ignore_check (word[1], IG_DCC))
+ handle_dcc (sess, nick, word, word_eol, tags_data);
+ }
+ return;
+ }
if (ignore_check (word[1], IG_CTCP))
return;