]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Make sure that if an oper opers up and has an swhois in their opertype or oper tag...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 1 Jan 2007 20:00:46 +0000 (20:00 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 1 Jan 2007 20:00:46 +0000 (20:00 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6206 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_swhois.cpp

index f1a089dd0535f4a8a80d7fec362b5e5326b20e42..50f6578dbc104fd73f0d695d536d075314874a0b 100644 (file)
@@ -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<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);