summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/misc.cpp61
-rw-r--r--protocols/VKontakte/src/vk_avatars.cpp2
-rw-r--r--protocols/VKontakte/src/vk_captcha.cpp2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp12
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp74
-rw-r--r--protocols/VKontakte/src/vk_files.cpp12
-rw-r--r--protocols/VKontakte/src/vk_history.cpp2
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp4
-rw-r--r--protocols/VKontakte/src/vk_options.cpp2
-rw-r--r--protocols/VKontakte/src/vk_pollserver.cpp6
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp6
-rw-r--r--protocols/VKontakte/src/vk_proto.h5
-rw-r--r--protocols/VKontakte/src/vk_queue.cpp2
-rw-r--r--protocols/VKontakte/src/vk_search.cpp18
-rw-r--r--protocols/VKontakte/src/vk_status.cpp2
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp44
-rw-r--r--protocols/VKontakte/src/vk_wallpost.cpp2
17 files changed, 128 insertions, 128 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 41f2c8c588..93f82571d3 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -373,7 +373,7 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, const JSONNode &jnNode)
else {
CMString msg;
msg.AppendFormat(TranslateT("Error %d. Data will not be sent or received."), iErrorCode);
- MsgPopup(NULL, msg.GetBuffer(), TranslateT("Error"), true);
+ MsgPopup(NULL, msg, TranslateT("Error"), true);
debugLogA("CVkProto::CheckJsonResult SendError");
}
break;
@@ -479,7 +479,7 @@ bool CVkProto::AutoFillForm(char *pBody, CMStringA &szAction, CMStringA& szResul
}
szResult = result;
- debugLogA("CVkProto::AutoFillForm result = \"%s\"", szResult.GetBuffer());
+ debugLogA("CVkProto::AutoFillForm result = \"%s\"", szResult);
return true;
}
@@ -697,7 +697,7 @@ void CVkProto::SetMirVer(MCONTACT hContact, int platform)
return;
if (bSetFlag)
- setTString(hContact, "MirVer", MirVer.GetBuffer());
+ setTString(hContact, "MirVer", MirVer);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -758,7 +758,7 @@ char* CVkProto::GetStickerId(const char* Msg, int &stickerid)
if (retLen < mir_strlen(Msg)) {
CMStringA szMsg(Msg, int(mir_strlen(Msg) - mir_strlen(tmpMsg)));
szMsg.Append(&tmpMsg[retLen]);
- retMsg = mir_strdup(szMsg.GetBuffer());
+ retMsg = mir_strdup(szMsg);
}
}
@@ -776,7 +776,7 @@ int CVkProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam)
CMStringA szListeningTo(m_szModuleName);
szListeningTo += "Enabled";
- if (!mir_strcmp(cws->szSetting, szListeningTo.GetBuffer())) {
+ if (!mir_strcmp(cws->szSetting, szListeningTo)) {
MusicSendMetod iOldMusicSendMetod = (MusicSendMetod)getByte("OldMusicSendMetod", sendBroadcastAndStatus);
if (cws->value.bVal == 0)
@@ -873,9 +873,9 @@ CMString CVkProto::GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC)
int iWidth = jnPhoto["width"].as_int();
int iHeight = jnPhoto["height"].as_int();
- tszRes.AppendFormat(_T("%s (%dx%d)"), SetBBCString(TranslateT("Photo"), iBBC, vkbbcUrl, tszLink.GetBuffer()).GetBuffer(), iWidth, iHeight);
+ tszRes.AppendFormat(_T("%s (%dx%d)"), SetBBCString(TranslateT("Photo"), iBBC, vkbbcUrl, tszLink), iWidth, iHeight);
if (m_iIMGBBCSupport)
- tszRes.AppendFormat(_T("\n\t[img]%s[/img]"), !tszPreviewLink.IsEmpty() ? tszPreviewLink.GetBuffer() : (!tszLink.IsEmpty() ? tszLink.GetBuffer() : _T("")));
+ tszRes.AppendFormat(_T("\n\t[img]%s[/img]"), !tszPreviewLink.IsEmpty() ? tszPreviewLink : (!tszLink.IsEmpty() ? tszLink : _T("")));
CMString tszText(jnPhoto["text"].as_mstring());
if (!tszText.IsEmpty())
tszRes += _T("\n") + tszText;
@@ -883,8 +883,7 @@ CMString CVkProto::GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC)
return tszRes;
}
-
-CMString CVkProto::SetBBCString(TCHAR *ptszString, BBCSupport iBBC, VKBBCType bbcType, TCHAR *tszAddString)
+CMString CVkProto::SetBBCString(LPCTSTR ptszString, BBCSupport iBBC, VKBBCType bbcType, LPCTSTR tszAddString)
{
CVKBBCItem bbcItem[] = {
{ vkbbcB, bbcNo, _T("%s") },
@@ -985,11 +984,11 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMString tszTitle(jnAudio["title"].as_mstring());
CMString tszUrl(jnAudio["url"].as_mstring());
CMString tszAudio;
- tszAudio.AppendFormat(_T("%s - %s"), tszArtist.GetBuffer(), tszTitle.GetBuffer());
+ tszAudio.AppendFormat(_T("%s - %s"), tszArtist, tszTitle);
res.AppendFormat(_T("%s: %s"),
- SetBBCString(TranslateT("Audio"), iBBC, vkbbcB).GetBuffer(),
- SetBBCString(tszAudio.GetBuffer(), iBBC, vkbbcUrl, tszUrl.GetBuffer()).GetBuffer());
+ SetBBCString(TranslateT("Audio"), iBBC, vkbbcB),
+ SetBBCString(tszAudio, iBBC, vkbbcUrl, tszUrl));
}
else if (tszType ==_T("video")) {
const JSONNode &jnVideo = jnAttach["video"];
@@ -1002,8 +1001,8 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMString tszUrl;
tszUrl.AppendFormat(_T("http://vk.com/video%d_%d"), ownerID, vid);
res.AppendFormat(_T("%s: %s"),
- SetBBCString(TranslateT("Video"), iBBC, vkbbcB).GetBuffer(),
- SetBBCString(tszTitle.GetBuffer(), iBBC, vkbbcUrl, tszUrl.GetBuffer()).GetBuffer());
+ SetBBCString(TranslateT("Video"), iBBC, vkbbcB),
+ SetBBCString(tszTitle, iBBC, vkbbcUrl, tszUrl));
}
else if (tszType == _T("doc")) {
const JSONNode &jnDoc = jnAttach["doc"];
@@ -1013,8 +1012,8 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMString tszTitle(jnDoc["title"].as_mstring());
CMString tszUrl(jnDoc["url"].as_mstring());
res.AppendFormat(_T("%s: %s"),
- SetBBCString(TranslateT("Document"), iBBC, vkbbcB).GetBuffer(),
- SetBBCString(tszTitle.GetBuffer(), iBBC, vkbbcUrl, tszUrl.GetBuffer()).GetBuffer());
+ SetBBCString(TranslateT("Document"), iBBC, vkbbcB),
+ SetBBCString(tszTitle, iBBC, vkbbcUrl, tszUrl));
}
else if (tszType == _T("wall")) {
const JSONNode &jnWall = jnAttach["wall"];
@@ -1027,8 +1026,8 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMString tszUrl;
tszUrl.AppendFormat(_T("http://vk.com/wall%d_%d"), fromID, id);
res.AppendFormat(_T("%s: %s"),
- SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, tszUrl.GetBuffer()).GetBuffer(),
- tszText.IsEmpty() ? _T(" ") : tszText.GetBuffer());
+ SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, tszUrl),
+ tszText.IsEmpty() ? _T(" ") : tszText);
const JSONNode &jnSubAttachments = jnWall["attachments"];
if (!jnSubAttachments.isnull()) {
@@ -1060,7 +1059,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
res.AppendFormat(_T("%s"), tszLink);
if (m_iIMGBBCSupport)
- res.AppendFormat(_T("[img]%s[/img]"), tszLink.GetBuffer());
+ res.AppendFormat(_T("[img]%s[/img]"), tszLink);
}
}
else if (tszType == _T("link")) {
@@ -1074,16 +1073,16 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMString tszImage(jnLink["image_src"].as_mstring());
res.AppendFormat(_T("%s: %s"),
- SetBBCString(TranslateT("Link"), iBBC, vkbbcB).GetBuffer(),
- SetBBCString(tszTitle.GetBuffer(), iBBC, vkbbcUrl, tszUrl.GetBuffer()).GetBuffer());
+ SetBBCString(TranslateT("Link"), iBBC, vkbbcB),
+ SetBBCString(tszTitle, iBBC, vkbbcUrl, tszUrl));
if (!tszImage.IsEmpty())
if (m_iIMGBBCSupport)
- res.AppendFormat(_T("\n\t%s: [img]%s[/img]"), TranslateT("Image"), tszImage.GetBuffer());
+ res.AppendFormat(_T("\n\t%s: [img]%s[/img]"), TranslateT("Image"), tszImage);
else
- res.AppendFormat(_T("\n\t%s: %s"), TranslateT("Image"), tszImage.GetBuffer());
+ res.AppendFormat(_T("\n\t%s: %s"), TranslateT("Image"), tszImage);
if (tszDescription)
- res.AppendFormat(_T("\n\t%s"), tszDescription.GetBuffer());
+ res.AppendFormat(_T("\n\t%s"), tszDescription);
}
else if (tszType == _T("gift")) {
const JSONNode &jnGift = jnAttach["gift"];
@@ -1100,14 +1099,14 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
}
if (tszLink.IsEmpty())
continue;
- res += SetBBCString(TranslateT("Gift"), iBBC, vkbbcUrl, tszLink.GetBuffer());
+ res += SetBBCString(TranslateT("Gift"), iBBC, vkbbcUrl, tszLink);
if (m_iIMGBBCSupport)
- res.AppendFormat(_T("\n\t[img]%s[/img]"), tszLink.GetBuffer());
+ res.AppendFormat(_T("\n\t[img]%s[/img]"), tszLink);
}
else
- res.AppendFormat(TranslateT("Unsupported or unknown attachment type: %s"), SetBBCString(tszType.GetBuffer(), iBBC, vkbbcB).GetBuffer());
+ res.AppendFormat(TranslateT("Unsupported or unknown attachment type: %s"), SetBBCString(tszType, iBBC, vkbbcB));
res.AppendChar('\n');
}
@@ -1165,11 +1164,11 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, BBCSupport iBBC)
tszBody.Replace(_T("\n"), _T("\n\t"));
CMString tszMes;
tszMes.AppendFormat(_T("%s %s %s %s:\n%s"),
- SetBBCString(TranslateT("Message from"), iBBC, vkbbcB).GetBuffer(),
- SetBBCString(tszNick.GetBuffer(), iBBC, vkbbcUrl, tszUrl.GetBuffer()).GetBuffer(),
- SetBBCString(TranslateT("at"), iBBC, vkbbcB).GetBuffer(),
+ SetBBCString(TranslateT("Message from"), iBBC, vkbbcB),
+ SetBBCString(tszNick, iBBC, vkbbcUrl, tszUrl),
+ SetBBCString(TranslateT("at"), iBBC, vkbbcB),
ttime,
- tszBody.GetBuffer());
+ tszBody);
if (!res.IsEmpty())
res.AppendChar(_T('\n'));
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp
index 85740be99c..f5a7046171 100644
--- a/protocols/VKontakte/src/vk_avatars.cpp
+++ b/protocols/VKontakte/src/vk_avatars.cpp
@@ -157,7 +157,7 @@ void CVkProto::SetAvatarUrl(MCONTACT hContact, CMString &tszUrl)
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, 0);
}
else {
- setTString(hContact, "AvatarUrl", tszUrl.GetBuffer());
+ setTString(hContact, "AvatarUrl", tszUrl);
setByte(hContact,"NeedNewAvatar", 1);
PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) };
AI.hContact = hContact;
diff --git a/protocols/VKontakte/src/vk_captcha.cpp b/protocols/VKontakte/src/vk_captcha.cpp
index 8064a3ea89..5725adb0e2 100644
--- a/protocols/VKontakte/src/vk_captcha.cpp
+++ b/protocols/VKontakte/src/vk_captcha.cpp
@@ -154,7 +154,7 @@ bool CVkProto::ApplyCaptcha(AsyncHttpRequest *pReq, const JSONNode &jnErrorNode)
return false;
CMStringA userReply;
- if (!RunCaptchaForm(szUrl.GetBuffer(), userReply))
+ if (!RunCaptchaForm(szUrl, userReply))
return false;
pReq << CHAR_PARAM("captcha_sid", szSid) << CHAR_PARAM("captcha_key", userReply.GetString());
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index c3e6514008..5eaab37ad1 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -47,7 +47,7 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg)
c = new CVkChatInfo(id);
if (!jnDlg.isnull()) {
tszTitle = jnDlg["title"].as_mstring();
- c->m_tszTopic = mir_tstrdup(!tszTitle.IsEmpty() ? tszTitle.GetBuffer() : _T(""));
+ c->m_tszTopic = mir_tstrdup(!tszTitle.IsEmpty() ? tszTitle : _T(""));
}
CMString sid;
@@ -57,7 +57,7 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg)
GCSESSION gcw = { sizeof(gcw) };
gcw.iType = GCW_CHATROOM;
gcw.pszModule = m_szModuleName;
- gcw.ptszName = tszTitle.GetBuffer();
+ gcw.ptszName = tszTitle;
gcw.ptszID = sid;
CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw);
@@ -139,7 +139,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
if (!jnInfo.isnull()) {
CMString tszTitle(jnInfo["title"].as_mstring());
if (tszTitle == cc->m_tszTopic) {
- cc->m_tszTopic = mir_tstrdup(tszTitle.GetBuffer());
+ cc->m_tszTopic = mir_tstrdup(tszTitle);
setTString(cc->m_hContact, "Nick", tszTitle);
GCDEST gcd = { m_szModuleName, cc->m_tszId, GC_EVENT_CHANGESESSIONAME };
@@ -182,7 +182,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
CMString fName(jnUser["first_name"].as_mstring());
CMString lName(jnUser["last_name"].as_mstring());
CMString tszNick = fName.Trim() + _T(" ") + lName.Trim();
- cu->m_tszNick = mir_tstrdup(tszNick.GetBuffer());
+ cu->m_tszNick = mir_tstrdup(tszNick);
cu->m_bUnknown = false;
if (bNew) {
@@ -273,7 +273,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, bool bIsHistory)
}
if (cc->m_bHistoryRead)
- AppendChatMessage(cc, uid, msgTime, tszBody.GetBuffer(), bIsHistory);
+ AppendChatMessage(cc, uid, msgTime, tszBody, bIsHistory);
else {
CVkChatMessage *cm = cc->m_msgs.find((CVkChatMessage *)&mid);
if (cm == NULL)
@@ -281,7 +281,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, bool bIsHistory)
cm->m_uid = uid;
cm->m_date = msgTime;
- cm->m_tszBody = mir_tstrdup(tszBody.GetBuffer());
+ cm->m_tszBody = mir_tstrdup(tszBody);
cm->m_bHistory = bIsHistory;
}
}
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index ade52f1382..1ee1c184a1 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -154,7 +154,7 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo
if (!tszText.IsEmpty())
tszText += _T("\n");
- debugLog(_T("CVkProto::GetVkNewsItem %d %d %s <%s>"), iSourceId, iPostId, vkNewsItem->tszType.GetBuffer(), tszText.GetBuffer());
+ debugLog(_T("CVkProto::GetVkNewsItem %d %d %s <%s>"), iSourceId, iPostId, vkNewsItem->tszType, tszText);
if (vkNewsItem->tszType == _T("photo_tag")) {
bPostLink = false;
@@ -219,17 +219,17 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo
}
vkNewsItem->tszText.AppendFormat(tszResFormat,
- SetBBCString(vkNewsItem->vkUser->m_tszUserNick.GetBuffer(), m_iBBCForNews, vkbbcUrl,
- vkNewsItem->vkUser->m_tszLink.GetBuffer()), tszText.GetBuffer());
+ SetBBCString(vkNewsItem->vkUser->m_tszUserNick, m_iBBCForNews, vkbbcUrl,
+ vkNewsItem->vkUser->m_tszLink), tszText);
vkNewsItem->tszId.AppendFormat(_T("%d_%d"), vkNewsItem->vkUser->m_UserId, iPostId);
if (bPostLink) {
vkNewsItem->tszLink = CMString(_T("https://vk.com/wall")) + vkNewsItem->tszId;
vkNewsItem->tszText.AppendChar(_T('\n'));
- vkNewsItem->tszText += SetBBCString(TranslateT("Link"), m_iBBCForNews, vkbbcUrl, vkNewsItem->tszLink.GetBuffer());
+ vkNewsItem->tszText += SetBBCString(TranslateT("Link"), m_iBBCForNews, vkbbcUrl, vkNewsItem->tszLink);
}
- debugLog(_T("CVkProto::GetVkNewsItem %d %d <%s> <%s>"), iSourceId, iPostId, vkNewsItem->tszText.GetBuffer(), tszText.GetBuffer());
+ debugLog(_T("CVkProto::GetVkNewsItem %d %d <%s> <%s>"), iSourceId, iPostId, vkNewsItem->tszText, tszText);
return vkNewsItem;
}
@@ -266,9 +266,9 @@ CMString CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbac
vkUser = GetVkUserInfo(iUserId, vkUsers);
if (!tszUsers.IsEmpty())
tszUsers += _T(", ");
- tszUsers += SetBBCString(vkUser->m_tszUserNick.GetBuffer(), m_iBBCForNews, vkbbcUrl, vkUser->m_tszLink.GetBuffer());
+ tszUsers += SetBBCString(vkUser->m_tszUserNick, m_iBBCForNews, vkbbcUrl, vkUser->m_tszLink);
}
- tszRes.AppendFormat(_T("%s %%s %%s"), tszUsers.GetBuffer());
+ tszRes.AppendFormat(_T("%s %%s %%s"), tszUsers);
vkUser = NULL;
iUserId = 0;
}
@@ -277,13 +277,13 @@ CMString CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbac
vkUser = GetVkUserInfo(iUserId, vkUsers);
CMString tszText(jnFeedback["text"].as_mstring());
tszText.Replace(_T("%"), _T("%%"));
- tszRes.AppendFormat(tszFormat, SetBBCString(vkUser->m_tszUserNick.GetBuffer(), m_iBBCForNews, vkbbcUrl, vkUser->m_tszLink.GetBuffer()), ClearFormatNick(tszText).GetBuffer());
+ tszRes.AppendFormat(tszFormat, SetBBCString(vkUser->m_tszUserNick, m_iBBCForNews, vkbbcUrl, vkUser->m_tszLink), ClearFormatNick(tszText));
}
return tszRes;
}
-CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentType, TCHAR *ptszReplyText, TCHAR *ptszReplyLink)
+CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentType, LPCTSTR ptszReplyText, LPCTSTR ptszReplyLink)
{
debugLogA("CVkProto::GetVkParent");
CMString tszRes;
@@ -297,48 +297,48 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT
LONG iOwnerId = jnParent["owner_id"].as_int();
LONG iId = jnParent["id"].as_int();
vkNotificationItem->tszId.AppendFormat(_T("%d_%d"), iOwnerId, iId);
- vkNotificationItem->tszLink.AppendFormat(_T("https://vk.com/photo%s"), vkNotificationItem->tszId.GetBuffer());
- vkNotificationItem->tszText.AppendFormat(_T("\n%s"), tszPhoto.GetBuffer());
+ vkNotificationItem->tszLink.AppendFormat(_T("https://vk.com/photo%s"), vkNotificationItem->tszId);
+ vkNotificationItem->tszText.AppendFormat(_T("\n%s"), tszPhoto);
if (ptszReplyText)
- vkNotificationItem->tszText.AppendFormat(_T("\n>> %s"), SetBBCString(ptszReplyText, m_iBBCForNews, vkbbcI).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n>> %s"), SetBBCString(ptszReplyText, m_iBBCForNews, vkbbcI));
- vkNotificationItem->tszText.AppendFormat(_T("\n%s"), SetBBCString(TranslateT("Link"), m_iBBCForNews, vkbbcUrl, vkNotificationItem->tszLink.GetBuffer()).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n%s"), SetBBCString(TranslateT("Link"), m_iBBCForNews, vkbbcUrl, vkNotificationItem->tszLink));
}
else if (vkParentType == vkVideo) {
LONG iOwnerId = jnParent["owner_id"].as_int();
LONG iId = jnParent["id"].as_int();
CMString tszTitle(jnParent["title"].as_mstring());
vkNotificationItem->tszId.AppendFormat(_T("%d_%d"), iOwnerId, iId);
- vkNotificationItem->tszLink.AppendFormat(_T("https://vk.com/video%s"), vkNotificationItem->tszId.GetBuffer());
+ vkNotificationItem->tszLink.AppendFormat(_T("https://vk.com/video%s"), vkNotificationItem->tszId);
CMString tszText(jnParent["text"].as_mstring());
ClearFormatNick(tszText);
if (!tszText.IsEmpty())
- vkNotificationItem->tszText.AppendFormat(_T("\n%s: %s"), SetBBCString(TranslateT("Video description:"), m_iBBCForNews, vkbbcB), SetBBCString(tszText.GetBuffer(), m_iBBCForNews, vkbbcI).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n%s: %s"), SetBBCString(TranslateT("Video description:"), m_iBBCForNews, vkbbcB), SetBBCString(tszText, m_iBBCForNews, vkbbcI));
if (ptszReplyText)
- vkNotificationItem->tszText.AppendFormat(_T("\n>> %s"), SetBBCString(ptszReplyText, m_iBBCForNews, vkbbcI).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n>> %s"), SetBBCString(ptszReplyText, m_iBBCForNews, vkbbcI));
- vkNotificationItem->tszText.AppendFormat(_T("\n%s"), SetBBCString(tszTitle.GetBuffer(), m_iBBCForNews, vkbbcUrl, vkNotificationItem->tszLink.GetBuffer()).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n%s"), SetBBCString(tszTitle, m_iBBCForNews, vkbbcUrl, vkNotificationItem->tszLink));
}
else if (vkParentType == vkPost) {
LONG iOwnerId = jnParent["from_id"].as_int();
LONG iId = jnParent["id"].as_int();
vkNotificationItem->tszId.AppendFormat(_T("%d_%d"), iOwnerId, iId);
- vkNotificationItem->tszLink.AppendFormat(_T("https://vk.com/wall%s%s"), vkNotificationItem->tszId.GetBuffer(), ptszReplyLink ? ptszReplyLink : _T(""));
+ vkNotificationItem->tszLink.AppendFormat(_T("https://vk.com/wall%s%s"), vkNotificationItem->tszId, ptszReplyLink ? ptszReplyLink : _T(""));
CMString tszText(jnParent["text"].as_mstring());
ClearFormatNick(tszText);
if (!tszText.IsEmpty())
- vkNotificationItem->tszText.AppendFormat(_T("\n%s: %s"), SetBBCString(TranslateT("Post text:"), m_iBBCForNews, vkbbcB), SetBBCString(tszText.GetBuffer(), m_iBBCForNews, vkbbcI).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n%s: %s"), SetBBCString(TranslateT("Post text:"), m_iBBCForNews, vkbbcB), SetBBCString(tszText, m_iBBCForNews, vkbbcI));
if (ptszReplyText)
- vkNotificationItem->tszText.AppendFormat(_T("\n>> %s"), SetBBCString(ptszReplyText, m_iBBCForNews, vkbbcI).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n>> %s"), SetBBCString(ptszReplyText, m_iBBCForNews, vkbbcI));
- vkNotificationItem->tszText.AppendFormat(_T("\n%s"), SetBBCString(TranslateT("Link"), m_iBBCForNews, vkbbcUrl, vkNotificationItem->tszLink.GetBuffer()).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n%s"), SetBBCString(TranslateT("Link"), m_iBBCForNews, vkbbcUrl, vkNotificationItem->tszLink));
}
else if (vkParentType == vkTopic) {
LONG iOwnerId = jnParent["owner_id"].as_int();
@@ -346,18 +346,18 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT
CMString tszTitle(jnParent["title"].as_mstring());
vkNotificationItem->tszId.AppendFormat(_T("%d_%d"), iOwnerId, iId);
vkNotificationItem->tszLink.AppendFormat(_T("https://vk.com/topic%s%s"),
- vkNotificationItem->tszId.GetBuffer(), ptszReplyLink ? ptszReplyLink : _T(""));
+ vkNotificationItem->tszId, ptszReplyLink ? ptszReplyLink : _T(""));
CMString tszText(jnParent["text"].as_mstring());
ClearFormatNick(tszText);
if (!tszText.IsEmpty())
- vkNotificationItem->tszText.AppendFormat(_T("\n%s: %s"), SetBBCString(TranslateT("Topic text:"), m_iBBCForNews, vkbbcB), SetBBCString(tszText.GetBuffer(), m_iBBCForNews, vkbbcI).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n%s: %s"), SetBBCString(TranslateT("Topic text:"), m_iBBCForNews, vkbbcB), SetBBCString(tszText, m_iBBCForNews, vkbbcI));
if (ptszReplyText)
- vkNotificationItem->tszText.AppendFormat(_T("\n>> %s"), SetBBCString(ptszReplyText, m_iBBCForNews, vkbbcI).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n>> %s"), SetBBCString(ptszReplyText, m_iBBCForNews, vkbbcI));
- vkNotificationItem->tszText.AppendFormat(_T("\n%s"), SetBBCString(tszTitle.GetBuffer(), m_iBBCForNews, vkbbcUrl, vkNotificationItem->tszLink.GetBuffer()).GetBuffer());
+ vkNotificationItem->tszText.AppendFormat(_T("\n%s"), SetBBCString(tszTitle, m_iBBCForNews, vkbbcUrl, vkNotificationItem->tszLink));
}
else if (vkParentType == vkComment) {
CMString tszText(jnParent["text"].as_mstring());
@@ -366,13 +366,13 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT
const JSONNode &jnPhoto = jnParent["photo"];
if (!jnPhoto.isnull()) {
delete vkNotificationItem;
- return GetVkParent(jnPhoto, vkPhoto, tszText.IsEmpty() ? NULL : tszText.GetBuffer());
+ return GetVkParent(jnPhoto, vkPhoto, tszText);
}
const JSONNode &jnVideo = jnParent["video"];
if (!jnVideo.isnull()) {
delete vkNotificationItem;
- return GetVkParent(jnVideo, vkVideo, tszText.IsEmpty() ? NULL : tszText.GetBuffer());
+ return GetVkParent(jnVideo, vkVideo, tszText);
}
LONG iId = jnParent["id"].as_int();
@@ -382,7 +382,7 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT
CMString tszRepl;
tszRepl.AppendFormat(_T("?reply=%d"), iId);
delete vkNotificationItem;
- return GetVkParent(jnPost, vkPost, tszText.IsEmpty() ? NULL : tszText.GetBuffer(), tszRepl.GetBuffer());
+ return GetVkParent(jnPost, vkPost, tszText, tszRepl);
}
const JSONNode &jnTopic = jnParent["topic"];
@@ -390,7 +390,7 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT
CMString tszRepl;
tszRepl.AppendFormat(_T("?reply=%d"), iId);
delete vkNotificationItem;
- return GetVkParent(jnTopic, vkTopic, tszText.IsEmpty() ? NULL : tszText.GetBuffer(), tszRepl.GetBuffer());
+ return GetVkParent(jnTopic, vkTopic, tszText, tszRepl);
}
}
@@ -424,7 +424,7 @@ CVKNewsItem* CVkProto::GetVkNotificationsItem(const JSONNode &jnItem, OBJLIST<CV
if (vkNotification && !tszFeedback.IsEmpty()) {
CMString tszNotificaton;
- tszNotificaton.AppendFormat(tszFeedback, tszNotificationTranslate.GetBuffer(), vkNotification->tszText.GetBuffer());
+ tszNotificaton.AppendFormat(tszFeedback, tszNotificationTranslate, vkNotification->tszText);
vkNotification->tszText = tszNotificaton;
vkNotification->tszType = tszType;
vkNotification->tDate = jnItem["date"].as_int();
@@ -470,12 +470,12 @@ CVKNewsItem* CVkProto::GetVkGroupInvates(const JSONNode &jnItem, OBJLIST<CVkUser
CMString tszGroupName, tszGLink;
CMString tszGName = jnItem["name"].as_mstring();
- tszGLink.AppendFormat(_T("https://vk.com/%s"), jnItem["screen_name"].as_mstring().GetBuffer());
- tszGroupName = SetBBCString(tszGName.GetBuffer(), m_iBBCForNews, vkbbcUrl, tszGLink.GetBuffer());
+ tszGLink.AppendFormat(_T("https://vk.com/%s"), jnItem["screen_name"].as_mstring());
+ tszGroupName = SetBBCString(tszGName, m_iBBCForNews, vkbbcUrl, tszGLink);
- CMString tszUsers = SetBBCString(vkNotification->vkUser->m_tszUserNick.GetBuffer(), m_iBBCForNews, vkbbcUrl, vkNotification->vkUser->m_tszLink.GetBuffer());
+ CMString tszUsers = SetBBCString(vkNotification->vkUser->m_tszUserNick, m_iBBCForNews, vkbbcUrl, vkNotification->vkUser->m_tszLink);
- vkNotification->tszText.AppendFormat(_T("%s %s %s"), tszUsers.GetBuffer(), tszNotificationTranslate.GetBuffer(), tszGroupName.GetBuffer());
+ vkNotification->tszText.AppendFormat(_T("%s %s %s"), tszUsers, tszNotificationTranslate, tszGroupName);
tszIds += tszId;
setTString("InviteGroupIds", tszIds);
@@ -530,8 +530,8 @@ void CVkProto::RetrieveUnreadNews(time_t tLastNewsTime)
<< INT_PARAM("return_banned", m_bNewsSourceIncludeBanned ? 1 : 0)
<< INT_PARAM("max_photos", m_iMaxLoadNewsPhoto)
<< INT_PARAM("start_time", tLastNewsTime + 1)
- << CHAR_PARAM("filters", szFilter.GetBuffer())
- << CHAR_PARAM("source_ids", szSource.GetBuffer())
+ << CHAR_PARAM("filters", szFilter)
+ << CHAR_PARAM("source_ids", szSource)
<< VER_API);
}
@@ -592,7 +592,7 @@ void CVkProto::RetrieveUnreadNotifications(time_t tLastNotificationsTime)
m_bNotificationFilterInvites ? _T(",\"groupinvates\":API.groups.getInvites({\"extended\":1})};") : _T("};"));
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveUnreadNotifications)
- << TCHAR_PARAM("code", code.GetBuffer())
+ << TCHAR_PARAM("code", code)
<< VER_API);
}
diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp
index 3cfbf27894..c4d528fc39 100644
--- a/protocols/VKontakte/src/vk_files.cpp
+++ b/protocols/VKontakte/src/vk_files.cpp
@@ -50,7 +50,7 @@ CVkFileUploadParam::VKFileType CVkFileUploadParam::GetType()
CMStringA fn;
T2Utf pszFNAME(FNAME), pszEXT(EXT);
fn.AppendFormat("%s%s", pszFNAME, pszEXT);
- fname = mir_strdup(fn.GetBuffer());
+ fname = mir_strdup(fn);
if (tlstrstr(img, EXT)) {
filetype = CVkFileUploadParam::typeImg;
@@ -112,7 +112,7 @@ void CVkProto::SendFileFiled(CVkFileUploadParam *fup, TCHAR *reason)
default:
tszError = TranslateT("Unknown error occurred");
}
- MsgPopup(NULL, tszError.GetBuffer(), TranslateT("File upload error"), true);
+ MsgPopup(NULL, tszError, TranslateT("File upload error"), true);
delete fup;
}
@@ -193,7 +193,7 @@ void CVkProto::OnReciveUploadServer(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
}
fseek(pFile, 0, SEEK_SET);
- AsyncHttpRequest *pUploadReq = new AsyncHttpRequest(this, REQUEST_POST, uri.GetBuffer(), false, &CVkProto::OnReciveUpload);
+ AsyncHttpRequest *pUploadReq = new AsyncHttpRequest(this, REQUEST_POST, uri, false, &CVkProto::OnReciveUpload);
pUploadReq->m_bApiReq = false;
pUploadReq->m_szParam = "";
CMStringA boundary, header;
@@ -205,8 +205,8 @@ void CVkProto::OnReciveUploadServer(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
int iboundary = rand();
boundary.AppendFormat("Miranda%dNG%d", iboundary, time(NULL));
// Header
- header.AppendFormat("multipart/form-data; boundary=%s", boundary.GetBuffer());
- pUploadReq->AddHeader("Content-Type", header.GetBuffer());
+ header.AppendFormat("multipart/form-data; boundary=%s", boundary);
+ pUploadReq->AddHeader("Content-Type", header);
// Content-Disposition {
CMStringA DataBegin = "--";
DataBegin += boundary;
@@ -369,7 +369,7 @@ void CVkProto::OnReciveUploadFile(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR
AsyncHttpRequest *pMsgReq = new AsyncHttpRequest(this, REQUEST_POST, "/method/messages.send.json", true, &CVkProto::OnSendMessage, AsyncHttpRequest::rpHigh)
<< INT_PARAM("user_id", userID)
<< TCHAR_PARAM("message", fup->Desc)
- << TCHAR_PARAM("attachment", Attachment.GetBuffer())
+ << TCHAR_PARAM("attachment", Attachment)
<< VER_API;
pMsgReq->AddHeader("Content-Type", "application/x-www-form-urlencoded");
pMsgReq->pUserInfo = new CVkSendMsgParam(fup->hContact, -1, (int)pReq->pUserInfo);
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp
index 7d0726d27a..ac3965f7dd 100644
--- a/protocols/VKontakte/src/vk_history.cpp
+++ b/protocols/VKontakte/src/vk_history.cpp
@@ -213,7 +213,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque
tszBody += tszAttachmentDescr;
}
- T2Utf pszBody(tszBody.GetBuffer());
+ T2Utf pszBody(tszBody);
MCONTACT hContact = FindUser(uid, true);
PROTORECVEVENT recv = { 0 };
if (isRead)
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index 3020907d3a..03d946045e 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -237,7 +237,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
if (chat_id != 0) {
debugLogA("CVkProto::OnReceiveMessages chat_id != 0");
CMString action_chat = jnMsg["action"].as_mstring();
- int action_mid = _ttoi(jnMsg["action_mid"].as_mstring().GetBuffer());
+ int action_mid = _ttoi(jnMsg["action_mid"].as_mstring());
if ((action_chat == "chat_kick_user") && (action_mid == m_myUserId))
KickFromChat(chat_id, uid, jnMsg);
else
@@ -253,7 +253,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
else if (m_bUserForceOnlineOnActivity)
SetInvisible(hContact);
- T2Utf pszBody(tszBody.GetBuffer());
+ T2Utf pszBody(tszBody);
recv.timestamp = m_bUseLocalTime ? time(NULL) : datetime;
recv.szMessage = pszBody;
recv.lParam = isOut;
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp
index 0e169aceb9..a75d44213a 100644
--- a/protocols/VKontakte/src/vk_options.cpp
+++ b/protocols/VKontakte/src/vk_options.cpp
@@ -327,7 +327,7 @@ INT_PTR CALLBACK CVkProto::OptionsAdvProc(HWND hwndDlg, UINT uMsg, WPARAM wParam
ppro->setByte("MusicSendMetod", ppro->m_iMusicSendMetod);
CMStringA szListeningTo(ppro->m_szModuleName);
szListeningTo += "Enabled";
- db_set_b(NULL, "ListeningTo", szListeningTo.GetBuffer(), ppro->m_iMusicSendMetod == 0 ? 0 : 1);
+ db_set_b(NULL, "ListeningTo", szListeningTo, ppro->m_iMusicSendMetod == 0 ? 0 : 1);
TCHAR buffer[5] = { 0 };
GetDlgItemText(hwndDlg, IDC_ED_INT_INVIS, buffer, SIZEOF(buffer));
diff --git a/protocols/VKontakte/src/vk_pollserver.cpp b/protocols/VKontakte/src/vk_pollserver.cpp
index 3a66e994ac..350bbf1081 100644
--- a/protocols/VKontakte/src/vk_pollserver.cpp
+++ b/protocols/VKontakte/src/vk_pollserver.cpp
@@ -42,8 +42,8 @@ void CVkProto::OnReceivePollingInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
itoa(jnResponse["ts"].as_int(), ts, 10);
m_pollingTs = mir_strdup(ts);
- m_pollingKey = mir_t2a(jnResponse["key"].as_mstring().GetBuffer());
- m_pollingServer = mir_t2a(jnResponse["server"].as_mstring().GetBuffer());
+ m_pollingKey = mir_t2a(jnResponse["key"].as_mstring());
+ m_pollingServer = mir_t2a(jnResponse["server"].as_mstring());
if (!m_hPollingThread) {
debugLogA("CVkProto::OnReceivePollingInfo m_hPollingThread is NULL");
@@ -174,7 +174,7 @@ int CVkProto::PollServer()
// see mode parametr description on https://vk.com/dev/using_longpoll (Russian version)
NETLIBHTTPREQUEST req = { sizeof(req) };
req.requestType = REQUEST_GET;
- req.szUrl = mir_strdup(szReqUrl.GetBuffer());
+ req.szUrl = mir_strdup(szReqUrl);
req.flags = VK_NODUMPHEADERS | NLHRF_PERSISTENT | NLHRF_HTTP11 | NLHRF_SSL;
req.timeout = 30000;
req.nlc = m_pollingConn;
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index c8b4b5ed45..ae7bb7e818 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -83,7 +83,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
m_iSyncHistoryMetod = (SyncHistoryMetod)getByte("SyncHistoryMetod", syncOff);
CMStringA szListeningTo(m_szModuleName);
szListeningTo += "Enabled";
- db_set_b(NULL, "ListeningTo", szListeningTo.GetBuffer(), m_iMusicSendMetod == 0 ? 0 : 1);
+ db_set_b(NULL, "ListeningTo", szListeningTo, m_iMusicSendMetod == 0 ? 0 : 1);
m_bNewsEnabled = getBool("NewsEnabled", false);
m_iMaxLoadNewsPhoto = getByte("MaxLoadNewsPhoto", 5);
@@ -548,8 +548,8 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
tszNick = ptrT(db_get_tsa(param->hContact, m_szModuleName, "Nick"));
if (tszNick.IsEmpty())
tszNick = TranslateT("(Unknown contact)");
- msg.AppendFormat(TranslateT("User %s added as friend"), tszNick.GetBuffer());
- MsgPopup(param->hContact, msg.GetBuffer(), tszNick.GetBuffer());
+ msg.AppendFormat(TranslateT("User %s added as friend"), tszNick);
+ MsgPopup(param->hContact, msg, tszNick);
}
}
else {
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index 91beb7f09f..b244550e72 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -359,7 +359,7 @@ struct CVkProto : public PROTO<CVkProto>
CVKNewsItem* GetVkGroupInvates(const JSONNode &jnItem, OBJLIST<CVkUserInfo> &vkUsers);
CVKNewsItem* GetVkNotificationsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo> &vkUsers);
CMString GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbackType, OBJLIST<CVkUserInfo> &vkUsers, CVkUserInfo *vkUser);
- CVKNewsItem* GetVkParent(const JSONNode &jnParent, VKObjType vkParentType, TCHAR *ptszReplyText = NULL, TCHAR *ptszReplyLink = NULL);
+ CVKNewsItem* GetVkParent(const JSONNode &jnParent, VKObjType vkParentType, LPCTSTR ptszReplyText = NULL, LPCTSTR ptszReplyLink = NULL);
void RetrieveUnreadNews(time_t tLastNewsTime);
void OnReceiveUnreadNews(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
@@ -407,7 +407,8 @@ struct CVkProto : public PROTO<CVkProto>
CMString SpanVKNotificationType(CMString& tszType, VKObjType& vkFeedback, VKObjType& vkParent);
CMString GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC);
- CMString SetBBCString(TCHAR *tszString, BBCSupport iBBC, VKBBCType bbcType, TCHAR *tszAddString = NULL);
+
+ CMString SetBBCString(LPCTSTR tszString, BBCSupport iBBC, VKBBCType bbcType, LPCTSTR tszAddString = NULL);
CMString& ClearFormatNick(CMString& tszText);
CMString GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport iBBC = bbcNo);
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp
index 4934c3a29f..683dafdc86 100644
--- a/protocols/VKontakte/src/vk_queue.cpp
+++ b/protocols/VKontakte/src/vk_queue.cpp
@@ -44,7 +44,7 @@ void CVkProto::ExecuteRequest(AsyncHttpRequest *pReq)
pReq->szUrl = str.GetBuffer();
}
else {
- pReq->pData = mir_strdup(pReq->m_szParam.GetBuffer());
+ pReq->pData = mir_strdup(pReq->m_szParam);
pReq->dataLength = pReq->m_szParam.GetLength();
}
}
diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp
index a6e0cbdbba..2ba9be838b 100644
--- a/protocols/VKontakte/src/vk_search.cpp
+++ b/protocols/VKontakte/src/vk_search.cpp
@@ -129,10 +129,10 @@ void CVkProto::OnSearch(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
CMString Nick(jnRecord["nickname"].as_mstring());
CMString Domain(jnRecord["domain"].as_mstring());
- psr.id = mir_tstrdup(Id.GetBuffer());
- psr.firstName = mir_tstrdup(FirstName.GetBuffer());
- psr.lastName = mir_tstrdup(LastName.GetBuffer());
- psr.nick = Nick.IsEmpty() ? mir_tstrdup(Domain.GetBuffer()) : mir_tstrdup(Nick.GetBuffer());
+ psr.id = mir_tstrdup(Id);
+ psr.firstName = mir_tstrdup(FirstName);
+ psr.lastName = mir_tstrdup(LastName);
+ psr.nick = Nick.IsEmpty() ? mir_tstrdup(Domain) : mir_tstrdup(Nick);
bool filter = true;
if (pParam) {
@@ -194,11 +194,11 @@ void CVkProto::OnSearchByMail(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
CMString Email(jnRecord["contact"].as_mstring());
- psr.id = mir_tstrdup(Id.GetBuffer());
- psr.firstName = mir_tstrdup(FirstName.GetBuffer());
- psr.lastName = mir_tstrdup(LastName.GetBuffer());
- psr.nick = Nick.IsEmpty() ? mir_tstrdup(Email.GetBuffer()) : mir_tstrdup(Nick.GetBuffer());
- psr.email = mir_tstrdup(Email.GetBuffer());
+ psr.id = mir_tstrdup(Id);
+ psr.firstName = mir_tstrdup(FirstName);
+ psr.lastName = mir_tstrdup(LastName);
+ psr.nick = Nick.IsEmpty() ? mir_tstrdup(Email) : mir_tstrdup(Nick);
+ psr.email = mir_tstrdup(Email);
ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
}
diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp
index 1c4490b324..d8299db63e 100644
--- a/protocols/VKontakte/src/vk_status.cpp
+++ b/protocols/VKontakte/src/vk_status.cpp
@@ -161,7 +161,7 @@ void CVkProto::OnReceiveStatus(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
const JSONNode &jnAudio = jnResponse["audio"];
if (jnAudio.isnull()) {
CMString tszStatusText(jnResponse["text"].as_mstring());
- if (tszStatusText.GetBuffer()[0] != TCHAR(9835))
+ if (tszStatusText[0] != TCHAR(9835))
setTString("OldStatusMsg", tszStatusText);
}
}
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 5713f570e3..a1c49edf96 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -141,7 +141,7 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
pReq->AddHeader("Referer", m_prevUrl);
pReq->Redirect(reply);
if (!pReq->m_szUrl.IsEmpty()) {
- if (pReq->m_szUrl.GetBuffer()[0] == '/')
+ if (pReq->m_szUrl[0] == '/')
pReq->m_szUrl = VK_LOGIN_DOMAIN + pReq->m_szUrl;
ApplyCookies(pReq);
m_prevUrl = pReq->m_szUrl;
@@ -182,7 +182,7 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
pReq->m_szParam = szBody;
pReq->m_szUrl = szAction;
if (!pReq->m_szUrl.IsEmpty())
- if (pReq->m_szUrl.GetBuffer()[0] == '/')
+ if (pReq->m_szUrl[0] == '/')
pReq->m_szUrl = VK_LOGIN_DOMAIN + pReq->m_szUrl;
m_prevUrl = pReq->m_szUrl;
pReq->m_pFunc = &CVkProto::OnOAuthAuthorize;
@@ -258,14 +258,14 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
tszValue = jnItem["first_name"].as_mstring();
if (!tszValue.IsEmpty()) {
- setTString(hContact, "FirstName", tszValue.GetBuffer());
+ setTString(hContact, "FirstName", tszValue);
tszNick.Append(tszValue);
tszNick.AppendChar(' ');
}
tszValue = jnItem["last_name"].as_mstring();
if (!tszValue.IsEmpty()) {
- setTString(hContact, "LastName", tszValue.GetBuffer());
+ setTString(hContact, "LastName", tszValue);
tszNick.Append(tszValue);
}
@@ -279,7 +279,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
tszValue = jnItem["bdate"].as_mstring();
if (!tszValue.IsEmpty()) {
int d, m, y, iReadCount;
- iReadCount = _stscanf(tszValue.GetBuffer(), _T("%d.%d.%d"), &d, &m, &y);
+ iReadCount = _stscanf(tszValue, _T("%d.%d.%d"), &d, &m, &y);
if (iReadCount > 1) {
if (iReadCount == 3)
setWord(hContact, "BirthYear", y);
@@ -317,24 +317,24 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
tszValue = jnItem["mobile_phone"].as_mstring();
if (!tszValue.IsEmpty())
- setTString(hContact, "Cellular", tszValue.GetBuffer());
+ setTString(hContact, "Cellular", tszValue);
tszValue = jnItem["home_phone"].as_mstring();
if (!tszValue.IsEmpty())
- setTString(hContact, "Phone", tszValue.GetBuffer());
+ setTString(hContact, "Phone", tszValue);
tszValue = jnItem["status"].as_mstring();
CMString tszOldStatus(ptrT(db_get_tsa(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg")));
if (tszValue != tszOldStatus) {
- db_set_ts(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg", tszValue.GetBuffer());
+ db_set_ts(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg", tszValue);
db_unset(hContact, m_szModuleName, "AudioUrl");
const JSONNode &jnAudio = jnItem["status_audio"];
if (!jnAudio.isnull()) {
- db_set_ts(hContact, m_szModuleName, "ListeningTo", tszValue.GetBuffer());
+ db_set_ts(hContact, m_szModuleName, "ListeningTo", tszValue);
tszValue = jnAudio["url"].as_mstring();
- db_set_ts(hContact, m_szModuleName, "AudioUrl", tszValue.GetBuffer());
+ db_set_ts(hContact, m_szModuleName, "AudioUrl", tszValue);
}
- else if (tszValue.GetBuffer()[0] == TCHAR(9835) && tszValue.GetLength() > 2)
+ else if (tszValue[0] == TCHAR(9835) && tszValue.GetLength() > 2)
db_set_ts(hContact, m_szModuleName, "ListeningTo", &(tszValue.GetBuffer())[2]);
else
db_unset(hContact, m_szModuleName, "ListeningTo");
@@ -343,14 +343,14 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
tszValue = jnItem["about"].as_mstring();
if (!tszValue.IsEmpty())
- setTString(hContact, "About", tszValue.GetBuffer());
+ setTString(hContact, "About", tszValue);
tszValue = jnItem["domain"].as_mstring();
if (!tszValue.IsEmpty()) {
- setTString(hContact, "domain", tszValue.GetBuffer());
+ setTString(hContact, "domain", tszValue);
CMString tszUrl("https://vk.com/");
tszUrl.Append(tszValue);
- setTString(hContact, "Homepage", tszUrl.GetBuffer());
+ setTString(hContact, "Homepage", tszUrl);
}
return hContact;
@@ -366,7 +366,7 @@ void CVkProto::RetrieveUserInfo(LONG userID)
userIDs.AppendFormat(_T("%i"), userID);
code.AppendFormat(_T("var userIDs=\"%s\";return{\"freeoffline\":0,\"users\":API.users.get({\"user_ids\":userIDs,\"fields\":\"%s\",\"name_case\":\"nom\"})};"),
- userIDs.GetBuffer(), CMString(fieldsName).GetBuffer());
+ userIDs, CMString(fieldsName));
Push(new AsyncHttpRequest(this, REQUEST_POST, "/method/execute.json", true, &CVkProto::OnReceiveUserInfo)
<< TCHAR_PARAM("code", code)
<< VER_API);
@@ -400,7 +400,7 @@ void CVkProto::RetrieveUsersInfo(bool flag)
else
codeformat += CMString("var res=API.users.get({\"user_ids\":userIDs,\"fields\":\"%s\",\"name_case\":\"nom\"});"
"return{\"freeoffline\":0,\"users\":res};");
- code.AppendFormat(codeformat, userIDs.GetBuffer(), CMString(flag ? "online,status" : fieldsName).GetBuffer());
+ code.AppendFormat(codeformat, userIDs, CMString(flag ? "online,status" : fieldsName));
Push(new AsyncHttpRequest(this, REQUEST_POST, "/method/execute.json", true, &CVkProto::OnReceiveUserInfo)
<< TCHAR_PARAM("code", code)
@@ -563,7 +563,7 @@ INT_PTR __cdecl CVkProto::SvcDeleteFriend(WPARAM hContact, LPARAM flag)
CMString ptszMsg;
if (flag == 0) {
ptszMsg.AppendFormat(TranslateT("Are you sure to delete %s from your friend list?"), IsEmpty(ptszNick) ? TranslateT("(Unknown contact)") : ptszNick);
- if (IDNO == MessageBox(NULL, ptszMsg.GetBuffer(), TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
+ if (IDNO == MessageBox(NULL, ptszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
return 1;
}
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/friends.delete.json", true, &CVkProto::OnReceiveDeleteFriend)
@@ -597,12 +597,12 @@ void CVkProto::OnReceiveDeleteFriend(NETLIBHTTPREQUEST* reply, AsyncHttpRequest*
msgformat = TranslateT("Friend request suggestion for the user %s deleted");
msg.AppendFormat(msgformat, tszNick);
- MsgPopup(param->hContact, msg.GetBuffer(), tszNick.GetBuffer());
+ MsgPopup(param->hContact, msg, tszNick);
setByte(param->hContact, "Auth", 1);
}
else {
msg = TranslateT("User or request was not deleted");
- MsgPopup(param->hContact, msg.GetBuffer(), tszNick.GetBuffer());
+ MsgPopup(param->hContact, msg, tszNick);
}
}
}
@@ -656,9 +656,9 @@ INT_PTR __cdecl CVkProto::SvcBanUser(WPARAM hContact, LPARAM)
ptszMsg.AppendFormat(TranslateT("Are you sure to ban %s? %s%sContinue?"),
IsEmpty(ptszNick) ? TranslateT("(Unknown contact)") : ptszNick,
tszVarWarning.IsEmpty() ? _T(" ") : TranslateT("\nIt will also"),
- tszVarWarning.IsEmpty() ? _T("\n") : tszVarWarning.GetBuffer());
+ tszVarWarning.IsEmpty() ? _T("\n") : tszVarWarning);
- if (IDNO == MessageBox(NULL, ptszMsg.GetBuffer(), TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
+ if (IDNO == MessageBox(NULL, ptszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
return 1;
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveSmth)
@@ -682,7 +682,7 @@ INT_PTR __cdecl CVkProto::SvcReportAbuse(WPARAM hContact, LPARAM)
tszNick = ptrT(db_get_tsa(hContact, m_szModuleName, "Nick")),
ptszMsg;
ptszMsg.AppendFormat(formatstr, tszNick.IsEmpty() ? TranslateT("(Unknown contact)") : tszNick);
- if (IDNO == MessageBox(NULL, ptszMsg.GetBuffer(), TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
+ if (IDNO == MessageBox(NULL, ptszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
return 1;
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/users.report.json", true, &CVkProto::OnReceiveSmth)
diff --git a/protocols/VKontakte/src/vk_wallpost.cpp b/protocols/VKontakte/src/vk_wallpost.cpp
index 2648d88af9..585cf1738d 100644
--- a/protocols/VKontakte/src/vk_wallpost.cpp
+++ b/protocols/VKontakte/src/vk_wallpost.cpp
@@ -50,7 +50,7 @@ static INT_PTR CALLBACK WallPostFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
SetDlgItemText(hwndDlg, IDC_ST_WARNING, _T(""));
CMString tszTitle;
tszTitle.AppendFormat(_T("%s %s"), TranslateT("Wall message for"), param->ptszNick);
- SetWindowText(hwndDlg, tszTitle.GetBuffer());
+ SetWindowText(hwndDlg, tszTitle);
}
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)param);
return TRUE;