diff --git a/include/znc/znc.h b/include/znc/znc.h index 041feb7b..93ebabf9 100644 --- a/include/znc/znc.h +++ b/include/znc/znc.h @@ -56,6 +56,7 @@ public: void BackupConfigOnce(const CString& sSuffix); static CString GetVersion(); static CString GetTag(bool bIncludeVersion = true); + static CString GetCompileOptionsString(); CString GetUptime() const; void ClearBindHosts(); bool AddBindHost(const CString& sHost); diff --git a/src/ClientCommand.cpp b/src/ClientCommand.cpp index 8689bcc3..5d848673 100644 --- a/src/ClientCommand.cpp +++ b/src/ClientCommand.cpp @@ -124,26 +124,8 @@ void CClient::UserCommand(CString& sLine) { PutStatus("There were [" + CString(uMatches) + "] channels matching [" + sChan + "]"); PutStatus("Detached [" + CString(uDetached) + "] channels"); } else if (sCommand.Equals("VERSION")) { - const char *features = "IPv6: " -#ifdef HAVE_IPV6 - "yes" -#else - "no" -#endif - ", SSL: " -#ifdef HAVE_LIBSSL - "yes" -#else - "no" -#endif - ", dns: " -#ifdef HAVE_THREADED_DNS - "threads"; -#else - "blocking"; -#endif PutStatus(CZNC::GetTag()); - PutStatus(features); + PutStatus(CZNC::GetCompileOptionsString()); } else if (sCommand.Equals("MOTD") || sCommand.Equals("ShowMOTD")) { if (!SendMotd()) { PutStatus("There is no MOTD set."); diff --git a/src/main.cpp b/src/main.cpp index fbd196e6..a95623e5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -138,6 +138,7 @@ int main(int argc, char** argv) { return 0; case 'v': cout << CZNC::GetTag() << endl; + cout << CZNC::GetCompileOptionsString() << endl; return 0; case 'n': CDebug::SetStdoutIsTTY(false); diff --git a/src/znc.cpp b/src/znc.cpp index db30b59b..5718d206 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -92,6 +92,29 @@ CString CZNC::GetTag(bool bIncludeVersion) { return szBuf; } +CString CZNC::GetCompileOptionsString() { + return + "IPv6: " +#ifdef HAVE_IPV6 + "yes" +#else + "no" +#endif + ", SSL: " +#ifdef HAVE_LIBSSL + "yes" +#else + "no" +#endif + ", DNS: " +#ifdef HAVE_THREADED_DNS + "threads" +#else + "blocking" +#endif + ; +} + CString CZNC::GetUptime() const { time_t now = time(NULL); return CString::ToTimeStr(now - TimeStarted());