ServerInstance->SendWhoisLine(user, dest, 320, "%s %s :%s",user->nick,dest->nick,swhois->c_str());
}
}
+
/* Dont block anything */
return 0;
}
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);
+ dest->Shrink("swhois");
+ delete text;
}
+
+ if (extdata.empty())
+ return; // XXX does the command parser even allow sending blank mdata? it needs to here! -- w00t
+
+ text = new std::string(extdata);
+ dest->Extend("swhois", text);
}
}
virtual Version GetVersion()
{
- return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+ return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
}
};