summaryrefslogtreecommitdiff
path: root/include/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-06-23 09:45:15 -0400
committerAdam <Adam@anope.org>2014-06-23 09:45:15 -0400
commitfd9bb0ea7e3c8a39f1632c2ebbdc25d0fac192a0 (patch)
tree1d68e86065e0b012aee41533d4f9b289ee0707ac /include/modules
parent148b26f687ce85dc01e852a2358b03d493757ada (diff)
parent9a947fa4359c667be58ebae4634d9ac0e53d5db4 (diff)
Merge branch '2.0' into 2.1
Conflicts: cmake/Anope.cmake cmake/FindGettext.cmake include/access.h include/messages.h include/modes.h include/modules.h include/users.h modules/CMakeLists.txt modules/commands/bs_bot.cpp modules/commands/cs_access.cpp modules/commands/cs_ban.cpp modules/commands/cs_clone.cpp modules/commands/cs_flags.cpp modules/commands/cs_info.cpp modules/commands/cs_list.cpp modules/commands/cs_log.cpp modules/commands/cs_mode.cpp modules/commands/cs_status.cpp modules/commands/cs_suspend.cpp modules/commands/cs_updown.cpp modules/commands/cs_xop.cpp modules/commands/ms_check.cpp modules/commands/ns_access.cpp modules/commands/ns_cert.cpp modules/commands/ns_group.cpp modules/commands/ns_register.cpp modules/commands/ns_set.cpp modules/commands/ns_suspend.cpp modules/commands/os_session.cpp modules/commands/os_svs.cpp modules/extra/m_ldap_authentication.cpp modules/extra/m_regex_pcre.cpp modules/extra/m_sql_authentication.cpp modules/extra/stats/m_chanstats.cpp modules/protocol/bahamut.cpp modules/protocol/hybrid.cpp modules/protocol/inspircd12.cpp modules/protocol/inspircd20.cpp modules/protocol/unreal.cpp modules/pseudoclients/chanserv.cpp modules/pseudoclients/chanserv/channel.cpp modules/pseudoclients/nickserv/nickserv.cpp modules/webcpanel/pages/chanserv/access.cpp src/access.cpp src/bots.cpp src/channels.cpp src/language.cpp src/modes.cpp src/modulemanager.cpp src/process.cpp src/users.cpp src/version.sh
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/chanserv.h48
-rw-r--r--include/modules/nickserv.h3
-rw-r--r--include/modules/os_session.h2
3 files changed, 48 insertions, 5 deletions
diff --git a/include/modules/chanserv.h b/include/modules/chanserv.h
index 9170ea2d2..c5e677407 100644
--- a/include/modules/chanserv.h
+++ b/include/modules/chanserv.h
@@ -365,6 +365,10 @@ namespace ChanServ
/* Represents one entry of an access list on a channel. */
class CoreExport ChanAccess : public Serializable
{
+ Anope::string mask;
+ /* account this access entry is for, if any */
+ Serialize::Reference<NickServ::Account> nc;
+
public:
typedef std::multimap<const ChanAccess *, const ChanAccess *> Set;
/* shows the 'path' taken to determine if an access entry matches a user
@@ -377,9 +381,6 @@ namespace ChanServ
AccessProvider *provider;
/* Channel this access entry is on */
Serialize::Reference<Channel> ci;
- /* account this access entry is for, if any */
- Serialize::Reference<NickServ::Account> nc;
- Anope::string mask;
Anope::string creator;
time_t last_seen;
time_t created;
@@ -391,6 +392,47 @@ namespace ChanServ
service->Destruct(this);
}
+ void SetMask(const Anope::string &mask, Channel *c)
+ {
+ if (nc != NULL)
+ nc->RemoveChannelReference(this->ci);
+ else if (!this->mask.empty())
+ {
+ Channel *targc = ChanServ::Find(this->mask);
+ if (targc)
+ targc->RemoveChannelReference(this->ci->name);
+ }
+
+ ci = c;
+ this->mask.clear();
+ nc = NULL;
+
+ const NickServ::Nick *na = NickServ::FindNick(mask);
+ if (na != NULL)
+ {
+ nc = na->nc;
+ nc->AddChannelReference(ci);
+ }
+ else
+ {
+ this->mask = mask;
+
+ Channel *targci = ChanServ::Find(mask);
+ if (targci != NULL)
+ targci->AddChannelReference(ci->name);
+ }
+ }
+
+ const Anope::string &Mask() const
+ {
+ if (nc)
+ return nc->display;
+ else
+ return mask;
+ }
+
+ NickServ::Account *GetAccount() const { return nc; }
+
void Serialize(Serialize::Data &data) const override
{
service->Serialize(this, data);
diff --git a/include/modules/nickserv.h b/include/modules/nickserv.h
index a55786ffb..0430276fe 100644
--- a/include/modules/nickserv.h
+++ b/include/modules/nickserv.h
@@ -82,8 +82,9 @@ namespace NickServ
/** Called when a nick is registered
* @param user The user registering the nick, of any
* @param The nick
+ * @param password The password of the nick
*/
- virtual void OnNickRegister(User *user, Nick *na) anope_abstract;
+ virtual void OnNickRegister(User *user, Nick *na, const Anope::string &password) anope_abstract;
};
static EventHandlersReference<NickRegister> OnNickRegister("OnNickRegister");
diff --git a/include/modules/os_session.h b/include/modules/os_session.h
index 54be44545..89b063104 100644
--- a/include/modules/os_session.h
+++ b/include/modules/os_session.h
@@ -7,7 +7,7 @@ struct Session
unsigned count; /* Number of clients with this host */
unsigned hits; /* Number of subsequent kills for a host */
- Session(const Anope::string &ip, int len) : addr(ip, len), count(1), hits(0) { }
+ Session(const sockaddrs &ip, int len) : addr(ip, len), count(1), hits(0) { }
};
struct Exception : Serializable