summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-protocol.c
diff options
context:
space:
mode:
authorSimmo Saan <simmo.saan@gmail.com>2018-09-09 20:46:05 +0300
committerSébastien Helleu <flashcode@flashtux.org>2023-05-18 13:51:14 +0200
commit3c3bb933e928dfea0c21bd63a3b5409f5a0a8276 (patch)
treeedcafad0071625ed2f3d738025fe54acf0e50302 /src/plugins/irc/irc-protocol.c
parent6edc88f7d6cb42d776b39f23e620060a910b490e (diff)
downloadweechat-3c3bb933e928dfea0c21bd63a3b5409f5a0a8276.zip
irc: optimize and reuse irc_channel_rejoin
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r--src/plugins/irc/irc-protocol.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 20a960fb7..e495eecb2 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -2718,8 +2718,8 @@ IRC_PROTOCOL_CALLBACK(notice)
IRC_PROTOCOL_CALLBACK(part)
{
- char *str_comment, *join_string;
- int join_length, local_part, display_host;
+ char *str_comment;
+ int local_part, display_host;
struct t_irc_channel *ptr_channel;
struct t_irc_nick *ptr_nick;
struct t_irc_channel_speaking *ptr_nick_speaking;
@@ -2832,26 +2832,7 @@ IRC_PROTOCOL_CALLBACK(part)
if (ptr_channel->cycle)
{
ptr_channel->cycle = 0;
- if (ptr_channel->key)
- {
- join_length = strlen (ptr_channel->name) + 1 +
- strlen (ptr_channel->key) + 1;
- join_string = malloc (join_length);
- if (join_string)
- {
- snprintf (join_string, join_length, "%s %s",
- ptr_channel->name,
- ptr_channel->key);
- irc_command_join_server (server, join_string, 1, 1);
- free (join_string);
- }
- else
- irc_command_join_server (server, ptr_channel->name,
- 1, 1);
- }
- else
- irc_command_join_server (server, ptr_channel->name,
- 1, 1);
+ irc_channel_rejoin (server, ptr_channel, 1, 1);
}
else
{