From ccc99fa8f4766d60e87bb0ac58be2ce8e77e34ef Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 29 Mar 2016 16:23:39 +0200 Subject: m_spanningtree Add class SpanningTree::RemoteUser --- src/modules/m_spanningtree/remoteuser.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/modules/m_spanningtree/remoteuser.cpp (limited to 'src/modules/m_spanningtree/remoteuser.cpp') diff --git a/src/modules/m_spanningtree/remoteuser.cpp b/src/modules/m_spanningtree/remoteuser.cpp new file mode 100644 index 000000000..cbd1b801e --- /dev/null +++ b/src/modules/m_spanningtree/remoteuser.cpp @@ -0,0 +1,28 @@ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2016 Attila Molnar + * + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include "inspircd.h" + +#include "main.h" +#include "remoteuser.h" + +SpanningTree::RemoteUser::RemoteUser(const std::string& uid, Server* srv) + : ::RemoteUser(uid, srv) +{ +} -- cgit v1.3.1-10-gc9f91 From 5fbb5a0b2c5c08f76f99bd03b51bce2164feade3 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 29 Mar 2016 16:43:30 +0200 Subject: Make User::WriteRemoteNumeric() virtual, implement it in SpanningTree::RemoteUser --- include/users.h | 2 +- src/modules/m_spanningtree/remoteuser.cpp | 5 +++++ src/modules/m_spanningtree/remoteuser.h | 1 + src/users.cpp | 3 +-- 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/modules/m_spanningtree/remoteuser.cpp') diff --git a/include/users.h b/include/users.h index c2ad6b9ee..8cbf8a8da 100644 --- a/include/users.h +++ b/include/users.h @@ -524,7 +524,7 @@ class CoreExport User : public Extensible */ virtual void WriteRemoteNotice(const std::string& text); - void WriteRemoteNumeric(const Numeric::Numeric& numeric); + virtual void WriteRemoteNumeric(const Numeric::Numeric& numeric); template void WriteRemoteNumeric(unsigned int numeric, T1 p1) diff --git a/src/modules/m_spanningtree/remoteuser.cpp b/src/modules/m_spanningtree/remoteuser.cpp index cbd1b801e..717a6fd9f 100644 --- a/src/modules/m_spanningtree/remoteuser.cpp +++ b/src/modules/m_spanningtree/remoteuser.cpp @@ -26,3 +26,8 @@ SpanningTree::RemoteUser::RemoteUser(const std::string& uid, Server* srv) : ::RemoteUser(uid, srv) { } + +void SpanningTree::RemoteUser::WriteRemoteNumeric(const Numeric::Numeric& numeric) +{ + CommandNum::Builder(this, numeric).Unicast(this); +} diff --git a/src/modules/m_spanningtree/remoteuser.h b/src/modules/m_spanningtree/remoteuser.h index 235cbfd78..416f2f760 100644 --- a/src/modules/m_spanningtree/remoteuser.h +++ b/src/modules/m_spanningtree/remoteuser.h @@ -28,4 +28,5 @@ class SpanningTree::RemoteUser : public ::RemoteUser { public: RemoteUser(const std::string& uid, Server* srv); + void WriteRemoteNumeric(const Numeric::Numeric& numeric) CXX11_OVERRIDE; }; diff --git a/src/users.cpp b/src/users.cpp index e1bda1ad3..7437e8a20 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -950,8 +950,7 @@ void User::SendText(const char *text, ...) void User::WriteRemoteNumeric(const Numeric::Numeric& numeric) { - const std::string& servername = (numeric.GetServer() ? numeric.GetServer()->GetName() : ServerInstance->Config->ServerName); - SendText(BuildNumeric(servername, this, numeric.GetNumeric(), numeric.GetParams())); + WriteNumeric(numeric); } /* return 0 or 1 depending if users u and u2 share one or more common channels -- cgit v1.3.1-10-gc9f91