diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-07-07 11:44:27 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-07-07 11:44:27 +0000 |
commit | 320ae2c5255401fa7237307f59064d49b27282a4 (patch) | |
tree | f45d93de2d7b81645387dfebd308af54b028c5af /protocols/SkypeWeb/src/stdafx.h | |
parent | 8f5d25a514c3c3bf0080accdfc39b5411ce068c0 (diff) |
SkypeWeb: status messages support
git-svn-id: http://svn.miranda-ng.org/main/trunk@17075 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/stdafx.h')
-rw-r--r-- | protocols/SkypeWeb/src/stdafx.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h index c4ade57724..a3840cfd3e 100644 --- a/protocols/SkypeWeb/src/stdafx.h +++ b/protocols/SkypeWeb/src/stdafx.h @@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <regex>
#include <map>
#include <memory>
+#include <functional>
#include <newpluginapi.h>
@@ -104,6 +105,7 @@ struct MessageId HANDLE handle;
};
+
//#include "websocket.h"
#include "version.h"
#include "resource.h"
@@ -133,6 +135,61 @@ struct MessageId #include "request_queue.h"
#include "skype_proto.h"
+void SkypeHttpResponse(const NETLIBHTTPREQUEST *response, void *arg);
+
+class SkypeResponseDelegateBase
+{
+protected:
+ CSkypeProto *proto;
+public:
+ SkypeResponseDelegateBase(CSkypeProto *ppro) : proto(ppro) {}
+ virtual void Invoke(const NETLIBHTTPREQUEST *) = 0;
+ virtual ~SkypeResponseDelegateBase(){};
+};
+
+class SkypeResponseDelegate : public SkypeResponseDelegateBase
+{
+ SkypeResponseCallback pfnResponseCallback;
+public:
+ SkypeResponseDelegate(CSkypeProto *ppro, SkypeResponseCallback callback) : SkypeResponseDelegateBase(ppro), pfnResponseCallback(callback) {}
+
+ virtual void Invoke(const NETLIBHTTPREQUEST *response) override
+ {
+ (proto->*(pfnResponseCallback))(response);
+ }
+};
+
+class SkypeResponseDelegateWithArg : public SkypeResponseDelegateBase
+{
+ SkypeResponseWithArgCallback pfnResponseCallback;
+ void *arg;
+public:
+ SkypeResponseDelegateWithArg(CSkypeProto *ppro, SkypeResponseWithArgCallback callback, void *p) :
+ SkypeResponseDelegateBase(ppro),
+ pfnResponseCallback(callback),
+ arg(p)
+ {}
+
+ virtual void Invoke(const NETLIBHTTPREQUEST *response) override
+ {
+ (proto->*(pfnResponseCallback))(response, arg);
+ }
+};
+
+template <typename F>
+class SkypeResponseDelegateLambda : public SkypeResponseDelegateBase
+{
+ F lCallback;
+public:
+ SkypeResponseDelegateLambda(CSkypeProto *ppro, F &callback) : SkypeResponseDelegateBase(ppro), lCallback(callback) {}
+
+ virtual void Invoke(const NETLIBHTTPREQUEST *response) override
+ {
+ lCallback(response);
+ }
+};
+
+
#define MODULE "Skype"
#define SKYPE_MAX_CONNECT_RETRIES 10
|