mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1693 726aef4b-f618-498e-8847-2d620e286838
43 lines
969 B
C++
43 lines
969 B
C++
/*
|
|
* Copyright (C) 2004-2010 See the AUTHORS file for details.
|
|
*
|
|
* 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 "User.h"
|
|
#include "znc.h"
|
|
|
|
class CSendRaw_Mod: public CGlobalModule {
|
|
public:
|
|
GLOBALMODCONSTRUCTOR(CSendRaw_Mod) {}
|
|
|
|
virtual ~CSendRaw_Mod() {
|
|
}
|
|
|
|
virtual void OnModCommand(const CString& sLine) {
|
|
CString sUser = sLine.Token(0);
|
|
CString sSend = sLine.Token(1, true);
|
|
CUser *pUser;
|
|
|
|
if (!m_pUser->IsAdmin()) {
|
|
PutModule("You must have admin privileges to use this");
|
|
return;
|
|
}
|
|
|
|
pUser = CZNC::Get().FindUser(sUser);
|
|
|
|
if (!pUser) {
|
|
PutModule("User not found");
|
|
PutModule("The expected format is: <user> <line to send>");
|
|
return;
|
|
}
|
|
|
|
pUser->PutIRC(sSend);
|
|
PutModule("done");
|
|
}
|
|
};
|
|
|
|
GLOBALMODULEDEFS(CSendRaw_Mod, "Let's you send some raw IRC lines as someone else");
|