Add chanopt for stripping colors

This commit is contained in:
TingPing 2013-06-06 17:47:01 -04:00
parent fd762303b0
commit cf505b850b
5 changed files with 8 additions and 1 deletions

View File

@ -65,6 +65,7 @@ static const channel_options chanopt[] =
{"text_hidejoinpart", "CONFMODE", S_F(text_hidejoinpart)},
{"text_logging", NULL, S_F(text_logging)},
{"text_scrollback", NULL, S_F(text_scrollback)},
{"text_strip", NULL, S_F(text_strip)},
};
#undef S_F
@ -179,6 +180,7 @@ typedef struct
guint8 text_hidejoinpart;
guint8 text_logging;
guint8 text_scrollback;
guint8 text_strip;
char *network;
char *channel;

View File

@ -465,6 +465,7 @@ session_new (server *serv, char *from, int type, int focus)
sess->text_hidejoinpart = SET_DEFAULT;
sess->text_logging = SET_DEFAULT;
sess->text_scrollback = SET_DEFAULT;
sess->text_strip = SET_DEFAULT;
sess->lastact_idx = LACT_NONE;

View File

@ -398,6 +398,7 @@ typedef struct session
guint8 text_hidejoinpart;
guint8 text_logging;
guint8 text_scrollback;
guint8 text_strip;
struct server *server;
void *usertree_alpha; /* pure alphabetical tree */

View File

@ -2043,7 +2043,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
{
char *word[PDIWORDS];
int i;
unsigned int stripcolor_args = (prefs.hex_text_stripcolor_msg ? 0xFFFFFFFF : 0);
unsigned int stripcolor_args = (chanopt_is_set (prefs.hex_text_stripcolor_msg, sess->text_strip) ? 0xFFFFFFFF : 0);
char tbuf[NICKLEN + 4];
if (prefs.hex_text_color_nicks && (index == XP_TE_CHANACTION || index == XP_TE_CHANMSG))

View File

@ -1561,7 +1561,10 @@ mg_create_perchannelmenu (session *sess, GtkWidget *menu)
mg_perchan_menu_item (_("_Log to Disk"), submenu, &sess->text_logging, prefs.hex_irc_logging);
mg_perchan_menu_item (_("_Reload Scrollback"), submenu, &sess->text_scrollback, prefs.hex_text_replay);
if (sess->type == SESS_CHANNEL)
{
mg_perchan_menu_item (_("Strip _Colors"), submenu, &sess->text_strip, prefs.hex_text_stripcolor_msg);
mg_perchan_menu_item (_("_Hide Join/Part Messages"), submenu, &sess->text_hidejoinpart, prefs.hex_irc_conf_mode);
}
}
static void