-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathznc-whorefilter.cpp
46 lines (39 loc) · 1.13 KB
/
znc-whorefilter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* ZNC Whore Filter
*
* Allows the user to redirect what boring ppl say to another (fake) chan.
*
* Copyright (c) 2012 Romain Labolle
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
class CWhoreMod : public CModule {
public:
MODCONSTRUCTOR(CWhoreMod) {}
virtual bool OnLoad(const CString& sArgs, CString& sErrorMsg) {
m_sHostmask = "attentionwhor*!*srs@*";
m_sChannel = "#srsbsns";
m_sNewChan = "~#whorefilter";
return true;
}
virtual ~CWhoreMod() {}
virtual EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) {
if (Nick.GetHostMask().WildCmp(m_sHostmask) && Channel.GetName().AsLower().WildCmp(m_sChannel)) {
PutUser(":" + Nick.GetHostMask() + " PRIVMSG " + m_sNewChan + " :" + sMessage);
return HALT;
}
return CONTINUE;
}
private:
CString m_sHostmask;
CString m_sChannel;
CString m_sNewChan;
};
MODULEDEFS(CWhoreMod, "Filter redirect whore msg to another (fake) chan")