diff options
author | DukePyrolator <anope@s15355730.onlinehome-server.info> | 2010-06-22 22:06:23 +0200 |
---|---|---|
committer | DukePyrolator <anope@s15355730.onlinehome-server.info> | 2010-06-22 22:06:23 +0200 |
commit | 959a1a69a5179c6f186026190cd77f8338b5c50a (patch) | |
tree | bbffc7c7a620a799612602836440a6c72234e6ed /src/modules.cpp | |
parent | 7e872db956da543b321e69cf5ff6c8d0866d9cc4 (diff) |
moved FindMessage() into the Anope class
Diffstat (limited to 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 9ca850b57..c32544aa4 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -158,6 +158,27 @@ bool Anope::DelMessage(Message *m) return false; } +/** Find message in the message table + * @param name The name of the message were looking for + * @return NULL if we cant find it, or a pointer to the Message if we can + **/ +std::vector<Message *> Anope::FindMessage(const std::string &name) +{ + std::vector<Message *> messages; + + std::multimap<std::string, Message *>::iterator it = MessageMap.find(name); + + if (it == MessageMap.end()) + return messages; + + std::multimap<std::string, Message *>::iterator upper = MessageMap.upper_bound(name); + + for (; it != upper; ++it) + messages.push_back(it->second); + + return messages; +} + /******************************************************************************* * Command Functions @@ -200,27 +221,6 @@ int Module::DelCommand(BotInfo *bi, Command *c) return MOD_ERR_OK; } -/** - * Find a message in the message table - * @param name The name of the message were looking for - * @return NULL if we cant find it, or a pointer to the Message if we can - **/ -std::vector<Message *> FindMessage(const std::string &name) -{ - std::vector<Message *> messages; - - std::multimap<std::string, Message *>::iterator it = MessageMap.find(name); - - if (it == MessageMap.end()) - return messages; - - std::multimap<std::string, Message *>::iterator upper = MessageMap.upper_bound(name); - - for (; it != upper; ++it) - messages.push_back(it->second); - - return messages; -} /******************************************************************************* * Module Callback Functions |