mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix several issues in modpython.
1. In several cases CString wasn't handled properly. 2. Some container-like object didn't return from functions properly. 3. Buffer.h was missing
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "../include/znc/FileUtils.h"
|
||||
#include "../include/znc/ZNCDebug.h"
|
||||
#include "../include/znc/ExecSock.h"
|
||||
#include "../include/znc/Buffer.h"
|
||||
#include "modpython/module.h"
|
||||
|
||||
#include "modpython/retstring.h"
|
||||
@@ -67,6 +68,10 @@ namespace std {
|
||||
}
|
||||
%}
|
||||
|
||||
%template(VIRCNetworks) std::vector<CIRCNetwork*>;
|
||||
%template(VChannels) std::vector<CChan*>;
|
||||
%template(MNicks) std::map<CString, CNick>;
|
||||
|
||||
%typemap(in) CString& {
|
||||
String* p;
|
||||
int res = SWIG_IsOK(SWIG_ConvertPtr($input, (void**)&p, SWIG_TypeQuery("String*"), 0));
|
||||
@@ -111,6 +116,7 @@ namespace std {
|
||||
%include "../include/znc/Server.h"
|
||||
%include "../include/znc/ZNCDebug.h"
|
||||
%include "../include/znc/ExecSock.h"
|
||||
%include "../include/znc/Buffer.h"
|
||||
|
||||
%include "modpython/module.h"
|
||||
|
||||
@@ -167,6 +173,9 @@ public:
|
||||
CString __repr__() {
|
||||
return "<CUser " + $self->GetUserName() + ">";
|
||||
}
|
||||
std::vector<CIRCNetwork*> GetNetworks_() {
|
||||
return $self->GetNetworks();
|
||||
}
|
||||
};
|
||||
|
||||
%extend CIRCNetwork {
|
||||
@@ -176,6 +185,9 @@ public:
|
||||
CString __repr__() {
|
||||
return "<CIRCNetwork " + $self->GetName() + ">";
|
||||
}
|
||||
std::vector<CChan*> GetChans_() {
|
||||
return $self->GetChans();
|
||||
}
|
||||
}
|
||||
|
||||
%extend CChan {
|
||||
@@ -185,6 +197,9 @@ public:
|
||||
CString __repr__() {
|
||||
return "<CChan " + $self->GetName() + ">";
|
||||
}
|
||||
std::map<CString, CNick> GetNicks_() {
|
||||
return $self->GetNicks();
|
||||
}
|
||||
};
|
||||
|
||||
%extend CNick {
|
||||
|
||||
Reference in New Issue
Block a user