diff options
author | Alexander Færøy <ahf@0x90.dk> | 2014-12-06 16:11:15 +0100 |
---|---|---|
committer | Alexander Færøy <ahf@0x90.dk> | 2014-12-06 16:11:15 +0100 |
commit | d87c494d893e22bb172f9f9e8f2378606b29114a (patch) | |
tree | fda34e63029777c3217db7dd282b515ec1656f96 /src/fe-common/irc | |
parent | bbd733392446951f41d04c88cbab9a46ccec31d5 (diff) | |
parent | 1edfcedda1105d79fa6b92d77a8fb60f296abe1e (diff) | |
download | irssi-d87c494d893e22bb172f9f9e8f2378606b29114a.zip |
Merge pull request #162 from dequis/self-messages
Receive 'self messages' in the right query window
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r-- | src/fe-common/irc/fe-irc-messages.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/fe-common/irc/fe-irc-messages.c b/src/fe-common/irc/fe-irc-messages.c index 0c83a531..e0849c75 100644 --- a/src/fe-common/irc/fe-irc-messages.c +++ b/src/fe-common/irc/fe-irc-messages.c @@ -160,6 +160,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, const char *oldtarget; char *freemsg = NULL; int level; + int own = FALSE; oldtarget = target; target = skip_target(IRC_SERVER(server), target); @@ -174,10 +175,12 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, level | MSGLEVEL_NO_ACT)) level |= MSGLEVEL_NO_ACT; - if (ischannel(*target)) + if (ischannel(*target)) { item = irc_channel_find(server, target); - else - item = privmsg_get_query(SERVER(server), nick, FALSE, level); + } else { + own = (!strcmp(nick, server->nick)); + item = privmsg_get_query(SERVER(server), own ? nick : target, FALSE, level); + } if (settings_get_bool("emphasis")) msg = freemsg = expand_emphasis(item, msg); @@ -195,11 +198,19 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, 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); + if (own) { + /* own action bounced */ + printformat(server, target, + MSGLEVEL_ACTIONS | MSGLEVEL_MSGS, + item != NULL && oldtarget == target ? IRCTXT_OWN_ACTION : IRCTXT_OWN_ACTION_TARGET, + server->nick, msg, oldtarget); + } 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); |