summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-irc-messages.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-01-07 19:42:59 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-01-07 19:42:59 +0000
commit1de2aade402c17e2049432acf7d93edbcc78482d (patch)
tree9f7a9b4e2335137916ae858185259cec4668201d /src/fe-common/irc/fe-irc-messages.c
parente46e2b5e0939a39059258e7302401775203063f1 (diff)
downloadirssi-1de2aade402c17e2049432acf7d93edbcc78482d.zip
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
Diffstat (limited to 'src/fe-common/irc/fe-irc-messages.c')
-rw-r--r--src/fe-common/irc/fe-irc-messages.c17
1 files changed, 13 insertions, 4 deletions
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);
}