diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-30 14:28:22 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-30 14:28:22 +0000 |
commit | 0e4420f083034c3964feb2db8cdb10a4d85e4412 (patch) | |
tree | 291b25a01373008126bc2795db0917593617ce5f | |
parent | 79d51f20eb6b96b2096751a636ad372e2380684f (diff) |
Added OnGetServerDescription (mainly for link modules)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2056 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/modules.h | 2 | ||||
-rw-r--r-- | src/helperfuncs.cpp | 11 | ||||
-rw-r--r-- | src/modules.cpp | 1 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 9 |
4 files changed, 22 insertions, 1 deletions
diff --git a/include/modules.h b/include/modules.h index b61e75b07..c86a11616 100644 --- a/include/modules.h +++ b/include/modules.h @@ -424,6 +424,8 @@ class Module : public classbase virtual void OnUserNotice(userrec* user, void* dest, int target_type, std::string text); virtual void OnMode(userrec* user, void* dest, int target_type, std::string text); + + virtual void OnGetServerDescription(std::string servername,std::string &description); virtual int OnUserPreNick(userrec* user, std::string newnick); diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 9f457868c..cfb96cca2 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -377,7 +377,16 @@ void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...) std::string GetServerDescription(char* servername) { - return ServerDesc; // not a remote server that can be found, it must be me. + std::string description = ""; + FOREACH_MOD OnGetServerDescription(servername,description); + if (description != "") + { + return description; + } + else + { + return ServerDesc; // not a remote server that can be found, it must be me. + } } /* write a formatted string to all users who share at least one common diff --git a/src/modules.cpp b/src/modules.cpp index 8d8f66ae9..f9bdeefcf 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -365,6 +365,7 @@ void Module::OnUserNotice(userrec* user, void* dest, int target_type, std::stri void Module::OnRemoteKill(userrec* source, userrec* dest, std::string reason) { }; void Module::OnUserInvite(userrec* source,userrec* dest,chanrec* channel) { }; void Module::OnPostLocalTopicChange(userrec* user, chanrec* chan, std::string topic) { }; +void Module::OnGetServerDescription(std::string servername,std::string &description) { }; // server is a wrapper class that provides methods to all of the C-style // exports in the core diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index faba676d9..51efcb740 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1371,6 +1371,15 @@ class ModuleSpanningTree : public Module return 0; } + virtual void OnGetServerDescription(std::string servername,std::string &description) + { + TreeServer* s = FindServer(servername); + if (s) + { + return s->GetDesc(); + } + } + virtual void OnUserInvite(userrec* source,userrec* dest,chanrec* channel) { if (std::string(source->server) == Srv->GetServerName()) |