summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/membership.h5
-rw-r--r--src/channels.cpp8
-rw-r--r--src/modules/m_chanhistory.cpp2
3 files changed, 14 insertions, 1 deletions
diff --git a/include/membership.h b/include/membership.h
index 8630bb673..6d0bc274f 100644
--- a/include/membership.h
+++ b/include/membership.h
@@ -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;
};
diff --git a/src/channels.cpp b/src/channels.cpp
index 7e6555ae8..352715728 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -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);
+}
diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp
index d95d8fbfb..e8a516b94 100644
--- a/src/modules/m_chanhistory.cpp
+++ b/src/modules/m_chanhistory.cpp
@@ -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)