summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-28 14:43:49 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-28 14:43:49 +0000
commit256fd772c6441f0000ee44e79f78b062e54ef52d (patch)
tree383ce207b7e93c27b85a5df1ff1deda29a5806a2 /src/modules
parentf0bd343e646e7d41dc8a2b157462d13d6e496449 (diff)
Don't desync when setting swhois
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9198 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_swhois.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp
index 068dfc341..10e001f81 100644
--- a/src/modules/m_swhois.cpp
+++ b/src/modules/m_swhois.cpp
@@ -133,6 +133,7 @@ class ModuleSWhois : public Module
ServerInstance->SendWhoisLine(user, dest, 320, "%s %s :%s",user->nick,dest->nick,swhois->c_str());
}
}
+
/* Dont block anything */
return 0;
}
@@ -200,13 +201,17 @@ class ModuleSWhois : public Module
if ((target_type == TYPE_USER) && (extname == "swhois"))
{
User* dest = (User*)target;
- // if they dont already have an swhois field, accept the remote server's
+
+ // if they already have an swhois field, trash it and replace it with the remote one.
std::string* text;
- if (!dest->GetExt("swhois", text))
+ if (dest->GetExt("swhois", text))
{
- std::string* text2 = new std::string(extdata);
- dest->Extend("swhois",text2);
+ user->Shrink("swhois");
+ delete text;
}
+
+ text2 = new std::string(extdata);
+ dest->Extend("swhois", text);
}
}