summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2017-10-15 14:01:40 +0500
committerElzorFox <elzorfox@ya.ru>2017-10-15 14:01:40 +0500
commit394ee282dbc46c15162c33d9012d2492ef17847d (patch)
treef8fa762859b1d69fa6aa66a8ad9da1c83c539a6e /protocols
parent5c9429642824d3f6c9d23bd43164b5f538bb87f9 (diff)
VKontakte: ignore ‘friends_recomm’ news type
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index 3228b8c829..2e47317451 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -160,10 +160,11 @@ void CVkProto::CreateVkUserInfoList(OBJLIST<CVkUserInfo> &vkUsers, const JSONNod
CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo> &vkUsers, bool isRepost)
{
+ if (!jnItem || jnItem["type"].as_mstring() == L"friends_recomm")
+ return nullptr;
+
bool bPostLink = true;
CVKNewsItem *vkNewsItem = new CVKNewsItem();
- if (!jnItem)
- return vkNewsItem;
LONG iSourceId = !jnItem["source_id"] ? jnItem["owner_id"].as_int() : jnItem["source_id"].as_int();
LONG iPostId = jnItem["post_id"].as_int();
@@ -221,16 +222,18 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo
const JSONNode &jnRepost = jnItem["copy_history"];
if (jnRepost) {
CVKNewsItem *vkRepost = GetVkNewsItem((*jnRepost.begin()), vkUsers, true);
- vkRepost->wszText.Replace(L"\n", L"\n\t");
- wszText += vkRepost->wszText;
- wszText += L"\n";
-
- wszPopupText += L"\t";
- wszPopupText += vkRepost->wszPopupTitle;
- wszPopupText += L"\n\t";
- wszPopupText += vkRepost->wszPopupText;
- vkNewsItem->bIsRepost = true;
- delete vkRepost;
+ if (vkRepost) {
+ vkRepost->wszText.Replace(L"\n", L"\n\t");
+ wszText += vkRepost->wszText;
+ wszText += L"\n";
+
+ wszPopupText += L"\t";
+ wszPopupText += vkRepost->wszPopupTitle;
+ wszPopupText += L"\n\t";
+ wszPopupText += vkRepost->wszPopupText;
+ vkNewsItem->bIsRepost = true;
+ delete vkRepost;
+ }
}
const JSONNode &jnAttachments = jnItem["attachments"];