static void sig_message_own_public(SERVER_REC *server, const char *msg, const char *target, const char *origtarget) { const char *oldtarget; char *nickmode; if (!IS_IRC_SERVER(server)) return; oldtarget = target; target = skip_target(IRC_SERVER(server), target); if (target != oldtarget) { /* Hybrid 6 / Bahamut feature, send msg to all ops / ops+voices in channel */ nickmode = channel_get_nickmode(channel_find(server, target), server->nick); printformat_module("fe-common/core", server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, TXT_OWN_MSG_CHANNEL, server->nick, oldtarget, msg, nickmode); g_free(nickmode); signal_stop(); } }
static void sig_message_own_notice(IRC_SERVER_REC *server, const char *msg, const char *target) { printformat(server, skip_target(target), MSGLEVEL_NOTICES | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, IRCTXT_OWN_NOTICE, target, msg); }
static void sig_message_own_ctcp(IRC_SERVER_REC *server, const char *cmd, const char *data, const char *target) { printformat(server, skip_target(server, target), MSGLEVEL_CTCPS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, IRCTXT_OWN_CTCP, target, cmd, data); }
static void sig_message_irc_ctcp(IRC_SERVER_REC *server, const char *cmd, const char *data, const char *nick, const char *addr, const char *target) { const char *oldtarget; oldtarget = target; target = skip_target(server, target); printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS, IRCTXT_CTCP_REQUESTED, nick, addr, cmd, data, oldtarget); }
static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, const char *nick, const char *address, const char *target) { void *item; const char *oldtarget; char *freemsg = NULL; int level; oldtarget = target; target = skip_target(IRC_SERVER(server), target); level = MSGLEVEL_ACTIONS | (ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS); if (ignore_check(SERVER(server), nick, address, target, msg, level)) return; if (ignore_check(SERVER(server), nick, address, target, msg, level | MSGLEVEL_NO_ACT)) level |= MSGLEVEL_NO_ACT; if (ischannel(*target)) item = irc_channel_find(server, target); else item = privmsg_get_query(SERVER(server), nick, FALSE, level); if (settings_get_bool("emphasis")) msg = freemsg = expand_emphasis(item, msg); if (ischannel(*target)) { /* channel action */ if (window_item_is_active(item) && target == oldtarget) { /* message to active channel in window */ printformat(server, target, level, IRCTXT_ACTION_PUBLIC, nick, msg); } else { /* message to not existing/active channel, or to @/+ */ printformat(server, target, level, IRCTXT_ACTION_PUBLIC_CHANNEL, nick, oldtarget, msg); } } else { /* private action */ printformat(server, nick, MSGLEVEL_ACTIONS | MSGLEVEL_MSGS, item == NULL ? IRCTXT_ACTION_PRIVATE : IRCTXT_ACTION_PRIVATE_QUERY, nick, address == NULL ? "" : address, msg); } g_free_not_null(freemsg); }
static void sig_message_irc_notice(SERVER_REC *server, const char *msg, const char *nick, const char *address, const char *target) { const char *oldtarget; int level = MSGLEVEL_NOTICES; oldtarget = target; target = skip_target(IRC_SERVER(server), target); if (address == NULL || *address == '\0') { /* notice from server */ if (!ignore_check(server, nick, "", target, msg, MSGLEVEL_SNOTES)) { printformat(server, target, MSGLEVEL_SNOTES, IRCTXT_NOTICE_SERVER, nick, msg); } return; } if (ignore_check(server, nick, address, ischannel(*target) ? target : NULL, msg, level)) return; if (ignore_check(server, nick, address, ischannel(*target) ? target : NULL, msg, level | MSGLEVEL_NO_ACT)) level |= MSGLEVEL_NO_ACT; if (ischannel(*target)) { /* notice in some channel */ printformat(server, target, level, IRCTXT_NOTICE_PUBLIC, nick, oldtarget, msg); } else { /* private notice */ privmsg_get_query(SERVER(server), nick, FALSE, MSGLEVEL_NOTICES); printformat(server, nick, level, IRCTXT_NOTICE_PRIVATE, nick, address, msg); } }
static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg, const char *target) { void *item; const char *oldtarget; char *freemsg = NULL; oldtarget = target; target = skip_target(IRC_SERVER(server), target); if (ischannel(*target)) item = irc_channel_find(server, target); else item = irc_query_find(server, target); if (settings_get_bool("emphasis")) msg = freemsg = expand_emphasis(item, msg); printformat(server, target, MSGLEVEL_ACTIONS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT | (ischannel(*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); }