mirror of
https://github.com/znc/znc.git
synced 2026-05-08 22:34:45 +02:00
Importing the block_motd module into the extra module package. Psychon is probably its author since I grabbed it from here: http://people.znc.in/~psychon/znc/modules/, so thanks psychon! :>
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1700 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2009 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 "Modules.h"
|
||||
|
||||
class CBlockMotd : public CModule {
|
||||
public:
|
||||
MODCONSTRUCTOR(CBlockMotd) {
|
||||
}
|
||||
|
||||
virtual ~CBlockMotd() {
|
||||
}
|
||||
|
||||
virtual EModRet OnRaw(CString &sLine) {
|
||||
const CString sCmd = sLine.Token(1);
|
||||
|
||||
if (sCmd == "375" /* begin of MOTD */
|
||||
|| sCmd == "372" /* MOTD */)
|
||||
return HALT;
|
||||
if (sCmd == "376" /* End of MOTD */) {
|
||||
sLine = sLine.Token(0) + " 422 " +
|
||||
sLine.Token(2) + " :MOTD blocked by ZNC";
|
||||
}
|
||||
return CONTINUE;
|
||||
}
|
||||
};
|
||||
|
||||
MODULEDEFS(CBlockMotd, "Block the MOTD from IRC so it's not sent to your client(s).")
|
||||
Reference in New Issue
Block a user