summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp6
-rw-r--r--src/modules/m_spanningtree/fmode.cpp14
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp4
3 files changed, 7 insertions, 17 deletions
diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp
index b9bd79f18..28a922c0f 100644
--- a/src/modules/m_spanningtree/fjoin.cpp
+++ b/src/modules/m_spanningtree/fjoin.cpp
@@ -123,7 +123,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
modelist.push_back(params[idx]);
}
- this->ServerInstance->SendMode(modelist, this->ServerInstance->FakeClient);
+ this->ServerInstance->SendMode(modelist, Utils->ServerUser);
}
/* Now, process every 'modes,nick' pair */
@@ -188,7 +188,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
while (modestack.GetStackedLine(stackresult))
{
mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end());
- ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
+ ServerInstance->SendMode(mode_junk, Utils->ServerUser);
mode_junk.erase(mode_junk.begin() + 1, mode_junk.end());
}
}
@@ -225,7 +225,7 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string>
while (stack.GetStackedLine(stackresult))
{
mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end());
- ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
+ ServerInstance->SendMode(mode_junk, Utils->ServerUser);
mode_junk.erase(mode_junk.begin() + 1, mode_junk.end());
}
}
diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp
index 24047226d..2d9c37339 100644
--- a/src/modules/m_spanningtree/fmode.cpp
+++ b/src/modules/m_spanningtree/fmode.cpp
@@ -31,7 +31,6 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
return true;
}
- bool smode = false;
std::string sourceserv;
/* Are we dealing with an FMODE from a user, or from a server? */
@@ -44,8 +43,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
else
{
/* FMODE from a server, use a fake user to receive mode feedback */
- who = this->ServerInstance->FakeClient;
- smode = true; /* Setting this flag tells us it is a server mode*/
+ who = Utils->ServerUser;
sourceserv = source; /* Set sourceserv to the actual source string */
}
std::vector<std::string> modelist;
@@ -99,14 +97,8 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
*/
if (TS <= ourTS)
{
- if (smode)
- {
- this->ServerInstance->SendMode(modelist, who);
- }
- else
- {
- this->ServerInstance->CallCommandHandler("MODE", modelist, who);
- }
+ ServerInstance->Modes->Process(modelist, who, (who == Utils->ServerUser));
+
/* HOT POTATO! PASS IT ON! */
Utils->DoOneToAllButSender(source,"FMODE",params,sourceserv);
}
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 68b5a7840..6f5bd6f3e 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -299,9 +299,7 @@ bool TreeSocket::ProcessLine(std::string &line)
TreeServer *ServerSource = Utils->FindServer(prefix);
if (ServerSource)
{
- // ServerSource->GetName().c_str() may become invalid before it is used
- Utils->ServerUser->nick = ServerSource->GetName().c_str();
- Utils->ServerUser->server = Utils->ServerUser->nick.c_str();
+ Utils->ServerUser->SetFakeServer(ServerSource->GetName());
Utils->ServerUser->uuid = ServerSource->GetID();
}