|
@@ -54,6 +54,8 @@
|
|
|
#endif
|
|
#endif
|
|
|
#endif
|
|
#endif
|
|
|
#include <sys/utsname.h>
|
|
#include <sys/utsname.h>
|
|
|
|
|
+#include <bdlib/src/Array.h>
|
|
|
|
|
+#include <bdlib/src/String.h>
|
|
|
|
|
|
|
|
char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop +meankicks ban-type 3 protect-backup 1";
|
|
char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop +meankicks ban-type 3 protect-backup 1";
|
|
|
struct chanset_t *chanset = NULL; /* Channel list */
|
|
struct chanset_t *chanset = NULL; /* Channel list */
|
|
@@ -857,10 +859,24 @@ bool bot_shouldjoin(struct userrec* u, struct flag_record* fr, struct chanset_t*
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+
|
|
|
|
|
+ // Am I in the groups that this channel has?
|
|
|
|
|
+ bd::Array<bd::String> my_groupsArray(bd::String(groups).split(',')), channel_groupsArray(bd::String(chan->groups).split(' '));
|
|
|
|
|
+ bool group_match = 0;
|
|
|
|
|
+
|
|
|
|
|
+ for (size_t i = 0; i < my_groupsArray.length(); ++i) {
|
|
|
|
|
+ if (channel_groupsArray.find(my_groupsArray[i]) != channel_groupsArray.npos) {
|
|
|
|
|
+ group_match = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Ignore +inactive during cmd_slowjoin to ensure that +backup bots join
|
|
// Ignore +inactive during cmd_slowjoin to ensure that +backup bots join
|
|
|
- return (!glob_kick(*fr) && !chan_kick(*fr) &&
|
|
|
|
|
- ((ignore_inactive || !channel_inactive(chan)) &&
|
|
|
|
|
- (channel_backup(chan) || (!glob_backup(*fr) && !chan_backup(*fr)))));
|
|
|
|
|
|
|
+ return (!glob_kick(*fr) && !chan_kick(*fr) && // Not being kicked
|
|
|
|
|
+ ((ignore_inactive || !channel_inactive(chan)) && // Not inactive
|
|
|
|
|
+ ((channel_backup(chan) && (glob_backup(*fr) || chan_backup(*fr))) || (!channel_backup(chan) && !glob_backup(*fr) && !chan_backup(*fr)))) && // Is +backup and I'm B|B, or is -backup and I am not B|B
|
|
|
|
|
+ group_match // My group should join
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool shouldjoin(struct chanset_t *chan)
|
|
bool shouldjoin(struct chanset_t *chan)
|