summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-10-23 18:40:19 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-10-23 18:40:19 +0200
commit64c227b5138f12533a658dc744066d6ea1907e77 (patch)
treec6f993d0383199d5a8ee07d32fc214eab1876801 /src/plugins/irc
parenta965be6802bbc601096c4186d3e338652b6c9bd2 (diff)
downloadweechat-64c227b5138f12533a658dc744066d6ea1907e77.zip
Add option to toggle display of IRC channel modes after buffer name in status bar (irc.look.display_channel_modes)
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-bar-item.c1
-rw-r--r--src/plugins/irc/irc-config.c17
-rw-r--r--src/plugins/irc/irc-config.h1
3 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c
index a7e521c28..983fd5c55 100644
--- a/src/plugins/irc/irc-bar-item.c
+++ b/src/plugins/irc/irc-bar-item.c
@@ -131,6 +131,7 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item,
if (channel)
{
if (channel->nicks
+ && weechat_config_boolean (irc_config_look_display_channel_modes)
&& channel->modes && channel->modes[0]
&& (strcmp (channel->modes, "+") != 0))
{
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index 385cf856b..598dfd3d8 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -56,6 +56,7 @@ struct t_config_option *irc_config_look_nick_prefix;
struct t_config_option *irc_config_look_nick_suffix;
struct t_config_option *irc_config_look_nick_completion_smart;
struct t_config_option *irc_config_look_display_away;
+struct t_config_option *irc_config_look_display_channel_modes;
struct t_config_option *irc_config_look_highlight_tags;
struct t_config_option *irc_config_look_show_away_once;
struct t_config_option *irc_config_look_notice_as_pv;
@@ -152,6 +153,17 @@ irc_config_change_one_server_buffer ()
}
/*
+ * irc_config_change_display_channel_modes: called when the "display channel modes"
+ * setting is changed
+ */
+
+void
+irc_config_change_display_channel_modes ()
+{
+ weechat_bar_item_update ("buffer_name");
+}
+
+/*
* irc_config_change_away_check: called when away check is changed
*/
@@ -994,6 +1006,11 @@ irc_config_init ()
"display_away", "integer",
N_("display message when (un)marking as away"),
"off|local|channel", 0, 0, "local", NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ irc_config_look_display_channel_modes = weechat_config_new_option (
+ irc_config_file, ptr_section,
+ "display_channel_modes", "boolean",
+ N_("display channel modes in \"buffer_name\" bar item"),
+ NULL, 0, 0, "on", NULL, NULL, NULL, &irc_config_change_display_channel_modes, NULL, NULL, NULL);
irc_config_look_highlight_tags = weechat_config_new_option (
irc_config_file, ptr_section,
"highlight_tags", "string",
diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h
index 9a6f80b16..d1c110254 100644
--- a/src/plugins/irc/irc-config.h
+++ b/src/plugins/irc/irc-config.h
@@ -68,6 +68,7 @@ extern struct t_config_option *irc_config_look_nick_prefix;
extern struct t_config_option *irc_config_look_nick_suffix;
extern struct t_config_option *irc_config_look_nick_completion_smart;
extern struct t_config_option *irc_config_look_display_away;
+extern struct t_config_option *irc_config_look_display_channel_modes;
extern struct t_config_option *irc_config_look_highlight_tags;
extern struct t_config_option *irc_config_look_show_away_once;
extern struct t_config_option *irc_config_look_notice_as_pv;