summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-06-04 16:21:08 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-06-04 16:21:08 +0000
commit625d0a8916327ffe942fc8683291c6355e814963 (patch)
treec6521e70f0758f7959f91b1e0ee987526c060260 /protocols/SkypeWeb/src
parent85b8e59c6eaca1dd444789db06ffdd9582045c05 (diff)
SkypeWeb: Setting for place.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14000 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r--protocols/SkypeWeb/src/requests/capabilities.h9
-rw-r--r--protocols/SkypeWeb/src/resource.h3
-rw-r--r--protocols/SkypeWeb/src/skype_contacts.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp15
-rw-r--r--protocols/SkypeWeb/src/skype_options.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_options.h1
6 files changed, 23 insertions, 11 deletions
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 <http://www.gnu.org/licenses/>.
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<char> 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;