1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 08:16:39 +02:00

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
This commit is contained in:
jantje_85
2008-12-23 23:27:37 +00:00
parent e802b6dfe8
commit fe67916159
+13 -7
View File
@@ -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;
}
}
}