diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | doc/en/config.xml | 7 | ||||
-rw-r--r-- | doc/en/weechat.en.xml | 4 | ||||
-rw-r--r-- | doc/fr/config.xml | 9 | ||||
-rw-r--r-- | doc/fr/weechat.fr.xml | 4 | ||||
-rw-r--r-- | src/common/completion.c | 16 | ||||
-rw-r--r-- | src/common/weeconfig.c | 5 | ||||
-rw-r--r-- | src/common/weeconfig.h | 1 | ||||
-rw-r--r-- | src/irc/irc-send.c | 95 | ||||
-rw-r--r-- | weechat/ChangeLog | 2 | ||||
-rw-r--r-- | weechat/doc/en/config.xml | 7 | ||||
-rw-r--r-- | weechat/doc/en/weechat.en.xml | 4 | ||||
-rw-r--r-- | weechat/doc/fr/config.xml | 9 | ||||
-rw-r--r-- | weechat/doc/fr/weechat.fr.xml | 4 | ||||
-rw-r--r-- | weechat/src/common/completion.c | 16 | ||||
-rw-r--r-- | weechat/src/common/weeconfig.c | 5 | ||||
-rw-r--r-- | weechat/src/common/weeconfig.h | 1 | ||||
-rw-r--r-- | weechat/src/irc/irc-send.c | 95 |
18 files changed, 94 insertions, 192 deletions
@@ -5,6 +5,8 @@ ChangeLog - 2006-01-08 Version 0.1.7 (under dev!): + * removed "irc_default_msg_away" setting, for RFC 2812 conformity + (/away command wihtout argument only removes away status) * fixed refresh bug with Solaris when term size is changed * replaced Texinfo doc by XML Docbook * added color for window separators (when splited) diff --git a/doc/en/config.xml b/doc/en/config.xml index 62884ad17..b5591da75 100644 --- a/doc/en/config.xml +++ b/doc/en/config.xml @@ -763,13 +763,6 @@ <entry>Display message to all channels when (un)marking as away</entry> </row> <row> - <entry><option>irc_default_msg_away</option></entry> - <entry>string</entry> - <entry>any string</entry> - <entry></entry> - <entry>Default message when away</entry> -</row> -<row> <entry><option>irc_default_msg_part</option></entry> <entry>string</entry> <entry>any string</entry> diff --git a/doc/en/weechat.en.xml b/doc/en/weechat.en.xml index e61d4a001..9e1d0e0aa 100644 --- a/doc/en/weechat.en.xml +++ b/doc/en/weechat.en.xml @@ -1686,10 +1686,6 @@ plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL); <entry><literal>%w</literal></entry> <entry>WeeChat commands</entry> </row> - <row> - <entry><literal>%y</literal></entry> - <entry>default "away" message</entry> - </row> </tbody> </tgroup> </informaltable> diff --git a/doc/fr/config.xml b/doc/fr/config.xml index 3263b3475..9c3f46154 100644 --- a/doc/fr/config.xml +++ b/doc/fr/config.xml @@ -759,17 +759,10 @@ <entry><option>irc_display_away</option></entry> <entry>booléen</entry> <entry>'on' ou 'off'</entry> - <entry>'on'</entry> + <entry>'off'</entry> <entry>Affiche un message sur tous les canaux pour l'absence/le retour</entry> </row> <row> - <entry><option>irc_default_msg_away</option></entry> - <entry>chaîne</entry> - <entry>toute chaîne</entry> - <entry>'away'</entry> - <entry>Message par défaut pour l'absence</entry> -</row> -<row> <entry><option>irc_default_msg_part</option></entry> <entry>chaîne</entry> <entry>toute chaîne</entry> diff --git a/doc/fr/weechat.fr.xml b/doc/fr/weechat.fr.xml index 408b6ba01..551f2a26c 100644 --- a/doc/fr/weechat.fr.xml +++ b/doc/fr/weechat.fr.xml @@ -1715,10 +1715,6 @@ plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL); <entry><literal>%w</literal></entry> <entry>commandes WeeChat</entry> </row> - <row> - <entry><literal>%y</literal></entry> - <entry>message d'absence ("away") par défaut</entry> - </row> </tbody> </tgroup> </informaltable> diff --git a/src/common/completion.c b/src/common/completion.c index a2bd350c8..fb4f4ff90 100644 --- a/src/common/completion.c +++ b/src/common/completion.c @@ -574,19 +574,6 @@ completion_list_add_weechat_cmd (t_completion *completion) } /* - * completion_list_add_away: add away message to completion list - */ - -void -completion_list_add_away (t_completion *completion) -{ - if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0]) - weelist_add (&completion->completion_list, - &completion->last_completion, - cfg_irc_default_msg_away); -} - -/* * completion_build_list_template: build data list according to a template */ @@ -680,9 +667,6 @@ completion_build_list_template (t_completion *completion, char *template) case 'w': /* WeeChat commands */ completion_list_add_weechat_cmd (completion); break; - case 'y': /* away message */ - completion_list_add_away (completion); - break; } } break; diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c index 34e5b37dc..d0ddb588e 100644 --- a/src/common/weeconfig.c +++ b/src/common/weeconfig.c @@ -650,7 +650,6 @@ t_config_option weechat_options_log[] = /* config, irc section */ int cfg_irc_display_away; -char *cfg_irc_default_msg_away; char *cfg_irc_default_msg_part; char *cfg_irc_default_msg_quit; int cfg_irc_notice_as_pv; @@ -668,10 +667,6 @@ t_config_option weechat_options_irc[] = N_("display message to all channels when (un)marking as away"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE, NULL, NULL, &cfg_irc_display_away, NULL, &config_change_noop }, - { "irc_default_msg_away", N_("default message when away"), - N_("default message when away"), - OPTION_TYPE_STRING, 0, 0, 0, - "away", NULL, NULL, &cfg_irc_default_msg_away, &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, diff --git a/src/common/weeconfig.h b/src/common/weeconfig.h index 254a56a44..9cfd8f006 100644 --- a/src/common/weeconfig.h +++ b/src/common/weeconfig.h @@ -183,7 +183,6 @@ extern char *cfg_log_timestamp; extern int cfg_log_hide_nickserv_pwd; extern int cfg_irc_display_away; -extern char *cfg_irc_default_msg_away; extern char *cfg_irc_default_msg_part; extern char *cfg_irc_default_msg_quit; extern int cfg_irc_notice_as_pv; diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c index f6b6ce4b8..ca225d59c 100644 --- a/src/irc/irc-send.c +++ b/src/irc/irc-send.c @@ -195,8 +195,7 @@ irc_cmd_send_amsg (t_irc_server *server, char *arguments) int irc_cmd_send_away (t_irc_server *server, char *arguments) { - char *pos, *ptr_away_msg; - char *ptr_away_default_msg = "away"; + char *pos; t_irc_server *ptr_server; t_gui_window *ptr_window; time_t elapsed; @@ -217,37 +216,14 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) { if (ptr_server->is_connected) { - if (ptr_server->is_away && (!pos)) - { - server_sendf (ptr_server, "AWAY\r\n"); - ptr_server->is_away = 0; - if (server->away_time != 0) - { - elapsed = time (NULL) - ptr_server->away_time; - ptr_server->away_time = 0; - if (cfg_irc_display_away) - { - snprintf (buffer, sizeof (buffer), - "is back (gone %.2ld:%.2ld:%.2ld)", - (long int)(elapsed / 3600), - (long int)((elapsed / 60) % 60), - (long int)(elapsed % 60)); - irc_send_me_all_channels (ptr_server, buffer); - } - } - server_set_away (ptr_server, ptr_server->nick, 0); - } - else + if (pos) { ptr_server->is_away = 1; ptr_server->away_time = time (NULL); - ptr_away_msg = (pos) ? pos : - ((cfg_irc_default_msg_away && cfg_irc_default_msg_away[0]) ? - cfg_irc_default_msg_away : ptr_away_default_msg); - server_sendf (ptr_server, "AWAY :%s\r\n", ptr_away_msg); + server_sendf (ptr_server, "AWAY :%s\r\n", pos); if (cfg_irc_display_away) { - string = (char *)gui_color_decode ((unsigned char *)ptr_away_msg, 1); + string = (char *)gui_color_decode ((unsigned char *)pos, 1); snprintf (buffer, sizeof (buffer), "is away: %s", (string) ? string : ""); irc_send_me_all_channels (ptr_server, buffer); if (string) @@ -262,12 +238,51 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) ptr_window->buffer->last_line; } } + else + { + server_sendf (ptr_server, "AWAY\r\n"); + ptr_server->is_away = 0; + if (server->away_time != 0) + { + elapsed = time (NULL) - ptr_server->away_time; + ptr_server->away_time = 0; + if (cfg_irc_display_away) + { + snprintf (buffer, sizeof (buffer), + "is back (gone %.2ld:%.2ld:%.2ld)", + (long int)(elapsed / 3600), + (long int)((elapsed / 60) % 60), + (long int)(elapsed % 60)); + irc_send_me_all_channels (ptr_server, buffer); + } + } + server_set_away (ptr_server, ptr_server->nick, 0); + } } } } else { - if (server->is_away && (!arguments)) + if (arguments) + { + server->is_away = 1; + server->away_time = time (NULL); + server_sendf (server, "AWAY :%s\r\n", arguments); + if (cfg_irc_display_away) + { + snprintf (buffer, sizeof (buffer), "is away: %s", arguments); + irc_send_me_all_channels (server, buffer); + } + server_set_away (server, server->nick, 1); + for (ptr_window = gui_windows; ptr_window; + ptr_window = ptr_window->next_window) + { + if (SERVER(ptr_window->buffer) == server) + ptr_window->buffer->last_read_line = + ptr_window->buffer->last_line; + } + } + else { server_sendf (server, "AWAY\r\n"); server->is_away = 0; @@ -287,28 +302,6 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) } server_set_away (server, server->nick, 0); } - else - { - server->is_away = 1; - server->away_time = time (NULL); - ptr_away_msg = (arguments) ? arguments : - ((cfg_irc_default_msg_away && cfg_irc_default_msg_away[0]) ? - cfg_irc_default_msg_away : ptr_away_default_msg); - server_sendf (server, "AWAY :%s\r\n", ptr_away_msg); - if (cfg_irc_display_away) - { - snprintf (buffer, sizeof (buffer), "is away: %s", ptr_away_msg); - irc_send_me_all_channels (server, buffer); - } - server_set_away (server, server->nick, 1); - for (ptr_window = gui_windows; ptr_window; - ptr_window = ptr_window->next_window) - { - if (SERVER(ptr_window->buffer) == server) - ptr_window->buffer->last_read_line = - ptr_window->buffer->last_line; - } - } } gui_draw_buffer_status (gui_current_window->buffer, 1); gui_add_hotlist = 1; diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 8bc9439a7..12270e9e9 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -5,6 +5,8 @@ ChangeLog - 2006-01-08 Version 0.1.7 (under dev!): + * removed "irc_default_msg_away" setting, for RFC 2812 conformity + (/away command wihtout argument only removes away status) * fixed refresh bug with Solaris when term size is changed * replaced Texinfo doc by XML Docbook * added color for window separators (when splited) diff --git a/weechat/doc/en/config.xml b/weechat/doc/en/config.xml index 62884ad17..b5591da75 100644 --- a/weechat/doc/en/config.xml +++ b/weechat/doc/en/config.xml @@ -763,13 +763,6 @@ <entry>Display message to all channels when (un)marking as away</entry> </row> <row> - <entry><option>irc_default_msg_away</option></entry> - <entry>string</entry> - <entry>any string</entry> - <entry></entry> - <entry>Default message when away</entry> -</row> -<row> <entry><option>irc_default_msg_part</option></entry> <entry>string</entry> <entry>any string</entry> diff --git a/weechat/doc/en/weechat.en.xml b/weechat/doc/en/weechat.en.xml index e61d4a001..9e1d0e0aa 100644 --- a/weechat/doc/en/weechat.en.xml +++ b/weechat/doc/en/weechat.en.xml @@ -1686,10 +1686,6 @@ plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL); <entry><literal>%w</literal></entry> <entry>WeeChat commands</entry> </row> - <row> - <entry><literal>%y</literal></entry> - <entry>default "away" message</entry> - </row> </tbody> </tgroup> </informaltable> diff --git a/weechat/doc/fr/config.xml b/weechat/doc/fr/config.xml index 3263b3475..9c3f46154 100644 --- a/weechat/doc/fr/config.xml +++ b/weechat/doc/fr/config.xml @@ -759,17 +759,10 @@ <entry><option>irc_display_away</option></entry> <entry>booléen</entry> <entry>'on' ou 'off'</entry> - <entry>'on'</entry> + <entry>'off'</entry> <entry>Affiche un message sur tous les canaux pour l'absence/le retour</entry> </row> <row> - <entry><option>irc_default_msg_away</option></entry> - <entry>chaîne</entry> - <entry>toute chaîne</entry> - <entry>'away'</entry> - <entry>Message par défaut pour l'absence</entry> -</row> -<row> <entry><option>irc_default_msg_part</option></entry> <entry>chaîne</entry> <entry>toute chaîne</entry> diff --git a/weechat/doc/fr/weechat.fr.xml b/weechat/doc/fr/weechat.fr.xml index 408b6ba01..551f2a26c 100644 --- a/weechat/doc/fr/weechat.fr.xml +++ b/weechat/doc/fr/weechat.fr.xml @@ -1715,10 +1715,6 @@ plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL); <entry><literal>%w</literal></entry> <entry>commandes WeeChat</entry> </row> - <row> - <entry><literal>%y</literal></entry> - <entry>message d'absence ("away") par défaut</entry> - </row> </tbody> </tgroup> </informaltable> diff --git a/weechat/src/common/completion.c b/weechat/src/common/completion.c index a2bd350c8..fb4f4ff90 100644 --- a/weechat/src/common/completion.c +++ b/weechat/src/common/completion.c @@ -574,19 +574,6 @@ completion_list_add_weechat_cmd (t_completion *completion) } /* - * completion_list_add_away: add away message to completion list - */ - -void -completion_list_add_away (t_completion *completion) -{ - if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0]) - weelist_add (&completion->completion_list, - &completion->last_completion, - cfg_irc_default_msg_away); -} - -/* * completion_build_list_template: build data list according to a template */ @@ -680,9 +667,6 @@ completion_build_list_template (t_completion *completion, char *template) case 'w': /* WeeChat commands */ completion_list_add_weechat_cmd (completion); break; - case 'y': /* away message */ - completion_list_add_away (completion); - break; } } break; diff --git a/weechat/src/common/weeconfig.c b/weechat/src/common/weeconfig.c index 34e5b37dc..d0ddb588e 100644 --- a/weechat/src/common/weeconfig.c +++ b/weechat/src/common/weeconfig.c @@ -650,7 +650,6 @@ t_config_option weechat_options_log[] = /* config, irc section */ int cfg_irc_display_away; -char *cfg_irc_default_msg_away; char *cfg_irc_default_msg_part; char *cfg_irc_default_msg_quit; int cfg_irc_notice_as_pv; @@ -668,10 +667,6 @@ t_config_option weechat_options_irc[] = N_("display message to all channels when (un)marking as away"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE, NULL, NULL, &cfg_irc_display_away, NULL, &config_change_noop }, - { "irc_default_msg_away", N_("default message when away"), - N_("default message when away"), - OPTION_TYPE_STRING, 0, 0, 0, - "away", NULL, NULL, &cfg_irc_default_msg_away, &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, diff --git a/weechat/src/common/weeconfig.h b/weechat/src/common/weeconfig.h index 254a56a44..9cfd8f006 100644 --- a/weechat/src/common/weeconfig.h +++ b/weechat/src/common/weeconfig.h @@ -183,7 +183,6 @@ extern char *cfg_log_timestamp; extern int cfg_log_hide_nickserv_pwd; extern int cfg_irc_display_away; -extern char *cfg_irc_default_msg_away; extern char *cfg_irc_default_msg_part; extern char *cfg_irc_default_msg_quit; extern int cfg_irc_notice_as_pv; diff --git a/weechat/src/irc/irc-send.c b/weechat/src/irc/irc-send.c index f6b6ce4b8..ca225d59c 100644 --- a/weechat/src/irc/irc-send.c +++ b/weechat/src/irc/irc-send.c @@ -195,8 +195,7 @@ irc_cmd_send_amsg (t_irc_server *server, char *arguments) int irc_cmd_send_away (t_irc_server *server, char *arguments) { - char *pos, *ptr_away_msg; - char *ptr_away_default_msg = "away"; + char *pos; t_irc_server *ptr_server; t_gui_window *ptr_window; time_t elapsed; @@ -217,37 +216,14 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) { if (ptr_server->is_connected) { - if (ptr_server->is_away && (!pos)) - { - server_sendf (ptr_server, "AWAY\r\n"); - ptr_server->is_away = 0; - if (server->away_time != 0) - { - elapsed = time (NULL) - ptr_server->away_time; - ptr_server->away_time = 0; - if (cfg_irc_display_away) - { - snprintf (buffer, sizeof (buffer), - "is back (gone %.2ld:%.2ld:%.2ld)", - (long int)(elapsed / 3600), - (long int)((elapsed / 60) % 60), - (long int)(elapsed % 60)); - irc_send_me_all_channels (ptr_server, buffer); - } - } - server_set_away (ptr_server, ptr_server->nick, 0); - } - else + if (pos) { ptr_server->is_away = 1; ptr_server->away_time = time (NULL); - ptr_away_msg = (pos) ? pos : - ((cfg_irc_default_msg_away && cfg_irc_default_msg_away[0]) ? - cfg_irc_default_msg_away : ptr_away_default_msg); - server_sendf (ptr_server, "AWAY :%s\r\n", ptr_away_msg); + server_sendf (ptr_server, "AWAY :%s\r\n", pos); if (cfg_irc_display_away) { - string = (char *)gui_color_decode ((unsigned char *)ptr_away_msg, 1); + string = (char *)gui_color_decode ((unsigned char *)pos, 1); snprintf (buffer, sizeof (buffer), "is away: %s", (string) ? string : ""); irc_send_me_all_channels (ptr_server, buffer); if (string) @@ -262,12 +238,51 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) ptr_window->buffer->last_line; } } + else + { + server_sendf (ptr_server, "AWAY\r\n"); + ptr_server->is_away = 0; + if (server->away_time != 0) + { + elapsed = time (NULL) - ptr_server->away_time; + ptr_server->away_time = 0; + if (cfg_irc_display_away) + { + snprintf (buffer, sizeof (buffer), + "is back (gone %.2ld:%.2ld:%.2ld)", + (long int)(elapsed / 3600), + (long int)((elapsed / 60) % 60), + (long int)(elapsed % 60)); + irc_send_me_all_channels (ptr_server, buffer); + } + } + server_set_away (ptr_server, ptr_server->nick, 0); + } } } } else { - if (server->is_away && (!arguments)) + if (arguments) + { + server->is_away = 1; + server->away_time = time (NULL); + server_sendf (server, "AWAY :%s\r\n", arguments); + if (cfg_irc_display_away) + { + snprintf (buffer, sizeof (buffer), "is away: %s", arguments); + irc_send_me_all_channels (server, buffer); + } + server_set_away (server, server->nick, 1); + for (ptr_window = gui_windows; ptr_window; + ptr_window = ptr_window->next_window) + { + if (SERVER(ptr_window->buffer) == server) + ptr_window->buffer->last_read_line = + ptr_window->buffer->last_line; + } + } + else { server_sendf (server, "AWAY\r\n"); server->is_away = 0; @@ -287,28 +302,6 @@ irc_cmd_send_away (t_irc_server *server, char *arguments) } server_set_away (server, server->nick, 0); } - else - { - server->is_away = 1; - server->away_time = time (NULL); - ptr_away_msg = (arguments) ? arguments : - ((cfg_irc_default_msg_away && cfg_irc_default_msg_away[0]) ? - cfg_irc_default_msg_away : ptr_away_default_msg); - server_sendf (server, "AWAY :%s\r\n", ptr_away_msg); - if (cfg_irc_display_away) - { - snprintf (buffer, sizeof (buffer), "is away: %s", ptr_away_msg); - irc_send_me_all_channels (server, buffer); - } - server_set_away (server, server->nick, 1); - for (ptr_window = gui_windows; ptr_window; - ptr_window = ptr_window->next_window) - { - if (SERVER(ptr_window->buffer) == server) - ptr_window->buffer->last_read_line = - ptr_window->buffer->last_line; - } - } } gui_draw_buffer_status (gui_current_window->buffer, 1); gui_add_hotlist = 1; |