From: brain Date: Mon, 1 Jan 2007 20:00:46 +0000 (+0000) Subject: Make sure that if an oper opers up and has an swhois in their opertype or oper tag... X-Git-Tag: v2.0.23~6179 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=8a0a8ce160dbc623350b80f8f6e06afb9c7a1f86;p=user%2Fhenk%2Fcode%2Finspircd.git Make sure that if an oper opers up and has an swhois in their opertype 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 --- diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index f1a089dd0..50f6578db 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -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") { @@ -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!"); - } } } @@ -185,7 +180,6 @@ 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; @@ -193,7 +187,6 @@ class ModuleSWhois : public Module { std::string* text = new std::string(extdata); dest->Extend("swhois",text); - ServerInstance->Log(DEBUG,"extended: %s %s", dest->nick, text->c_str()); } } } @@ -242,8 +235,15 @@ class ModuleSWhois : public Module std::string *text = new std::string(swhois); user->Extend("swhois", text); + std::deque* metadata = new std::deque; + 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);