aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjgeboski <jgeboski@gmail.com>2015-01-16 16:50:25 -0300
committerdequis <dx@dxzone.com.ar>2015-01-16 16:50:25 -0300
commitecbd22a87ca7bc2675e9368445d193c6c81bf3c1 (patch)
treee9b87dcfcba2218205fa187c02e06b26195346e2
parentfed4f766c05e44e99917909b266c99c052ed9c3e (diff)
channel: fixed auto-join occurring when disabled
With the auto_join channel flag set to false, the channel is still auto-joined. This can lead to the channel being "doubly" joined if a client previously sent a channel join request. The result of being "doubly" joined is really undefined, but most notably memory leaks can occur. It also appears, based on the comment under the modified condition, the previous condition was incorrect. Another patch should probably implement some sort of check to ensure a channel is not already joined, assuming the auto_join flag is enabled.
-rw-r--r--irc_channel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/irc_channel.c b/irc_channel.c
index 0a6e11d2..f3ec296c 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -431,7 +431,7 @@ void irc_channel_auto_joins( irc_t *irc, account_t *acc )
can only auto-join them if their account is online. */
char *acc_s;
- if( !aj && !( ic->flags & IRC_CHANNEL_JOINED ) )
+ if( !aj || ( ic->flags & IRC_CHANNEL_JOINED ) )
/* Only continue if this one's marked as auto_join
or if we're in it already. (Possible if the
client auto-rejoined it before identyfing.) */