diff options
author | jantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-12-23 23:27:37 +0000 |
---|---|---|
committer | jantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-12-23 23:27:37 +0000 |
commit | fe6791615901d26fda5992f851fb2dc41e6c7424 (patch) | |
tree | 68fb43d149b65710f89f9f33d170becfc0679d29 /src | |
parent | e802b6dfe8ef0105389b69e17e7faa2e4c92d756 (diff) |
Fixed problem with unreal protocol module not storing usermode changes. Not the nicest patch, but should do the job.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1862 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/protocol/unreal32.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 5d574c3ba..f5ec00397 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -534,12 +534,22 @@ class UnrealIRCdProto : public IRCDProto { void ProcessUsermodes(User *user, int ac, const char **av) { - int add = 1; /* 1 if adding modes, 0 if deleting */ + int backup, add = 1; /* 1 if adding modes, 0 if deleting */ const char *modes = av[0]; --ac; if (!user || !modes) return; /* Prevent NULLs from doing bad things */ if (debug) alog("debug: Changing mode for %s to %s", user->nick, modes); + while (*modes) { + uint32 backup = user->mode; + + /* This looks better, much better than "add ? (do_add) : (do_remove)". + * At least this is readable without paying much attention :) -GD */ + if (add) + user->mode |= umodes[static_cast<int>(*modes)]; + else + user->mode &= ~umodes[static_cast<int>(*modes)]; + switch (*modes++) { case '+': @@ -554,6 +564,7 @@ class UnrealIRCdProto : public IRCDProto if (isdigit(*av[1])) { user->svid = strtoul(av[1], NULL, 0); + user->mode = backup; /* Ugly fix, but should do the job ~ Viper */ continue; // +d was setting a service stamp, ignore the usermode +-d. } break; @@ -575,12 +586,7 @@ class UnrealIRCdProto : public IRCDProto update_host(user); break; default: - /* This looks better, much better than "add ? (do_add) : (do_remove)". - * At least this is readable without paying much attention :) -GD */ - if (add) - user->mode |= umodes[static_cast<int>(*modes)]; - else - user->mode &= ~umodes[static_cast<int>(*modes)]; + break; } } } |