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/skype_request.cpp | |
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/skype_request.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_request.cpp | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/protocols/SkypeWeb/src/skype_request.cpp b/protocols/SkypeWeb/src/skype_request.cpp index 4ba0fbd43a..9322ef8451 100644 --- a/protocols/SkypeWeb/src/skype_request.cpp +++ b/protocols/SkypeWeb/src/skype_request.cpp @@ -17,35 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-class SkypeResponseDelegate
+void SkypeHttpResponse(const NETLIBHTTPREQUEST *response, void *arg)
{
-private:
- CSkypeProto *proto;
- SkypeResponseCallback responseCallback;
- SkypeResponseWithArgCallback responseWithArgCallback;
-
- void *arg;
- bool hasArg;
-
-public:
- SkypeResponseDelegate(CSkypeProto *proto, SkypeResponseCallback responseCallback)
- : proto(proto), responseCallback(responseCallback), responseWithArgCallback(NULL), arg(NULL), hasArg(false) {}
-
- SkypeResponseDelegate(CSkypeProto *proto, SkypeResponseWithArgCallback responseCallback, void *arg)
- : proto(proto), responseCallback(NULL), responseWithArgCallback(responseCallback), arg(arg), hasArg(true) { }
-
- void Invoke(const NETLIBHTTPREQUEST *response)
- {
- if (hasArg)
- (proto->*(responseWithArgCallback))(response, arg);
- else
- (proto->*(responseCallback))(response);
- }
-};
-
-static void SkypeHttpResponse(const NETLIBHTTPREQUEST *response, void *arg)
-{
- SkypeResponseDelegate *delegate = (SkypeResponseDelegate*)arg;
+ SkypeResponseDelegateBase *delegate = (SkypeResponseDelegateBase*)arg;
delegate->Invoke(response);
delete delegate;
}
@@ -57,13 +31,13 @@ void CSkypeProto::PushRequest(HttpRequest *request) void CSkypeProto::PushRequest(HttpRequest *request, SkypeResponseCallback response)
{
- SkypeResponseDelegate *delegate = new SkypeResponseDelegate(this, response);
+ SkypeResponseDelegateBase *delegate = new SkypeResponseDelegate(this, response);
requestQueue->Push(request, SkypeHttpResponse, delegate);
}
void CSkypeProto::PushRequest(HttpRequest *request, SkypeResponseWithArgCallback response, void *arg)
{
- SkypeResponseDelegate *delegate = new SkypeResponseDelegate(this, response, arg);
+ SkypeResponseDelegateBase *delegate = new SkypeResponseDelegateWithArg(this, response, arg);
requestQueue->Push(request, SkypeHttpResponse, delegate);
}
@@ -74,12 +48,12 @@ void CSkypeProto::SendRequest(HttpRequest *request) void CSkypeProto::SendRequest(HttpRequest *request, SkypeResponseCallback response)
{
- SkypeResponseDelegate *delegate = new SkypeResponseDelegate(this, response);
+ SkypeResponseDelegateBase *delegate = new SkypeResponseDelegate(this, response);
requestQueue->Send(request, SkypeHttpResponse, delegate);
}
void CSkypeProto::SendRequest(HttpRequest *request, SkypeResponseWithArgCallback response, void *arg)
{
- SkypeResponseDelegate *delegate = new SkypeResponseDelegate(this, response, arg);
+ SkypeResponseDelegateBase *delegate = new SkypeResponseDelegateWithArg(this, response, arg);
requestQueue->Send(request, SkypeHttpResponse, delegate);
}
\ No newline at end of file |