]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/delline.cpp
Server origin PRIVMSG and NOTICE now supported by protocol. Will add interface after...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / delline.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15 #include "xline.h"
16
17 #include "m_spanningtree/treesocket.h"
18 #include "m_spanningtree/treeserver.h"
19 #include "m_spanningtree/utils.h"
20
21 /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
22
23
24 bool TreeSocket::DelLine(const std::string &prefix, std::deque<std::string> &params)
25 {
26         if (params.size() < 2)
27                 return true;
28
29         User* user = Instance->FindNick(prefix);
30
31         /* NOTE: No check needed on 'user', this function safely handles NULL */
32         if (Instance->XLines->DelLine(params[0].c_str(), params[1], user))
33         {
34                 this->Instance->SNO->WriteToSnoMask('x',"%s removed %s%s on %s.", prefix.c_str(),
35                                 params[0].c_str(), params[0].length() == 1 ? "LINE" : "", params[1].c_str());
36                 Utils->DoOneToAllButSender(prefix,"DELLINE", params, prefix);
37         }
38         return true;
39 }
40