diff options
author | Timo Sirainen <cras@irssi.org> | 2001-03-16 22:14:50 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-03-16 22:14:50 +0000 |
commit | 9a7524ae757d08238c445fd42967c8da2b77459e (patch) | |
tree | 59663f3b2957b8f637a9e4efdc2fe4f700ce76aa | |
parent | ebe99f825c084eec78cd8b70783c182626e18150 (diff) | |
download | irssi-9a7524ae757d08238c445fd42967c8da2b77459e.zip |
emphasis works with actions now
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1399 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/fe-common/irc/fe-irc-messages.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/fe-common/irc/fe-irc-messages.c b/src/fe-common/irc/fe-irc-messages.c index 27ece21a..911ea62b 100644 --- a/src/fe-common/irc/fe-irc-messages.c +++ b/src/fe-common/irc/fe-irc-messages.c @@ -23,6 +23,7 @@ #include "levels.h" #include "channels.h" #include "ignore.h" +#include "settings.h" #include "irc.h" #include "irc-channels.h" @@ -95,17 +96,23 @@ static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg, const char *target) { void *item; + char *freemsg = NULL; 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 ? IRCTXT_OWN_ACTION : IRCTXT_OWN_ACTION_TARGET, server->nick, msg, target); + + g_free_not_null(freemsg); } static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, @@ -113,6 +120,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, const char *target) { void *item; + char *freemsg = NULL; int level; level = MSGLEVEL_ACTIONS | @@ -121,10 +129,16 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, if (ignore_check(SERVER(server), nick, address, target, msg, level)) return; - if (ischannel(*target)) { - /* channel action */ + 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)) { /* message to active channel in window */ printformat(server, target, level, @@ -137,13 +151,13 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, } } else { /* private action */ - item = privmsg_get_query(SERVER(server), nick, FALSE, - MSGLEVEL_MSGS); 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_own_notice(IRC_SERVER_REC *server, const char *msg, |