summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/channels.h5
-rw-r--r--src/channels.cpp7
2 files changed, 12 insertions, 0 deletions
diff --git a/include/channels.h b/include/channels.h
index 0cf477f22..0a131ddb3 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -332,6 +332,11 @@ class CoreExport Channel : public Extensible
/** Get the status of an "action" type extban
*/
ModResult GetExtBanStatus(User *u, char type);
+
+ /** Write a NOTICE to all local users on the channel
+ * @param text Text to send
+ */
+ void WriteNotice(const std::string& text);
};
inline bool Channel::HasUser(User* user)
diff --git a/src/channels.cpp b/src/channels.cpp
index a2d5c4a30..14b1ea545 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -562,6 +562,13 @@ const char* Channel::ChanModes(bool showkey)
return scratch.c_str();
}
+void Channel::WriteNotice(const std::string& text)
+{
+ std::string rawmsg = "NOTICE ";
+ rawmsg.append(this->name).append(" :").append(text);
+ WriteChannelWithServ(ServerInstance->Config->ServerName, rawmsg);
+}
+
/* returns the status character for a given user on a channel, e.g. @ for op,
* % for halfop etc. If the user has several modes set, the highest mode
* the user has must be returned.