From 038bcd2b135e1d6841ced7cac29f51e8a2ecbaf7 Mon Sep 17 00:00:00 2001 From: John Reese Date: Fri, 11 Apr 2014 13:45:33 -0700 Subject: [PATCH] Add support for loading push as a user module Loading as a user module will require either the webadmin or controlpanel module, as ZNC Push will retain the current behavior of loading as a network module by default. Fixes #79 --- README.md | 8 ++++++++ push.cpp | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a78de63..c73ae6c 100755 --- a/README.md +++ b/README.md @@ -89,6 +89,14 @@ Now, load the module in ZNC: /msg *status loadmod push +Note: the above command will only enable ZNC Push for a single network in ZNC. If instead +you would like to load ZNC Push as a "user level" module, so that you can share configuration +options across multiple networks, you will need to either use the web admin page for the +user to enable the "push" module, or you will need to use ZNC's "controlpanel" module: + + /msg *status loadmod controlpanel + /msg *controlpanel loadmod push + Then select the push service you want to use, and set your username and secret as needed. The secret is not your password, and can be obtained by logging into the service's website and looking in your profile or settings: diff --git a/push.cpp b/push.cpp index 40faa1d..b9676e9 100755 --- a/push.cpp +++ b/push.cpp @@ -1691,4 +1691,9 @@ void CPushSocket::Disconnected() } #endif // USE_CURL -MODULEDEFS(CPushMod, "Send highlights and personal messages to a push notification service") +template<> void TModInfo(CModInfo& Info) { + Info.AddType(CModInfo::UserModule); + Info.SetWikiPage("push"); +} + +NETWORKMODULEDEFS(CPushMod, "Send highlights and personal messages to a push notification service")