mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 02:33:12 +02:00
irc: optimize and reuse irc_channel_rejoin
This commit is contained in:
committed by
Sébastien Helleu
parent
6edc88f7d6
commit
3c3bb933e9
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user