summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-15 17:04:27 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-15 17:04:27 +0000
commit834f4d1bf0c228f35f392808d3882ec3c1a43444 (patch)
tree4aaf51dd1d80ef7b37ee1a0f60ee8eaebd39510e
parentab4533e58a80057426ccc68850abe052962f5260 (diff)
Cleaned up some of the cloaked host tracking on Unreal
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@3004 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--src/protocol/unreal32.c41
-rw-r--r--src/users.c8
2 files changed, 4 insertions, 45 deletions
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c
index 7cf9b26f5..1041352db 100644
--- a/src/protocol/unreal32.c
+++ b/src/protocol/unreal32.c
@@ -845,21 +845,12 @@ int anope_event_sethost(const char *source, int ac, const char **av)
return MOD_CONT;
}
- /* If a user has a custom host and a server splits and reconnects
- * Unreal does not send the users cloaked host to Anope.. so we do not know it.
- * However, they will be +t if this is the case, so we will set their vhost
- * to the sethost value (which really is their vhost) and clear the chost.
- * The chost will be request later (if needed) - Adam
- */
- if (u->HasMode(UMODE_VHOST))
+ /* When a user sets +x we recieve the new host and then the mode change */
+ if (u->HasMode(UMODE_CLOAK))
{
u->SetDisplayedHost(av[0]);
- u->chost.clear();
}
- /* If the new host doesn't match the real host or ip.. set it
- * else we will not set a cloaked host, and request it later if needed
- */
- else if ((u->host && strcmp(av[0], u->host)) || (u->hostip && strcmp(av[0], u->hostip)))
+ else
{
u->SetCloakedHost(av[0]);
}
@@ -1040,31 +1031,6 @@ int anope_event_sdesc(const char *source, int ac, const char **av)
return MOD_CONT;
}
-int anope_event_userhost(const char *source, int ac, const char **av)
-{
- /** Hack to get around Unreal:
- * This is the USERHOST reply, we only send a request if we do not know the users cloaked host
- * (they got introducted using a vhost) - Adam
- */
- if (ac < 2 || !av[1] || !*av[1])
- return MOD_CONT;
-
- std::string reply = av[1];
- std::string user = std::string(reply.begin(), std::find(reply.begin(), reply.end(), '='));
- if (user[user.length() - 1] == '*')
- user.erase(user.length() - 1);
- std::string host = std::string(std::find(reply.begin(), reply.end(), '@'), reply.end());
- host.erase(host.begin());
-
- User *u = finduser(user);
- if (u)
- {
- u->SetCloakedHost(host);
- }
-
- return MOD_CONT;
-}
-
int anope_event_sjoin(const char *source, int ac, const char **av)
{
Channel *c = findchan(av[1]);
@@ -1286,7 +1252,6 @@ void moduleAddIRCDMsgs() {
m = createMessage("~", anope_event_sjoin); addCoreMessage(IRCD,m);
m = createMessage("SDESC", anope_event_sdesc); addCoreMessage(IRCD,m);
m = createMessage("AG", anope_event_sdesc); addCoreMessage(IRCD,m);
- m = createMessage("302", anope_event_userhost); addCoreMessage(IRCD,m);
/* The non token version of these is in messages.c */
m = createMessage("2", m_stats); addCoreMessage(IRCD,m);
diff --git a/src/users.c b/src/users.c
index 059d598b4..4ff223ee6 100644
--- a/src/users.c
+++ b/src/users.c
@@ -1320,13 +1320,7 @@ void UserSetInternalModes(User *user, int ac, const char **av)
break;
case UMODE_CLOAK:
case UMODE_VHOST:
- if (add && user->vhost)
- {
- user->SetCloakedHost(user->vhost);
- delete [] user->vhost;
- user->vhost = NULL;
- }
- else if (user->vhost)
+ if (!add && user->vhost)
{
delete [] user->vhost;
user->vhost = NULL;