summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-07-13 19:11:30 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-07-13 19:11:30 +0000
commit432bd3d2f4c35472d1389b187cc572d20819cabf (patch)
tree0e6675c105b10c66035c6a78001b7795486856c6
parentceae4e57634e4ff9efe506e3e937006d16f4787f (diff)
SkypeWeb: fix "/me" sending
git-svn-id: http://svn.miranda-ng.org/main/trunk@14552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/SkypeWeb/src/requests/messages.h6
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h
index 198930fd65..1f4d4bc87d 100644
--- a/protocols/SkypeWeb/src/requests/messages.h
+++ b/protocols/SkypeWeb/src/requests/messages.h
@@ -42,7 +42,7 @@ public:
class SendActionRequest : public HttpRequest
{
public:
- SendActionRequest(const char *regToken, const char *username, time_t timestamp, const char *message, const char *server = SKYPE_ENDPOINTS_HOST) :
+ SendActionRequest(const char *regToken, const char *username, const char *selfusername, time_t timestamp, const char *message, const char *server = SKYPE_ENDPOINTS_HOST) :
HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/conversations/8:%s/messages", server, username)
{
Headers
@@ -51,14 +51,14 @@ public:
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8");
CMStringA content;
- content.AppendFormat("%s %s", username, message);
+ content.AppendFormat("%s %s", selfusername, message);
JSONNode node(JSON_NODE);
node.push_back(JSONNode("clientmessageid", (long)timestamp));
node.push_back(JSONNode("messagetype", "RichText"));
node.push_back(JSONNode("contenttype", "text"));
node.push_back(JSONNode("content", content));
- node.push_back(JSONNode("skypeemoteoffset", (int)(mir_strlen(username) + 1)));
+ node.push_back(JSONNode("skypeemoteoffset", (int)(mir_strlen(selfusername) + 1)));
Body << VALUE(node.write().c_str());
}
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index 5dbfbb78e0..8f74578b4f 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -76,7 +76,7 @@ int CSkypeProto::OnSendMessage(MCONTACT hContact, int, const char *szMessage)
delete[] buff;*/
if (strncmp(szMessage, "/me ", 4) == 0)
- SendRequest(new SendActionRequest(m_szRegToken, m_szSelfSkypeName, param->hMessage, &szMessage[4], m_szServer), &CSkypeProto::OnMessageSent, param);
+ SendRequest(new SendActionRequest(m_szRegToken, username, m_szSelfSkypeName, param->hMessage, &szMessage[4], m_szServer), &CSkypeProto::OnMessageSent, param);
else
SendRequest(new SendMessageRequest(m_szRegToken, username, param->hMessage, szMessage, m_szServer), &CSkypeProto::OnMessageSent, param);