summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-29 16:11:50 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-29 16:11:50 +0000
commit76f43a55180e8b8e8e3bbb32be3931ca1431666a (patch)
tree35461ff5cd692107ce12bcdd0a8c90cf386586cc /src/modules
parenta9e58bb31fcf709c4ecce84f546af4966f51b6d5 (diff)
Added NICK and QUIT
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2009 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 8e0812bd7..172a36a14 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1314,24 +1314,47 @@ class ModuleSpanningTree : public Module
virtual void OnUserConnect(userrec* user)
{
+ char agestr[MAXBUF];
if (std::string(user->server) == Srv->GetServerName())
{
log(DEBUG,"**** User on %s CONNECTS: %s",user->server,user->nick);
std::deque<std::string> params;
- sprintf(agestr,"%d",user->age);
+ snprintf(agestr,MAXBUF,"%d",user->age);
params.clear();
params.push_back(agestr);
params.push_back(user->nick);
params.push_back(user->host);
params.push_back(user->dhost);
params.push_back(user->ident);
- params.push_back("+"+std::string(user->modes))
+ params.push_back("+"+std::string(user->modes));
params.push_back(user->ip);
- params.push_back(":"+std::string(user->fullname))
+ params.push_back(":"+std::string(user->fullname));
DoOneToMany(Srv->GetServerName(),"NICK",params);
}
}
+ virtual void OnUserQuit(userrec* user, std::string reason)
+ {
+ if (std::string(user->server) == Srv->GetServerName())
+ {
+ log(DEBUG,"**** User on %s QUITS: %s",user->server,user->nick);
+ std::deque<std::string> params;
+ params.push_back(":"+reason);
+ DoOneToMany(user->nick,"QUIT",params);
+ }
+ }
+
+ virtual void OnUserPostNick(userrec* user, std::string oldnick)
+ {
+ if (std::string(user->server) == Srv->GetServerName())
+ {
+ log(DEBUG,"**** User on %s changes NICK: %s",user->server,user->nick);
+ std::deque<std::string> params;
+ params.push_back(user->nick);
+ DoOneToMany(oldnick,"NICK",params);
+ }
+ }
+
virtual ~ModuleSpanningTree()
{
delete Srv;