diff --git a/include/znc/Modules.h b/include/znc/Modules.h index f4c4dd6a..b7e3e995 100644 --- a/include/znc/Modules.h +++ b/include/znc/Modules.h @@ -29,7 +29,6 @@ class CModule; class CModInfo; // !Forward Declarations -// User Module Macros #ifdef REQUIRESSL #ifndef HAVE_LIBSSL #error - @@ -91,13 +90,9 @@ template CModule* TModLoad(ModHandle p, CUser* pUser, const CString& sModPath) \ : CModule(pDLL, pUser, pNetwork, sModName, sModPath) -/** At the end of your source file, you must call this macro in global context. - * It defines some static functions which ZNC needs to load this module. - * @param CLASS The name of your module's class. - * @param DESCRIPTION A short description of your module. - * @see For global modules you need GLOBALMODULEDEFS. - */ -#define MODULEDEFS(CLASS, DESCRIPTION) \ +// User Module Macros +/** This works exactly like MODULEDEFS, but for user modules. */ +#define USERMODULEDEFS(CLASS, DESCRIPTION) \ MODCOMMONDEFS(CLASS, DESCRIPTION, CModInfo::UserModule) // !User Module Macros @@ -113,6 +108,14 @@ template CModule* TModLoad(ModHandle p, CUser* pUser, MODCOMMONDEFS(CLASS, DESCRIPTION, CModInfo::NetworkModule) // !Network Module Macros +/** At the end of your source file, you must call this macro in global context. + * It defines some static functions which ZNC needs to load this module. + * By default the module will be a network module. + * @param CLASS The name of your module's class. + * @param DESCRIPTION A short description of your module. + */ +#define MODULEDEFS(CLASS, DESCRIPTION) NETWORKMODULEDEFS(CLASS, DESCRIPTION) + // Forward Declarations class CZNC; class CUser; diff --git a/modules/admin.cpp b/modules/admin.cpp index ec3c8487..c99c9820 100644 --- a/modules/admin.cpp +++ b/modules/admin.cpp @@ -987,4 +987,4 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("admin"); } -MODULEDEFS(CAdminMod, "Dynamic configuration of users/settings through IRC. Allows editing only yourself if you're not ZNC admin.") +USERMODULEDEFS(CAdminMod, "Dynamic configuration of users/settings through IRC. Allows editing only yourself if you're not ZNC admin.") diff --git a/modules/autoattach.cpp b/modules/autoattach.cpp index 54328c4b..97b81ab8 100644 --- a/modules/autoattach.cpp +++ b/modules/autoattach.cpp @@ -250,4 +250,4 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("autoattach"); } -MODULEDEFS(CChanAttach, "Reattaches you to channels on activity.") +USERMODULEDEFS(CChanAttach, "Reattaches you to channels on activity.") diff --git a/modules/autoreply.cpp b/modules/autoreply.cpp index 473d1e6e..645527de 100644 --- a/modules/autoreply.cpp +++ b/modules/autoreply.cpp @@ -93,5 +93,5 @@ template<> void TModInfo(CModInfo& Info) { Info.AddType(CModInfo::NetworkModule); } -MODULEDEFS(CAutoReplyMod, "Reply to queries when you are away") +USERMODULEDEFS(CAutoReplyMod, "Reply to queries when you are away") diff --git a/modules/bouncedcc.cpp b/modules/bouncedcc.cpp index 3d51ced7..de8372c7 100644 --- a/modules/bouncedcc.cpp +++ b/modules/bouncedcc.cpp @@ -451,5 +451,5 @@ unsigned short CDCCBounce::DCCRequest(const CString& sNick, unsigned long uLongI -MODULEDEFS(CBounceDCCMod, "Bounces DCC transfers through ZNC instead of sending them directly to the user. ") +USERMODULEDEFS(CBounceDCCMod, "Bounces DCC transfers through ZNC instead of sending them directly to the user. ") diff --git a/modules/buffextras.cpp b/modules/buffextras.cpp index 01581209..97e7b3e4 100644 --- a/modules/buffextras.cpp +++ b/modules/buffextras.cpp @@ -68,5 +68,5 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("buffextras"); } -MODULEDEFS(CBuffExtras, "Add joins, parts etc. to the playback buffer") +USERMODULEDEFS(CBuffExtras, "Add joins, parts etc. to the playback buffer") diff --git a/modules/cert.cpp b/modules/cert.cpp index a5a2f4e8..a756b609 100644 --- a/modules/cert.cpp +++ b/modules/cert.cpp @@ -90,4 +90,4 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("cert"); } -MODULEDEFS(CCertMod, "Use a ssl certificate to connect to a server") +USERMODULEDEFS(CCertMod, "Use a ssl certificate to connect to a server") diff --git a/modules/chansaver.cpp b/modules/chansaver.cpp index da5e2f26..45766074 100644 --- a/modules/chansaver.cpp +++ b/modules/chansaver.cpp @@ -78,4 +78,4 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("chansaver"); } -MODULEDEFS(CChanSaverMod, "Keep config up-to-date when user joins/parts") +USERMODULEDEFS(CChanSaverMod, "Keep config up-to-date when user joins/parts") diff --git a/modules/clientnotify.cpp b/modules/clientnotify.cpp index 488f2e76..72d3415c 100644 --- a/modules/clientnotify.cpp +++ b/modules/clientnotify.cpp @@ -106,5 +106,5 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("clientnotify"); } -MODULEDEFS(CClientNotifyMod, "Notifies you when another IRC client logs into or out of your account. Configurable.") +USERMODULEDEFS(CClientNotifyMod, "Notifies you when another IRC client logs into or out of your account. Configurable.") diff --git a/modules/disconkick.cpp b/modules/disconkick.cpp index 31fcec21..46480dae 100644 --- a/modules/disconkick.cpp +++ b/modules/disconkick.cpp @@ -33,4 +33,4 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("disconkick"); } -MODULEDEFS(CKickClientOnIRCDisconnect, "Kicks the client from all channels when the connection to the IRC server is lost") +USERMODULEDEFS(CKickClientOnIRCDisconnect, "Kicks the client from all channels when the connection to the IRC server is lost") diff --git a/modules/extra/autocycle.cpp b/modules/extra/autocycle.cpp index eaa6d91d..7eb6980b 100644 --- a/modules/extra/autocycle.cpp +++ b/modules/extra/autocycle.cpp @@ -239,4 +239,4 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("autocycle"); } -MODULEDEFS(CAutoCycleMod, "Rejoins channels to gain Op if you're the only user left") +USERMODULEDEFS(CAutoCycleMod, "Rejoins channels to gain Op if you're the only user left") diff --git a/modules/extra/block_motd.cpp b/modules/extra/block_motd.cpp index c4467771..3ebbd582 100644 --- a/modules/extra/block_motd.cpp +++ b/modules/extra/block_motd.cpp @@ -30,4 +30,4 @@ public: } }; -MODULEDEFS(CBlockMotd, "Block the MOTD from IRC so it's not sent to your client(s).") +USERMODULEDEFS(CBlockMotd, "Block the MOTD from IRC so it's not sent to your client(s).") diff --git a/modules/extra/charset.cpp b/modules/extra/charset.cpp index bd3b529b..737aa857 100644 --- a/modules/extra/charset.cpp +++ b/modules/extra/charset.cpp @@ -244,4 +244,4 @@ public: } }; -MODULEDEFS(CCharsetMod, "Normalizes character encodings.") +USERMODULEDEFS(CCharsetMod, "Normalizes character encodings.") diff --git a/modules/extra/clearbufferonmsg.cpp b/modules/extra/clearbufferonmsg.cpp index 0df53788..03e13d81 100644 --- a/modules/extra/clearbufferonmsg.cpp +++ b/modules/extra/clearbufferonmsg.cpp @@ -63,4 +63,4 @@ public: } }; -MODULEDEFS(CClearBufferOnMsgMod, "Clear all channel buffers whenever the user does something") +USERMODULEDEFS(CClearBufferOnMsgMod, "Clear all channel buffers whenever the user does something") diff --git a/modules/extra/ctcpflood.cpp b/modules/extra/ctcpflood.cpp index 66d14ff5..1050a469 100644 --- a/modules/extra/ctcpflood.cpp +++ b/modules/extra/ctcpflood.cpp @@ -113,4 +113,4 @@ private: unsigned int m_iThresholdMsgs; }; -MODULEDEFS(CCtcpFloodMod, "Don't forward CTCP floods to clients") +USERMODULEDEFS(CCtcpFloodMod, "Don't forward CTCP floods to clients") diff --git a/modules/extra/dcc.cpp b/modules/extra/dcc.cpp index 4d19107d..b34cc7ce 100644 --- a/modules/extra/dcc.cpp +++ b/modules/extra/dcc.cpp @@ -471,5 +471,5 @@ bool CDCCSock::Seek(unsigned int uPos) { return false; } -MODULEDEFS(CDCCMod, "This module allows you to transfer files to and from ZNC") +USERMODULEDEFS(CDCCMod, "This module allows you to transfer files to and from ZNC") diff --git a/modules/extra/email.cpp b/modules/extra/email.cpp index 5ee7f2aa..7cc8a034 100644 --- a/modules/extra/email.cpp +++ b/modules/extra/email.cpp @@ -249,5 +249,5 @@ void CEmailJob::RunJob() CEmail *p = (CEmail *)m_pModule; p->StartParser(); } -MODULEDEFS(CEmail, "Monitors Email activity on local disk /var/mail/user") +USERMODULEDEFS(CEmail, "Monitors Email activity on local disk /var/mail/user") diff --git a/modules/extra/flooddetach.cpp b/modules/extra/flooddetach.cpp index dc69d545..d82821cd 100644 --- a/modules/extra/flooddetach.cpp +++ b/modules/extra/flooddetach.cpp @@ -187,4 +187,4 @@ private: unsigned int m_iThresholdMsgs; }; -MODULEDEFS(CFloodDetachMod, "Detach channels when flooded") +USERMODULEDEFS(CFloodDetachMod, "Detach channels when flooded") diff --git a/modules/extra/listsockets.cpp b/modules/extra/listsockets.cpp index fcb68471..66729803 100644 --- a/modules/extra/listsockets.cpp +++ b/modules/extra/listsockets.cpp @@ -257,5 +257,5 @@ public: } }; -MODULEDEFS(CListSockets, "List active sockets") +USERMODULEDEFS(CListSockets, "List active sockets") diff --git a/modules/extra/send_raw.cpp b/modules/extra/send_raw.cpp index 8869022b..7b1fc9f0 100644 --- a/modules/extra/send_raw.cpp +++ b/modules/extra/send_raw.cpp @@ -119,4 +119,4 @@ public: } }; -MODULEDEFS(CSendRaw_Mod, "Lets you send some raw IRC lines as/to someone else") +USERMODULEDEFS(CSendRaw_Mod, "Lets you send some raw IRC lines as/to someone else") diff --git a/modules/extra/shell.cpp b/modules/extra/shell.cpp index e659c8b1..487f3f09 100644 --- a/modules/extra/shell.cpp +++ b/modules/extra/shell.cpp @@ -127,5 +127,5 @@ void CShellSock::Disconnected() { m_pParent->SetClient(NULL); } -MODULEDEFS(CShellMod, "Gives shell access") +USERMODULEDEFS(CShellMod, "Gives shell access") diff --git a/modules/log.cpp b/modules/log.cpp index 8f533045..89ca58fd 100644 --- a/modules/log.cpp +++ b/modules/log.cpp @@ -290,4 +290,4 @@ template<> void TModInfo(CModInfo& Info) { Info.AddType(CModInfo::GlobalModule); } -MODULEDEFS(CLogMod, "Write IRC logs") +USERMODULEDEFS(CLogMod, "Write IRC logs") diff --git a/modules/notes.cpp b/modules/notes.cpp index 752ad627..37404c4e 100644 --- a/modules/notes.cpp +++ b/modules/notes.cpp @@ -216,4 +216,4 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("notes"); } -MODULEDEFS(CNotesMod, "Keep and replay notes") +USERMODULEDEFS(CNotesMod, "Keep and replay notes") diff --git a/modules/sample.cpp b/modules/sample.cpp index 56e4741c..96e2eb65 100644 --- a/modules/sample.cpp +++ b/modules/sample.cpp @@ -245,5 +245,5 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("sample"); } -MODULEDEFS(CSampleMod, "To be used as a sample for writing modules") +USERMODULEDEFS(CSampleMod, "To be used as a sample for writing modules")