|
|
@@ -808,14 +808,8 @@ getin_request(char *botnick, char *code, char *par)
|
|
|
bool sendi = 0;
|
|
|
|
|
|
if (chan->channel.maxmembers) {
|
|
|
- int lim = (chan->channel.members - chan->channel.splitmembers) + 5, curlim = chan->channel.maxmembers;
|
|
|
- if (curlim < lim) {
|
|
|
- char s2[6] = "";
|
|
|
-
|
|
|
- sendi = 1;
|
|
|
- simple_snprintf(s2, sizeof(s2), "%d", lim);
|
|
|
- add_mode(chan, '+', 'l', s2);
|
|
|
- putlog(LOG_GETIN, "*", "inreq from %s/%s for %s - Raised limit to %d", botnick, nick, chan->dname, lim);
|
|
|
+ if (raise_limit(chan)) {
|
|
|
+ putlog(LOG_GETIN, "*", "inreq from %s/%s for %s - Raised limit", botnick, nick, chan->dname);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1395,15 +1389,15 @@ check_netfight(struct chanset_t *chan)
|
|
|
chan->channel.fighting = 0; /* we put this here because we need to clear it once per min */
|
|
|
}
|
|
|
|
|
|
-void
|
|
|
+bool
|
|
|
raise_limit(struct chanset_t *chan)
|
|
|
{
|
|
|
if (!chan || !me_op(chan))
|
|
|
- return;
|
|
|
+ return false;
|
|
|
|
|
|
/* Don't bother setting limit if the user has set a protect -l */
|
|
|
if (chan->mode_mns_prot & CHANLIMIT)
|
|
|
- return;
|
|
|
+ return false;
|
|
|
|
|
|
int nl = (chan->channel.members - chan->channel.splitmembers) + chan->limitraise; /* new limit */
|
|
|
int i = chan->limitraise >> 2; /* DIV 4 */
|
|
|
@@ -1412,15 +1406,18 @@ raise_limit(struct chanset_t *chan)
|
|
|
int ll = nl - i; /* lower limit */
|
|
|
|
|
|
if ((chan->channel.maxmembers > ll) && (chan->channel.maxmembers < ul))
|
|
|
- return; /* the current limit is in the range, so leave it. */
|
|
|
+ return false; /* the current limit is in the range, so leave it. */
|
|
|
|
|
|
if (nl != chan->channel.maxmembers) {
|
|
|
char s[6] = "";
|
|
|
|
|
|
simple_snprintf(s, sizeof(s), "%d", nl);
|
|
|
add_mode(chan, '+', 'l', s);
|
|
|
+
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
void check_shouldjoin(struct chanset_t* chan)
|