1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

Added option "irc_show_away_once", to show away message only once in pv

This commit is contained in:
Sebastien Helleu
2006-01-21 11:56:58 +00:00
parent e907b3b7a5
commit 5aeb7921fe
28 changed files with 2100 additions and 1980 deletions
+4 -1
View File
@@ -1,9 +1,12 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-01-14
ChangeLog - 2006-01-21
Version 0.1.8 (under dev!):
* added option "irc_show_away_once", to show away message only once in pv
Version 0.1.7 (2006-01-14):
* fixed msg command (now allowed in private buffer with "*" as target)
* removed "irc_default_msg_away" setting, for RFC 2812 conformity
+7
View File
@@ -762,6 +762,13 @@
<entry></entry>
<entry>Display message when (un)marking as away</entry>
</row>
<row>
<entry><option>irc_show_away_once</option></entry>
<entry>boolean</entry>
<entry>'on' or 'off'</entry>
<entry></entry>
<entry>Show remote away message only once in private</entry>
</row>
<row>
<entry><option>irc_default_msg_part</option></entry>
<entry>string</entry>
+7
View File
@@ -762,6 +762,13 @@
<entry>'off'</entry>
<entry>Affiche un message pour l'absence/le retour</entry>
</row>
<row>
<entry><option>irc_show_away_once</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>Voir le message d'absence distant une seule fois en privé</entry>
</row>
<row>
<entry><option>irc_default_msg_part</option></entry>
<entry>chaîne</entry>
+248 -244
View File
File diff suppressed because it is too large Load Diff
+248 -244
View File
File diff suppressed because it is too large Load Diff
+249 -245
View File
File diff suppressed because it is too large Load Diff
+251 -247
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -171,6 +171,7 @@ session_save_channel (FILE *file, t_irc_channel *channel)
rc = rc && (session_write_str (file, SESSION_CHAN_KEY, channel->key));
rc = rc && (session_write_int (file, SESSION_CHAN_NICKS_COUNT, channel->nicks_count));
rc = rc && (session_write_int (file, SESSION_CHAN_CHECKING_AWAY, channel->checking_away));
rc = rc && (session_write_str (file, SESSION_CHAN_AWAY_MESSAGE, channel->away_message));
rc = rc && (session_write_id (file, SESSION_CHAN_END));
if (!rc)
@@ -1038,6 +1039,9 @@ session_load_channel (FILE *file)
case SESSION_CHAN_CHECKING_AWAY:
rc = rc && (session_read_int (file, &(session_current_channel->checking_away)));
break;
case SESSION_CHAN_AWAY_MESSAGE:
rc = rc && (session_read_str (file, &(session_current_channel->away_message)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"channel (object id: %d)\n"));
+2 -1
View File
@@ -101,7 +101,8 @@ enum t_session_channel
SESSION_CHAN_LIMIT,
SESSION_CHAN_KEY,
SESSION_CHAN_NICKS_COUNT,
SESSION_CHAN_CHECKING_AWAY
SESSION_CHAN_CHECKING_AWAY,
SESSION_CHAN_AWAY_MESSAGE
};
enum t_session_nick
+5
View File
@@ -650,6 +650,7 @@ t_config_option weechat_options_log[] =
/* config, irc section */
int cfg_irc_display_away;
int cfg_irc_show_away_once;
char *cfg_irc_display_away_values[] =
{ "off", "local", "channel", NULL };
char *cfg_irc_default_msg_part;
@@ -669,6 +670,10 @@ t_config_option weechat_options_irc[] =
N_("display message when (un)marking as away"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"off", cfg_irc_display_away_values, &cfg_irc_display_away, NULL, &config_change_noop },
{ "irc_show_away_once", N_("show remote away message only once in private"),
N_("show remote away message only once in private"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_irc_show_away_once, NULL, &config_change_noop },
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
OPTION_TYPE_STRING, 0, 0, 0,
+1
View File
@@ -187,6 +187,7 @@ extern char *cfg_log_timestamp;
extern int cfg_log_hide_nickserv_pwd;
extern int cfg_irc_display_away;
extern int cfg_irc_show_away_once;
extern char *cfg_irc_default_msg_part;
extern char *cfg_irc_default_msg_quit;
extern int cfg_irc_notice_as_pv;
+4
View File
@@ -66,6 +66,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name)
new_channel->key = NULL;
new_channel->nicks_count = 0;
new_channel->checking_away = 0;
new_channel->away_message = NULL;
new_channel->nicks = NULL;
new_channel->last_nick = NULL;
@@ -119,6 +120,8 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
if (channel->topic)
free (channel->topic);
nick_free_all (channel);
if (channel->away_message)
free (channel->away_message);
free (channel);
server->channels = new_channels;
}
@@ -481,6 +484,7 @@ channel_print_log (t_irc_channel *channel)
weechat_log_printf (" limit. . . . : %d\n", channel->limit);
weechat_log_printf (" key. . . . . : '%s'\n", channel->key);
weechat_log_printf (" checking_away: %d\n", channel->checking_away);
weechat_log_printf (" away_message : '%s'\n", channel->away_message);
weechat_log_printf (" nicks. . . . : 0x%X\n", channel->nicks);
weechat_log_printf (" last_nick. . : 0x%X\n", channel->last_nick);
weechat_log_printf (" buffer . . . : 0x%X\n", channel->buffer);
+19 -8
View File
@@ -2564,14 +2564,25 @@ irc_cmd_recv_301 (t_irc_server *server, char *host, char *nick, char *arguments)
{
/* look for private buffer to display message */
ptr_channel = channel_search (server, pos_nick);
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
gui_printf (ptr_buffer,
_("%s%s%s is away: %s\n"),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
pos_nick,
GUI_COLOR(COLOR_WIN_CHAT),
pos_message);
if (!cfg_irc_show_away_once || !ptr_channel ||
!(ptr_channel->away_message) ||
(strcmp (ptr_channel->away_message, pos_message) != 0))
{
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
gui_printf (ptr_buffer,
_("%s%s%s is away: %s\n"),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
pos_nick,
GUI_COLOR(COLOR_WIN_CHAT),
pos_message);
if (ptr_channel)
{
if (ptr_channel->away_message)
free (ptr_channel->away_message);
ptr_channel->away_message = strdup (pos_message);
}
}
}
}
}
+1
View File
@@ -110,6 +110,7 @@ struct t_irc_channel
char *key; /* channel key (NULL if no key is set) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
char *away_message; /* to display away only once in private */
t_irc_nick *nicks; /* nicks on the channel */
t_irc_nick *last_nick; /* last nick on the channel */
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
+4 -1
View File
@@ -1,9 +1,12 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-01-14
ChangeLog - 2006-01-21
Version 0.1.8 (under dev!):
* added option "irc_show_away_once", to show away message only once in pv
Version 0.1.7 (2006-01-14):
* fixed msg command (now allowed in private buffer with "*" as target)
* removed "irc_default_msg_away" setting, for RFC 2812 conformity
+7
View File
@@ -762,6 +762,13 @@
<entry></entry>
<entry>Display message when (un)marking as away</entry>
</row>
<row>
<entry><option>irc_show_away_once</option></entry>
<entry>boolean</entry>
<entry>'on' or 'off'</entry>
<entry></entry>
<entry>Show remote away message only once in private</entry>
</row>
<row>
<entry><option>irc_default_msg_part</option></entry>
<entry>string</entry>
+7
View File
@@ -762,6 +762,13 @@
<entry>'off'</entry>
<entry>Affiche un message pour l'absence/le retour</entry>
</row>
<row>
<entry><option>irc_show_away_once</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>Voir le message d'absence distant une seule fois en privé</entry>
</row>
<row>
<entry><option>irc_default_msg_part</option></entry>
<entry>chaîne</entry>
+248 -244
View File
File diff suppressed because it is too large Load Diff
+248 -244
View File
File diff suppressed because it is too large Load Diff
+249 -245
View File
File diff suppressed because it is too large Load Diff
+251 -247
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -171,6 +171,7 @@ session_save_channel (FILE *file, t_irc_channel *channel)
rc = rc && (session_write_str (file, SESSION_CHAN_KEY, channel->key));
rc = rc && (session_write_int (file, SESSION_CHAN_NICKS_COUNT, channel->nicks_count));
rc = rc && (session_write_int (file, SESSION_CHAN_CHECKING_AWAY, channel->checking_away));
rc = rc && (session_write_str (file, SESSION_CHAN_AWAY_MESSAGE, channel->away_message));
rc = rc && (session_write_id (file, SESSION_CHAN_END));
if (!rc)
@@ -1038,6 +1039,9 @@ session_load_channel (FILE *file)
case SESSION_CHAN_CHECKING_AWAY:
rc = rc && (session_read_int (file, &(session_current_channel->checking_away)));
break;
case SESSION_CHAN_AWAY_MESSAGE:
rc = rc && (session_read_str (file, &(session_current_channel->away_message)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"channel (object id: %d)\n"));
+2 -1
View File
@@ -101,7 +101,8 @@ enum t_session_channel
SESSION_CHAN_LIMIT,
SESSION_CHAN_KEY,
SESSION_CHAN_NICKS_COUNT,
SESSION_CHAN_CHECKING_AWAY
SESSION_CHAN_CHECKING_AWAY,
SESSION_CHAN_AWAY_MESSAGE
};
enum t_session_nick
+5
View File
@@ -650,6 +650,7 @@ t_config_option weechat_options_log[] =
/* config, irc section */
int cfg_irc_display_away;
int cfg_irc_show_away_once;
char *cfg_irc_display_away_values[] =
{ "off", "local", "channel", NULL };
char *cfg_irc_default_msg_part;
@@ -669,6 +670,10 @@ t_config_option weechat_options_irc[] =
N_("display message when (un)marking as away"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"off", cfg_irc_display_away_values, &cfg_irc_display_away, NULL, &config_change_noop },
{ "irc_show_away_once", N_("show remote away message only once in private"),
N_("show remote away message only once in private"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_irc_show_away_once, NULL, &config_change_noop },
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
OPTION_TYPE_STRING, 0, 0, 0,
+1
View File
@@ -187,6 +187,7 @@ extern char *cfg_log_timestamp;
extern int cfg_log_hide_nickserv_pwd;
extern int cfg_irc_display_away;
extern int cfg_irc_show_away_once;
extern char *cfg_irc_default_msg_part;
extern char *cfg_irc_default_msg_quit;
extern int cfg_irc_notice_as_pv;
+4
View File
@@ -66,6 +66,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name)
new_channel->key = NULL;
new_channel->nicks_count = 0;
new_channel->checking_away = 0;
new_channel->away_message = NULL;
new_channel->nicks = NULL;
new_channel->last_nick = NULL;
@@ -119,6 +120,8 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
if (channel->topic)
free (channel->topic);
nick_free_all (channel);
if (channel->away_message)
free (channel->away_message);
free (channel);
server->channels = new_channels;
}
@@ -481,6 +484,7 @@ channel_print_log (t_irc_channel *channel)
weechat_log_printf (" limit. . . . : %d\n", channel->limit);
weechat_log_printf (" key. . . . . : '%s'\n", channel->key);
weechat_log_printf (" checking_away: %d\n", channel->checking_away);
weechat_log_printf (" away_message : '%s'\n", channel->away_message);
weechat_log_printf (" nicks. . . . : 0x%X\n", channel->nicks);
weechat_log_printf (" last_nick. . : 0x%X\n", channel->last_nick);
weechat_log_printf (" buffer . . . : 0x%X\n", channel->buffer);
+19 -8
View File
@@ -2564,14 +2564,25 @@ irc_cmd_recv_301 (t_irc_server *server, char *host, char *nick, char *arguments)
{
/* look for private buffer to display message */
ptr_channel = channel_search (server, pos_nick);
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
gui_printf (ptr_buffer,
_("%s%s%s is away: %s\n"),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
pos_nick,
GUI_COLOR(COLOR_WIN_CHAT),
pos_message);
if (!cfg_irc_show_away_once || !ptr_channel ||
!(ptr_channel->away_message) ||
(strcmp (ptr_channel->away_message, pos_message) != 0))
{
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
gui_printf (ptr_buffer,
_("%s%s%s is away: %s\n"),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
pos_nick,
GUI_COLOR(COLOR_WIN_CHAT),
pos_message);
if (ptr_channel)
{
if (ptr_channel->away_message)
free (ptr_channel->away_message);
ptr_channel->away_message = strdup (pos_message);
}
}
}
}
}
+1
View File
@@ -110,6 +110,7 @@ struct t_irc_channel
char *key; /* channel key (NULL if no key is set) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
char *away_message; /* to display away only once in private */
t_irc_nick *nicks; /* nicks on the channel */
t_irc_nick *last_nick; /* last nick on the channel */
t_gui_buffer *buffer; /* GUI buffer allocated for channel */