From 226a95aab09b9e1f43f61e78179bfa1135816c2d Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 28 Apr 2013 12:17:53 +0100 Subject: Add method for writing server notices. This allows us to send a server notice to a user without worrying about whether they are registered or not. If a user receives a server notice and they are not registered then the nickname field will contain an asterisk instead of their nick name. --- src/modules/m_spanningtree/main.cpp | 2 +- src/modules/m_spanningtree/override_squit.cpp | 6 +++--- src/modules/m_spanningtree/rconnect.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 1fa7ef76b..bfd3f75ea 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -388,7 +388,7 @@ void ModuleSpanningTree::RemoteMessage(User* user, const char* format, ...) va_end(argsPtr); if (IS_LOCAL(user)) - user->WriteServ("NOTICE %s :%s", user->nick.c_str(), text); + user->WriteNotice(text); else ServerInstance->PI->SendUserNotice(user, text); } diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp index c8151cbdf..6d82f43db 100644 --- a/src/modules/m_spanningtree/override_squit.cpp +++ b/src/modules/m_spanningtree/override_squit.cpp @@ -36,7 +36,7 @@ ModResult ModuleSpanningTree::HandleSquit(const std::vector& parame { if (s == Utils->TreeRoot) { - user->WriteServ("NOTICE %s :*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)",user->nick.c_str(),parameters[0].c_str()); + user->WriteNotice("*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (" + parameters[0] + " matches local server name)"); return MOD_RES_DENY; } @@ -51,12 +51,12 @@ ModResult ModuleSpanningTree::HandleSquit(const std::vector& parame } else { - user->WriteServ("NOTICE %s :*** SQUIT may not be used to remove remote servers. Please use RSQUIT instead.",user->nick.c_str()); + user->WriteNotice("*** SQUIT may not be used to remove remote servers. Please use RSQUIT instead."); } } else { - user->WriteServ("NOTICE %s :*** SQUIT: The server \002%s\002 does not exist on the network.",user->nick.c_str(),parameters[0].c_str()); + user->WriteNotice("*** SQUIT: The server \002" + parameters[0] + "\002 does not exist on the network."); } return MOD_RES_DENY; } diff --git a/src/modules/m_spanningtree/rconnect.cpp b/src/modules/m_spanningtree/rconnect.cpp index ec925c0ca..7398f6e9a 100644 --- a/src/modules/m_spanningtree/rconnect.cpp +++ b/src/modules/m_spanningtree/rconnect.cpp @@ -61,7 +61,7 @@ CmdResult CommandRConnect::Handle (const std::vector& parameters, U */ if (IS_LOCAL(user)) { - user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick.c_str(),parameters[0].c_str(),parameters[1].c_str()); + user->WriteNotice("*** RCONNECT: Sending remote connect to \002 " + parameters[0] + "\002 to connect server \002" + parameters[1] + "\002."); } } return CMD_SUCCESS; -- cgit v1.2.3