|
@@ -987,15 +987,17 @@ request_in(struct chanset_t *chan)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int foundBots = 0;
|
|
int foundBots = 0;
|
|
|
- char* botops[MAX_BOTS];
|
|
|
|
|
|
|
+// char* botops[MAX_BOTS];
|
|
|
|
|
|
|
|
for (tand_t* bot = tandbot; bot && (foundBots < MAX_BOTS); bot = bot->next) {
|
|
for (tand_t* bot = tandbot; bot && (foundBots < MAX_BOTS); bot = bot->next) {
|
|
|
if (bot->hub || !bot->u)
|
|
if (bot->hub || !bot->u)
|
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
get_user_flagrec(bot->u, &fr, chan->dname, chan);
|
|
get_user_flagrec(bot->u, &fr, chan->dname, chan);
|
|
|
- if (bot_shouldjoin(bot->u, &fr, chan) && chk_op(fr, chan))
|
|
|
|
|
- botops[foundBots++] = bot->bot;
|
|
|
|
|
|
|
+ if (bot_shouldjoin(bot->u, &fr, chan) && chk_op(fr, chan)) {
|
|
|
|
|
+ ++foundBots;
|
|
|
|
|
+// botops[foundBots++] = bot->bot;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!foundBots) {
|
|
if (!foundBots) {
|
|
@@ -1003,23 +1005,9 @@ request_in(struct chanset_t *chan)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- int cnt = foundBots < in_bots ? foundBots : in_bots;
|
|
|
|
|
- char s[255] = "";
|
|
|
|
|
- char l[1024] = "";
|
|
|
|
|
- size_t len = 0;
|
|
|
|
|
-
|
|
|
|
|
- simple_snprintf(s, sizeof(s), "gi i %s %s %s!%s %s", chan->dname, botname, botname, botuserhost, botuserip);
|
|
|
|
|
-
|
|
|
|
|
- shuffleArray(botops, foundBots);
|
|
|
|
|
- for (int n = 0; n < cnt; ++n) {
|
|
|
|
|
- putbot(botops[n], s);
|
|
|
|
|
-
|
|
|
|
|
- if (l[0])
|
|
|
|
|
- len += strlcpy(l + len, ", ", sizeof(l) - len);
|
|
|
|
|
- len += strlcpy(l + len, botops[n], sizeof(l) - len);
|
|
|
|
|
- }
|
|
|
|
|
- l[len] = 0;
|
|
|
|
|
- putlog(LOG_GETIN, "*", "Requested help to join %s from %s", chan->dname, l);
|
|
|
|
|
|
|
+ bd::String request(bd::String::printf("gi i %s %s %s!%s %s", chan->dname, botname, botname, botuserhost, botuserip));
|
|
|
|
|
+ putallbots(request.c_str());
|
|
|
|
|
+ putlog(LOG_GETIN, "*", "Requested help to join %s", chan->dname);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|