mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
SET print_active_channel - if you have multiple channels in same window,
should we always print the channel for each message (<nick:#channel>) or only when the channel isn't active. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@513 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
a31ac88d7d
commit
1a816b15f5
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user