2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2018-2020 Sadie Powell <sadie@witchery.services>
5 * Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com>
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.
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
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/>.
25 #include "treeserver.h"
27 void CmdBuilder::FireEvent(Server* target, const char* cmd, ClientProtocol::TagMap& taglist)
29 if (!Utils->Creator || Utils->Creator->dying)
32 FOREACH_MOD_CUSTOM(Utils->Creator->GetMessageEventProvider(), ServerProtocol::MessageEventListener, OnBuildMessage, (target, cmd, taglist));
36 void CmdBuilder::FireEvent(User* target, const char* cmd, ClientProtocol::TagMap& taglist)
38 if (!Utils->Creator || Utils->Creator->dying)
41 FOREACH_MOD_CUSTOM(Utils->Creator->GetMessageEventProvider(), ServerProtocol::MessageEventListener, OnBuildMessage, (target, cmd, taglist));
45 void CmdBuilder::UpdateTags()
51 for (ClientProtocol::TagMap::const_iterator iter = tags.begin(); iter != tags.end(); ++iter)
53 taglist.push_back(separator);
55 taglist.append(iter->first);
56 if (!iter->second.value.empty())
58 taglist.push_back('=');
59 taglist.append(iter->second.value);
62 taglist.push_back(' ');
64 content.replace(0, tagsize, taglist);
65 tagsize = taglist.length();
68 CmdResult CommandSNONotice::Handle(User* user, Params& params)
70 ServerInstance->SNO->WriteToSnoMask(params[0][0], "From " + user->nick + ": " + params[1]);
74 CmdResult CommandEndBurst::HandleServer(TreeServer* server, Params& params)
76 server->FinishBurst();