projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8c2e34a
)
fixed auto-rejoin when only bots are in an opless channel
author
pk910
<philipp@zoelle1.de>
Fri, 10 Aug 2012 19:18:14 +0000
(21:18 +0200)
committer
pk910
<philipp@zoelle1.de>
Fri, 10 Aug 2012 19:45:15 +0000
(21:45 +0200)
src/IRCParser.c
patch
|
blob
|
history
diff --git
a/src/IRCParser.c
b/src/IRCParser.c
index ca42770bd8370725feacc467294230b86dd662c1..2c30d6992dfe32f89abe3fd6b944d97b3e8652c4 100644
(file)
--- a/
src/IRCParser.c
+++ b/
src/IRCParser.c
@@
-239,11
+239,11
@@
static IRC_CMD(raw_join) {
free(chan->rejoin_array);
chan->flags &= ~CHANFLAG_REJOINING;
}
free(chan->rejoin_array);
chan->flags &= ~CHANFLAG_REJOINING;
}
- } else if(
chan->usercount == 1 && isUserOnChan(user, chan)) {
+ } else if(
isUserOnChan(user, chan)) { //user is already in the channel? ^^
//first bot rejoined
//first bot rejoined
+ chan->flags &= ~CHANFLAG_RECEIVED_USERLIST;
struct ChanUser *chanuser = getChanUser(user, chan);
struct ChanUser *chanuser = getChanUser(user, chan);
- chanuser->flags &= ~CHANUSERFLAG_VOICED;
- chanuser->flags |= CHANUSERFLAG_OPPED;
+ get_userlist_with_invisible(chan, 0, got_channel_userlist, chanuser);
}
DESYNCHRONIZE(cache_sync);
return 1;
}
DESYNCHRONIZE(cache_sync);
return 1;
@@
-329,8
+329,14
@@
static IRC_CMD(raw_part) {
}
else if(keep_channel && (chan->flags & CHANFLAG_REJOINING) && chan->usercount == 1) {
//bot is alone... rejoin!
}
else if(keep_channel && (chan->flags & CHANFLAG_REJOINING) && chan->usercount == 1) {
//bot is alone... rejoin!
- putsock(client, "PART %s :magic hop", chan->name);
- putsock(client, "JOIN %s", chan->name);
+ struct ClientSocket *bot;
+ //find the last bot in the channel
+ for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) {
+ if(bot->user == chan->chanbot) {
+ putsock(bot, "PART %s :magic hop", chan->name);
+ putsock(bot, "JOIN %s", chan->name);
+ }
+ }
}
DESYNCHRONIZE(cache_sync);
return 1;
}
DESYNCHRONIZE(cache_sync);
return 1;