From a63882846432fda67e6282e979ab8ad248f4b574 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 10 Jun 2014 17:36:19 +0200 Subject: m_spanningtree Allow callers of InsertCurrentChannelTS() to customize positions --- src/modules/m_spanningtree/compat.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/m_spanningtree/compat.cpp') diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 857e95da9..98b6826e2 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -184,14 +184,14 @@ void TreeSocket::WriteLine(const std::string& original_line) namespace { - bool InsertCurrentChannelTS(std::vector& params) + bool InsertCurrentChannelTS(std::vector& params, unsigned int chanindex = 0, unsigned int pos = 1) { - Channel* chan = ServerInstance->FindChan(params[0]); + Channel* chan = ServerInstance->FindChan(params[chanindex]); if (!chan) return false; - // Insert the current TS of the channel between the first and the second parameters - params.insert(params.begin()+1, ConvToStr(chan->age)); + // Insert the current TS of the channel after the pos-th parameter + params.insert(params.begin()+pos, ConvToStr(chan->age)); return true; } } -- cgit v1.2.3