Skip to content

Commit

Permalink
Added ability to mark users as either ID'd or UNID'd after user intro…
Browse files Browse the repository at this point in the history
…duction. 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
  • Loading branch information
jantje_85 committed Oct 6, 2009
1 parent ab337e8 commit 699bee0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
34 changes: 28 additions & 6 deletions src/users.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion version.log
Expand Up @@ -9,9 +9,11 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="2"
VERSION_EXTRA="-svn"
VERSION_BUILD="2525"
VERSION_BUILD="2534"

# $Log$ # Changes since 1.8.2 Release
#Revision 2534 - 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)
#Revision 2533 - Backport of r2531, reset +r on registered channels after a netmerge when our creation time is newer than what we recieved.
#Revision 2525 - Fix bug #1097. CS FORBID now clears excepts & invites before banning everyone to avoid rejoin floods.
#Revision 2511 - Updated French language file, patch from Saka
#Revision 2495 - Fixed a number of TS6 issues, mainly related to nicks instead of IDs being given to anope_cmd_mode() in combination with a status change (Bug #1096). Also Fixed a small bug in os_oline.
Expand Down

0 comments on commit 699bee0

Please sign in to comment.