summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:44:40 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:44:40 +0000
commit5d67a5fff127bf95bca69b436ef7f645f2fe3281 (patch)
tree7f6b23b35a94f91eaad69a511d3d21b36b651a4c
parenta02ed18a1a1ae42fd81452b6ca5809fc3430a04c (diff)
Remove unneeded ProtocolInterface::Introduce
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11600 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/protocol.h5
-rw-r--r--src/modules/m_spanningtree/main.cpp29
-rw-r--r--src/modules/m_spanningtree/main.h1
-rw-r--r--src/modules/m_spanningtree/protocolinterface.cpp27
-rw-r--r--src/modules/m_spanningtree/protocolinterface.h1
-rw-r--r--src/modules/m_spanningtree/uid.cpp2
-rw-r--r--src/users.cpp2
7 files changed, 26 insertions, 41 deletions
diff --git a/include/protocol.h b/include/protocol.h
index 49288fd3b..fdfb89aab 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -135,11 +135,6 @@ class ProtocolInterface : public Extensible
* XXX: document me properly, this is shit.
*/
virtual void GetServerList(ProtoServerList &sl) { }
-
- /** Send information about a user connection to linked servers.
- * @param u The user to send information about.
- */
- virtual void Introduce(User* u) { }
};
#endif
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 7f2164f62..c402b145a 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -52,7 +52,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
I_OnChangeLocalUserHost, I_OnChangeName, I_OnUserPart, I_OnUnloadModule, I_OnUserQuit,
I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash, I_OnPreRehash, I_OnOper,
I_OnAddLine, I_OnDelLine, I_OnMode, I_OnLoadModule, I_OnStats, I_OnEvent, I_OnSetAway,
- I_OnPostCommand
+ I_OnPostCommand, I_OnUserConnect
};
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
@@ -60,10 +60,8 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance);
loopCall = false;
- for (std::vector<User*>::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); i++)
- {
- ServerInstance->PI->Introduce(*i);
- }
+ // update our local user count
+ Utils->TreeRoot->SetUserCount(ServerInstance->Users->local_users.size());
}
void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
@@ -579,6 +577,27 @@ void ModuleSpanningTree::OnBackgroundTimer(time_t curtime)
DoConnectTimeout(curtime);
}
+void ModuleSpanningTree::OnUserConnect(User* user)
+{
+ if (user->quitting)
+ return;
+
+ parameterlist params;
+ params.push_back(user->uuid);
+ params.push_back(ConvToStr(user->age));
+ params.push_back(user->nick);
+ params.push_back(user->host);
+ params.push_back(user->dhost);
+ params.push_back(user->ident);
+ params.push_back(user->GetIPString());
+ params.push_back(ConvToStr(user->signon));
+ params.push_back("+"+std::string(user->FormatModes(true)));
+ params.push_back(":"+std::string(user->fullname));
+ Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params);
+
+ Utils->TreeRoot->SetUserCount(1); // increment by 1
+}
+
void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
{
// Only do this for local users
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 3d6e3375d..15d59701d 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -160,6 +160,7 @@ class ModuleSpanningTree : public Module
virtual int OnPreCommand(std::string &command, std::vector<std::string>& parameters, User *user, bool validated, const std::string &original_line);
virtual void OnPostCommand(const std::string &command, const std::vector<std::string>& parameters, User *user, CmdResult result, const std::string &original_line);
virtual void OnGetServerDescription(const std::string &servername,std::string &description);
+ virtual void OnUserConnect(User* source);
virtual void OnUserInvite(User* source,User* dest,Channel* channel, time_t);
virtual void OnPostLocalTopicChange(User* user, Channel* chan, const std::string &topic);
virtual void OnWallops(User* user, const std::string &text);
diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp
index 1e5ae7ade..989e8b3e4 100644
--- a/src/modules/m_spanningtree/protocolinterface.cpp
+++ b/src/modules/m_spanningtree/protocolinterface.cpp
@@ -176,30 +176,3 @@ void SpanningTreeProtocolInterface::SendUserNotice(User* target, const std::stri
}
}
}
-
-void SpanningTreeProtocolInterface::Introduce(User* user)
-{
- if (user->quitting)
- return;
- if (IS_LOCAL(user))
- {
- parameterlist params;
- params.push_back(user->uuid);
- params.push_back(ConvToStr(user->age));
- params.push_back(user->nick);
- params.push_back(user->host);
- params.push_back(user->dhost);
- params.push_back(user->ident);
- params.push_back(user->GetIPString());
- params.push_back(ConvToStr(user->signon));
- params.push_back("+"+std::string(user->FormatModes(true)));
- params.push_back(":"+std::string(user->fullname));
- Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params);
- }
-
- TreeServer* SourceServer = Utils->FindServer(user->server);
- if (SourceServer)
- {
- SourceServer->SetUserCount(1); // increment by 1
- }
-}
diff --git a/src/modules/m_spanningtree/protocolinterface.h b/src/modules/m_spanningtree/protocolinterface.h
index de0afcef7..84da6d8cf 100644
--- a/src/modules/m_spanningtree/protocolinterface.h
+++ b/src/modules/m_spanningtree/protocolinterface.h
@@ -25,7 +25,6 @@ class SpanningTreeProtocolInterface : public ProtocolInterface
virtual void SendUserPrivmsg(User* target, const std::string &text);
virtual void SendUserNotice(User* target, const std::string &text);
virtual void GetServerList(ProtoServerList &sl);
- virtual void Introduce(User* u);
};
#endif
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index 7146f4c01..b7c13b5f8 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -160,6 +160,7 @@ bool TreeSocket::ParseUID(const std::string &source, parameterlist &params)
_new->SetClientIP(params[6].c_str());
ServerInstance->Users->AddGlobalClone(_new);
+ remoteserver->SetUserCount(1); // increment by 1
bool dosend = true;
@@ -172,7 +173,6 @@ bool TreeSocket::ParseUID(const std::string &source, parameterlist &params)
params[params.size() - 1] = ":" + params[params.size() - 1];
Utils->DoOneToAllButSender(source, "UID", params, source);
- ServerInstance->PI->Introduce(_new);
FOREACH_MOD_I(ServerInstance,I_OnPostConnect,OnPostConnect(_new));
return true;
diff --git a/src/users.cpp b/src/users.cpp
index 6be64fe1d..6087f4d1c 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -985,8 +985,6 @@ void User::FullConnect()
this->registered = REG_ALL;
- ServerInstance->PI->Introduce(this);
-
FOREACH_MOD(I_OnPostConnect,OnPostConnect(this));
ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d: %s!%s@%s [%s] [%s]",