-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathzlined.cpp
More file actions
34 lines (30 loc) · 1.03 KB
/
zlined.cpp
File metadata and controls
34 lines (30 loc) · 1.03 KB
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
// Detect /zlines.
// <*zlined> idiot (ident@example.com) from channels: #foobar, #xyz
#include <znc/Chan.h>
#include <znc/IRCNetwork.h>
#include <znc/Modules.h>
using std::vector;
class Czlined : public CModule {
public:
MODCONSTRUCTOR(Czlined) {}
virtual ~Czlined() {}
void OnQuitMessage(CQuitMessage& Message,
const vector<CChan*>& vChans) override {
const CNick& Nick = Message.GetNick();
const CString sMessage = Message.GetReason();
if (sMessage.Token(0) == "Z-Lined") {
VCString vsChans;
for (CChan* pChan : vChans) {
vsChans.push_back(pChan->GetName());
}
PutModule("" + Nick.GetNick() + " (" + Nick.GetIdent() + "@" + Nick.GetHost() + ") from channels: " +
CString(", ").Join(vsChans.begin(), vsChans.end()));
}
}
};
template <>
void TModInfo<Czlined>(CModInfo& Info) {
// Info.SetWikiPage("zlined");
Info.SetHasArgs(false);
}
NETWORKMODULEDEFS(Czlined, "Watch for Z-Lines.")