aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree/utils.cpp
diff options
context:
space:
mode:
authorGravatar attilamolnar2012-07-04 23:11:01 +0200
committerGravatar attilamolnar2013-04-12 21:03:05 +0200
commitda28fe0b8c0bec9ab111044b1004f24cbf2d742e (patch)
treeaa2b3e206af49087e9ecafba600ce7802f4b82fb /src/modules/m_spanningtree/utils.cpp
parentm_spanningtree Change TreeServerList to be a set, get rid of a function dedic... (diff)
downloadinspircd++-da28fe0b8c0bec9ab111044b1004f24cbf2d742e.tar.gz
inspircd++-da28fe0b8c0bec9ab111044b1004f24cbf2d742e.tar.bz2
inspircd++-da28fe0b8c0bec9ab111044b1004f24cbf2d742e.zip
m_spanningtree Introduce new function to send channel messages
Use it from the protocol interface and PRIVMSG/NOTICE handlers Unite OnUserNotice and OnUserMessage code into LocalMessage()
Diffstat (limited to 'src/modules/m_spanningtree/utils.cpp')
-rw-r--r--src/modules/m_spanningtree/utils.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index 7941970da..344c8138f 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -421,3 +421,21 @@ Link* SpanningTreeUtilities::FindLink(const std::string& name)
}
return NULL;
}
+
+void SpanningTreeUtilities::SendChannelMessage(const std::string& prefix, Channel* target, const std::string &text, char status, const CUList& exempt_list, const char* message_type)
+{
+ std::string raw(":");
+ raw.append(prefix).append(1, ' ').append(message_type).push_back(' ');
+ if (status)
+ raw.push_back(status);
+ raw.append(target->name).append(" :").append(text);
+
+ TreeServerList list;
+ this->GetListOfServersForChannel(target, list, status, exempt_list);
+ for (TreeServerList::iterator i = list.begin(); i != list.end(); ++i)
+ {
+ TreeSocket* Sock = (*i)->GetSocket();
+ if (Sock)
+ Sock->WriteLine(raw);
+ }
+}