diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-29 15:37:04 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-29 15:37:04 +0000 |
commit | 090e691462bbe60c72c734f454f6d1e20c41a4e8 (patch) | |
tree | f5e60b4b9898da5b8ece7946738d85800f4489b0 /src | |
parent | 35ac0e70f91f17f6d150fa99819f4bc88071d9c6 (diff) |
Added reason to OnUserQuit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2007 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.cpp | 3 | ||||
-rw-r--r-- | src/inspircd.cpp | 2 | ||||
-rw-r--r-- | src/modules.cpp | 2 | ||||
-rw-r--r-- | src/modules/extra/m_sqllog.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_foobar.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_nicklock.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_park.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_silence.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 20 | ||||
-rw-r--r-- | src/modules/m_watch.cpp | 2 |
10 files changed, 30 insertions, 9 deletions
diff --git a/src/commands.cpp b/src/commands.cpp index 1b7c03ea3..a1f914734 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -867,6 +867,7 @@ void handle_quit(char **parameters, int pcnt, userrec *user) Write(user->fd,"ERROR :Closing link (%s@%s) [%s%s]",user->ident,user->host,PrefixQuit,parameters[0]); WriteOpers("*** Client exiting: %s!%s@%s [%s%s]",user->nick,user->ident,user->host,PrefixQuit,parameters[0]); WriteCommonExcept(user,"QUIT :%s%s",PrefixQuit,parameters[0]); + FOREACH_MOD OnUserQuit(user,parameters[0]); } else @@ -874,9 +875,9 @@ void handle_quit(char **parameters, int pcnt, userrec *user) Write(user->fd,"ERROR :Closing link (%s@%s) [QUIT]",user->ident,user->host); WriteOpers("*** Client exiting: %s!%s@%s [Client exited]",user->nick,user->ident,user->host); WriteCommonExcept(user,"QUIT :Client exited"); + FOREACH_MOD OnUserQuit(user,"Client exited"); } - FOREACH_MOD OnUserQuit(user); AddWhoWas(user); } diff --git a/src/inspircd.cpp b/src/inspircd.cpp index fa5e420c5..68aee8681 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -1097,7 +1097,7 @@ void kill_link(userrec *user,const char* r) log(DEBUG,"closing fd %lu",(unsigned long)user->fd); if (user->registered == 7) { - FOREACH_MOD OnUserQuit(user); + FOREACH_MOD OnUserQuit(user,reason); WriteCommonExcept(user,"QUIT :%s",reason); } diff --git a/src/modules.cpp b/src/modules.cpp index 899e6759a..61abe5564 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -306,7 +306,7 @@ std::string Event::GetEventID() Module::Module() { } Module::~Module() { } void Module::OnUserConnect(userrec* user) { } -void Module::OnUserQuit(userrec* user) { } +void Module::OnUserQuit(userrec* user, std::string message) { } void Module::OnUserDisconnect(userrec* user) { } void Module::OnUserJoin(userrec* user, chanrec* channel) { } void Module::OnUserPart(userrec* user, chanrec* channel) { } diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index 72d1ffcea..0596fdc74 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -225,7 +225,7 @@ class ModuleSQLLog : public Module AddLogEntry(LT_CONNECT,user->nick,user->host,user->server); } - virtual void OnUserQuit(userrec* user) + virtual void OnUserQuit(userrec* user, std::string reason) { AddLogEntry(LT_DISCONNECT,user->nick,user->host,user->server); } diff --git a/src/modules/m_foobar.cpp b/src/modules/m_foobar.cpp index 81757799c..b2e56c94d 100644 --- a/src/modules/m_foobar.cpp +++ b/src/modules/m_foobar.cpp @@ -66,7 +66,7 @@ class ModuleFoobar : public Module Srv->Log(DEBUG,"Foobar: User connecting: " + b); } - virtual void OnUserQuit(userrec* user) + virtual void OnUserQuit(userrec* user, std::string reason) { // method called when a user disconnects diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 70fbcac62..e31fed675 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -103,7 +103,7 @@ class ModuleNickLock : public Module return 0; } - virtual void OnUserQuit(userrec* user) + virtual void OnUserQuit(userrec* user, std::string reason) { user->Shrink("nick_locked"); } diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp index 8ceb54715..8ca5fcf89 100644 --- a/src/modules/m_park.cpp +++ b/src/modules/m_park.cpp @@ -209,7 +209,7 @@ class ModulePark : public Module output = output + std::string(" PARK"); } - virtual void OnUserQuit(userrec* user) + virtual void OnUserQuit(userrec* user, std::string reason) { std::string nick = user->nick; // track quits in our parked user list diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index c423506a0..e1c4f3fee 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -131,7 +131,7 @@ class ModuleSilence : public Module Srv->AddCommand("SILENCE",handle_silence,0,0,"m_silence.so"); } - virtual void OnUserQuit(userrec* user) + virtual void OnUserQuit(userrec* user, std::string reason) { // when the user quits tidy up any silence list they might have just to keep things tidy // and to prevent a HONKING BIG MEMORY LEAK! diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index cd35e824d..8e0812bd7 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1312,6 +1312,26 @@ class ModuleSpanningTree : public Module } } + virtual void OnUserConnect(userrec* user) + { + 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); + 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(user->ip); + params.push_back(":"+std::string(user->fullname)) + DoOneToMany(Srv->GetServerName(),"NICK",params); + } + } + virtual ~ModuleSpanningTree() { delete Srv; diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 008aada57..b15a0b65c 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -189,7 +189,7 @@ class Modulewatch : public Module Srv->AddCommand("WATCH",handle_watch,0,0,"m_watch.so"); } - virtual void OnUserQuit(userrec* user) + virtual void OnUserQuit(userrec* user, std::string reason) { log(DEBUG,"*** WATCH: On global quit: user %s",user->nick); irc::string n2 = user->nick; |