From 1de2aade402c17e2049432acf7d93edbcc78482d Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 7 Jan 2001 19:42:59 +0000 Subject: In core/module-formats.h: IRCTXT_ -> TXT_ Added "message irc ctcp" signal to print CTCPs git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1094 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-irc-messages.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/fe-common/irc/fe-irc-messages.c') diff --git a/src/fe-common/irc/fe-irc-messages.c b/src/fe-common/irc/fe-irc-messages.c index 1d33c9c2..8c9707cf 100644 --- a/src/fe-common/irc/fe-irc-messages.c +++ b/src/fe-common/irc/fe-irc-messages.c @@ -25,9 +25,8 @@ #include "irc.h" -/* FIXME: hmm. there's should be some better way to use other module's - formats than this since now we can't use this module's formats.. */ #include "../core/module-formats.h" +#include "module-formats.h" #include "printtext.h" #include "fe-messages.h" @@ -45,7 +44,7 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg, printformat_module("fe-common/core", server, target+1, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, - IRCTXT_OWN_MSG_CHANNEL, + TXT_OWN_MSG_CHANNEL, server->nick, target, msg, nickmode); signal_stop(); } @@ -63,19 +62,29 @@ static void sig_message_irc_op_public(SERVER_REC *server, const char *msg, optarget = g_strconcat("@", target, NULL); printformat_module("fe-common/core", server, target, MSGLEVEL_PUBLIC | MSGLEVEL_HILIGHT, - IRCTXT_PUBMSG_ME_CHANNEL, + TXT_PUBMSG_ME_CHANNEL, nick, optarget, msg, nickmode); g_free(optarget); } +static void sig_message_irc_ctcp(IRC_SERVER_REC *server, const char *msg, + const char *nick, const char *addr, + const char *target) +{ + printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS, + IRCTXT_CTCP_REQUESTED, nick, addr, msg, target); +} + void fe_irc_messages_init(void) { signal_add("message own_public", (SIGNAL_FUNC) sig_message_own_public); signal_add("message irc op_public", (SIGNAL_FUNC) sig_message_irc_op_public); + signal_add("message irc ctcp", (SIGNAL_FUNC) sig_message_irc_ctcp); } void fe_irc_messages_deinit(void) { signal_remove("message own_public", (SIGNAL_FUNC) sig_message_own_public); signal_remove("message irc op_public", (SIGNAL_FUNC) sig_message_irc_op_public); + signal_remove("message irc ctcp", (SIGNAL_FUNC) sig_message_irc_ctcp); } -- cgit v1.2.3