Skip to content

Commit 7c05b57

Browse files
Trigger event handlers when syncing channel
Found by: wilkowy Patch by: michaelortmann Fixes: #599 When the bot joins a chan, gotjoin() creates a member for the channel member list and then it resets the chan with flags CHAN_RESETALL, removing that member again. This PR unsets flag CHAN_RESETWHO for this very case, when the member list contains 1 member, which is the bot itself that just got created.
1 parent 779e6a1 commit 7c05b57

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mod/irc.mod/chan.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2109,7 +2109,10 @@ static int gotjoin(char *from, char *channame)
21092109
else
21102110
putlog(LOG_JOIN | LOG_MISC, chan->dname, "%s joined %s.", nick,
21112111
chname);
2112-
reset_chan_info(chan, (CHAN_RESETALL & ~CHAN_RESETTOPIC), 1);
2112+
reset_chan_info(chan, (CHAN_RESETALL & ~CHAN_RESETTOPIC &
2113+
(chan->channel.members == 1 ? ~CHAN_RESETWHO : CHAN_RESETALL)), /* do not remove myself again */
2114+
1);
2115+
21132116
} else {
21142117
struct chanuserrec *cr;
21152118

0 commit comments

Comments
 (0)