summaryrefslogtreecommitdiff
path: root/include/users.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-02-27 22:42:54 -0500
committerAdam <Adam@anope.org>2014-02-27 22:42:54 -0500
commitfee016bb84ba9a951000dac581261827a11cb668 (patch)
tree251d5d5755652f0eb8b9154b4d52603ea6f98c23 /include/users.h
parentd24fb039172786e0fb3e3164140b337c85cdeeca (diff)
Handle nick collisions somewhat instead of blindly overwriting the nicks
in memory, which does weird things. For fun different ircds implement this differently (Unreal compares timestamps, TS6 compares timestamps and user username/host), and whether or not we get a kill for our user also varies, so just kill everyone. This can't really happen anyway with properly set qlines, only if services haven't yet set the qlines, or possibly in a bot add/nick user introduce race, or with enforcers, which not many ircds require.
Diffstat (limited to 'include/users.h')
-rw-r--r--include/users.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/users.h b/include/users.h
index 4b07b2f33..73c373938 100644
--- a/include/users.h
+++ b/include/users.h
@@ -92,6 +92,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
/* Last time this user sent an email */
time_t lastmail;
+ protected:
/** Create a new user object, initialising necessary fields and
* adds it to the hash
*
@@ -102,19 +103,20 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
* @param sip The ip of the user
* @param sserver The server of the user
* @param srealname The realname/gecos of teh user
- * @param ssignon User's timestamp
+ * @param ts User's timestamp
* @param smodes User's modes
* @param suid The unique identifier of the user.
* @param nc The account the user is identified as, if any
*/
- User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ssignon, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
+ User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
- protected:
/** Destroy a user.
*/
virtual ~User();
public:
+ static User* OnIntroduce(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
+
/** Update the nickname of a user record accordingly, should be
* called from ircd protocol.
* @param newnick The new username