mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02:00
/SET beep_on_msg handling moved to printtext() where it catches all the
levels, not just the IRC levels. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@552 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
c8706013f8
commit
18bdc77b88
2 changed files with 22 additions and 34 deletions
|
|
@ -40,6 +40,7 @@ typedef struct {
|
|||
int level;
|
||||
} TEXT_DEST_REC;
|
||||
|
||||
static int beep_msg_level, beep_when_away;
|
||||
static int timestamps, msgs_timestamps, hide_text_style;
|
||||
static int timestamp_timeout;
|
||||
|
||||
|
|
@ -687,12 +688,22 @@ static char *get_server_tag(TEXT_DEST_REC *dest)
|
|||
return output_format_text(dest, IRCTXT_SERVERTAG, server->tag);
|
||||
}
|
||||
|
||||
static void sig_print_text(WINDOW_REC *window, SERVER_REC *server, const char *target, gpointer level, const char *text)
|
||||
static void msg_beep_check(SERVER_REC *server, int level)
|
||||
{
|
||||
if (level != 0 && (beep_msg_level & level) &&
|
||||
(beep_when_away || (server != NULL && !server->usermode_away))) {
|
||||
printbeep();
|
||||
}
|
||||
}
|
||||
|
||||
static void sig_print_text(WINDOW_REC *window, SERVER_REC *server,
|
||||
const char *target, gpointer level,
|
||||
const char *text)
|
||||
{
|
||||
TEXT_DEST_REC dest;
|
||||
gchar *dup, *ptr, type, *str, *timestamp, *servertag;
|
||||
gint fgcolor, bgcolor;
|
||||
gint flags;
|
||||
char *dup, *ptr, type, *str, *timestamp, *servertag;
|
||||
int fgcolor, bgcolor;
|
||||
int flags;
|
||||
|
||||
g_return_if_fail(text != NULL);
|
||||
g_return_if_fail(window != NULL);
|
||||
|
|
@ -702,6 +713,8 @@ static void sig_print_text(WINDOW_REC *window, SERVER_REC *server, const char *t
|
|||
dest.channel = target;
|
||||
dest.level = GPOINTER_TO_INT(level);
|
||||
|
||||
msg_beep_check(server, dest.level);
|
||||
|
||||
flags = 0; fgcolor = -1; bgcolor = -1; type = '\0';
|
||||
window->last_line = time(NULL);
|
||||
newline(window);
|
||||
|
|
@ -726,7 +739,7 @@ static void sig_print_text(WINDOW_REC *window, SERVER_REC *server, const char *t
|
|||
break;
|
||||
}
|
||||
|
||||
*ptr = (gchar) translation_in[(gint) (guchar) *ptr];
|
||||
*ptr = (char) translation_in[(gint) (guchar) *ptr];
|
||||
}
|
||||
|
||||
if (type == 7)
|
||||
|
|
@ -906,6 +919,8 @@ static void read_settings(void)
|
|||
timestamp_timeout = settings_get_int("timestamp_timeout");
|
||||
msgs_timestamps = settings_get_bool("msgs_timestamps");
|
||||
hide_text_style = settings_get_bool("hide_text_style");
|
||||
beep_msg_level = level2bits(settings_get_str("beep_on_msg"));
|
||||
beep_when_away = settings_get_bool("beep_when_away");
|
||||
}
|
||||
|
||||
void printtext_init(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue