summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/fe-messages.c19
-rw-r--r--src/fe-common/core/fe-queries.c7
-rw-r--r--src/fe-common/irc/fe-irc-messages.c27
-rw-r--r--src/fe-common/irc/fe-whois.c4
4 files changed, 40 insertions, 17 deletions
diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c
index 97f3d84d..1d44bdd9 100644
--- a/src/fe-common/core/fe-messages.c
+++ b/src/fe-common/core/fe-messages.c
@@ -242,13 +242,16 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
}
static void sig_message_private(SERVER_REC *server, const char *msg,
- const char *nick, const char *address)
+ const char *nick, const char *address, const char *target)
{
QUERY_REC *query;
char *freemsg = NULL;
int level = MSGLEVEL_MSGS;
- query = query_find(server, nick);
+ /* own message returned by bouncer? */
+ int own = (!strcmp(nick, server->nick));
+
+ query = query_find(server, own ? target : nick);
if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg);
@@ -256,9 +259,15 @@ static void sig_message_private(SERVER_REC *server, const char *msg,
if (ignore_check(server, nick, address, NULL, msg, level | MSGLEVEL_NO_ACT))
level |= MSGLEVEL_NO_ACT;
- printformat(server, nick, level,
- query == NULL ? TXT_MSG_PRIVATE :
- TXT_MSG_PRIVATE_QUERY, nick, address, msg);
+ if (own) {
+ printformat(server, target, level,
+ query == NULL ? TXT_OWN_MSG_PRIVATE :
+ TXT_OWN_MSG_PRIVATE_QUERY, target, msg, server->nick);
+ } else {
+ printformat(server, nick, level,
+ query == NULL ? TXT_MSG_PRIVATE :
+ TXT_MSG_PRIVATE_QUERY, nick, address, msg);
+ }
g_free_not_null(freemsg);
}
diff --git a/src/fe-common/core/fe-queries.c b/src/fe-common/core/fe-queries.c
index 7599fb23..5cdf87ee 100644
--- a/src/fe-common/core/fe-queries.c
+++ b/src/fe-common/core/fe-queries.c
@@ -326,12 +326,15 @@ static int sig_query_autoclose(void)
}
static void sig_message_private(SERVER_REC *server, const char *msg,
- const char *nick, const char *address)
+ const char *nick, const char *address, const char *target)
{
QUERY_REC *query;
+ /* own message returned by bouncer? */
+ int own = (!strcmp(nick, server->nick));
+
/* create query window if needed */
- query = privmsg_get_query(server, nick, FALSE, MSGLEVEL_MSGS);
+ query = privmsg_get_query(server, own ? target : nick, FALSE, MSGLEVEL_MSGS);
/* reset the query's last_unread_msg timestamp */
if (query != NULL)
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);
diff --git a/src/fe-common/irc/fe-whois.c b/src/fe-common/irc/fe-whois.c
index 35f99375..a9c3775e 100644
--- a/src/fe-common/irc/fe-whois.c
+++ b/src/fe-common/irc/fe-whois.c
@@ -92,7 +92,7 @@ static void event_whois_oper(IRC_SERVER_REC *server, const char *data)
params = event_get_params(data, 3, NULL, &nick, &type);
- /* Bugfix: http://bugs.irssi.org/?do=details&id=99
+ /* Bugfix: http://bugs.irssi.org/?do=details&task_id=99
* Author: Geert Hauwaerts <geert@irssi.org>
* Date: Wed Sep 15 20:17:24 CEST 2004
*/
@@ -410,7 +410,7 @@ void fe_whois_init(void)
signal_add("event 311", (SIGNAL_FUNC) event_whois);
signal_add("event 312", (SIGNAL_FUNC) event_whois_server);
/* readding this events fixes the printing of /whois -yes *
- Bug http://bugs.irssi.org/?do=details&id=123 */
+ Bug http://bugs.irssi.org/?do=details&task_id=123 */
signal_add("event 317", (SIGNAL_FUNC) event_whois_idle);
signal_add("event 319", (SIGNAL_FUNC) event_whois_channels);
signal_add("event 313", (SIGNAL_FUNC) event_whois_oper);