diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-10-17 15:44:37 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-10-17 15:44:37 +0000 |
commit | 664d32a0cea975db58eda84aa6b6e943657bc7fa (patch) | |
tree | 8b42330fef0769dbc20cccb28799ef1e2f1c340a /protocols/VKontakte/src/vk_thread.cpp | |
parent | 33a897142ea5e2693ffc6e3daaad9218e88238f8 (diff) |
VKontakte:
more broadcast option (path by alitor)
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@10814 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 5d526189e5..d4c1b8f2fc 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -843,20 +843,30 @@ void CVkProto::RetrieveStatusMusic(const CMString &StatusMsg) CMString code;
CMString oldStatusMsg = db_get_tsa(0, m_szModuleName, "OldStatusMsg");
if (StatusMsg.IsEmpty()){
- if (oldStatusMsg.IsEmpty())
- code = "API.status.set();return null;";
+ if (oldStatusMsg.IsEmpty() || m_bAudioStatusOnly)
+ code = "API.audio.setBroadcast();return null;";
else{
- CMString codeformat("API.status.set({text:\"%s\"});return null;");
- code.AppendFormat(codeformat, oldStatusMsg);
+ CMString codeformat("API.status.set({text:\"%s\"});return null;");
+ code.AppendFormat(codeformat, oldStatusMsg);
}
}
else {
- CMString codeformat("var userID=%d;var StatusMsg=\"%s\";var oldStatus=API.status.get({\"user_id\":userID});"
- "var Track=API.audio.search({\"q\":StatusMsg,\"count\":1});if(Track.count==0){API.status.set({\"text\":StatusMsg});"
- "return oldStatus;}else{var owner=Track.items[0].owner_id;var trackID=Track.items[0].id;var audioTxt=owner+\"_\"+trackID;"
- "var ids=API.audio.setBroadcast({\"audio\":audioTxt});if(userID==ids[0]){return null;}else{"
- "API.status.set({\"text\":StatusMsg });return oldStatus;};};");
- code.AppendFormat(codeformat, m_myUserId, StatusMsg);
+ if (m_bAudioStatusOnly){
+ CMString codeformat("var StatusMsg=\"%s\";"
+ "var Track=API.audio.search({\"q\":StatusMsg,\"count\":1});"
+ "if(Track.count==0){API.audio.setBroadcast();}"
+ "else{var owner=Track.items[0].owner_id;var trackID=Track.items[0].id;var audioTxt=owner+\"_\"+trackID;"
+ "var ids=API.audio.setBroadcast({\"audio\":audioTxt});};return null;");
+ code.AppendFormat(codeformat, StatusMsg);
+ }
+ else{
+ CMString codeformat("var StatusMsg=\"%s\";"
+ "var Track=API.audio.search({\"q\":StatusMsg,\"count\":1});"
+ "if(Track.count==0){API.status.set({\"text\":StatusMsg});return null;}"
+ "else{var owner=Track.items[0].owner_id;var trackID=Track.items[0].id;var audioTxt=owner+\"_\"+trackID;"
+ "var ids=API.audio.setBroadcast({\"audio\":audioTxt});return null;};");
+ code.AppendFormat(codeformat, StatusMsg);
+ }
}
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveSmth)
<< TCHAR_PARAM("code", code)
|