Mods are network mods by default.

Network modules are the simplest ones.
This commit is contained in:
Alexey Sokolov
2012-02-04 00:29:58 +07:00
parent b966204456
commit ae68a5a608
24 changed files with 34 additions and 31 deletions
+11 -8
View File
@@ -29,7 +29,6 @@ class CModule;
class CModInfo;
// !Forward Declarations
// User Module Macros
#ifdef REQUIRESSL
#ifndef HAVE_LIBSSL
#error -
@@ -91,13 +90,9 @@ template<class M> 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<class M> 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;
+1 -1
View File
@@ -987,4 +987,4 @@ template<> void TModInfo<CAdminMod>(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.")
+1 -1
View File
@@ -250,4 +250,4 @@ template<> void TModInfo<CChanAttach>(CModInfo& Info) {
Info.SetWikiPage("autoattach");
}
MODULEDEFS(CChanAttach, "Reattaches you to channels on activity.")
USERMODULEDEFS(CChanAttach, "Reattaches you to channels on activity.")
+1 -1
View File
@@ -93,5 +93,5 @@ template<> void TModInfo<CAutoReplyMod>(CModInfo& Info) {
Info.AddType(CModInfo::NetworkModule);
}
MODULEDEFS(CAutoReplyMod, "Reply to queries when you are away")
USERMODULEDEFS(CAutoReplyMod, "Reply to queries when you are away")
+1 -1
View File
@@ -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. ")
+1 -1
View File
@@ -68,5 +68,5 @@ template<> void TModInfo<CBuffExtras>(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")
+1 -1
View File
@@ -90,4 +90,4 @@ template<> void TModInfo<CCertMod>(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")
+1 -1
View File
@@ -78,4 +78,4 @@ template<> void TModInfo<CChanSaverMod>(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")
+1 -1
View File
@@ -106,5 +106,5 @@ template<> void TModInfo<CClientNotifyMod>(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.")
+1 -1
View File
@@ -33,4 +33,4 @@ template<> void TModInfo<CKickClientOnIRCDisconnect>(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")
+1 -1
View File
@@ -239,4 +239,4 @@ template<> void TModInfo<CAutoCycleMod>(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")
+1 -1
View File
@@ -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).")
+1 -1
View File
@@ -244,4 +244,4 @@ public:
}
};
MODULEDEFS(CCharsetMod, "Normalizes character encodings.")
USERMODULEDEFS(CCharsetMod, "Normalizes character encodings.")
+1 -1
View File
@@ -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")
+1 -1
View File
@@ -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")
+1 -1
View File
@@ -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")
+1 -1
View File
@@ -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")
+1 -1
View File
@@ -187,4 +187,4 @@ private:
unsigned int m_iThresholdMsgs;
};
MODULEDEFS(CFloodDetachMod, "Detach channels when flooded")
USERMODULEDEFS(CFloodDetachMod, "Detach channels when flooded")
+1 -1
View File
@@ -257,5 +257,5 @@ public:
}
};
MODULEDEFS(CListSockets, "List active sockets")
USERMODULEDEFS(CListSockets, "List active sockets")
+1 -1
View File
@@ -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")
+1 -1
View File
@@ -127,5 +127,5 @@ void CShellSock::Disconnected() {
m_pParent->SetClient(NULL);
}
MODULEDEFS(CShellMod, "Gives shell access")
USERMODULEDEFS(CShellMod, "Gives shell access")
+1 -1
View File
@@ -290,4 +290,4 @@ template<> void TModInfo<CLogMod>(CModInfo& Info) {
Info.AddType(CModInfo::GlobalModule);
}
MODULEDEFS(CLogMod, "Write IRC logs")
USERMODULEDEFS(CLogMod, "Write IRC logs")
+1 -1
View File
@@ -216,4 +216,4 @@ template<> void TModInfo<CNotesMod>(CModInfo& Info) {
Info.SetWikiPage("notes");
}
MODULEDEFS(CNotesMod, "Keep and replay notes")
USERMODULEDEFS(CNotesMod, "Keep and replay notes")
+1 -1
View File
@@ -245,5 +245,5 @@ template<> void TModInfo<CSampleMod>(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")