Skip to content

Instantly share code, notes, and snippets.

@mattstevens
Last active December 22, 2015 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattstevens/6391429 to your computer and use it in GitHub Desktop.
Save mattstevens/6391429 to your computer and use it in GitHub Desktop.
Quick and dirty ZNC filter to stop people from crashing clients (no longer needed as of 10.8.5)
#include <znc/Modules.h>
using namespace std;
static const char evil[] = { (char)0xd8, (char)0xb3, 0 };
class CFilterMod : public CModule {
public:
MODCONSTRUCTOR(CFilterMod) {
}
virtual EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) {
if (sMessage.find(evil) != string::npos) {
return HALT;
}
return CONTINUE;
}
};
MODULEDEFS(CFilterMod, "Message filter module")
@mattstevens
Copy link
Author

  1. znc-buildmod filter.cpp
  2. Copy filter.so into ZNC modules directory
  3. /msg *status loadmod filter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment