]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/misccommands.cpp
Use irc::equals instead of strcasecmp where appropriate.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / misccommands.cpp
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services>
5  *   Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com>
6  *
7  * This file is part of InspIRCd.  InspIRCd is free software: you can
8  * redistribute it and/or modify it under the terms of the GNU General Public
9  * License as published by the Free Software Foundation, version 2.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20
21 #include "inspircd.h"
22
23 #include "main.h"
24 #include "commands.h"
25 #include "treeserver.h"
26
27 void CmdBuilder::FireEvent(Server* target, const char* cmd, ClientProtocol::TagMap& taglist)
28 {
29         FOREACH_MOD_CUSTOM(Utils->Creator->GetMessageEventProvider(), ServerProtocol::MessageEventListener, OnBuildMessage, (target, cmd, taglist));
30         UpdateTags();
31 }
32
33 void CmdBuilder::FireEvent(User* target, const char* cmd, ClientProtocol::TagMap& taglist)
34 {
35         FOREACH_MOD_CUSTOM(Utils->Creator->GetMessageEventProvider(), ServerProtocol::MessageEventListener, OnBuildMessage, (target, cmd, taglist));
36         UpdateTags();
37 }
38
39 void CmdBuilder::UpdateTags()
40 {
41         std::string taglist;
42         if (!tags.empty())
43         {
44                 char separator = '@';
45                 for (ClientProtocol::TagMap::const_iterator iter = tags.begin(); iter != tags.end(); ++iter)
46                 {
47                         taglist.push_back(separator);
48                         separator = ';';
49                         taglist.append(iter->first);
50                         if (!iter->second.value.empty())
51                         {
52                                 taglist.push_back('=');
53                                 taglist.append(iter->second.value);
54                         }
55                 }
56                 taglist.push_back(' ');
57         }
58         content.replace(0, tagsize, taglist);
59         tagsize = taglist.length();
60 }
61
62 CmdResult CommandSNONotice::Handle(User* user, Params& params)
63 {
64         ServerInstance->SNO->WriteToSnoMask(params[0][0], "From " + user->nick + ": " + params[1]);
65         return CMD_SUCCESS;
66 }
67
68 CmdResult CommandEndBurst::HandleServer(TreeServer* server, Params& params)
69 {
70         server->FinishBurst();
71         return CMD_SUCCESS;
72 }