Merge branch 'modinfo'

This commit is contained in:
Alexey Sokolov
2011-06-11 18:32:09 +07:00
45 changed files with 262 additions and 112 deletions
+4
View File
@@ -857,4 +857,8 @@ public:
virtual ~CAdminMod() {}
};
template<> void TModInfo<CAdminMod>(CModInfo& Info) {
Info.SetWikiPage("admin");
}
MODULEDEFS(CAdminMod, "Dynamic configuration of users/settings through IRC")
+4
View File
@@ -163,4 +163,8 @@ private:
CString m_sLogFile;
};
template<> void TModInfo<CAdminLogMod>(CModInfo& Info) {
Info.SetWikiPage("adminlog");
}
GLOBALMODULEDEFS(CAdminLogMod, "Log ZNC events to file and/or syslog.")
+4
View File
@@ -246,4 +246,8 @@ private:
VAttachMatch m_vMatches;
};
template<> void TModInfo<CChanAttach>(CModInfo& Info) {
Info.SetWikiPage("autoattach");
}
MODULEDEFS(CChanAttach, "Reattaches you to channels on activity.")
+4
View File
@@ -224,4 +224,8 @@ private:
vector<CString> m_vsNegChans;
};
template<> void TModInfo<CAutoCycleMod>(CModInfo& Info) {
Info.SetWikiPage("autocycle");
}
MODULEDEFS(CAutoCycleMod, "Rejoins channels to gain Op if you're the only user left")
+4
View File
@@ -463,4 +463,8 @@ void CAutoOpTimer::RunJob() {
m_pParent->ProcessQueue();
}
template<> void TModInfo<CAutoOpMod>(CModInfo& Info) {
Info.SetWikiPage("autoop");
}
MODULEDEFS(CAutoOpMod, "Auto op the good guys")
+4
View File
@@ -88,5 +88,9 @@ private:
TCacheMap<CString> m_Messaged;
};
template<> void TModInfo<CAutoReplyMod>(CModInfo& Info) {
Info.SetWikiPage("autoreply");
}
MODULEDEFS(CAutoReplyMod, "Reply to queries when you are away")
+4
View File
@@ -186,4 +186,8 @@ void CAwayNickTimer::RunJob() {
}
}
template<> void TModInfo<CAwayNickMod>(CModInfo& Info) {
Info.SetWikiPage("awaynick");
}
MODULEDEFS(CAwayNickMod, "Change your nick while you are away")
+4
View File
@@ -168,4 +168,8 @@ private:
}
};
template<> void TModInfo<CBlockUser>(CModInfo& Info) {
Info.SetWikiPage("blockuser");
}
GLOBALMODULEDEFS(CBlockUser, "Block certain users from logging in")
+4
View File
@@ -66,5 +66,9 @@ public:
}
};
template<> void TModInfo<CBuffExtras>(CModInfo& Info) {
Info.SetWikiPage("buffextras");
}
MODULEDEFS(CBuffExtras, "Add joins, parts etc. to the playback buffer")
+4
View File
@@ -85,4 +85,8 @@ public:
}
};
template<> void TModInfo<CCertMod>(CModInfo& Info) {
Info.SetWikiPage("cert");
}
MODULEDEFS(CCertMod, "Use a ssl certificate to connect to a server")
+4
View File
@@ -276,4 +276,8 @@ private:
MSCString m_PubKeys;
};
template<> void TModInfo<CSSLClientCertMod>(CModInfo& Info) {
Info.SetWikiPage("certauth");
}
GLOBALMODULEDEFS(CSSLClientCertMod, "Allow users to authenticate via SSL client certificates")
+4
View File
@@ -72,4 +72,8 @@ private:
bool m_bWriteConf;
};
template<> void TModInfo<CChanSaverMod>(CModInfo& Info) {
Info.SetWikiPage("chansaver");
}
MODULEDEFS(CChanSaverMod, "Keep config up-to-date when user joins/parts")
+4
View File
@@ -102,5 +102,9 @@ public:
}
};
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.")
+4
View File
@@ -151,4 +151,8 @@ public:
}
};
template<> void TModInfo<CCryptMod>(CModInfo& Info) {
Info.SetWikiPage("crypt");
}
MODULEDEFS(CCryptMod, "Encryption for channel/private messages")
@@ -136,7 +136,7 @@
<? LOOP ModuleLoop ?>
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
<td class="mod_name">
<input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? VAR Name ?></label>
<input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? IF Wiki ?><a href="http://wiki.znc.in/<? VAR Wiki ?>"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label>
</td>
<td class="mod_args">
<? IF Disabled ?><? VAR Args ?><? ELSE ?><input class="third" type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>" /><? ENDIF ?>
+1 -1
View File
@@ -132,7 +132,7 @@
<tbody>
<? LOOP ModuleLoop ?>
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
<td class="mod_name"><input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? VAR Name ?></label></td>
<td class="mod_name"><input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? IF Wiki ?> <a href="http://wiki.znc.in/<? VAR Wiki ?>"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label></td>
<td class="mod_args"><input type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>" /></td>
<td class="mod_descr"><? VAR Description ?></td>
</tr>
+4
View File
@@ -29,4 +29,8 @@ public:
}
};
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")
+4
View File
@@ -95,4 +95,8 @@ private:
unsigned int m_uiAllowedFailed;
};
template<> void TModInfo<CFailToBanMod>(CModInfo& Info) {
Info.SetWikiPage("fail2ban");
}
GLOBALMODULEDEFS(CFailToBanMod, "Block IPs for some time after a failed login")
+4
View File
@@ -22,4 +22,8 @@ public:
}
};
template<> void TModInfo<CPreventIdMsgMod>(CModInfo& Info) {
Info.SetWikiPage("fixfreenode");
}
MODULEDEFS(CPreventIdMsgMod, "Prevent client from sending IDENTIFY-MSG to server")
+4
View File
@@ -162,4 +162,8 @@ public:
}
};
template<> void TModInfo<CIdentFileModule>(CModInfo& Info) {
Info.SetWikiPage("identfile");
}
GLOBALMODULEDEFS(CIdentFileModule, "Write the ident of a user to a file when they are trying to connect")
+4
View File
@@ -192,4 +192,8 @@ void CKeepNickTimer::RunJob() {
m_pMod->KeepNick();
}
template<> void TModInfo<CKeepNickMod>(CModInfo& Info) {
Info.SetWikiPage("keepnick");
}
MODULEDEFS(CKeepNickMod, "Keep trying for your primary nick")
+4
View File
@@ -108,4 +108,8 @@ public:
}
};
template<> void TModInfo<CRejoinMod>(CModInfo& Info) {
Info.SetWikiPage("kickrejoin");
}
MODULEDEFS(CRejoinMod, "Autorejoin on kick")
+4
View File
@@ -148,4 +148,8 @@ public:
};
template<> void TModInfo<CLastSeenMod>(CModInfo& Info) {
Info.SetWikiPage("lastseen");
}
GLOBALMODULEDEFS(CLastSeenMod, "Collects data about when a user last logged in")
+8 -2
View File
@@ -147,11 +147,12 @@ public:
break;
case Perl_Loaded:
result = HALT;
if (3 == ret) {
if (4 == ret) {
ModInfo.SetGlobal(false);
ModInfo.SetDescription(PString(ST(2)));
ModInfo.SetName(sModule);
ModInfo.SetPath(PString(ST(1)));
ModInfo.SetWikiPage(PString(ST(3)));
bSuccess = true;
} else {
bSuccess = false;
@@ -201,11 +202,12 @@ public:
PUSH_STR(sPath);
PUSH_STR(sName);
PCALL("ZNC::Core::ModInfoByPath");
if (!SvTRUE(ERRSV) && ret == 1) {
if (!SvTRUE(ERRSV) && ret == 2) {
ModInfo.SetGlobal(false);
ModInfo.SetDescription(PString(ST(0)));
ModInfo.SetName(sName);
ModInfo.SetPath(sPath);
ModInfo.SetWikiPage(PString(ST(1)));
ssMods.insert(ModInfo);
}
PEND;
@@ -316,4 +318,8 @@ CPerlSocket::~CPerlSocket() {
}
}
template<> void TModInfo<CModPerl>(CModInfo& Info) {
Info.SetWikiPage("modperl");
}
GLOBALMODULEDEFS(CModPerl, "Loads perl scripts as ZNC modules")
+6 -2
View File
@@ -154,7 +154,7 @@ sub GetModInfo {
return ($ZNC::Perl_LoadError, "Incorrect perl module.") unless IsModule $modpath, $modname;
require $modpath;
my $pmod = bless {}, $modname;
return ($ZNC::Perl_Loaded, $modpath, $pmod->description)
return ($ZNC::Perl_Loaded, $modpath, $pmod->description, $pmod->wiki_page)
}
sub ModInfoByPath {
@@ -162,7 +162,7 @@ sub ModInfoByPath {
die "Incorrect perl module." unless IsModule $modpath, $modname;
require $modpath;
my $pmod = bless {}, $modname;
return ($pmod->description)
return ($pmod->description, $pmod->wiki_page)
}
sub CallModFunc {
@@ -279,6 +279,10 @@ sub description {
"< Placeholder for a description >"
}
sub wiki_page {
''
}
# Default implementations for module hooks. They can be overriden in derived modules.
sub OnLoad {1}
sub OnBoot {}
+4
View File
@@ -478,4 +478,8 @@ PyObject* CPySocket::WriteBytes(PyObject* data) {
}
}
template<> void TModInfo<CModPython>(CModInfo& Info) {
Info.SetWikiPage("modpython");
}
GLOBALMODULEDEFS(CModPython, "Loads python scripts as ZNC modules")
+5 -1
View File
@@ -151,6 +151,8 @@ class ModuleNV(collections.MutableMapping):
class Module:
description = '< Placeholder for a description >'
wiki_page = ''
def __str__(self):
return self.GetModName()
@@ -498,6 +500,7 @@ def get_mod_info(modname, retmsg, modinfo):
cl = pymodule.__dict__[modname]
modinfo.SetGlobal(False)
modinfo.SetDescription(cl.description)
modinfo.SetWikiPage(cl.wiki_page)
modinfo.SetName(modname)
modinfo.SetPath(pymodule.__file__)
return 2
@@ -524,7 +527,8 @@ def get_mod_info_path(path, modname, modinfo):
return 0
cl = pymodule.__dict__[modname]
modinfo.SetGlobal(False)
modinfo.SetDescription(get_descr(cl))
modinfo.SetDescription(cl.description)
modinfo.SetWikiPage(cl.wiki_page)
modinfo.SetName(modname)
modinfo.SetPath(pymodule.__file__)
return 1
+4
View File
@@ -494,4 +494,8 @@ void CModTclStartTimer::RunJob() {
p->Start();
}
template<> void TModInfo<CModTcl>(CModInfo& Info) {
Info.SetWikiPage("modtcl");
}
MODULEDEFS(CModTcl, "Loads Tcl scripts as ZNC modules")
+4
View File
@@ -76,4 +76,8 @@ private:
CString m_sPass;
};
template<> void TModInfo<CNickServ>(CModInfo& Info) {
Info.SetWikiPage("nickserv");
}
MODULEDEFS(CNickServ, "Auths you with NickServ")
+4
View File
@@ -212,4 +212,8 @@ public:
}
};
template<> void TModInfo<CNotesMod>(CModInfo& Info) {
Info.SetWikiPage("notes");
}
MODULEDEFS(CNotesMod, "Keep and replay notes")
+4
View File
@@ -715,4 +715,8 @@ private:
set<CString> m_ssDefaultChans;
};
template<> void TModInfo<CPartylineMod>(CModInfo& Info) {
Info.SetWikiPage("partyline");
}
GLOBALMODULEDEFS(CPartylineMod, "Internal channels and queries for users connected to znc")
+4
View File
@@ -166,4 +166,8 @@ private:
VCString m_vPerform;
};
template<> void TModInfo<CPerform>(CModInfo& Info) {
Info.SetWikiPage("perform");
}
MODULEDEFS(CPerform, "Keeps a list of commands to be executed when ZNC connects to IRC.")
+4
View File
@@ -8,6 +8,10 @@ sub description {
'Evaluates perl code'
}
sub wiki_page {
'perleval'
}
sub OnLoad {
my $self = shift;
if (!$self->GetUser->IsAdmin) {
+4
View File
@@ -483,4 +483,8 @@ private:
}
};
template<> void TModInfo<CQModule>(CModInfo& Info) {
Info.SetWikiPage("Q");
}
MODULEDEFS(CQModule, "Auths you with QuakeNet's Q bot.")
+4
View File
@@ -28,5 +28,9 @@ public:
}
};
template<> void TModInfo<CRawMod>(CModInfo& Info) {
Info.SetWikiPage("raw");
}
MODULEDEFS(CRawMod, "View all of the raw traffic")
+4
View File
@@ -422,4 +422,8 @@ void CRouteTimeout::RunJob()
pMod->Timeout();
}
template<> void TModInfo<CRouteRepliesMod>(CModInfo& Info) {
Info.SetWikiPage("route_replies");
}
MODULEDEFS(CRouteRepliesMod, "Send replies (e.g. to /who) to the right client only")
+4
View File
@@ -230,5 +230,9 @@ public:
}
};
template<> void TModInfo<CSampleMod>(CModInfo& Info) {
Info.SetWikiPage("sample");
}
MODULEDEFS(CSampleMod, "To be used as a sample for writing modules")
+4
View File
@@ -335,5 +335,9 @@ void CSaveBuffJob::RunJob()
p->SaveBufferToDisk();
}
template<> void TModInfo<CSaveBuff>(CModInfo& Info) {
Info.SetWikiPage("savebuff");
}
MODULEDEFS(CSaveBuff, "Stores channel buffers to disk, encrypted")
+5
View File
@@ -463,5 +463,10 @@ void CRemMarkerJob::RunJob()
// store buffer
}
template<> void TModInfo<CSChat>(CModInfo& Info) {
Info.SetWikiPage("schat");
}
MODULEDEFS(CSChat, "Secure cross platform (:P) chat system")
+3
View File
@@ -216,5 +216,8 @@ void CSimpleAwayJob::RunJob() {
((CSimpleAway*)m_pModule)->SetAway(false);
}
template<> void TModInfo<CSimpleAway>(CModInfo& Info) {
Info.SetWikiPage("simple_away");
}
MODULEDEFS(CSimpleAway, "Auto away when last client disconnects")
+4
View File
@@ -187,4 +187,8 @@ bool CStickyChan::OnLoad(const CString& sArgs, CString& sMessage)
return(true);
}
template<> void TModInfo<CStickyChan>(CModInfo& Info) {
Info.SetWikiPage("stickychan");
}
MODULEDEFS(CStickyChan, "configless sticky chans, keeps you there very stickily even")
+4
View File
@@ -550,4 +550,8 @@ private:
CBuffer m_Buffer;
};
template<> void TModInfo<CWatcherMod>(CModInfo& Info) {
Info.SetWikiPage("watch");
}
MODULEDEFS(CWatcherMod, "Copy activity from a specific user into a separate window")
+6
View File
@@ -745,6 +745,7 @@ public:
l["Name"] = Info.GetName();
l["Description"] = Info.GetDescription();
l["Args"] = GetModArgs(pUser, Info.GetName());
l["Wiki"] = Info.GetWikiPage();
if (pUser && pUser->GetModules().FindModule(Info.GetName())) {
l["Checked"] = "true";
@@ -1039,6 +1040,7 @@ public:
l["Name"] = Info.GetName();
l["Description"] = Info.GetDescription();
l["Args"] = GetModArgs(NULL, Info.GetName(), true);
l["Wiki"] = Info.GetWikiPage();
}
return true;
@@ -1124,4 +1126,8 @@ public:
}
};
template<> void TModInfo<CWebAdminMod>(CModInfo& Info) {
Info.SetWikiPage("webadmin");
}
GLOBALMODULEDEFS(CWebAdminMod, "Web based administration module")