From: Kyle Fuller Date: Fri, 27 Sep 2013 06:45:09 +0000 (+0100) Subject: Include an info command to get info X-Git-Tag: 1.0.0~17 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=5584e10b38ee2c716349f586ce27f2c8aa350674;p=znc-palaver.git Include an info command to get info --- diff --git a/palaver.cpp b/palaver.cpp index 8515bc7..fffd037 100644 --- a/palaver.cpp +++ b/palaver.cpp @@ -15,6 +15,10 @@ #include +#ifndef PALAVER_VERSION + #define PALAVER_VERSION "unknown" +#endif + const char *kPLVCapability = "palaverapp.com"; const char *kPLVCommand = "PALAVER"; @@ -559,6 +563,8 @@ public: "", "Send notifications to registered devices"); AddCommand("list", static_cast(&CPalaverMod::HandleListCommand), "", "List all registered devices"); + AddCommand("info", static_cast(&CPalaverMod::HandleInfoCommand), + "", "Show's module information"); } virtual bool OnLoad(const CString& sArgs, CString& sMessage) { @@ -935,6 +941,21 @@ public: } } + void HandleInfoCommand(const CString &sLine) { + PutModule("Please contact support@palaverapp.com if you have any troubles with this module."); + PutModule("Be sure to include all information from this command so we can try and debug any issues."); + PutModule("--"); + + PutModule("Palaver ZNC: " + CString(PALAVER_VERSION) + " -- http://palaverapp.com/"); + CDevice *pDevice = DeviceForClient(*m_pClient); + if (pDevice) { + PutModule("Current device: (" + pDevice->GetToken() + ")"); + } + PutModule(CString(m_vDevices.size()) + " registered devices"); + + PutStatus(CZNC::GetTag()); + PutStatus(CZNC::GetCompileOptionsString()); + } private: std::vector m_vDevices; @@ -945,3 +966,4 @@ template<> void TModInfo(CModInfo& Info) { } GLOBALMODULEDEFS(CPalaverMod, "Palaver support module") +