Esempio n. 1
0
        public NewsFeedIgnoreItemData GetIgnoreItemData()
        {
            NewsItem newsItem = this._newsItemWithInfo.NewsItem;
            List <VKClient.Common.Backend.DataObjects.Video> videoList1;

            if (newsItem == null)
            {
                videoList1 = (List <VKClient.Common.Backend.DataObjects.Video>)null;
            }
            else
            {
                VKList <VKClient.Common.Backend.DataObjects.Video> video = newsItem.video;
                videoList1 = video != null ? video.items : (List <VKClient.Common.Backend.DataObjects.Video>)null;
            }
            List <VKClient.Common.Backend.DataObjects.Video> videoList2 = videoList1;

            if (videoList2 == null || videoList2.Count <= 0)
            {
                return((NewsFeedIgnoreItemData)null);
            }
            VKClient.Common.Backend.DataObjects.Video video1 = videoList2[0];
            long itemId = videoList2.Count == 1 ? video1.id : BaseFormatterHelper.GetLastMidnight((long)newsItem.date, false);

            return(new NewsFeedIgnoreItemData("video", video1.owner_id, itemId));
        }
Esempio n. 2
0
        public NewsFeedIgnoreItemData GetIgnoreItemData()
        {
            NewsItem newsItem = this._newsPost.NewsItem;
            string   postType = newsItem.post_type;
            string   type     = "";
            long     sourceId = newsItem.source_id;
            long     itemId   = 0;

            if (postType == "photo" || postType == "photo_tag" || postType == "wall_photo")
            {
                if (!(postType == "photo") && !(postType == "wall_photo"))
                {
                    if (postType == "photo_tag")
                    {
                        type = "tag";
                    }
                }
                else
                {
                    type = "photo";
                }
                Photo photo = this._photo;
                itemId = photo != null ? photo.id : BaseFormatterHelper.GetLastMidnight((long)newsItem.date, false);
            }
            else if (postType == "video")
            {
                type = "video";
                VKClient.Common.Backend.DataObjects.Video video = this._video;
                itemId = video != null ? video.id : BaseFormatterHelper.GetLastMidnight((long)newsItem.date, false);
            }
            if (!string.IsNullOrEmpty(type) && sourceId != 0L && itemId != 0L)
            {
                return(new NewsFeedIgnoreItemData(type, sourceId, itemId));
            }
            return(null);
        }