]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix m_chanhistory sending the history notice directly to the user.
authorPeter Powell <petpow@saberuk.com>
Wed, 3 Jan 2018 16:24:19 +0000 (16:24 +0000)
committerPeter Powell <petpow@saberuk.com>
Wed, 3 Jan 2018 16:24:19 +0000 (16:24 +0000)
Closes #1452.

include/membership.h
src/channels.cpp
src/modules/m_chanhistory.cpp

index 8630bb6730692886bd24bd657536e48aa35e0762..6d0bc274f94adf70c6ea1b7507580c4df1d5676b 100644 (file)
@@ -111,4 +111,9 @@ class CoreExport Membership : public Extensible, public insp::intrusive_list_nod
         * this when multiple prefixes are used names lists.
         */
        std::string GetAllPrefixChars() const;
+
+       /** Sends a server notice to this user in the context of this channel.
+        * @param text The contents of the message to send.
+        */
+       void WriteNotice(const std::string& text) const;
 };
index 7e6555ae80b94d666f22ae46aa60a1d10ae816df..352715728e16c14160d44d80e184a200d0737b25 100644 (file)
@@ -660,3 +660,11 @@ bool Membership::SetPrefix(PrefixMode* delta_mh, bool adding)
                modes.push_back(prefix);
        return adding;
 }
+
+
+void Membership::WriteNotice(const std::string& text) const
+{
+       std::string rawmsg = "NOTICE ";
+       rawmsg.append(chan->name).append(" :").append(text);
+       user->WriteServ(rawmsg);
+}
index d95d8fbfbac40073bb772ece3745d99f4c1a7b44..e8a516b947aa8c1f2b7c3c95a2d0917893aa47f1 100644 (file)
@@ -157,7 +157,7 @@ class ModuleChanHistory : public Module
                        std::string message("Replaying up to " + ConvToStr(list->maxlen) + " lines of pre-join history");
                        if (list->maxtime > 0)
                                message.append(" spanning up to " + ConvToStr(list->maxtime) + " seconds");
-                       memb->user->WriteNotice(message);
+                       memb->WriteNotice(message);
                }
 
                for(std::deque<HistoryItem>::iterator i = list->lines.begin(); i != list->lines.end(); ++i)