]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remote server PRIVMSG/NOTICE to nickname support
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 4 Apr 2008 15:06:32 +0000 (15:06 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 4 Apr 2008 15:06:32 +0000 (15:06 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9314 e03df62e-2008-0410-955e-edbf42e46eb7

include/protocol.h
src/modules/m_spanningtree/protocolinterface.cpp
src/modules/m_spanningtree/protocolinterface.h

index 6f9cf8022eba3664e7a0fec5e9d4fdeca608c019..9ceb438a1bff27c2eae2c9cd0cb60a6413bead02 100644 (file)
@@ -58,6 +58,10 @@ class ProtocolInterface : public Extensible
        virtual void SendChannelPrivmsg(Channel* target, char status, const std::string &text) { }
 
        virtual void SendChannelNotice(Channel* target, char status, const std::string &text) { }
+
+       virtual void SendUserPrivmsg(User* target, const std::string &text) { }
+
+       virtual void SendUserNotice(User* target, const std::string &text) { }
 };
 
 #endif
index d10f7f98143ec1c594747534eca24171f8031561..d4ef886743070d7a88dfe59957d70a37473b08c5 100644 (file)
@@ -132,3 +132,29 @@ void SpanningTreeProtocolInterface::SendChannelNotice(Channel* target, char stat
        SendChannel(target, status, ServerInstance->Config->GetSID()+" NOTICE "+target->name+" :"+text);
 }
 
+void SpanningTreeProtocolInterface::SendUserPrivmsg(User* target, const std::string &text)
+{
+       TreeServer* serv = Utils->FindServer(target->server);
+       if (serv)
+       {
+               TreeSocket* sock = serv->GetSock();
+               if (sock)
+               {
+                       Sock->WriteLine(ServerInstance->Config->GetSID() + " PRIVMSG " + target->nick + " :"+text);
+               }
+       }
+}
+
+void SpanningTreeProtocolInterface::SendUserNotice(User* target, const std::string &text)
+{
+       TreeServer* serv = Utils->FindServer(target->server);
+       if (serv)
+       {
+               TreeSocket* sock = serv->GetSock();
+               if (sock)
+               {
+                       Sock->WriteLine(ServerInstance->Config->GetSID() + " NOTICE " + target->nick + " :"+text);
+               }
+       }
+}
+
index 29d669da9f805983f6fc3545e68c51d3af0df973..ab6270772aec26ad02883a232e8800c718954ee1 100644 (file)
@@ -24,6 +24,8 @@ class SpanningTreeProtocolInterface : public ProtocolInterface
         virtual void PushToClient(User* target, const std::string &rawline);
        virtual void SendChannelPrivmsg(Channel* target, char status, const std::string &text);
        virtual void SendChannelNotice(Channel* target, char status, const std::string &text);
+       virtual void SendUserPrivmsg(User* target, const std::string &text);
+       virtual void SendUserNotice(User* target, const std::string &text);
 };
 
 #endif