summaryrefslogtreecommitdiff
path: root/src/fe-common/irc
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r--src/fe-common/irc/fe-common-irc.c1
-rw-r--r--src/fe-common/irc/fe-events.c9
-rw-r--r--src/fe-common/irc/fe-irc-commands.c11
3 files changed, 17 insertions, 4 deletions
diff --git a/src/fe-common/irc/fe-common-irc.c b/src/fe-common/irc/fe-common-irc.c
index 5cc67fd0..9a6eb78b 100644
--- a/src/fe-common/irc/fe-common-irc.c
+++ b/src/fe-common/irc/fe-common-irc.c
@@ -107,6 +107,7 @@ void fe_common_irc_init(void)
settings_add_bool("lookandfeel", "beep_when_away", TRUE);
settings_add_bool("lookandfeel", "show_away_once", TRUE);
settings_add_bool("lookandfeel", "show_quit_once", FALSE);
+ settings_add_bool("lookandfeel", "print_active_channel", FALSE);
theme_register(fecommon_irc_formats);
diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c
index 24a1c0c3..e79cf122 100644
--- a/src/fe-common/irc/fe-events.c
+++ b/src/fe-common/irc/fe-events.c
@@ -59,8 +59,8 @@ static void print_channel_msg(IRC_SERVER_REC *server, const char *msg,
{
CHANNEL_REC *chanrec;
NICK_REC *nickrec;
- int for_me;
const char *nickmode;
+ int for_me, print_channel;
char *color;
chanrec = channel_find(server, target);
@@ -71,7 +71,12 @@ static void print_channel_msg(IRC_SERVER_REC *server, const char *msg,
nickmode = (!settings_get_bool("show_nickmode") || nickrec == NULL) ? "" :
(nickrec->op ? "@" : nickrec->voice ? "+" : " ");
- if (window_item_is_active((WI_ITEM_REC *) chanrec)) {
+ print_channel = !window_item_is_active((WI_ITEM_REC *) chanrec);
+ if (!print_channel && settings_get_bool("print_active_channel") &&
+ window_item_window((WI_ITEM_REC *) chanrec)->items->next != NULL)
+ print_channel = TRUE;
+
+ if (!print_channel) {
/* message to active channel in window */
if (color != NULL) {
/* highlighted nick */
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index f390c6b0..31af63df 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -98,7 +98,7 @@ static void cmd_msg(gchar *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
const char *nickmode;
char *target, *msg, *freestr, *newtarget;
void *free_arg;
- int free_ret;
+ int free_ret, print_channel;
g_return_if_fail(data != NULL);
@@ -148,7 +148,14 @@ static void cmd_msg(gchar *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
nickrec->op ? "@" : nickrec->voice ? "+" : " ";
window = channel == NULL ? NULL : window_item_window((WI_ITEM_REC *) channel);
- if (window != NULL && window->active == (WI_ITEM_REC *) channel)
+
+ print_channel = window == NULL ||
+ window->active != (WI_ITEM_REC *) channel;
+ if (!print_channel && settings_get_bool("print_active_channel") &&
+ window != NULL && g_slist_length(window->items) > 1)
+ print_channel = TRUE;
+
+ if (!print_channel)
{
printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT,
IRCTXT_OWN_MSG, server->nick, msg, nickmode);