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

irc: do not send command "MODE #channel" on manual /names (do it only when names are received on join of channel) (bug #35930)

This commit is contained in:
Sebastien Helleu
2012-03-22 16:02:25 +01:00
parent d87eacccc9
commit d4184f78c5
5 changed files with 33 additions and 8 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.8-dev, 2012-03-18
v0.3.8-dev, 2012-03-21
Version 0.3.8 (under dev!)
@@ -15,6 +15,8 @@ Version 0.3.8 (under dev!)
(task #11316)
* core: fix display of wide chars on last column of chat area (patch #7733)
* api: add list "gui_buffer_last_displayed" in hdata "buffer"
* irc: do not send command "MODE #channel" on manual /names (do it only when
names are received on join of channel) (bug #35930)
* irc: do not allow the creation of two servers with same name but different
case (fix error when writing file irc.conf) (bug #35840)
* irc: update away flag for nicks on manual /who
+8 -3
View File
@@ -264,6 +264,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
new_channel->modes = NULL;
new_channel->limit = 0;
new_channel->key = NULL;
new_channel->names_received = 0;
new_channel->checking_away = 0;
new_channel->away_message = NULL;
new_channel->has_quit_server = 0;
@@ -882,6 +883,7 @@ irc_channel_hdata_channel_cb (void *data, const char *hdata_name)
WEECHAT_HDATA_VAR(struct t_irc_channel, modes, STRING, NULL);
WEECHAT_HDATA_VAR(struct t_irc_channel, limit, INTEGER, NULL);
WEECHAT_HDATA_VAR(struct t_irc_channel, key, STRING, NULL);
WEECHAT_HDATA_VAR(struct t_irc_channel, names_received, INTEGER, NULL);
WEECHAT_HDATA_VAR(struct t_irc_channel, checking_away, INTEGER, NULL);
WEECHAT_HDATA_VAR(struct t_irc_channel, away_message, STRING, NULL);
WEECHAT_HDATA_VAR(struct t_irc_channel, has_quit_server, INTEGER, NULL);
@@ -971,9 +973,7 @@ irc_channel_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "key", channel->key))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "pv_remote_nick_color", channel->pv_remote_nick_color))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "nicks_count", channel->nicks_count))
if (!weechat_infolist_new_var_integer (ptr_item, "names_received", channel->names_received))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "checking_away", channel->checking_away))
return 0;
@@ -987,6 +987,10 @@ irc_channel_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "nick_completion_reset", channel->nick_completion_reset))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "pv_remote_nick_color", channel->pv_remote_nick_color))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "nicks_count", channel->nicks_count))
return 0;
for (i = 0; i < 2; i++)
{
if (channel->nicks_speaking[i])
@@ -1047,6 +1051,7 @@ irc_channel_print_log (struct t_irc_channel *channel)
weechat_log_printf (" modes. . . . . . . . . . : '%s'", channel->modes);
weechat_log_printf (" limit. . . . . . . . . . : %d", channel->limit);
weechat_log_printf (" key. . . . . . . . . . . : '%s'", channel->key);
weechat_log_printf (" names_received . . . . . : %d", channel->names_received);
weechat_log_printf (" checking_away. . . . . . : %d", channel->checking_away);
weechat_log_printf (" away_message . . . . . . : '%s'", channel->away_message);
weechat_log_printf (" has_quit_server. . . . . : %d", channel->has_quit_server);
+1
View File
@@ -47,6 +47,7 @@ struct t_irc_channel
char *modes; /* channel modes */
int limit; /* user limit (0 is limit not set) */
char *key; /* channel key (NULL if no key set) */
int names_received; /* names received (message 366) */
int checking_away; /* = 1 if checking away with WHO cmd */
char *away_message; /* to display away only once in pv */
int has_quit_server; /* =1 if nick has quit (pv only), to */
+20 -4
View File
@@ -557,9 +557,19 @@ IRC_PROTOCOL_CALLBACK(join)
}
}
/* remove topic if joining new channel */
/* reset some variables if joining new channel */
if (!ptr_channel->nicks)
{
irc_channel_set_topic (ptr_channel, NULL);
if (ptr_channel->modes)
{
free (ptr_channel->modes);
ptr_channel->modes = NULL;
}
ptr_channel->limit = 0;
ptr_channel->names_received = 0;
ptr_channel->checking_away = 0;
}
/* add nick in channel */
ptr_nick = irc_nick_new (server, ptr_channel, nick, NULL, 0);
@@ -3929,9 +3939,12 @@ IRC_PROTOCOL_CALLBACK(366)
NG_("normal", "normals", num_normal),
IRC_COLOR_CHAT_DELIMITERS);
irc_command_mode_server (server, ptr_channel, NULL,
IRC_SERVER_SEND_OUTQ_PRIO_LOW);
irc_channel_check_away (server, ptr_channel);
if (!ptr_channel->names_received)
{
irc_command_mode_server (server, ptr_channel, NULL,
IRC_SERVER_SEND_OUTQ_PRIO_LOW);
irc_channel_check_away (server, ptr_channel);
}
}
else
{
@@ -3947,6 +3960,9 @@ IRC_PROTOCOL_CALLBACK(366)
(argv[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]);
}
if (ptr_channel)
ptr_channel->names_received = 1;
return WEECHAT_RC_OK;
}
+1
View File
@@ -416,6 +416,7 @@ irc_upgrade_read_cb (void *data,
str = weechat_infolist_string (infolist, "key");
if (str)
irc_upgrade_current_channel->key = strdup (str);
irc_upgrade_current_channel->names_received = weechat_infolist_integer (infolist, "names_received");
irc_upgrade_current_channel->checking_away = weechat_infolist_integer (infolist, "checking_away");
str = weechat_infolist_string (infolist, "away_message");
if (str)