diff options
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_feed.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_messages.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 2 |
5 files changed, 7 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index d4af4c1a8c..3084ffa59e 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -799,11 +799,11 @@ char* CVkProto::GetStickerId(const char *Msg, int &stickerid) char *retMsg = nullptr;
int iRes = 0;
- char HeadMsg[32] = { 0 };
const char *tmpMsg = strstr(Msg, "[sticker:");
if (tmpMsg)
iRes = sscanf(tmpMsg, "[sticker:%d]", &stickerid);
if (iRes == 1) {
+ char HeadMsg[32] = { 0 };
mir_snprintf(HeadMsg, "[sticker:%d]", stickerid);
size_t retLen = mir_strlen(HeadMsg);
if (retLen < mir_strlen(Msg)) {
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index a6f6d4cfd6..d75f699e74 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -61,8 +61,10 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg) c->m_wszId = mir_wstrdup(sid);
SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, sid, wszTitle);
- if (si == nullptr)
+ if (si == nullptr) {
+ delete c;
return nullptr;
+ }
c->m_hContact = si->hContact;
setWString(si->hContact, "Nick", wszTitle);
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index e36d2332e1..7581f7f8bc 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -455,7 +455,6 @@ CVKNewsItem* CVkProto::GetVkNotificationsItem(const JSONNode &jnItem, OBJLIST<CV CMStringW wszType(jnItem["type"].as_mstring());
VKObjType vkFeedbackType = vkNull, vkParentType = vkNull;
- CMStringW wszNotificationTranslate = SpanVKNotificationType(wszType, vkFeedbackType, vkParentType);
const JSONNode &jnFeedback = jnItem["feedback"];
const JSONNode &jnParent = jnItem["parent"];
@@ -477,6 +476,7 @@ CVKNewsItem* CVkProto::GetVkNotificationsItem(const JSONNode &jnItem, OBJLIST<CV if (!wszFeedback.IsEmpty()) {
CMStringW wszNotificaton;
+ CMStringW wszNotificationTranslate = SpanVKNotificationType(wszType, vkFeedbackType, vkParentType);
wszNotificaton.AppendFormat(wszFeedback, wszNotificationTranslate.c_str(), vkNotification->wszText.c_str());
vkNotification->wszText = wszNotificaton;
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index 63d5ce317b..395f1818cd 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -101,7 +101,7 @@ void CVkProto::OnSendMessage(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) mid = jnResponse.as_int();
break;
case JSON_STRING:
- if (swscanf(jnResponse.as_mstring(), L"%d", &mid) != 1)
+ if (swscanf(jnResponse.as_mstring(), L"%u", &mid) != 1)
mid = 0;
break;
case JSON_ARRAY:
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index f2534e82f1..819389d0dc 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -823,9 +823,9 @@ INT_PTR __cdecl CVkProto::SvcDeleteFriend(WPARAM hContact, LPARAM flag) if (!IsOnline() || userID == VK_INVALID_USER || userID == VK_FEED_USER)
return 1;
- ptrW pwszNick(db_get_wsa(hContact, m_szModuleName, "Nick"));
if (flag == 0) {
CMStringW pwszMsg;
+ ptrW pwszNick(db_get_wsa(hContact, m_szModuleName, "Nick"));
pwszMsg.AppendFormat(TranslateT("Are you sure to delete %s from your friend list?"), IsEmpty(pwszNick) ? TranslateT("(Unknown contact)") : pwszNick);
if (IDNO == MessageBoxW(nullptr, pwszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
return 1;
|