diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-01-07 12:46:19 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-01-07 12:46:19 +0000 |
commit | 2d8ae354688e1a0cd015cd5e6563bfc9b21e0be4 (patch) | |
tree | 97854921190ed1e6b0735bde7a46f80f27619b77 /protocols | |
parent | b37e0bd58a5969b42f6feaf073afcdfe43330b41 (diff) |
VKontakte: rework stickers sending process (path by alitor, edited)
git-svn-id: http://svn.miranda-ng.org/main/trunk@11786 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 8df5807b8c..617da0c5eb 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -620,19 +620,25 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact) char* CVkProto::GetStickerId(const char* Msg, int &stickerid)
{
+ stickerid = 0;
+ char* retMsg = NULL;
+
int iRes = 0;
char HeadMsg[32] = { 0 };
- char* retMsg = NULL;
- iRes = sscanf(Msg, "[sticker:%d]", &stickerid);
+ const char * tmpMsg = strstr(Msg, "[sticker:");
+ if (tmpMsg)
+ iRes = sscanf(tmpMsg, "[sticker:%d]", &stickerid);
if (iRes == 1) {
mir_snprintf(HeadMsg, SIZEOF(HeadMsg), "[sticker:%d]", stickerid);
size_t retLen = mir_strlen(HeadMsg);
- if (retLen < mir_strlen(Msg))
- retMsg = mir_strdup(&Msg[retLen]);
- return retMsg;
+ if (retLen < mir_strlen(Msg)) {
+ CMStringA szMsg(Msg, mir_strlen(Msg) - mir_strlen(tmpMsg));
+ szMsg.Append(&tmpMsg[retLen]);
+ retMsg = mir_strdup(szMsg.GetBuffer());
+ }
}
- stickerid = 0;
- return NULL;
+
+ return retMsg;
}
int CVkProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam)
|