Used for "server-dependent" caps which already rely on sending NEW and
DEL to client. This functionality is not yet available for caps added by
modules.
Currently, there is no usable wrapper for CModCommand for use within
bindings, so this commit adds a proxy class that adds itself as a
callback and allows implementing Python classes to implement commands
via __call__().
A completely synthetic example:
import znc
class foo(znc.Module):
module_types = [znc.CModInfo.UserModule]
def OnLoad(self, args, message):
self.AddHelpCommand()
self.AddCommand(FooCmd)
return True
class FooCmd(znc.Command):
cmd = 'foo'
args = foo.t_d('bar')
desc = foo.t_d('baz')
def __call__(self, line):
self.GetModule().PutModule('I have been foo’d!')
Fixes https://github.com/znc/znc/issues/198
'imp' was deprecated since python 3.3.
This removes the undocumented feature of loading python C extension as
ZNC module, but adds a test that python package can be loaded.
Bump python requirements to 3.4
The issue was triggered by CCoreTranslationMixin being parent of
CZNCSock, and DisableReadLine wasn't found as attribute anymore.
Thanks to obiw4n for report.
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.
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.