]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/clientprotocol.h
Remove the Kiwi links from the readme.
[user/henk/code/inspircd.git] / include / clientprotocol.h
index 95683dc8f20da6c98ce9537da3bbbc8371371ba6..29035250d34e04bc9fceb32f031747bd2f333368 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2018-2020 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2018 Attila Molnar <attilamolnar@hush.com>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -238,13 +239,15 @@ class ClientProtocol::Message : public ClientProtocol::MessageSource
                }
 
                Param(int, const char* s)
-                       : owned(true)
+                       : ptr(NULL)
+                       , owned(true)
                {
                        new(str) std::string(s);
                }
 
                Param(int, const std::string& s)
-                       : owned(true)
+                       : ptr(NULL)
+                       , owned(true)
                {
                         new(str) std::string(s);
                }
@@ -515,6 +518,16 @@ class ClientProtocol::Event
        void GetMessagesForUser(LocalUser* user, MessageList& messagelist);
 };
 
+class ClientProtocol::MessageTagEvent
+       : public Events::ModuleEventProvider
+{
+ public:
+       MessageTagEvent(Module* mod)
+               : ModuleEventProvider(mod, "event/messagetag")
+       {
+       }
+};
+
 /** Base class for message tag providers.
  * All message tags belong to a message tag provider. Message tag providers can populate messages
  * with tags before the message is sent and they have the job of determining whether a user should
@@ -667,7 +680,8 @@ struct ClientProtocol::RFCEvents
  */
 class CoreExport ClientProtocol::Serializer : public DataProvider
 {
-       Events::ModuleEventProvider evprov;
+ private:
+       ClientProtocol::MessageTagEvent evprov;
 
        /** Make a white list containing which tags a user should get.
         * @param user User in question.
@@ -688,7 +702,7 @@ class CoreExport ClientProtocol::Serializer : public DataProvider
         * @param tagname Name of the tag.
         * @param tagvalue Tag value, may be empty.
         * @param tags TagMap to place the tag into, if it gets accepted.
-        * @return True if no error occured, false if the tag name is invalid or if this tag already exists.
+        * @return True if no error occurred, false if the tag name is invalid or if this tag already exists.
         */
        bool HandleTag(LocalUser* user, const std::string& tagname, std::string& tagvalue, TagMap& tags) const;