summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/misc.cpp70
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp6
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp58
-rw-r--r--protocols/VKontakte/src/vk_files.cpp4
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp2
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp2
-rw-r--r--protocols/VKontakte/src/vk_queue.cpp2
-rw-r--r--protocols/VKontakte/src/vk_status.cpp2
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp10
9 files changed, 78 insertions, 78 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 284ff08032..3ae47bcf21 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -451,7 +451,7 @@ bool CVkProto::AutoFillForm(char *pBody, CMStringA &szAction, CMStringA& szResul
}
szResult = result;
- debugLogA("CVkProto::AutoFillForm result = \"%s\"", szResult);
+ debugLogA("CVkProto::AutoFillForm result = \"%s\"", szResult.c_str());
return true;
}
@@ -964,9 +964,9 @@ CMStringW CVkProto::GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC)
int iWidth = jnPhoto["width"].as_int();
int iHeight = jnPhoto["height"].as_int();
- wszRes.AppendFormat(L"%s (%dx%d)", SetBBCString(TranslateT("Photo"), iBBC, vkbbcUrl, wszLink), iWidth, iHeight);
+ wszRes.AppendFormat(L"%s (%dx%d)", SetBBCString(TranslateT("Photo"), iBBC, vkbbcUrl, wszLink).c_str(), iWidth, iHeight);
if (m_vkOptions.iIMGBBCSupport && iBBC != bbcNo)
- wszRes.AppendFormat(L"\n\t%s", SetBBCString(!wszPreviewLink.IsEmpty() ? wszPreviewLink : (!wszLink.IsEmpty() ? wszLink : L""), bbcBasic, vkbbcImg));
+ wszRes.AppendFormat(L"\n\t%s", SetBBCString(!wszPreviewLink.IsEmpty() ? wszPreviewLink : (!wszLink.IsEmpty() ? wszLink : L""), bbcBasic, vkbbcImg).c_str());
CMStringW wszText(jnPhoto["text"].as_mstring());
if (!wszText.IsEmpty())
wszRes += L"\n" + wszText;
@@ -1077,15 +1077,15 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMStringW wszArtist(jnAudio["artist"].as_mstring());
CMStringW wszTitle(jnAudio["title"].as_mstring());
CMStringW wszUrl(jnAudio["url"].as_mstring());
- CMStringW wszAudio(FORMAT, L"%s - %s", wszArtist, wszTitle);
+ CMStringW wszAudio(FORMAT, L"%s - %s", wszArtist.c_str(), wszTitle.c_str());
int iParamPos = wszUrl.Find(L"?");
if (m_vkOptions.bShortenLinksForAudio && iParamPos != -1)
wszUrl = wszUrl.Left(iParamPos);
res.AppendFormat(L"%s: %s",
- SetBBCString(TranslateT("Audio"), iBBC, vkbbcB),
- SetBBCString(wszAudio, iBBC, vkbbcUrl, wszUrl));
+ SetBBCString(TranslateT("Audio"), iBBC, vkbbcB).c_str(),
+ SetBBCString(wszAudio, iBBC, vkbbcUrl, wszUrl).c_str());
}
else if (wszType == L"video") {
const JSONNode &jnVideo = jnAttach["video"];
@@ -1097,8 +1097,8 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
int ownerID = jnVideo["owner_id"].as_int();
CMStringW wszUrl(FORMAT, L"https://vk.com/video%d_%d", ownerID, vid);
res.AppendFormat(L"%s: %s",
- SetBBCString(TranslateT("Video"), iBBC, vkbbcB),
- SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl));
+ SetBBCString(TranslateT("Video"), iBBC, vkbbcB).c_str(),
+ SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl).c_str());
}
else if (wszType == L"doc") {
const JSONNode &jnDoc = jnAttach["doc"];
@@ -1108,8 +1108,8 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMStringW wszTitle(jnDoc["title"].as_mstring());
CMStringW wszUrl(jnDoc["url"].as_mstring());
res.AppendFormat(L"%s: %s",
- SetBBCString(TranslateT("Document"), iBBC, vkbbcB),
- SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl));
+ SetBBCString(TranslateT("Document"), iBBC, vkbbcB).c_str(),
+ SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl).c_str());
}
else if (wszType == L"wall") {
const JSONNode &jnWall = jnAttach["wall"];
@@ -1121,8 +1121,8 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
int fromID = jnWall["from_id"].as_int();
CMStringW wszUrl(FORMAT, L"https://vk.com/wall%d_%d", fromID, id);
res.AppendFormat(L"%s: %s",
- SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, wszUrl),
- wszText.IsEmpty() ? L" " : wszText);
+ SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, wszUrl).c_str(),
+ wszText.IsEmpty() ? L" " : wszText.c_str());
const JSONNode &jnCopyHystory = jnWall["copy_history"];
for (auto aCHit = jnCopyHystory.begin(); aCHit != jnCopyHystory.end(); ++aCHit) {
@@ -1134,8 +1134,8 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMStringW wszCHUrl(FORMAT, L"https://vk.com/wall%d_%d", iCHfromID, iCHid);
wszCHText.Replace(L"\n", L"\n\t\t");
res.AppendFormat(L"\n\t\t%s: %s",
- SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, wszCHUrl),
- wszCHText.IsEmpty() ? L" " : wszCHText);
+ SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, wszCHUrl).c_str(),
+ wszCHText.IsEmpty() ? L" " : wszCHText.c_str());
const JSONNode &jnSubAttachments = jnCopyHystoryItem["attachments"];
if (jnSubAttachments) {
@@ -1173,7 +1173,7 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
break;
}
}
- res.AppendFormat(L"%s", wszLink);
+ res.AppendFormat(L"%s", wszLink.c_str());
if (m_vkOptions.iIMGBBCSupport && iBBC != bbcNo)
res += SetBBCString(wszLink, iBBC, vkbbcImg);
@@ -1190,17 +1190,17 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMStringW wszDescription(jnLink["description"].as_mstring());
res.AppendFormat(L"%s: %s",
- SetBBCString(TranslateT("Link"), iBBC, vkbbcB),
- SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl));
+ SetBBCString(TranslateT("Link"), iBBC, vkbbcB).c_str(),
+ SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl).c_str());
if (!wszCaption.IsEmpty())
- res.AppendFormat(L"\n\t%s", SetBBCString(wszCaption, iBBC, vkbbcI));
+ res.AppendFormat(L"\n\t%s", SetBBCString(wszCaption, iBBC, vkbbcI).c_str());
if (jnLink["photo"])
- res.AppendFormat(L"\n\t%s", GetVkPhotoItem(jnLink["photo"], iBBC));
+ res.AppendFormat(L"\n\t%s", GetVkPhotoItem(jnLink["photo"], iBBC).c_str());
if (!wszDescription.IsEmpty())
- res.AppendFormat(L"\n\t%s", wszDescription);
+ res.AppendFormat(L"\n\t%s", wszDescription.c_str());
}
else if (wszType == L"market") {
const JSONNode &jnMarket = jnAttach["market"];
@@ -1217,21 +1217,21 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
id);
res.AppendFormat(L"%s: %s",
- SetBBCString(TranslateT("Product"), iBBC, vkbbcB),
- SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl));
+ SetBBCString(TranslateT("Product"), iBBC, vkbbcB).c_str(),
+ SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl).c_str());
if (!wszPhoto.IsEmpty())
res.AppendFormat(L"\n\t%s: %s",
- SetBBCString(TranslateT("Photo"), iBBC, vkbbcB),
- SetBBCString(wszPhoto, iBBC, vkbbcImg));
+ SetBBCString(TranslateT("Photo"), iBBC, vkbbcB).c_str(),
+ SetBBCString(wszPhoto, iBBC, vkbbcImg).c_str());
if (jnMarket["price"] && jnMarket["price"]["text"])
res.AppendFormat(L"\n\t%s: %s",
- SetBBCString(TranslateT("Price"), iBBC, vkbbcB),
- jnMarket["price"]["text"].as_mstring());
+ SetBBCString(TranslateT("Price"), iBBC, vkbbcB).c_str(),
+ jnMarket["price"]["text"].as_mstring().c_str());
if (!wszDescription.IsEmpty())
- res.AppendFormat(L"\n\t%s", wszDescription);
+ res.AppendFormat(L"\n\t%s", wszDescription.c_str());
}
else if (wszType == L"gift") {
const JSONNode &jnGift = jnAttach["gift"];
@@ -1251,10 +1251,10 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
res += SetBBCString(TranslateT("Gift"), iBBC, vkbbcUrl, wszLink);
if (m_vkOptions.iIMGBBCSupport && iBBC != bbcNo)
- res.AppendFormat(L"\n\t%s", SetBBCString(wszLink, iBBC, vkbbcImg));
+ res.AppendFormat(L"\n\t%s", SetBBCString(wszLink, iBBC, vkbbcImg).c_str());
}
else
- res.AppendFormat(TranslateT("Unsupported or unknown attachment type: %s"), SetBBCString(wszType, iBBC, vkbbcB));
+ res.AppendFormat(TranslateT("Unsupported or unknown attachment type: %s"), SetBBCString(wszType, iBBC, vkbbcB).c_str());
res.AppendChar('\n');
}
@@ -1277,7 +1277,7 @@ CMStringW CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &j
const JSONNode &jnUser = (*it);
int iUserId = jnUser["id"].as_int();
- CMStringW wszNick(FORMAT, L"%s %s", jnUser["first_name"].as_mstring(), jnUser["last_name"].as_mstring());
+ CMStringW wszNick(FORMAT, L"%s %s", jnUser["first_name"].as_mstring().c_str(), jnUser["last_name"].as_mstring().c_str());
CMStringW wszLink(FORMAT, L"https://vk.com/id%d", iUserId);
CVkUserInfo *vkUser = new CVkUserInfo(jnUser["id"].as_int(), false, wszNick, wszLink, FindUser(iUserId));
@@ -1332,12 +1332,12 @@ CMStringW CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &j
wszBody.Replace(L"\n", L"\n\t");
wchar_t tcSplit = m_vkOptions.bSplitFormatFwdMsg ? '\n' : ' ';
CMStringW wszMes(FORMAT, L"%s %s%c%s %s:\n\n%s\n",
- SetBBCString(TranslateT("Message from"), iBBC, vkbbcB),
- SetBBCString(wszNick, iBBC, vkbbcUrl, wszUrl),
+ SetBBCString(TranslateT("Message from"), iBBC, vkbbcB).c_str(),
+ SetBBCString(wszNick, iBBC, vkbbcUrl, wszUrl).c_str(),
tcSplit,
- SetBBCString(TranslateT("at"), iBBC, vkbbcB),
+ SetBBCString(TranslateT("at"), iBBC, vkbbcB).c_str(),
ttime,
- SetBBCString(wszBody, iBBC, vkbbcCode));
+ SetBBCString(wszBody, iBBC, vkbbcCode).c_str());
if (!res.IsEmpty())
res.AppendChar('\n');
@@ -1478,7 +1478,7 @@ void CVkProto::ShowCaptchaInBrowser(HBITMAP hBitmap)
void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType)
{
- debugLogW(L"CVkProto::AddVkDeactivateEvent hContact=%d, wszType=%s bShowVkDeactivateEvents=%d", hContact, wszType, (int)m_vkOptions.bShowVkDeactivateEvents);
+ debugLogW(L"CVkProto::AddVkDeactivateEvent hContact=%d, wszType=%s bShowVkDeactivateEvents=%d", hContact, wszType.c_str(), (int)m_vkOptions.bShowVkDeactivateEvents);
CVKDeactivateEvent vkDeactivateEvent[] = {
{ L"", Translate("User restored control over own page") },
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 4cac5fb957..5806f618ce 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -308,7 +308,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode &
if (wszUid == wszActionMid) {
if (cc->m_bHistoryRead)
return;
- wszBody.AppendFormat(L" (https://vk.com/id%s) %s", wszUid, TranslateT("left chat"));
+ wszBody.AppendFormat(L" (https://vk.com/id%s) %s", wszUid.c_str(), TranslateT("left chat"));
}
else {
int a_uid = 0;
@@ -332,7 +332,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode &
else {
CMStringW wszUid(FORMAT, L"%d", uid);
if (wszUid == wszActionMid)
- wszBody.AppendFormat(L" (https://vk.com/id%s) %s", wszUid, TranslateT("returned to chat"));
+ wszBody.AppendFormat(L" (https://vk.com/id%s) %s", wszUid.c_str(), TranslateT("returned to chat"));
else {
int a_uid = 0;
int iReadCount = swscanf(wszActionMid, L"%d", &a_uid);
@@ -360,7 +360,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode &
else if (wszAction == L"chat_photo_remove")
wszBody = TranslateT("deleted chat cover");
else
- wszBody.AppendFormat(L": %s (%s)", TranslateT("chat action not supported"), wszAction);
+ wszBody.AppendFormat(L": %s (%s)", TranslateT("chat action not supported"), wszAction.c_str());
}
wszBody.Replace(L"%", L"%%");
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index 39848669f0..7ea9d7fa97 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -180,7 +180,7 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo
if (!wszText.IsEmpty())
wszText += L"\n";
- debugLogW(L"CVkProto::GetVkNewsItem %d %d %s", iSourceId, iPostId, vkNewsItem->wszType);
+ debugLogW(L"CVkProto::GetVkNewsItem %d %d %s", iSourceId, iPostId, vkNewsItem->wszType.c_str());
if (vkNewsItem->wszType == L"photo_tag") {
bPostLink = false;
@@ -260,8 +260,8 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo
vkNewsItem->wszText.AppendFormat(wszResFormat,
SetBBCString(vkNewsItem->vkUser->m_wszUserNick, m_vkOptions.BBCForNews(), vkbbcUrl,
- vkNewsItem->vkUser->m_wszLink), wszText);
- vkNewsItem->wszPopupTitle.AppendFormat(wszTitleFormat, vkNewsItem->vkUser->m_wszUserNick);
+ vkNewsItem->vkUser->m_wszLink).c_str(), wszText.c_str());
+ vkNewsItem->wszPopupTitle.AppendFormat(wszTitleFormat, vkNewsItem->vkUser->m_wszUserNick.c_str());
vkNewsItem->wszPopupText = wszPopupText;
vkNewsItem->wszId.AppendFormat(L"%d_%d", vkNewsItem->vkUser->m_UserId, iPostId);
@@ -271,7 +271,7 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo
vkNewsItem->wszText += SetBBCString(TranslateT("Link"), m_vkOptions.BBCForNews(), vkbbcUrl, vkNewsItem->wszLink);
}
- debugLogW(L"CVkProto::GetVkNewsItem %d %d <\n%s\n>", iSourceId, iPostId, vkNewsItem->wszText);
+ debugLogW(L"CVkProto::GetVkNewsItem %d %d <\n%s\n>", iSourceId, iPostId, vkNewsItem->wszText.c_str());
return vkNewsItem;
}
@@ -310,7 +310,7 @@ CMStringW CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedba
wszUsers += L", ";
wszUsers += SetBBCString(vkUser->m_wszUserNick, m_vkOptions.BBCForNews(), vkbbcUrl, vkUser->m_wszLink);
}
- wszRes.AppendFormat(L"%s %%s %%s", wszUsers);
+ wszRes.AppendFormat(L"%s %%s %%s", wszUsers.c_str());
vkUser = NULL;
iUserId = 0;
}
@@ -319,7 +319,7 @@ CMStringW CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedba
vkUser = GetVkUserInfo(iUserId, vkUsers);
CMStringW wszText(jnFeedback["text"].as_mstring());
wszText.Replace(L"%", L"%%");
- wszRes.AppendFormat(wszFormat, SetBBCString(vkUser->m_wszUserNick, m_vkOptions.BBCForNews(), vkbbcUrl, vkUser->m_wszLink), ClearFormatNick(wszText));
+ wszRes.AppendFormat(wszFormat, SetBBCString(vkUser->m_wszUserNick, m_vkOptions.BBCForNews(), vkbbcUrl, vkUser->m_wszLink).c_str(), ClearFormatNick(wszText).c_str());
}
return wszRes;
@@ -339,58 +339,58 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT
LONG iOwnerId = jnParent["owner_id"].as_int();
LONG iId = jnParent["id"].as_int();
vkNotificationItem->wszId.AppendFormat(L"%d_%d", iOwnerId, iId);
- vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/photo%s", vkNotificationItem->wszId);
- vkNotificationItem->wszText.AppendFormat(L"\n%s", wszPhoto);
+ vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/photo%s", vkNotificationItem->wszId.c_str());
+ vkNotificationItem->wszText.AppendFormat(L"\n%s", wszPhoto.c_str());
if (pwszReplyText) {
- vkNotificationItem->wszText.AppendFormat(L"\n>> %s", SetBBCString(pwszReplyText, m_vkOptions.BBCForNews(), vkbbcI));
+ vkNotificationItem->wszText.AppendFormat(L"\n>> %s", SetBBCString(pwszReplyText, m_vkOptions.BBCForNews(), vkbbcI).c_str());
vkNotificationItem->wszPopupText.AppendFormat(L">> %s", pwszReplyText);
}
- vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(TranslateT("Link"), m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink));
+ vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(TranslateT("Link"), m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink).c_str());
}
else if (vkParentType == vkVideo) {
LONG iOwnerId = jnParent["owner_id"].as_int();
LONG iId = jnParent["id"].as_int();
CMStringW wszTitle(jnParent["title"].as_mstring());
vkNotificationItem->wszId.AppendFormat(L"%d_%d", iOwnerId, iId);
- vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/video%s", vkNotificationItem->wszId);
+ vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/video%s", vkNotificationItem->wszId.c_str());
CMStringW wszText(jnParent["text"].as_mstring());
ClearFormatNick(wszText);
if (!wszText.IsEmpty())
- vkNotificationItem->wszText.AppendFormat(L"\n%s: %s", SetBBCString(TranslateT("Video description:"), m_vkOptions.BBCForNews(), vkbbcB), SetBBCString(wszText, m_vkOptions.BBCForNews(), vkbbcI));
+ vkNotificationItem->wszText.AppendFormat(L"\n%s: %s", SetBBCString(TranslateT("Video description:"), m_vkOptions.BBCForNews(), vkbbcB).c_str(), SetBBCString(wszText, m_vkOptions.BBCForNews(), vkbbcI).c_str());
if (pwszReplyText) {
- vkNotificationItem->wszText.AppendFormat(L"\n>> %s", SetBBCString(pwszReplyText, m_vkOptions.BBCForNews(), vkbbcI));
+ vkNotificationItem->wszText.AppendFormat(L"\n>> %s", SetBBCString(pwszReplyText, m_vkOptions.BBCForNews(), vkbbcI).c_str());
vkNotificationItem->wszPopupText.AppendFormat(L">> %s", pwszReplyText);
}
- vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(wszTitle, m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink));
+ vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(wszTitle, m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink).c_str());
}
else if (vkParentType == vkPost) {
LONG iToId = jnParent["to_id"].as_int();
LONG iId = jnParent["id"].as_int();
vkNotificationItem->wszId.AppendFormat(L"%d_%d", iToId, iId);
- vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/wall%s%s", vkNotificationItem->wszId, pwszReplyLink ? pwszReplyLink : L"");
+ vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/wall%s%s", vkNotificationItem->wszId.c_str(), pwszReplyLink ? pwszReplyLink : L"");
CMStringW wszText(jnParent["text"].as_mstring());
ClearFormatNick(wszText);
if (!wszText.IsEmpty()) {
- vkNotificationItem->wszText.AppendFormat(L"\n%s: %s", SetBBCString(TranslateT("Post text:"), m_vkOptions.BBCForNews(), vkbbcB), SetBBCString(wszText, m_vkOptions.BBCForNews(), vkbbcI));
- vkNotificationItem->wszPopupText.AppendFormat(L"%s: %s", TranslateT("Post text:"), wszText);
+ vkNotificationItem->wszText.AppendFormat(L"\n%s: %s", SetBBCString(TranslateT("Post text:"), m_vkOptions.BBCForNews(), vkbbcB).c_str(), SetBBCString(wszText, m_vkOptions.BBCForNews(), vkbbcI).c_str());
+ vkNotificationItem->wszPopupText.AppendFormat(L"%s: %s", TranslateT("Post text:"), wszText.c_str());
}
if (pwszReplyText) {
- vkNotificationItem->wszText.AppendFormat(L"\n>> %s", SetBBCString(pwszReplyText, m_vkOptions.BBCForNews(), vkbbcI));
+ vkNotificationItem->wszText.AppendFormat(L"\n>> %s", SetBBCString(pwszReplyText, m_vkOptions.BBCForNews(), vkbbcI).c_str());
if (!vkNotificationItem->wszPopupText.IsEmpty())
vkNotificationItem->wszPopupText += L"\n";
vkNotificationItem->wszPopupText.AppendFormat(L">> %s", pwszReplyText);
}
- vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(TranslateT("Link"), m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink));
+ vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(TranslateT("Link"), m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink).c_str());
}
else if (vkParentType == vkTopic) {
LONG iOwnerId = jnParent["owner_id"].as_int();
@@ -398,24 +398,24 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT
CMStringW wszTitle(jnParent["title"].as_mstring());
vkNotificationItem->wszId.AppendFormat(L"%d_%d", iOwnerId, iId);
vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/topic%s%s",
- vkNotificationItem->wszId, pwszReplyLink ? pwszReplyLink : L"");
+ vkNotificationItem->wszId.c_str(), pwszReplyLink ? pwszReplyLink : L"");
CMStringW wszText(jnParent["text"].as_mstring());
ClearFormatNick(wszText);
if (!wszText.IsEmpty()) {
- vkNotificationItem->wszText.AppendFormat(L"\n%s %s", SetBBCString(TranslateT("Topic text:"), m_vkOptions.BBCForNews(), vkbbcB), SetBBCString(wszText, m_vkOptions.BBCForNews(), vkbbcI));
- vkNotificationItem->wszPopupText.AppendFormat(L"%s %s", TranslateT("Topic text:"), wszText);
+ vkNotificationItem->wszText.AppendFormat(L"\n%s %s", SetBBCString(TranslateT("Topic text:"), m_vkOptions.BBCForNews(), vkbbcB).c_str(), SetBBCString(wszText, m_vkOptions.BBCForNews(), vkbbcI).c_str());
+ vkNotificationItem->wszPopupText.AppendFormat(L"%s %s", TranslateT("Topic text:"), wszText.c_str());
}
if (pwszReplyText) {
- vkNotificationItem->wszText.AppendFormat(L"\n>> %s", SetBBCString(pwszReplyText, m_vkOptions.BBCForNews(), vkbbcI));
+ vkNotificationItem->wszText.AppendFormat(L"\n>> %s", SetBBCString(pwszReplyText, m_vkOptions.BBCForNews(), vkbbcI).c_str());
if (!vkNotificationItem->wszPopupText.IsEmpty())
vkNotificationItem->wszPopupText += L"\n";
vkNotificationItem->wszPopupText.AppendFormat(L">> %s", pwszReplyText);
}
- vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(wszTitle, m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink));
+ vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(wszTitle, m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink).c_str());
}
else if (vkParentType == vkComment) {
CMStringW wszText(jnParent["text"].as_mstring());
@@ -483,13 +483,13 @@ CVKNewsItem* CVkProto::GetVkNotificationsItem(const JSONNode &jnItem, OBJLIST<CV
if (vkNotification && !wszFeedback.IsEmpty()) {
CMStringW wszNotificaton;
- wszNotificaton.AppendFormat(wszFeedback, wszNotificationTranslate, vkNotification->wszText);
+ wszNotificaton.AppendFormat(wszFeedback, wszNotificationTranslate.c_str(), vkNotification->wszText.c_str());
vkNotification->wszText = wszNotificaton;
wszFeedback = RemoveBBC(wszFeedback);
int idx = wszFeedback.Find(L" %s %s");
- vkNotification->wszPopupTitle.AppendFormat(L"%s %s", wszFeedback.Mid(0, idx), wszNotificationTranslate);
+ vkNotification->wszPopupTitle.AppendFormat(L"%s %s", wszFeedback.Mid(0, idx).c_str(), wszNotificationTranslate.c_str());
if (wszFeedback.GetLength() > idx + 7) {
if (!vkNotification->wszPopupText.IsEmpty())
vkNotification->wszPopupText += L"\n>> ";
@@ -557,13 +557,13 @@ CVKNewsItem* CVkProto::GetVkGroupInvates(const JSONNode &jnItem, OBJLIST<CVkUser
CMStringW wszGroupName;
CMStringW wszGName = jnItem["name"].as_mstring();
- CMStringW wszGLink(FORMAT, L"https://vk.com/%s", jnItem["screen_name"].as_mstring());
+ CMStringW wszGLink(FORMAT, L"https://vk.com/%s", jnItem["screen_name"].as_mstring().c_str());
wszGroupName = SetBBCString(wszGName, m_vkOptions.BBCForNews(), vkbbcUrl, wszGLink);
CMStringW wszUsers = SetBBCString(iUserId ? vkNotification->vkUser->m_wszUserNick : TranslateT("Unknown"), m_vkOptions.BBCForNews(), vkbbcUrl, iUserId ? vkNotification->vkUser->m_wszLink : L"https://vk.com/");
- vkNotification->wszText.AppendFormat(L"%s %s %s", wszUsers, wszNotificationTranslate, wszGroupName);
- vkNotification->wszPopupTitle.AppendFormat(L"%s %s %s", iUserId ? vkNotification->vkUser->m_wszUserNick : TranslateT("Unknown"), wszNotificationTranslate, wszGName);
+ vkNotification->wszText.AppendFormat(L"%s %s %s", wszUsers.c_str(), wszNotificationTranslate.c_str(), wszGroupName.c_str());
+ vkNotification->wszPopupTitle.AppendFormat(L"%s %s %s", iUserId ? vkNotification->vkUser->m_wszUserNick.c_str() : TranslateT("Unknown"), wszNotificationTranslate.c_str(), wszGName.c_str());
wszIds += wszId;
setWString("InviteGroupIds", wszIds);
diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp
index 86aff9fb94..6a12284933 100644
--- a/protocols/VKontakte/src/vk_files.cpp
+++ b/protocols/VKontakte/src/vk_files.cpp
@@ -113,7 +113,7 @@ void CVkProto::SendFileFiled(CVkFileUploadParam *fup, int ErrorCode)
wszError = TranslateT("Unknown error occurred");
}
ProtoBroadcastAck(fup->hContact, ACKTYPE_FILE, ErrorCode== VKERR_AUDIO_DEL_COPYRIGHT ? ACKRESULT_DENIED : ACKRESULT_FAILED, (HANDLE)fup);
- debugLogW(L"CVkProto::SendFileFiled error code = %d (%s)", ErrorCode, wszError);
+ debugLogW(L"CVkProto::SendFileFiled error code = %d (%s)", ErrorCode, wszError.c_str());
MsgPopup(NULL, wszError, TranslateT("File upload error"), true);
delete fup;
}
@@ -174,7 +174,7 @@ void CVkProto::OnReciveUploadServer(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
Utils_GetRandom(&iboundary, sizeof(iboundary));
boundary.AppendFormat("Miranda%dNG%d", iboundary, time(NULL));
// Header
- header.AppendFormat("multipart/form-data; boundary=%s", boundary);
+ header.AppendFormat("multipart/form-data; boundary=%s", boundary.c_str());
pUploadReq->AddHeader("Content-Type", header);
// Content-Disposition {
CMStringA DataBegin = "--";
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index 220c4d98b5..beb0e019e7 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -67,7 +67,7 @@ int CVkProto::SendMsg(MCONTACT hContact, int, const char *szMsg)
if (m_vkOptions.bSendVKLinksAsAttachments) {
CMStringA szAttachments = GetAttachmentsFromMessage(szMsg);
if (!szAttachments.IsEmpty()) {
- debugLogA("CVkProto::SendMsg Attachments = %s", szAttachments);
+ debugLogA("CVkProto::SendMsg Attachments = %s", szAttachments.c_str());
pReq << CHAR_PARAM("attachment", szAttachments);
}
}
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 145f7545ee..45b68efee4 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -596,7 +596,7 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
wszNick(ptrW(db_get_wsa(param->hContact, m_szModuleName, "Nick")));
if (wszNick.IsEmpty())
wszNick = TranslateT("(Unknown contact)");
- msg.AppendFormat(TranslateT("User %s added as friend"), wszNick);
+ msg.AppendFormat(TranslateT("User %s added as friend"), wszNick.c_str());
MsgPopup(param->hContact, msg, wszNick);
}
}
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp
index ba844d1436..b190d080c7 100644
--- a/protocols/VKontakte/src/vk_queue.cpp
+++ b/protocols/VKontakte/src/vk_queue.cpp
@@ -40,7 +40,7 @@ void CVkProto::ExecuteRequest(AsyncHttpRequest *pReq)
pReq->szUrl = pReq->m_szUrl.GetBuffer();
if (!pReq->m_szParam.IsEmpty()) {
if (pReq->requestType == REQUEST_GET) {
- str.Format("%s?%s", pReq->m_szUrl, pReq->m_szParam);
+ str.Format("%s?%s", pReq->m_szUrl.c_str(), pReq->m_szParam.c_str());
pReq->szUrl = str.GetBuffer();
}
else {
diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp
index e7e335be2a..c723fad766 100644
--- a/protocols/VKontakte/src/vk_status.cpp
+++ b/protocols/VKontakte/src/vk_status.cpp
@@ -188,7 +188,7 @@ void CVkProto::RetrieveStatusMusic(const CMStringW &StatusMsg)
code = "API.audio.setBroadcast();return null;";
else {
CMStringW codeformat("API.status.set({text:\"%s\"});return null;");
- code.AppendFormat(codeformat, wszOldStatusMsg);
+ code.AppendFormat(codeformat, wszOldStatusMsg.c_str());
}
m_bSetBroadcast = false;
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveStatus)
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 5eac85f764..9594480776 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -192,7 +192,7 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
if (p1 && p2 && (p1 + 1 < p2)) {
CMStringA szMsg(p1 + 1, (int)(p2 - p1 - 1));
MsgPopup(NULL, ptrW(mir_utf8decodeW(szMsg)), TranslateT("Service message"), true);
- debugLogA("CVkProto::OnOAuthAuthorize %s", szMsg);
+ debugLogA("CVkProto::OnOAuthAuthorize %s", szMsg.c_str());
}
ConnectionFailed(LOGINERR_WRONGPASSWORD);
return;
@@ -390,7 +390,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
CMStringW wszOldListeningTo(ptrW(db_get_wsa(hContact, m_szModuleName, "ListeningTo")));
const JSONNode &jnAudio = jnItem["status_audio"];
if (jnAudio) {
- CMStringW wszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring(), jnAudio["title"].as_mstring());
+ CMStringW wszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring().c_str(), jnAudio["title"].as_mstring().c_str());
if (wszListeningTo != wszOldListeningTo) {
setWString(hContact, "ListeningTo", wszListeningTo);
setWString(hContact, "AudioUrl", jnAudio["url"].as_mstring());
@@ -514,7 +514,7 @@ void CVkProto::RetrieveGroupInfo(LONG groupID)
void CVkProto::RetrieveGroupInfo(CMStringA& groupIDs)
{
- debugLogA("CVkProto::RetrieveGroupInfo (%s)", groupIDs);
+ debugLogA("CVkProto::RetrieveGroupInfo (%s)", groupIDs.c_str());
if (groupIDs.IsEmpty() || !IsOnline())
return;
@@ -694,7 +694,7 @@ void CVkProto::OnReceiveGroupInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR
CMStringW wszOldListeningTo(ptrW(db_get_wsa(hContact, m_szModuleName, "ListeningTo")));
const JSONNode &jnAudio = jnItem["status_audio"];
if (jnAudio) {
- CMStringW wszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring(), jnAudio["title"].as_mstring());
+ CMStringW wszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring().c_str(), jnAudio["title"].as_mstring().c_str());
if (wszListeningTo != wszOldListeningTo) {
setWString(hContact, "ListeningTo", wszListeningTo);
setWString(hContact, "AudioUrl", jnAudio["url"].as_mstring());
@@ -839,7 +839,7 @@ void CVkProto::OnReceiveDeleteFriend(NETLIBHTTPREQUEST *reply, AsyncHttpRequest
else if (jnResponse["suggestion_deleted"].as_bool())
msgformat = TranslateT("Friend request suggestion for the user %s deleted");
- msg.AppendFormat(msgformat, wszNick);
+ msg.AppendFormat(msgformat, wszNick.c_str());
MsgPopup(param->hContact, msg, wszNick);
setByte(param->hContact, "Auth", 1);
}