mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
move away message to fe-common/core
This commit is contained in:
parent
61d215acdd
commit
5f13614d47
7 changed files with 27 additions and 41 deletions
|
|
@ -587,6 +587,25 @@ static void sig_message_topic(SERVER_REC *server, const char *channel,
|
|||
nick, channel, topic, address);
|
||||
}
|
||||
|
||||
static void sig_message_away_notify(SERVER_REC *server, const char *nick,
|
||||
const char *addr, const char *awaymsg)
|
||||
{
|
||||
int txt = *awaymsg == '\0' ? TXT_NOTIFY_UNAWAY_CHANNEL :
|
||||
TXT_NOTIFY_AWAY_CHANNEL;
|
||||
|
||||
if (!settings_get_bool("away_notify_public"))
|
||||
return;
|
||||
|
||||
spread_server_message_to_windows(server, FALSE,
|
||||
FALSE,
|
||||
MSGLEVEL_CRAP,
|
||||
txt, txt,
|
||||
nick, addr,
|
||||
awaymsg,
|
||||
awaymsg
|
||||
);
|
||||
}
|
||||
|
||||
static int printnick_exists(NICK_REC *first, NICK_REC *ignore,
|
||||
const char *nick)
|
||||
{
|
||||
|
|
@ -730,6 +749,7 @@ void fe_messages_init(void)
|
|||
settings_add_bool("lookandfeel", "print_active_channel", FALSE);
|
||||
settings_add_bool("lookandfeel", "show_quit_once", FALSE);
|
||||
settings_add_bool("lookandfeel", "show_own_nickchange_once", FALSE);
|
||||
settings_add_bool("lookandfeel", "away_notify_public", FALSE);
|
||||
|
||||
signal_add_last("message public", (SIGNAL_FUNC) sig_message_public);
|
||||
signal_add_last("message private", (SIGNAL_FUNC) sig_message_private);
|
||||
|
|
@ -744,6 +764,7 @@ void fe_messages_init(void)
|
|||
signal_add_last("message invite", (SIGNAL_FUNC) sig_message_invite);
|
||||
signal_add_last("message invite_other", (SIGNAL_FUNC) sig_message_invite_other);
|
||||
signal_add_last("message topic", (SIGNAL_FUNC) sig_message_topic);
|
||||
signal_add_last("message away_notify", (SIGNAL_FUNC) sig_message_away_notify);
|
||||
|
||||
signal_add("nicklist new", (SIGNAL_FUNC) sig_nicklist_new);
|
||||
signal_add("nicklist remove", (SIGNAL_FUNC) sig_nicklist_remove);
|
||||
|
|
@ -770,6 +791,7 @@ void fe_messages_deinit(void)
|
|||
signal_remove("message invite_other", (SIGNAL_FUNC) sig_message_invite_other);
|
||||
signal_remove("message invite", (SIGNAL_FUNC) sig_message_invite);
|
||||
signal_remove("message topic", (SIGNAL_FUNC) sig_message_topic);
|
||||
signal_remove("message away_notify", (SIGNAL_FUNC) sig_message_away_notify);
|
||||
|
||||
signal_remove("nicklist new", (SIGNAL_FUNC) sig_nicklist_new);
|
||||
signal_remove("nicklist remove", (SIGNAL_FUNC) sig_nicklist_remove);
|
||||
|
|
|
|||
|
|
@ -106,6 +106,8 @@ FORMAT_REC fecommon_core_formats[] = {
|
|||
{ "topic_unset", "Topic unset by {nick $0} on {channel $1}", 4, { 0, 0, 0, 0 } },
|
||||
{ "your_nick_changed", "You're now known as {nick $1}", 4, { 0, 0, 0, 0 } },
|
||||
{ "nick_changed", "{channick $0} is now known as {channick_hilight $1}", 4, { 0, 0, 0, 0 } },
|
||||
{ "notify_away_channel", "{channick $0} {chanhost $1} is now away: {reason $2}", 4, { 0, 0, 0, 0 } },
|
||||
{ "notify_unaway_channel", "{channick_hilight $0} {chanhost $1} is no longer away", 4, { 0, 0, 0, 0 } },
|
||||
{ "talking_in", "You are now talking in {channel $0}", 1, { 0 } },
|
||||
{ "not_in_channels", "You are not on any channels", 0 },
|
||||
{ "current_channel", "Current channel {channel $0}", 1, { 0 } },
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ enum {
|
|||
TXT_TOPIC_UNSET,
|
||||
TXT_YOUR_NICK_CHANGED,
|
||||
TXT_NICK_CHANGED,
|
||||
TXT_NOTIFY_AWAY_CHANNEL,
|
||||
TXT_NOTIFY_UNAWAY_CHANNEL,
|
||||
TXT_TALKING_IN,
|
||||
TXT_NOT_IN_CHANNELS,
|
||||
TXT_CURRENT_CHANNEL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue