Teach modperl and modpython about CMessage and new hooks which accept it.

Fix #1084
Fix #1085
This commit is contained in:
Alexey Sokolov
2015-11-22 23:38:04 +00:00
parent 11b19a63f1
commit cbf5c38d0a
9 changed files with 525 additions and 0 deletions

View File

@@ -106,6 +106,9 @@ class MCString : public std::map<CString, CString> {};
%template(VVString) std::vector<VCString>;
%template(VClients) std::vector<CClient*>;
#define REGISTER_ZNC_MESSAGE(M) \
%template(As_ ## M) CMessage::As<M>;
%typemap(in) CString& {
String* p;
int res = SWIG_IsOK(SWIG_ConvertPtr($input, (void**)&p, SWIG_TypeQuery("String*"), 0));
@@ -153,6 +156,7 @@ class MCString : public std::map<CString, CString> {};
%template(ZNCSocketManager) TSocketManager<CZNCSock>;
%include "../include/znc/Socket.h"
%include "../include/znc/FileUtils.h"
%include "../include/znc/Message.h"
%include "../include/znc/Modules.h"
%include "../include/znc/Nick.h"
%include "../include/znc/Chan.h"
@@ -291,6 +295,15 @@ class CPyRetBool {
}
};
%extend CMessage {
CString __str__() {
return $self->ToString();
}
CString __repr__() {
return $self->ToString();
}
};
%extend CZNC {
PyObject* GetUserMap_() {
PyObject* result = PyDict_New();