mirror of
https://github.com/anope/anope.git
synced 2026-07-05 18:03:13 +02:00
Fix setting some default flags, reading fantasy blocks, and minusers setting being off by 1
This commit is contained in:
@@ -229,7 +229,8 @@ class BotServCore : public Module
|
||||
* make it into the channel, leaving the channel botless even for
|
||||
* legit users - Rob
|
||||
**/
|
||||
if (c->users.size() >= Config->GetModule(this)->Get<unsigned>("minusers") && !c->FindUser(c->ci->bi))
|
||||
/* This is before the user has joined the channel, so check usercount + 1 */
|
||||
if (c->users.size() + 1 >= Config->GetModule(this)->Get<unsigned>("minusers") && !c->FindUser(c->ci->bi))
|
||||
{
|
||||
ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes"));
|
||||
c->ci->bi->Join(c, &status);
|
||||
@@ -336,7 +337,7 @@ class BotServCore : public Module
|
||||
/* Set default bot flags */
|
||||
spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy"));
|
||||
for (Anope::string token; sep.GetToken(token);)
|
||||
this->ExtendMetadata("BS_" + token);
|
||||
ci->ExtendMetadata("BS_" + token.upper());
|
||||
}
|
||||
|
||||
void OnPreUserKicked(MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) anope_override
|
||||
|
||||
@@ -315,7 +315,7 @@ class ChanServCore : public Module
|
||||
|
||||
/* Set default chan flags */
|
||||
for (unsigned i = 0; i < defaults.size(); ++i)
|
||||
this->ExtendMetadata(defaults[i]);
|
||||
ci->ExtendMetadata(defaults[i].upper());
|
||||
|
||||
{
|
||||
Anope::string modes;
|
||||
|
||||
@@ -437,7 +437,7 @@ class NickServCore : public Module
|
||||
{
|
||||
/* Set default flags */
|
||||
for (unsigned i = 0; i < defaults.size(); ++i)
|
||||
this->ExtendMetadata(defaults[i].upper());
|
||||
nc->ExtendMetadata(defaults[i].upper());
|
||||
}
|
||||
|
||||
void OnUserQuit(User *u, const Anope::string &msg)
|
||||
|
||||
+1
-1
@@ -452,7 +452,7 @@ Conf::Conf() : Block("")
|
||||
ValidateNotEmpty("fantasy", "name", nname);
|
||||
ValidateNotEmpty("fantasy", "command", service);
|
||||
|
||||
CommandInfo &c = this->Fantasy[name];
|
||||
CommandInfo &c = this->Fantasy[nname];
|
||||
c.name = service;
|
||||
c.permission = permission;
|
||||
c.group = group;
|
||||
|
||||
Reference in New Issue
Block a user