diff options
| author | jantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-06 12:52:14 +0000 |
|---|---|---|
| committer | jantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-06 12:52:14 +0000 |
| commit | 699bee06c3a6e69e44f0e5b91d8e2054685c8213 (patch) | |
| tree | ef7306a3dbcb64b24b22467a9004bbb2072743b3 /src | |
| parent | ab337e8de0b72e14135dd614fca947c12e268325 (diff) | |
Added ability to mark users as either ID'd or UNID'd after user introduction. This is the responsibility of the protocol module!(Required for Insp 1.2)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2534 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
| -rw-r--r-- | src/users.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src/users.c b/src/users.c index 0b4960ab3..e8487be4b 100644 --- a/src/users.c +++ b/src/users.c @@ -483,7 +483,19 @@ Uid *find_nickuid(const char *uid) /*************************************************************************/ /* Handle a server NICK command. */ - +/** + * Adds a new user to anopes internal userlist. + * + * If the SVID passed is 2, the user will not be marked registered or requested to ID. + * This is an addition to accomodate IRCds where we cannot determine this based on the NICK + * or UID command. Some IRCd's keep +r on when changing nicks and do not use SVID (ex. InspIRCd 1.2). + * Instead we get a METADATA command containing the accountname the user was last identified to. + * Since this is received after the user is introduced to us we should not yet mark the user + * as identified or ask him to identify. We will mark him as recognized for the time being and let + * him keep his +r if he has it. + * It is the responsibility of the protocol module to make sure that this is either invalidated, + * or changed to identified. ~ Viper + **/ User *do_nick(const char *source, char *nick, char *username, char *host, char *server, char *realname, time_t ts, uint32 svid, uint32 ip, char *vhost, char *uid) @@ -523,8 +535,8 @@ User *do_nick(const char *source, char *nick, char *username, char *host, if (LogUsers) { /** - * Ugly swap routine for Flop's bug :) - **/ + * Ugly swap routine for Flop's bug :) + **/ if (realname) { tmp = strchr(realname, '%'); while (tmp) { @@ -535,8 +547,8 @@ User *do_nick(const char *source, char *nick, char *username, char *host, logrealname = normalizeBuffer(realname); /** - * End of ugly swap - **/ + * End of ugly swap + **/ if (ircd->nickvhost) { if (ircd->nickip) { @@ -641,7 +653,17 @@ User *do_nick(const char *source, char *nick, char *username, char *host, display_news(user, NEWS_RANDOM); } - if (svid == ts && user->na) { + if (svid == 2 && user->na) { + /* We do not yet know if the user should be identified or not. + * mark him as recognized for now. + * It s up to the protocol module to make sure this either becomes ID'd or + * is invalidated. ~ Viper */ + if (debug) + alog("debug: Marking %s as recognized..", user->nick); + user->svid = 1; + user->na->status |= NS_RECOGNIZED; + nc_changed = 0; + } else if (svid == ts && user->na) { /* Timestamp and svid match, and nick is registered; automagically identify the nick */ user->svid = svid; user->na->status |= NS_IDENTIFIED; |
