summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-11-25 00:44:31 -0500
committerAdam <Adam@anope.org>2011-11-25 00:44:31 -0500
commitcef3eb78dfd2ea20e0a482d040cc99902fdb4b2a (patch)
treed9e964ac19137e87a6fb97d25dda9be6487c2aa9 /include
parent12d0a7302f76fe21c54ffcead286fc31e870b817 (diff)
Remove send_cmd and replace it with a stringstream
Diffstat (limited to 'include')
-rw-r--r--include/extern.h21
-rw-r--r--include/servers.h6
-rw-r--r--include/services.h2
3 files changed, 22 insertions, 7 deletions
diff --git a/include/extern.h b/include/extern.h
index 9a1583ec6..17802d91a 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -117,6 +117,21 @@ class UplinkSocket : public ConnectionSocket, public BufferedSocket
bool Read(const Anope::string &);
void OnConnect();
void OnError(const Anope::string &);
+
+ class CoreExport Message
+ {
+ Anope::string source;
+ std::stringstream buffer;
+ public:
+ Message();
+ Message(const Anope::string &);
+ ~Message();
+ template<typename T> Message &operator<<(const T &val)
+ {
+ this->buffer << val;
+ return *this;
+ }
+ };
};
E UplinkSocket *UplinkSock;
E int CurrentUplink;
@@ -200,12 +215,6 @@ E bool is_on_access(const User *u, const NickCore *nc);
E void process(const Anope::string &buf);
-/**** send.c ****/
-
-E void send_cmd(const Anope::string &source, const char *fmt, ...) FORMAT(printf, 2, 3);
-
-E void notice_server(const Anope::string &source, const Server *s, const char *fmt, ...) FORMAT(printf, 3, 4);
-
/**** sockets.cpp ****/
E int32_t TotalRead;
diff --git a/include/servers.h b/include/servers.h
index f23f20fc5..f63c747e3 100644
--- a/include/servers.h
+++ b/include/servers.h
@@ -152,6 +152,12 @@ class CoreExport Server : public Flags<ServerFlag>
*/
bool IsULined() const;
+ /** Send a message to alll users on this server
+ * @param source The source of the message
+ * @param message The message
+ */
+ void Notice(BotInfo *source, const Anope::string &message);
+
/** Find a server
* @param name The name or SID/numeric
* @param s The server list to search for this server on, defaults to our Uplink
diff --git a/include/services.h b/include/services.h
index 06596db5d..1da51e296 100644
--- a/include/services.h
+++ b/include/services.h
@@ -792,7 +792,7 @@ class CoreExport IRCDProto
virtual void SendPart(const BotInfo *bi, const Channel *chan, const char *fmt, ...);
virtual void SendGlobops(const BotInfo *source, const char *fmt, ...);
virtual void SendSQLine(User *, const XLine *x) { }
- virtual void SendSquit(const Anope::string &servname, const Anope::string &message);
+ virtual void SendSquit(Server *, const Anope::string &message);
virtual void SendSVSO(const Anope::string &, const Anope::string &, const Anope::string &) { }
virtual void SendChangeBotNick(const BotInfo *bi, const Anope::string &newnick);
virtual void SendForceNickChange(const User *u, const Anope::string &newnick, time_t when);