Commit Graph

28 Commits

Author SHA1 Message Date
Alexey Sokolov 9474c3dc09 Support ValidateWebRequestCSRFCheck in perl/python. Fix #1424 2017-12-17 22:10:41 +00:00
Alexey Sokolov ddd3023d5d Refactor default return values of callbacks of perl/python modules
See #1424
2017-12-17 22:03:47 +00:00
Eli Young 823ac07240 Add OnSendToIRCMessage and OnSendToClientMessage
This also alters PutClient such that the CMessage variant handles
sending messages, rather than the CString variant. As a side bonus, this
gives callers better information on whether the message was sent to the
client. Additionally, it eliminates the need for a hook to let modules
set the tags sent to a client, as that can now be done inside
OnSendToClientMessage.
2017-04-18 15:43:16 -07:00
Alexey Sokolov c803a85e13 Rename new On...Message modules callbacks to be more consistent.
OnPrivMessage -> OnPrivTextMessage
OnChanMessage -> OnChanTextMessage

Fix #1191
2016-12-25 15:48:29 +00:00
Alexey Sokolov 05bf1c0f5e Merge branch '1.6.x' 2016-07-31 10:37:38 +01:00
Alexey Sokolov dd58e369f8 Fix OnInvite in modpython and modperl.
They were silently not called.

Close #1283
2016-07-31 10:35:19 +01:00
Alexey Sokolov cbf5c38d0a Teach modperl and modpython about CMessage and new hooks which accept it.
Fix #1084
Fix #1085
2015-11-22 23:39:30 +00:00
OGAWA Hirofumi c6d093a53a Change to return the value from OnUserQuit() as request 2015-02-22 04:33:15 +09:00
OGAWA Hirofumi feec20b013 Add OnUserQuit() for extending clearbufferonmsg
Add OnUserQuit() callback. On smartphone, user doesn't want to see
same lines repeatedly. But, meanwhile, user doesn't want to miss lines
when connection was lost.

To do it, this uses OnUserQuit() callback. With this callback,
clearbufferonmsg can clear buffer if user quited client explicitly.
And when connection was lost, buffer is still not cleared.
2015-02-22 04:33:14 +09:00
Uli Schlachter de96cd95d0 modpython: Switch from CSmartPtr to std::shared_ptr
Patch by DarthGandalf, I just committed it to git.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-09-15 12:07:13 +02:00
Alexander Færøy db0e0995e2 Add OnJoining module hook.
This patch adds an OnJoining module hook that allows a module to allow
or disallow joining any given channel.
2014-05-29 23:10:30 +02:00
Alexey Sokolov 9cf61ac6d4 Argh, fuck it. Rename fixed (pointer) versions of OnMode to OnMode2 2014-04-12 08:51:04 +01:00
J-P Nurmi 76bfa99dd0 Add module hooks for raw client and server messages 2014-03-04 00:24:15 +01:00
Alexey Sokolov 618d9c58a4 Fix chansaver's channel keys by adding other OnMode() hooks 2014-02-27 00:49:45 +00:00
Alexey Sokolov 2a7bc29fcc Fix new OnAdd/DeleteNetwork hooks for perl/python 2013-11-09 10:17:34 +04:00
Alexey Sokolov ff755b8812 Modpython: support OnLoginAttempt.
So python part of #98 is completed.
2012-07-28 11:31:36 +07:00
Alexey Sokolov 219e6a97ce Support OnClientCapLs in modpython #98 2012-07-28 01:37:58 +07:00
Alexey Sokolov 5e711011c5 Support OnGetAvailableMods in python. #98
Currently this needs patched SWIG.
Upstream version crashes ZNC.
Hopefully they'll apply my patches upstream soon...
As for now, working modpython tarball is available at
http://people.znc.in/~darthgandalf/znc/modpython/
2012-07-27 01:02:04 +07:00
Kyle Fuller f4c2f911ae modpython: Remove some global module hooks which won't work
OnLoginAttempt
    OnClientCapLs
    OnGetAvailableMods
2012-02-28 15:51:16 +00:00
Kyle Fuller 961e3a81c6 modpython: Support global module hooks #98
The commit doesn't add support for the following module hooks:

    void OnClientCapLs(CClient* pClient, SCString& ssCaps)
    EModRet OnLoginAttempt(CSmartPtr<CAuthBase> Auth)

The reason for this is they do not currently work with codegen.pl
2012-02-26 15:03:25 +00:00
Alexey Sokolov c2cc57cbf4 Fix compilation of modpython. 2011-08-21 21:51:28 +07:00
Kyle Fuller b2d8f2ed62 Add CModInfo::SupportsType(EModuleType) and supply a module type with CModules::LoadModule
This would allow a module support multiple module types but CModule's do
not support this currently
2011-08-21 13:34:23 +01:00
Alexey Sokolov 0c9eae226e Fix global python modules. 2011-08-21 13:34:23 +01:00
Kyle Fuller 0b360c0102 Remove OnDCCUserSend module hook 2011-06-01 20:21:27 +01:00
Uli Schlachter 23fb4df67a Remove config-related module hooks
This removes the following module hooks:

OnConfigLine()
OnWriteConfig()
OnWriteUserConfig()
OnWriteChanConfig()

Modules could use these hooks for writing/reading their own stuff to/from
znc.conf. However, no module (ever?) did this and IMHO no module should ever do
this either. Modules can save stuff via SetNV(), module arguments (SetArgs())
and in their GetSavePath().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 17:29:49 +02:00
Kyle Fuller 7162b01111 Add the OnIRCConnectionError(CIRCSock *pIRCSock) module hook 2011-03-30 19:15:42 +01:00
darthgandalf 1d103351a9 Make modpython and modperl to work with new OnPart too.
Thanks, SilverLeo.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2216 726aef4b-f618-498e-8847-2d620e286838
2010-12-30 12:00:52 +00:00
darthgandalf a564e25c13 Add modpython module which allows to write ZNC modules on python3.
Notice for distro maintainers: perl interpreter is required to compile modpython.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2196 726aef4b-f618-498e-8847-2d620e286838
2010-12-22 14:52:53 +00:00