mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
/SET activity_level, /SET hilight_level .. which message levels should
be treated as msg/hilight activity. Patch by tommik. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@819 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
b3b1438d22
commit
a4bb4fb983
@ -31,6 +31,7 @@
|
||||
#include "hilight-text.h"
|
||||
|
||||
static const char *noact_channels;
|
||||
static int hilight_level, activity_level;
|
||||
|
||||
static void sig_hilight_text(WINDOW_REC *window, SERVER_REC *server,
|
||||
const char *channel, void *levelptr,
|
||||
@ -44,9 +45,9 @@ static void sig_hilight_text(WINDOW_REC *window, SERVER_REC *server,
|
||||
|
||||
/* hilights and private messages get HILIGHT status,
|
||||
public messages get MSGS status and rest get TEXT */
|
||||
new_data = (level & (MSGLEVEL_HILIGHT|MSGLEVEL_MSGS)) ?
|
||||
new_data = (level & (MSGLEVEL_HILIGHT|hilight_level)) ?
|
||||
NEWDATA_HILIGHT :
|
||||
((level & MSGLEVEL_PUBLIC) ? NEWDATA_MSG : NEWDATA_TEXT);
|
||||
((level & activity_level) ? NEWDATA_MSG : NEWDATA_TEXT);
|
||||
|
||||
/* check that channel isn't in "don't show activity" list */
|
||||
if (new_data < NEWDATA_HILIGHT &&
|
||||
@ -145,7 +146,7 @@ static void sig_message(SERVER_REC *server, const char *msg,
|
||||
/* hilight */
|
||||
if (item != NULL) item->last_color = hilight_last_nick_color();
|
||||
level = (item != NULL && item->last_color > 0) ||
|
||||
(level & MSGLEVEL_MSGS) ||
|
||||
(level & hilight_level) ||
|
||||
nick_match_msg(SERVER(server), msg, server->nick) ?
|
||||
NEWDATA_HILIGHT : NEWDATA_MSG;
|
||||
if (item != NULL && item->new_data < level) {
|
||||
@ -181,11 +182,15 @@ static void sig_message_private(SERVER_REC *server, const char *msg,
|
||||
static void read_settings(void)
|
||||
{
|
||||
noact_channels = settings_get_str("noact_channels");
|
||||
activity_level = level2bits(settings_get_str("activity_levels"));
|
||||
hilight_level = level2bits(settings_get_str("hilight_levels"));
|
||||
}
|
||||
|
||||
void window_activity_init(void)
|
||||
{
|
||||
settings_add_str("lookandfeel", "noact_channels", "");
|
||||
settings_add_str("lookandfeel", "activity_levels", "PUBLIC");
|
||||
settings_add_str("lookandfeel", "hilight_levels", "MSGS DCCMSGS");
|
||||
|
||||
read_settings();
|
||||
signal_add("print text", (SIGNAL_FUNC) sig_hilight_text);
|
||||
|
Loading…
Reference in New Issue
Block a user