From 625d0a8916327ffe942fc8683291c6355e814963 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Thu, 4 Jun 2015 16:21:08 +0000 Subject: SkypeWeb: Setting for place. git-svn-id: http://svn.miranda-ng.org/main/trunk@14000 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/requests/capabilities.h | 9 ++------- protocols/SkypeWeb/src/resource.h | 3 ++- protocols/SkypeWeb/src/skype_contacts.cpp | 2 +- protocols/SkypeWeb/src/skype_login.cpp | 15 ++++++++++++++- protocols/SkypeWeb/src/skype_options.cpp | 4 +++- protocols/SkypeWeb/src/skype_options.h | 1 + 6 files changed, 23 insertions(+), 11 deletions(-) (limited to 'protocols/SkypeWeb/src') diff --git a/protocols/SkypeWeb/src/requests/capabilities.h b/protocols/SkypeWeb/src/requests/capabilities.h index 5ac258db10..bc965e5a9b 100644 --- a/protocols/SkypeWeb/src/requests/capabilities.h +++ b/protocols/SkypeWeb/src/requests/capabilities.h @@ -21,7 +21,7 @@ along with this program. If not, see . class SendCapabilitiesRequest : public HttpRequest { public: - SendCapabilitiesRequest(const char *regToken, const char *endpointID, const char *server = SKYPE_ENDPOINTS_HOST) : + SendCapabilitiesRequest(const char *regToken, const char *endpointID, const char *hostname, const char *server = SKYPE_ENDPOINTS_HOST) : HttpRequest(REQUEST_PUT, FORMAT, "%s/v1/users/ME/endpoints/%s/presenceDocs/messagingService", server, ptrA(mir_urlEncode(endpointID))) { Headers @@ -29,14 +29,9 @@ public: << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8") << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken); - - TCHAR compName[MAX_COMPUTERNAME_LENGTH + 1]; - DWORD size = SIZEOF(compName); - GetComputerName(compName, &size); - JSONNode privateInfo(JSON_NODE); privateInfo.set_name("privateInfo"); - privateInfo.push_back(JSONNode("epname", (char*)T2Utf(compName))); + privateInfo.push_back(JSONNode("epname", hostname)); JSONNode publicInfo(JSON_NODE); publicInfo.set_name("publicInfo"); diff --git a/protocols/SkypeWeb/src/resource.h b/protocols/SkypeWeb/src/resource.h index 0e6ade4cb5..43bc008820 100644 --- a/protocols/SkypeWeb/src/resource.h +++ b/protocols/SkypeWeb/src/resource.h @@ -26,6 +26,7 @@ #define IDC_TITLE 1031 #define IDC_CONTACT 1032 #define IDC_MESASUREAD 1033 +#define IDC_PLACE 1034 // Next default values for new objects // @@ -33,7 +34,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 124 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1034 +#define _APS_NEXT_CONTROL_VALUE 1035 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index fca06e2f91..1ca0f61b94 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -254,7 +254,7 @@ void CSkypeProto::LoadContactList(const NETLIBHTTPREQUEST *response) do { LIST users(1); - for (; i < skypenames.getCount() && users.getCount() < 20; i++) + for (; i < skypenames.getCount() && users.getCount() < 25; i++) { users.insert(skypenames[i]); } diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 056f3df9bc..28131e1062 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -141,8 +141,21 @@ void CSkypeProto::OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response) SetStatus(ID_STATUS_OFFLINE); return; } + char *cName; + ptrT place(getTStringA("Place")); - PushRequest(new SendCapabilitiesRequest(RegToken, EndpointId, Server), &CSkypeProto::OnCapabilitiesSended); + if (place && *place) + cName = mir_utf8encodeT(place); + else + { + char compName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD size = SIZEOF(compName); + GetComputerNameA(compName, &size); + cName = compName; + } + PushRequest(new SendCapabilitiesRequest(RegToken, EndpointId, cName, Server), &CSkypeProto::OnCapabilitiesSended); + + mir_free(cName); } void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp index 7ef8886381..a257514c70 100644 --- a/protocols/SkypeWeb/src/skype_options.cpp +++ b/protocols/SkypeWeb/src/skype_options.cpp @@ -24,12 +24,14 @@ CSkypeOptionsMain::CSkypeOptionsMain(CSkypeProto *proto, int idDialog) m_group(this, IDC_GROUP), m_autosync(this, IDC_AUTOSYNC), m_localtime(this, IDC_LOCALTIME), - m_allasunread(this, IDC_MESASUREAD) + m_allasunread(this, IDC_MESASUREAD), + m_place(this, IDC_PLACE) { CreateLink(m_group, SKYPE_SETTINGS_GROUP, _T("Skype")); CreateLink(m_autosync, "AutoSync", DBVT_BYTE, 1); CreateLink(m_localtime, "UseLocalTime", DBVT_BYTE, 0); CreateLink(m_allasunread, "MarkMesUnread", DBVT_BYTE, 0); + CreateLink(m_place, "Place", _T("")); } void CSkypeOptionsMain::OnInitDialog() diff --git a/protocols/SkypeWeb/src/skype_options.h b/protocols/SkypeWeb/src/skype_options.h index f9eeea1177..35a2a743e6 100644 --- a/protocols/SkypeWeb/src/skype_options.h +++ b/protocols/SkypeWeb/src/skype_options.h @@ -24,6 +24,7 @@ private: CCtrlEdit m_skypename; CCtrlEdit m_password; CCtrlEdit m_group; + CCtrlEdit m_place; CCtrlCheck m_autosync; CCtrlCheck m_localtime; CCtrlCheck m_allasunread; -- cgit v1.2.3