summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_proto.h
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-03-18 20:28:01 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-03-18 20:28:01 +0000
commit3364fd6b8bdc21692805302a4333e49b44590b2c (patch)
tree578dd1a7a5db05311add225a78c65cc2a7b03f6d /protocols/SkypeWeb/src/skype_proto.h
parentcd4a3aab6a6406bcaca07734848e57477db4485d (diff)
SkypeWeb:
- contact list loading - refactoring git-svn-id: http://svn.miranda-ng.org/main/trunk@12431 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_proto.h')
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h35
1 files changed, 6 insertions, 29 deletions
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index b704bd4133..286e562ab7 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -1,7 +1,7 @@
#ifndef _TOX_PROTO_H_
#define _TOX_PROTO_H_
-class RequestQueueItem;
+typedef void(CSkypeProto::*SkypeResponseCallback)(const NETLIBHTTPREQUEST *response);
struct CSkypeProto : public PROTO < CSkypeProto >
{
@@ -93,31 +93,8 @@ private:
INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
- // api response wrappers
- template<void(CSkypeProto::*ResponseCallback)(const NETLIBHTTPREQUEST *response)>
- static void HttpResponse(const NETLIBHTTPREQUEST *response, void *arg)
- {
- (((CSkypeProto*)arg)->*ResponseCallback)(response);
- }
-
- template<void(CSkypeProto::*ResponseCallback)(const JSONNODE *response)>
- static void JsonResponse(const NETLIBHTTPREQUEST *response, void *arg)
- {
- JSONROOT root(response->pData);
- (((CSkypeProto*)arg)->*ResponseCallback)(root);
- }
-
- void PushRequest(HttpRequest *request, HttpResponseCallback response = NULL, void *arg = NULL)
- {
- if (!cookies.empty())
- {
- CMStringA allCookies;
- for (std::map<std::string, std::string>::iterator cookie = cookies.begin(); cookie != cookies.end(); ++cookie)
- allCookies.AppendFormat("%s=%s; ", cookie->first.c_str(), cookie->second.c_str());
- request->SetCookie(allCookies);
- }
- requestQueue->Push(request, response, arg);
- }
+ // requests
+ void PushRequest(HttpRequest *request, SkypeResponseCallback response = NULL);
// icons
static IconInfo Icons[];
@@ -146,13 +123,13 @@ private:
void SetContactStatus(MCONTACT hContact, WORD status);
void SetAllContactsStatus(WORD status);
- MCONTACT GetContact(const char *login);
+ MCONTACT GetContact(const char *skypename);
- MCONTACT AddContact(const char *login, bool isTemporary = false);
+ MCONTACT AddContact(const char *skypename, bool isTemporary = false);
MCONTACT GetContactFromAuthEvent(MEVENT hEvent);
- void __cdecl LoadFriendList(void*);
+ void LoadContacts(const NETLIBHTTPREQUEST *response);
INT_PTR __cdecl OnRequestAuth(WPARAM hContact, LPARAM lParam);
INT_PTR __cdecl OnGrantAuth(WPARAM hContact, LPARAM);