Skip to content

Commit

Permalink
Make sure that if an oper opers up and has an swhois in their opertyp…
Browse files Browse the repository at this point in the history
…e or oper tag, the swhois is sent out as metadata

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6206 e03df62e-2008-0410-955e-edbf42e46eb7
  • Loading branch information
braindigitalis committed Jan 1, 2007
1 parent 963af32 commit 8a0a8ce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/modules/m_swhois.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ class ModuleSWhois : public Module
// it is ours.
virtual void OnSyncUserMetaData(userrec* user, Module* proto, void* opaque, const std::string &extname)
{
ServerInstance->Log(DEBUG,"Sync user metadata type '%s'", extname.c_str());
// check if the linking module wants to know about OUR metadata
if (extname == "swhois")
{
Expand All @@ -138,10 +137,6 @@ class ModuleSWhois : public Module
// sees fit, and send it on its way. We dont need or want to know how.
proto->ProtoSendMetaData(opaque,TYPE_USER,user,extname,*swhois);
}
else
{
ServerInstance->Log(DEBUG,"User has a null swhois string!");
}
}
}

Expand Down Expand Up @@ -185,15 +180,13 @@ class ModuleSWhois : public Module
// check if its our metadata key, and its associated with a user
if ((target_type == TYPE_USER) && (extname == "swhois"))
{
ServerInstance->Log(DEBUG,"Extend with swhois");
userrec* dest = (userrec*)target;
// if they dont already have an swhois field, accept the remote server's
std::string* text;
if (!dest->GetExt("swhois", text))
{
std::string* text = new std::string(extdata);
dest->Extend("swhois",text);
ServerInstance->Log(DEBUG,"extended: %s %s", dest->nick, text->c_str());
}
}
}
Expand Down Expand Up @@ -242,8 +235,15 @@ class ModuleSWhois : public Module

std::string *text = new std::string(swhois);
user->Extend("swhois", text);
std::deque<std::string>* metadata = new std::deque<std::string>;
metadata->push_back(user->nick);
metadata->push_back("swhois"); // The metadata id
metadata->push_back(*text); // The value to send
Event event((char*)metadata,(Module*)this,"send_metadata");
event.Send(ServerInstance);
delete metadata;
}

virtual ~ModuleSWhois()
{
DELETE(Conf);
Expand Down

0 comments on commit 8a0a8ce

Please sign in to comment.