1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "commands/cmd_whois.h"
16 #include "commands/cmd_stats.h"
20 #include "transport.h"
21 #include "socketengine.h"
23 #include "m_spanningtree/main.h"
24 #include "m_spanningtree/utils.h"
25 #include "m_spanningtree/treeserver.h"
26 #include "m_spanningtree/link.h"
27 #include "m_spanningtree/treesocket.h"
28 #include "m_spanningtree/resolvers.h"
29 #include "m_spanningtree/handshaketimer.h"
31 /* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */
33 /** remote MOTD. leet, huh? */
34 bool TreeSocket::Motd(const std::string &prefix, std::deque<std::string> ¶ms)
36 if (params.size() > 0)
38 if (this->Instance->MatchText(this->Instance->Config->ServerName, params[0]))
40 /* It's for our server */
42 User* source = this->Instance->FindNick(prefix);
46 std::deque<std::string> par;
47 par.push_back(prefix);
50 if (!Instance->Config->MOTD.size())
52 par[1] = std::string("::")+Instance->Config->ServerName+" 422 "+source->nick+" :Message of the day file is missing.";
53 Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
57 par[1] = std::string("::")+Instance->Config->ServerName+" 375 "+source->nick+" :"+Instance->Config->ServerName+" message of the day";
58 Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
60 for (unsigned int i = 0; i < Instance->Config->MOTD.size(); i++)
62 par[1] = std::string("::")+Instance->Config->ServerName+" 372 "+source->nick+" :- "+Instance->Config->MOTD[i];
63 Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
66 par[1] = std::string("::")+Instance->Config->ServerName+" 376 "+source->nick+" :End of message of the day.";
67 Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
73 User* source = this->Instance->FindNick(prefix);
75 Utils->DoOneToOne(prefix, "MOTD", params, params[0]);