summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/CMakeLists.txt2
-rw-r--r--modules/commands/bs_kick.cpp2
-rw-r--r--modules/commands/cs_ban.cpp7
-rw-r--r--modules/commands/cs_mode.cpp4
-rw-r--r--modules/commands/ns_cert.cpp2
-rw-r--r--modules/commands/ns_group.cpp2
-rw-r--r--modules/database/db_old.cpp2
-rw-r--r--modules/encryption/enc_sha256.cpp4
-rw-r--r--modules/extra/m_mysql.cpp2
-rw-r--r--modules/protocol/inspircd.cpp42
-rw-r--r--modules/protocol/plexus.cpp2
-rw-r--r--modules/pseudoclients/botserv.cpp2
-rw-r--r--modules/webcpanel/templates/default/chanserv/set.html2
-rw-r--r--modules/webcpanel/webcpanel.cpp4
14 files changed, 56 insertions, 23 deletions
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index efa48235c..28fab4171 100644
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -115,7 +115,7 @@ macro(build_subdir)
# Append this source file's linker flags to the subdirectoy's linker flags, if there are any to append
if(TEMP_DEPENDENCIES)
- list(APPEND SUBDIR_EXTRA_DEPENDS ${TEMP_DEPDENCIES})
+ list(APPEND SUBDIR_EXTRA_DEPENDS ${TEMP_DEPENDENCIES})
endif()
endif()
endforeach()
diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp
index 90842df01..1a0ec73df 100644
--- a/modules/commands/bs_kick.cpp
+++ b/modules/commands/bs_kick.cpp
@@ -1335,7 +1335,7 @@ class BSKick : public Module
Anope::string nbuf = Anope::NormalizeBuffer(realbuf);
bool casesensitive = Config->GetModule("botserv")->Get<bool>("casesensitive");
- /* Normalize can return an empty string if this only conains control codes etc */
+ /* Normalize can return an empty string if this only contains control codes etc */
if (badwords && !nbuf.empty())
for (unsigned i = 0; i < badwords->GetBadWordCount(); ++i)
{
diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp
index 113873d2c..648651dfa 100644
--- a/modules/commands/cs_ban.cpp
+++ b/modules/commands/cs_ban.cpp
@@ -42,10 +42,13 @@ class CommandCSBan : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
- const Anope::string &chan = params[0];
Configuration::Block *block = Config->GetCommand(source);
const Anope::string &mode = block->Get<Anope::string>("mode", "BAN");
+ ChannelMode *cm = ModeManager::FindChannelModeByName(mode);
+ if (cm == NULL)
+ return;
+ const Anope::string &chan = params[0];
ChannelInfo *ci = ChannelInfo::Find(chan);
if (ci == NULL)
{
@@ -59,7 +62,7 @@ class CommandCSBan : public Command
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
return;
}
- else if (IRCD->GetMaxListFor(c) && c->HasMode(mode) >= IRCD->GetMaxListFor(c))
+ else if (IRCD->GetMaxListFor(c, cm) && c->HasMode(mode) >= IRCD->GetMaxListFor(c, cm))
{
source.Reply(_("The %s list for %s is full."), mode.lower().c_str(), c->name.c_str());
return;
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp
index d5129fdc6..0f6378036 100644
--- a/modules/commands/cs_mode.cpp
+++ b/modules/commands/cs_mode.cpp
@@ -336,7 +336,7 @@ class CommandCSMode : public Command
continue;
}
- if (cm->type == MODE_LIST && ci->c && IRCD->GetMaxListFor(ci->c) && ci->c->HasMode(cm->name) >= IRCD->GetMaxListFor(ci->c))
+ if (cm->type == MODE_LIST && ci->c && IRCD->GetMaxListFor(ci->c, cm) && ci->c->HasMode(cm->name) >= IRCD->GetMaxListFor(ci->c, cm))
{
source.Reply(_("List for mode %c is full."), cm->mchar);
continue;
@@ -660,7 +660,7 @@ class CommandCSMode : public Command
if (adding)
{
- if (IRCD->GetMaxListFor(ci->c) && ci->c->HasMode(cm->name) < IRCD->GetMaxListFor(ci->c))
+ if (IRCD->GetMaxListFor(ci->c, cm) && ci->c->HasMode(cm->name) < IRCD->GetMaxListFor(ci->c, cm))
ci->c->SetMode(NULL, cm, param);
}
else
diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp
index ab8957011..fec857109 100644
--- a/modules/commands/ns_cert.cpp
+++ b/modules/commands/ns_cert.cpp
@@ -55,7 +55,7 @@ struct NSCertListImpl : NSCertList
/** Get an entry from the nick's cert list by index
*
- * @param entry Index in the certificaate list vector to retrieve
+ * @param entry Index in the certificate list vector to retrieve
* @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
*
* Retrieves an entry from the certificate list corresponding to the given index.
diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp
index c68e53157..aa2865776 100644
--- a/modules/commands/ns_group.cpp
+++ b/modules/commands/ns_group.cpp
@@ -282,7 +282,7 @@ class CommandNSUngroup : public Command
{
this->SendSyntax(source);
source.Reply(" ");
- source.Reply(_("This command ungroups your nick, or if given, the specificed nick,\n"
+ source.Reply(_("This command ungroups your nick, or if given, the specified nick,\n"
"from the group it is in. The ungrouped nick keeps its registration\n"
"time, password, email, greet, language, and url. Everything else\n"
"is reset. You may not ungroup yourself if there is only one nick in\n"
diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp
index 1e48ec42a..bf756678a 100644
--- a/modules/database/db_old.cpp
+++ b/modules/database/db_old.cpp
@@ -340,7 +340,7 @@ static dbFILE *open_db_read(const char *service, const char *filename, int versi
}
else if (myversion < version)
{
- Log() << "Unsuported database version (" << myversion << ") on " << f->filename << ".";
+ Log() << "Unsupported database version (" << myversion << ") on " << f->filename << ".";
delete f;
return NULL;
}
diff --git a/modules/encryption/enc_sha256.cpp b/modules/encryption/enc_sha256.cpp
index 8690d513b..b425d6b9d 100644
--- a/modules/encryption/enc_sha256.cpp
+++ b/modules/encryption/enc_sha256.cpp
@@ -288,8 +288,8 @@ class ESHA256 : public Module
else
use_iv = false;
- Encryption::IV initilization(this->iv, 8);
- SHA256Context ctx(&initilization);
+ Encryption::IV initialization(this->iv, 8);
+ SHA256Context ctx(&initialization);
ctx.Update(reinterpret_cast<const unsigned char *>(src.c_str()), src.length());
ctx.Finalize();
diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp
index fa6d924da..dcac30ebd 100644
--- a/modules/extra/m_mysql.cpp
+++ b/modules/extra/m_mysql.cpp
@@ -24,7 +24,7 @@ using namespace SQL;
*
* This module spawns a single thread that is used to execute blocking MySQL queries.
* When a module requests a query to be executed it is added to a list for the thread
- * (which never stops looping and sleeing) to pick up and execute, the result of which
+ * (which never stops looping and sleeping) to pick up and execute, the result of which
* is inserted in to another queue to be picked up by the main thread. The main thread
* uses Pipe to become notified through the socket engine when there are results waiting
* to be sent back to the modules requesting the query
diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp
index bedb30ca3..9329b1a70 100644
--- a/modules/protocol/inspircd.cpp
+++ b/modules/protocol/inspircd.cpp
@@ -13,6 +13,8 @@
#include "modules/cs_mode.h"
#include "modules/sasl.h"
+typedef std::map<char, unsigned> ListLimits;
+
struct SASLUser
{
Anope::string uid;
@@ -54,7 +56,9 @@ class InspIRCdProto : public IRCDProto
}
public:
- InspIRCdProto(Module *creator) : IRCDProto(creator, "InspIRCd 3+")
+ PrimitiveExtensibleItem<ListLimits> maxlist;
+
+ InspIRCdProto(Module *creator) : IRCDProto(creator, "InspIRCd 3+"), maxlist(creator, "maxlist")
{
DefaultPseudoclientModes = "+I";
CanSVSNick = true;
@@ -72,6 +76,20 @@ class InspIRCdProto : public IRCDProto
MaxLine = 4096;
}
+ unsigned GetMaxListFor(Channel *c, ChannelMode *cm)
+ {
+ ListLimits *limits = maxlist.Get(c);
+ if (limits)
+ {
+ ListLimits::const_iterator limit = limits->find(cm->mchar);
+ if (limit != limits->end())
+ return limit->second;
+ }
+
+ // Fall back to the config limit if we can't find the mode.
+ return IRCDProto::GetMaxListFor(c, cm);
+ }
+
void SendConnect() anope_override
{
UplinkSocket::Message() << "CAPAB START 1205";
@@ -1322,9 +1340,10 @@ class IRCDMessageMetadata : IRCDMessage
{
const bool &do_topiclock;
const bool &do_mlock;
+ PrimitiveExtensibleItem<ListLimits> &maxlist;
public:
- IRCDMessageMetadata(Module *creator, const bool &handle_topiclock, const bool &handle_mlock) : IRCDMessage(creator, "METADATA", 3), do_topiclock(handle_topiclock), do_mlock(handle_mlock) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+ IRCDMessageMetadata(Module *creator, const bool &handle_topiclock, const bool &handle_mlock, PrimitiveExtensibleItem<ListLimits> &listlimits) : IRCDMessage(creator, "METADATA", 3), do_topiclock(handle_topiclock), do_mlock(handle_mlock), maxlist(listlimits) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) anope_override
{
@@ -1334,9 +1353,9 @@ class IRCDMessageMetadata : IRCDMessage
if ((params[0][0] == '#') && (params.size() > 3) && (!source.GetServer()->IsSynced()))
{
Channel *c = Channel::Find(params[0]);
- if (c && c->ci)
+ if (c)
{
- if ((do_mlock) && (params[2] == "mlock"))
+ if ((c->ci) && (do_mlock) && (params[2] == "mlock"))
{
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
Anope::string modes;
@@ -1347,13 +1366,24 @@ class IRCDMessageMetadata : IRCDMessage
if (modes != params[3])
UplinkSocket::Message(Me) << "METADATA " << c->name << " " << c->creation_time << " mlock :" << modes;
}
- else if ((do_topiclock) && (params[2] == "topiclock"))
+ else if ((c->ci) && (do_topiclock) && (params[2] == "topiclock"))
{
bool mystate = c->ci->HasExt("TOPICLOCK");
bool serverstate = (params[3] == "1");
if (mystate != serverstate)
UplinkSocket::Message(Me) << "METADATA " << c->name << " " << c->creation_time << " topiclock :" << (mystate ? "1" : "");
}
+ else if (params[2] == "maxlist")
+ {
+ ListLimits limits;
+ spacesepstream limitstream(params[3]);
+ Anope::string modechr, modelimit;
+ while (limitstream.GetToken(modechr) && limitstream.GetToken(modelimit))
+ {
+ limits.insert(std::make_pair(modechr[0], convertTo<unsigned>(modelimit)));
+ }
+ maxlist.Set(c, limits);
+ }
}
}
else if (isdigit(params[0][0]))
@@ -1862,7 +1892,7 @@ class ProtoInspIRCd : public Module
message_part(this), message_privmsg(this), message_quit(this), message_stats(this),
message_away(this), message_capab(this), message_encap(this), message_endburst(this), message_fhost(this),
message_fident(this), message_fjoin(this), message_fmode(this), message_ftopic(this), message_idle(this),
- message_ijoin(this), message_kick(this), message_metadata(this, use_server_side_topiclock, use_server_side_mlock),
+ message_ijoin(this), message_kick(this), message_metadata(this, use_server_side_topiclock, use_server_side_mlock, ircd_proto.maxlist),
message_mode(this), message_nick(this), message_opertype(this), message_ping(this), message_rsquit(this),
message_save(this), message_server(this), message_squit(this), message_time(this), message_uid(this)
{
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 5fd52fda3..0385f1046 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -115,7 +115,7 @@ class PlexusProto : public IRCDProto
* KNOCK - Supports KNOCK
* TBURST - Supports TBURST
* PARA - Supports invite broadcasting for +p
- * ENCAP - Supports encapsulization of protocol messages
+ * ENCAP - Supports encapsulation of protocol messages
* SVS - Supports services protocol extensions
*/
UplinkSocket::Message() << "CAPAB :QS EX CHW IE EOB KLN UNKLN GLN HUB KNOCK TBURST PARA ENCAP SVS";
diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp
index cadcad4bb..6aa75919c 100644
--- a/modules/pseudoclients/botserv.cpp
+++ b/modules/pseudoclients/botserv.cpp
@@ -119,7 +119,7 @@ class BotServCore : public Module
if (inhabit && inhabit->HasExt(c))
return;
- /* This is called prior to removing the user from the channnel, so c->users.size() - 1 should be safe */
+ /* This is called prior to removing the user from the channel, so c->users.size() - 1 should be safe */
if (c->ci && c->ci->bi && u != *c->ci->bi && c->users.size() - 1 <= Config->GetModule(this)->Get<unsigned>("minusers") && c->FindUser(c->ci->bi))
c->ci->bi->Part(c->ci->c);
}
diff --git a/modules/webcpanel/templates/default/chanserv/set.html b/modules/webcpanel/templates/default/chanserv/set.html
index 050c37f69..9437ca71a 100644
--- a/modules/webcpanel/templates/default/chanserv/set.html
+++ b/modules/webcpanel/templates/default/chanserv/set.html
@@ -25,7 +25,7 @@
{END IF}
{IF EXISTS SUCCESSOR}
<tr>
- <td>Succsesor</td>
+ <td>Successor</td>
<td>{SUCCESSOR}</td>
</tr>
{END IF}
diff --git a/modules/webcpanel/webcpanel.cpp b/modules/webcpanel/webcpanel.cpp
index 16b61e673..f95307f22 100644
--- a/modules/webcpanel/webcpanel.cpp
+++ b/modules/webcpanel/webcpanel.cpp
@@ -268,7 +268,7 @@ namespace WebPanel
my_reply(r, key);
CommandSource source(user, NULL, nc, &my_reply, bi);
- source.ip = client->clientaddr.addr();
+ source.ip = client->GetIP();
CommandInfo info;
info.name = c;
@@ -308,7 +308,7 @@ namespace WebPanel
my_reply(r, key);
CommandSource source(nc->display, NULL, nc, &my_reply, bi);
- source.ip = client->clientaddr.addr();
+ source.ip = client->GetIP();
cmd->Run(source, cmdname, *info, params);
}