mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 07:16:37 +02:00
Add new options irc.look.display_host_join/join_local/quit and irc.color.reason_quit
This commit is contained in:
@@ -78,6 +78,7 @@
|
||||
#define IRC_COLOR_STATUS_NAME_SSL weechat_color("status_name_ssl")
|
||||
#define IRC_COLOR_MESSAGE_JOIN weechat_color(weechat_config_string(irc_config_color_message_join))
|
||||
#define IRC_COLOR_MESSAGE_QUIT weechat_color(weechat_config_string(irc_config_color_message_quit))
|
||||
#define IRC_COLOR_REASON_QUIT weechat_color(weechat_config_string(irc_config_color_reason_quit))
|
||||
#define IRC_COLOR_NOTICE weechat_color(weechat_config_string(irc_config_color_notice))
|
||||
#define IRC_COLOR_INPUT_NICK weechat_color(weechat_config_string(irc_config_color_input_nick))
|
||||
#define IRC_COLOR_ITEM_AWAY weechat_color(weechat_config_string(irc_config_color_item_away))
|
||||
|
||||
@@ -61,6 +61,9 @@ struct t_config_option *irc_config_look_display_away;
|
||||
struct t_config_option *irc_config_look_display_ctcp_blocked;
|
||||
struct t_config_option *irc_config_look_display_ctcp_reply;
|
||||
struct t_config_option *irc_config_look_display_ctcp_unknown;
|
||||
struct t_config_option *irc_config_look_display_host_join;
|
||||
struct t_config_option *irc_config_look_display_host_join_local;
|
||||
struct t_config_option *irc_config_look_display_host_quit;
|
||||
struct t_config_option *irc_config_look_display_old_topic;
|
||||
struct t_config_option *irc_config_look_display_pv_away_once;
|
||||
struct t_config_option *irc_config_look_display_pv_back;
|
||||
@@ -93,6 +96,7 @@ struct t_config_option *irc_config_color_notice;
|
||||
struct t_config_option *irc_config_color_input_nick;
|
||||
struct t_config_option *irc_config_color_item_away;
|
||||
struct t_config_option *irc_config_color_item_channel_modes;
|
||||
struct t_config_option *irc_config_color_reason_quit;
|
||||
|
||||
/* IRC config, network section */
|
||||
|
||||
@@ -1529,6 +1533,24 @@ irc_config_init ()
|
||||
N_("display CTCP message even if it is unknown CTCP"),
|
||||
NULL, 0, 0, "on", NULL, 0, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
irc_config_look_display_host_join = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"display_host_join", "boolean",
|
||||
N_("display host in join messages"),
|
||||
NULL, 0, 0, "on", NULL, 0, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
irc_config_look_display_host_join_local = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"display_host_join_local", "boolean",
|
||||
N_("display host in join messages from local client"),
|
||||
NULL, 0, 0, "on", NULL, 0, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
irc_config_look_display_host_quit = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"display_host_quit", "boolean",
|
||||
N_("display host in part/quit messages"),
|
||||
NULL, 0, 0, "on", NULL, 0, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
irc_config_look_display_old_topic = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"display_old_topic", "boolean",
|
||||
@@ -1716,6 +1738,12 @@ irc_config_init ()
|
||||
N_("color for channel modes, near channel name"),
|
||||
NULL, -1, 0, "default", NULL, 0, NULL, NULL,
|
||||
&irc_config_change_color_item_buffer_name, NULL, NULL, NULL);
|
||||
irc_config_color_reason_quit = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"reason_quit", "color",
|
||||
N_("color for reason in part/quit messages"),
|
||||
NULL, -1, 0, "default", NULL, 0, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
/* network */
|
||||
ptr_section = weechat_config_new_section (irc_config_file, "network",
|
||||
|
||||
@@ -80,6 +80,9 @@ extern struct t_config_option *irc_config_look_display_away;
|
||||
extern struct t_config_option *irc_config_look_display_ctcp_blocked;
|
||||
extern struct t_config_option *irc_config_look_display_ctcp_reply;
|
||||
extern struct t_config_option *irc_config_look_display_ctcp_unknown;
|
||||
extern struct t_config_option *irc_config_look_display_host_join;
|
||||
extern struct t_config_option *irc_config_look_display_host_join_local;
|
||||
extern struct t_config_option *irc_config_look_display_host_quit;
|
||||
extern struct t_config_option *irc_config_look_display_old_topic;
|
||||
extern struct t_config_option *irc_config_look_display_pv_away_once;
|
||||
extern struct t_config_option *irc_config_look_display_pv_back;
|
||||
@@ -110,6 +113,7 @@ extern struct t_config_option *irc_config_color_notice;
|
||||
extern struct t_config_option *irc_config_color_input_nick;
|
||||
extern struct t_config_option *irc_config_color_item_away;
|
||||
extern struct t_config_option *irc_config_color_item_channel_modes;
|
||||
extern struct t_config_option *irc_config_color_reason_quit;
|
||||
|
||||
extern struct t_config_option *irc_config_network_autoreconnect_delay_growing;
|
||||
extern struct t_config_option *irc_config_network_autoreconnect_delay_max;
|
||||
|
||||
@@ -539,7 +539,7 @@ IRC_PROTOCOL_CALLBACK(join)
|
||||
struct t_irc_nick *ptr_nick;
|
||||
struct t_irc_channel_speaking *ptr_nick_speaking;
|
||||
char *pos_channel;
|
||||
int local_join;
|
||||
int local_join, display_host;
|
||||
|
||||
/*
|
||||
* JOIN message looks like:
|
||||
@@ -584,6 +584,9 @@ IRC_PROTOCOL_CALLBACK(join)
|
||||
ptr_nick_speaking = ((weechat_config_boolean (irc_config_look_smart_filter))
|
||||
&& (weechat_config_boolean (irc_config_look_smart_filter_join))) ?
|
||||
irc_channel_nick_speaking_time_search (ptr_channel, nick, 1) : NULL;
|
||||
display_host = (local_join) ?
|
||||
weechat_config_boolean (irc_config_look_display_host_join_local) :
|
||||
weechat_config_boolean (irc_config_look_display_host_join);
|
||||
weechat_printf_tags (ptr_channel->buffer,
|
||||
irc_protocol_tags (command,
|
||||
(local_join
|
||||
@@ -591,14 +594,16 @@ IRC_PROTOCOL_CALLBACK(join)
|
||||
|| !weechat_config_boolean (irc_config_look_smart_filter_join)
|
||||
|| ptr_nick_speaking) ?
|
||||
NULL : "irc_smart_filter"),
|
||||
_("%s%s%s %s(%s%s%s)%s has joined %s%s%s"),
|
||||
_("%s%s%s%s%s%s%s%s%s%s has joined %s%s%s"),
|
||||
weechat_prefix ("join"),
|
||||
IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick),
|
||||
nick,
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? " (" : "",
|
||||
IRC_COLOR_CHAT_HOST,
|
||||
address,
|
||||
(display_host) ? address : "",
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? ")" : "",
|
||||
IRC_COLOR_MESSAGE_JOIN,
|
||||
IRC_COLOR_CHAT_CHANNEL,
|
||||
pos_channel,
|
||||
@@ -1164,7 +1169,7 @@ IRC_PROTOCOL_CALLBACK(notice)
|
||||
IRC_PROTOCOL_CALLBACK(part)
|
||||
{
|
||||
char *pos_comment, *join_string;
|
||||
int join_length, local_part;
|
||||
int join_length, local_part, display_host;
|
||||
struct t_irc_channel *ptr_channel;
|
||||
struct t_irc_nick *ptr_nick;
|
||||
struct t_irc_channel_speaking *ptr_nick_speaking;
|
||||
@@ -1202,6 +1207,7 @@ IRC_PROTOCOL_CALLBACK(part)
|
||||
&& (weechat_config_boolean (irc_config_look_smart_filter_quit))) ?
|
||||
irc_channel_nick_speaking_time_search (ptr_channel, nick, 1) : NULL;
|
||||
}
|
||||
display_host = weechat_config_boolean (irc_config_look_display_host_quit);
|
||||
if (pos_comment)
|
||||
{
|
||||
weechat_printf_tags (ptr_channel->buffer,
|
||||
@@ -1212,21 +1218,23 @@ IRC_PROTOCOL_CALLBACK(part)
|
||||
|| !weechat_config_boolean (irc_config_look_smart_filter_quit)
|
||||
|| ptr_nick_speaking) ?
|
||||
NULL : "irc_smart_filter"),
|
||||
_("%s%s%s %s(%s%s%s)%s has left %s%s%s "
|
||||
_("%s%s%s%s%s%s%s%s%s%s has left %s%s%s "
|
||||
"%s(%s%s%s)"),
|
||||
weechat_prefix ("quit"),
|
||||
IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick),
|
||||
nick,
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? " (" : "",
|
||||
IRC_COLOR_CHAT_HOST,
|
||||
address,
|
||||
(display_host) ? address : "",
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? ")" : "",
|
||||
IRC_COLOR_MESSAGE_QUIT,
|
||||
IRC_COLOR_CHAT_CHANNEL,
|
||||
ptr_channel->name,
|
||||
IRC_COLOR_MESSAGE_QUIT,
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
IRC_COLOR_CHAT,
|
||||
IRC_COLOR_REASON_QUIT,
|
||||
pos_comment,
|
||||
IRC_COLOR_CHAT_DELIMITERS);
|
||||
}
|
||||
@@ -1240,15 +1248,17 @@ IRC_PROTOCOL_CALLBACK(part)
|
||||
|| !weechat_config_boolean (irc_config_look_smart_filter_quit)
|
||||
|| ptr_nick_speaking) ?
|
||||
NULL : "irc_smart_filter"),
|
||||
_("%s%s%s %s(%s%s%s)%s has left "
|
||||
_("%s%s%s%s%s%s%s%s%s%s has left "
|
||||
"%s%s%s"),
|
||||
weechat_prefix ("quit"),
|
||||
IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick),
|
||||
nick,
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? " (" : "",
|
||||
IRC_COLOR_CHAT_HOST,
|
||||
address,
|
||||
(display_host) ? address : "",
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? ")" : "",
|
||||
IRC_COLOR_MESSAGE_QUIT,
|
||||
IRC_COLOR_CHAT_CHANNEL,
|
||||
ptr_channel->name,
|
||||
@@ -1496,7 +1506,7 @@ IRC_PROTOCOL_CALLBACK(quit)
|
||||
struct t_irc_channel *ptr_channel;
|
||||
struct t_irc_nick *ptr_nick;
|
||||
struct t_irc_channel_speaking *ptr_nick_speaking;
|
||||
int local_quit;
|
||||
int local_quit, display_host;
|
||||
|
||||
/*
|
||||
* QUIT message looks like:
|
||||
@@ -1534,6 +1544,7 @@ IRC_PROTOCOL_CALLBACK(quit)
|
||||
{
|
||||
ptr_channel->has_quit_server = 1;
|
||||
}
|
||||
display_host = weechat_config_boolean (irc_config_look_display_host_quit);
|
||||
if (pos_comment && pos_comment[0])
|
||||
{
|
||||
weechat_printf_tags (ptr_channel->buffer,
|
||||
@@ -1544,19 +1555,21 @@ IRC_PROTOCOL_CALLBACK(quit)
|
||||
|| !weechat_config_boolean (irc_config_look_smart_filter_quit)
|
||||
|| ptr_nick_speaking) ?
|
||||
NULL : "irc_smart_filter"),
|
||||
_("%s%s%s %s(%s%s%s)%s has quit "
|
||||
_("%s%s%s%s%s%s%s%s%s%s has quit "
|
||||
"%s(%s%s%s)"),
|
||||
weechat_prefix ("quit"),
|
||||
(ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ?
|
||||
irc_nick_color_for_pv (ptr_channel, nick) : IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick),
|
||||
nick,
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? " (" : "",
|
||||
IRC_COLOR_CHAT_HOST,
|
||||
address,
|
||||
(display_host) ? address : "",
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? ")" : "",
|
||||
IRC_COLOR_MESSAGE_QUIT,
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
IRC_COLOR_CHAT,
|
||||
IRC_COLOR_REASON_QUIT,
|
||||
pos_comment,
|
||||
IRC_COLOR_CHAT_DELIMITERS);
|
||||
}
|
||||
@@ -1570,15 +1583,17 @@ IRC_PROTOCOL_CALLBACK(quit)
|
||||
|| !weechat_config_boolean (irc_config_look_smart_filter_quit)
|
||||
|| ptr_nick_speaking) ?
|
||||
NULL : "irc_smart_filter"),
|
||||
_("%s%s%s %s(%s%s%s)%s has quit"),
|
||||
_("%s%s%s%s%s%s%s%s%s%s has quit"),
|
||||
weechat_prefix ("quit"),
|
||||
(ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE) ?
|
||||
irc_nick_color_for_pv (ptr_channel, nick) : IRC_COLOR_NICK_IN_SERVER_MESSAGE(ptr_nick),
|
||||
nick,
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? " (" : "",
|
||||
IRC_COLOR_CHAT_HOST,
|
||||
address,
|
||||
(display_host) ? address : "",
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
(display_host) ? ")" : "",
|
||||
IRC_COLOR_MESSAGE_QUIT);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user