private void AddNewsItemIfItIsNotThere()
        {
            if (this._wallPostData == null)
            {
                return;
            }
            if (!this.IsWallPostAddedToUI)
            {
                GroupsService.Current.AddCachedGroups((IEnumerable <Group>) this._wallPostData.Groups);
                WallPostItem         wallPostItem = new WallPostItem(this._width, new Thickness(), false, this._wallPostData, new Action <WallPostItem>(this.DeletedWallPost), false, null, false, false, true, true, null, null);
                MyVirtualizingPanel2 panel        = this._panel;
                int index = 0;
                List <IVirtualizable> itemsToInsert = new List <IVirtualizable>();
                itemsToInsert.Add((IVirtualizable)wallPostItem);
                int num = 0;
                // ISSUE: variable of the null type

                panel.InsertRemoveItems(index, itemsToInsert, num != 0, null);
                this.UpdateCanSomethingProperties();
            }
            if (this._wallResponseData == null)
            {
                return;
            }
            EventAggregator current       = EventAggregator.Current;
            OpenPostEvent   openPostEvent = new OpenPostEvent();

            openPostEvent.PostId = this._wallResponseData.WallPost.PostId;
            List <string> copyPostIds = this._wallResponseData.WallPost.CopyPostIds;

            openPostEvent.CopyPostIds = copyPostIds;
            current.Publish(openPostEvent);
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: method pointer
            IEnumerable <IVirtualizable> arg_FD_0 = this._panel.VirtualizableItems;
            Func <IVirtualizable, bool>  arg_FD_1 = new Func <IVirtualizable, bool>((vi) => { return(vi is LikesItem); });

            if (Enumerable.FirstOrDefault <IVirtualizable>(arg_FD_0, arg_FD_1) == null)
            {
                double                width          = this._width;
                Thickness             margin         = new Thickness();
                WallPost              wallPost       = this._wallResponseData.WallPost;
                LikesInfo             likesAll       = this._wallResponseData.LikesAll;
                int                   num1           = this._wallResponseData.WallPost.likes.user_likes == 1 ? 1 : 0;
                User                  loggedInUser   = AppGlobalStateManager.Current.GlobalState.LoggedInUser;
                List <User>           users          = this._wallResponseData.Users;
                WallPostItem          wallPostItem1  = this.WallPostItem;
                int                   num2           = wallPostItem1 != null ? (wallPostItem1.CanShowLikesSeparator ? 1 : 0) : 0;
                LikesItem             likesItem      = new LikesItem(width, margin, wallPost, likesAll, num1 != 0, loggedInUser, users, num2 != 0);
                MyVirtualizingPanel2  panel1         = this._panel;
                int                   index1         = 1;
                List <IVirtualizable> itemsToInsert1 = new List <IVirtualizable>();
                itemsToInsert1.Add((IVirtualizable)likesItem);
                int num3 = 0;
                // ISSUE: variable of the null type
                panel1.InsertRemoveItems(index1, itemsToInsert1, num3 != 0, null);
            }
        }
        public void Handle(WallPostAddedOrEdited message)
        {
            if (this._wallPostData == null || this._wallPostData.WallPost.to_id != message.NewlyAddedWallPost.to_id || this._wallPostData.WallPost.id != message.NewlyAddedWallPost.id)
            {
                return;
            }
            NewsItemDataWithUsersAndGroupsInfo usersAndGroupsInfo = new NewsItemDataWithUsersAndGroupsInfo();
            List <Group> groups = message.Groups;

            usersAndGroupsInfo.Groups = groups;
            List <User> users = message.Users;

            usersAndGroupsInfo.Profiles = users;
            WallPost newlyAddedWallPost = message.NewlyAddedWallPost;

            usersAndGroupsInfo.WallPost = newlyAddedWallPost;
            this._wallPostData          = usersAndGroupsInfo;
            WallPostItem wallPostItem1 = new WallPostItem(this._width, new Thickness(), false, this._wallPostData, null, false, null, false, false, true, true, null, null);
            WallPostItem wallPostItem2 = ((IEnumerable <IVirtualizable>) this._panel.VirtualizableItems).FirstOrDefault <IVirtualizable>() as WallPostItem;

            if (wallPostItem2 == null)
            {
                return;
            }
            this._panel.Substitute((IVirtualizable)wallPostItem2, (IVirtualizable)wallPostItem1);
        }
        private string GetHighlightedText()
        {
            WallPost wallPost = this._notification.ParsedParent as WallPost;

            if (wallPost != null)
            {
                if (!string.IsNullOrEmpty(wallPost.text))
                {
                    return(this.CutText(wallPost.text));
                }
                if (wallPost.IsRepost())
                {
                    return(this.CutText(wallPost.copy_history[0].text));
                }
                return("");
            }
            Comment comment = this._notification.ParsedParent as Comment;

            if (comment != null)
            {
                return(this.CutText(comment.text ?? ""));
            }
            Topic topic = this._notification.ParsedParent as Topic;

            if (topic != null)
            {
                return(this.CutText(topic.title ?? ""));
            }
            return("");
        }
        private async Task <bool> ProcessSingleDashboardRequest(FeedOperationDetails fod)
        {
            BackendResult <WallData, ResultCode> wall = await WallService.Current.GetWall(RemoteIdHelper.GetItemIdByRemoteId(fod.OwnerRemoteId), 0, 1, "owner");

            if (wall.ResultCode == ResultCode.Succeeded && wall.ResultData.wall.Count > 0)
            {
                WallPost wallPost = wall.ResultData.wall[0];
                FeedItem feedItem = this.CreateFeedItem(wallPost, wall.ResultData.groups, wall.ResultData.profiles, false);
                if (feedItem != null)
                {
                    DashboardItem dashboardItem = await SocialManager.OpenContactDashboardAsync(fod);

                    dashboardItem.DefaultTarget = feedItem.DefaultTarget;
                    dashboardItem.Timestamp     = new DateTimeOffset(ExtensionsBase.UnixTimeStampToDateTime((double)wallPost.date, true));
                    if (!string.IsNullOrEmpty(feedItem.PrimaryContent.Title) || !string.IsNullOrEmpty(feedItem.PrimaryContent.Message))
                    {
                        dashboardItem.Content.Title   = feedItem.PrimaryContent.Title;
                        dashboardItem.Content.Message = feedItem.PrimaryContent.Message;
                    }
                    else
                    {
                        dashboardItem.Content.Title   = feedItem.SecondaryContent.Title;
                        dashboardItem.Content.Message = feedItem.SecondaryContent.Message;
                    }
                    dashboardItem.Content.Target = feedItem.PrimaryContent.Target;
                    await dashboardItem.SaveAsync();

                    return(true);
                }
                wallPost = null;
                feedItem = null;
            }
            return(false);
        }
        public void GetSingleNewsfeed(int id)
        {
            new Thread(() => {
                NewsfeedRequest request = new NewsfeedRequest()
                {
                    RequestType = RequestType.GetSingle,
                    Id          = id
                };

                BaseDto bDto = new BaseDto {
                    Type       = DtoType.Newsfeed,
                    JsonObject = JsonConvert.SerializeObject(request)
                };
                string result = _remoteConnection.Request(bDto);
                if (String.IsNullOrEmpty(result))
                {
                    Log.Error(Tag, "GetSingleWallpost error result is null");
                    return;
                }

                NewsfeedDto dto = JsonConvert.DeserializeObject <NewsfeedDto>(result);

                if (dto == null)
                {
                    Log.Error(Tag, String.Format("Could not parse newsfeeddto {0}", result));
                    return;
                }

                WallPost post = Mapper.Map <NewsfeedDto, WallPost>(dto);

                _newsfeedRepo.AddWallPosts(new List <WallPost>(new [] { post }));
                OnUpdate(this, null);
            }).Start();
        }
Beispiel #6
0
        NewsfeedDto ConvertWallPostToDto(WallPost post)
        {
            NewsfeedDto dto = Mapper.Map <WallPost, NewsfeedDto> (post);

            byte[] imageBytes;
            byte[] headerImageBytes;
            if (!String.IsNullOrEmpty(post.HeaderImage))
            {
                headerImageBytes = _imageRepository.GetImageBytes(post.HeaderImage);

                if (headerImageBytes != null)
                {
                    dto.HeaderImage = headerImageBytes;
                }
            }

            if (!String.IsNullOrEmpty(post.Image))
            {
                imageBytes = _imageRepository.GetImageBytes(post.Image);

                if (imageBytes != null)
                {
                    dto.Image = imageBytes;
                }
            }

            return(dto);
        }
Beispiel #7
0
        public WallPostLikersPage(WallPost postData)
        {
            Title           = AppResources.WallLikes;
            BackgroundColor = AppResources.WallPageBackgroundColor;

            var likes = new DynamicListData <WallPostLike>();

            likes.UpdateData(AppModel.Instance.GetWallPostLikes(postData));
            DataWrapper = new WallPostLikesWrapper(likes);

            var wrapper = new WallPostLikersWrapper(DataWrapper, postData);

            _likersListView = new ListView {
                HasUnevenRows       = false,
                RowHeight           = 60,
                ItemTemplate        = new DataTemplate(typeof(UserCell)),
                SeparatorVisibility = SeparatorVisibility.None,
                BackgroundColor     = Color.Transparent,
                ItemsSource         = DataWrapper,

                RefreshCommand         = wrapper.RefreshCommand,
                IsPullToRefreshEnabled = true,
                BindingContext         = wrapper
            };

            _likersListView.SetBinding <WallPostLikersWrapper> (ListView.IsRefreshingProperty, vm => vm.IsBusy, BindingMode.OneWay);

            Content = new ContentView {
                Content = _likersListView,
                Padding = new Thickness(10, 10, 10, 0)
            };
        }
Beispiel #8
0
 private WallPostModel MapWallPost(WallPost model)
 {
     if (model != null)
     {
         var result = new WallPostModel
         {
             Body         = model.Body,
             CreatedDate  = model.CreatedDate,
             Id           = model.Id,
             ModifiedDate = model.ModifiedDate,
             PostedBy     = model.CreatedBy,
             PostType     = model.PostType
         };
         if (model.UserWall != null)
         {
             result.WallOwner = new WallModel {
                 OwnerId = model.UserWall.UserId, WallOwnerType = WallType.user
             };
         }
         else if (model.GroupWall != null)
         {
             result.WallOwner = new WallModel {
                 OwnerId = model.GroupWall.GroupId, WallOwnerType = WallType.group
             };
         }
         return(result);
     }
     return(null);
 }
        public string GenerateTitleIfNecessary(WallPost wallPost)
        {
            string str = "";

            if (wallPost.attachments == null)
            {
                return(str);
            }
            if ((wallPost.attachments == null ? 0 : wallPost.attachments.Count <Attachment>((Func <Attachment, bool>)(a => a.photo != null))) > 0)
            {
                str = BaseFormatterHelper.FormatNumberOfSomething(wallPost.attachments.Count, BaseResources.OnePhotoFrm, BaseResources.TwoFourPhotosFrm, BaseResources.FivePhotosFrm, true, null, false);
            }
            List <Attachment>       attachments1 = wallPost.attachments;
            Func <Attachment, bool> predicate1   = (Func <Attachment, bool>)(a => a.link != null);

            if (attachments1.Any <Attachment>(predicate1))
            {
                str = BaseResources.Link;
            }
            List <Attachment>       attachments2 = wallPost.attachments;
            Func <Attachment, bool> predicate2   = (Func <Attachment, bool>)(a => a.Page != null);

            if (attachments2.Any <Attachment>(predicate2))
            {
                str = BaseResources.WikiPage;
            }
            return(str);
        }
Beispiel #10
0
    public string CreateWallPost(WallPost wallpost)
    {
        GraphClient client = new GraphClient(new Uri("http://localhost:7474/db/data"));

        client.Connect();

        IDictionary <string, object> qParams = new Dictionary <string, object>();

        qParams.Add("wrname", wallpost.writer);
        qParams.Add("recname", wallpost.recipient);
        qParams.Add("ts", wallpost.timestamp);
        qParams.Add("con", wallpost.content);

        // I'm sorry I have to use this abomination
        var query = new CypherQuery("MATCH (writer:User), (rec:User)" +
                                    "WHERE (writer.username = {wrname}) AND (rec.username = {recname})" +
                                    "CREATE (wp:WallPost {timestamp: {ts}, content: {con}}), (writer)-[:POSTED]->(wp), (rec)-[:HAS]->(wp)", qParams, CypherResultMode.Projection);

        ((IRawGraphClient)client).ExecuteCypher(query);

        // CURRENT VERSION OF C# CLIENT DOES NOT SUPPORT CHAIN CREATION!!!!!!!!!!!!!! --Bart
        //client.Cypher
        //    .Match("(writer:User)", "(recipient:User)")
        //    .Where((User writer) => writer.username == wallpost.writer)
        //    .AndWhere((User recipient) => recipient.username == wallpost.recipient)
        //    .Create("(wp:WallPost {timestamp:" + wallpost.timestamp + ", content:" + wallpost.content + "})," +
        //"(writer)-[:POSTED]->(wp), (recipient)-[:HAS]->(wp)")
        //    .ExecuteWithoutResults();

        return("success");
    }
Beispiel #11
0
        private string GetHighlightedText()
        {
            WallPost parsedParent1 = this._notification.ParsedParent as WallPost;

            if (parsedParent1 != null)
            {
                if (!string.IsNullOrEmpty(parsedParent1.text))
                {
                    return(this.CutText(parsedParent1.text));
                }
                if (parsedParent1.IsRepost())
                {
                    return(this.CutText(parsedParent1.copy_history[0].text));
                }
                return("");
            }
            Comment parsedParent2 = this._notification.ParsedParent as Comment;

            if (parsedParent2 != null)
            {
                return(this.CutText(parsedParent2.text ?? ""));
            }
            Topic parsedParent3 = this._notification.ParsedParent as Topic;

            if (parsedParent3 != null)
            {
                return(this.CutText(parsedParent3.title ?? ""));
            }
            return("");
        }
Beispiel #12
0
        public ActionResult CreateAccount(User model,
                                          HttpPostedFileBase file)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index", model));
            }

            if (db.Users.Any(u => u.Username == model.Username))
            {
                ModelState.AddModelError("", "Username " + model.Username +
                                         " is taken.");
                model.Username = "";
                return(View("Index", model));
            }

            db.Users.Add(model);
            db.SaveChanges();

            FormsAuthentication.SetAuthCookie(model.Username, false);

            model.ProfileImage = ConvertImage(file);

            WallPost wall = new WallPost()
            {
                Id          = model.Id,
                MessageText = "",
                DateEdited  = DateTime.Now
            };

            db.WallPosts.Add(wall);
            db.SaveChanges();

            return(Redirect("~/" + model.Username));
        }
        public void PostSingleNewsfeed(WallPost post)
        {
            new Thread(() => {
                NewsfeedDto dto = Mapper.Map <WallPost, NewsfeedDto>(post);

                NewsfeedRequest request = new NewsfeedRequest()
                {
                    RequestType = RequestType.PostSingle,
                    SingleDto   = dto,
                    Token       = "123498"
                                  //Token = _privateRepo.GetLocalUser().Token
                };

                BaseDto bDto = new BaseDto {
                    Type       = DtoType.Newsfeed,
                    JsonObject = JsonConvert.SerializeObject(request)
                };
                string result = _remoteConnection.Request(bDto);
                if (String.IsNullOrEmpty(result))
                {
                    Log.Error(Tag, "GetSingleWallpost error result is null");
                    return;
                }

                var resultObject = JsonConvert.DeserializeObject <NewsfeedDto>(result);

                if (resultObject.Error != null)
                {
                    Log.Error(Tag, resultObject.Error.Message);
                }
            }).Start();
        }
 public LikesAndCommentsItem(double width, Thickness margin, WallPost wallPost, Action commentsTapped, bool suppressRepostButton, bool displaySeparator)
     : base(width, margin, new Thickness())
 {
     if (wallPost == null)
     {
         Debugger.Break();
     }
     this._wallPost = wallPost;
     if (this._wallPost != null)
     {
         if (this._wallPost.likes == null)
         {
             this._wallPost.likes = new Likes();
         }
         if (this._wallPost.comments == null)
         {
             this._wallPost.comments = new Comments();
         }
         if (this._wallPost.reposts == null)
         {
             this._wallPost.reposts = new Reposts();
         }
     }
     this._itemType             = LikesAndCommentsItem.ItemType.Post;
     this._commentsTappedAction = commentsTapped;
     this._suppressRepostButton = suppressRepostButton;
     this._displaySeparator     = displaySeparator;
     this.Initialize();
 }
        private void RepostsCanvas_OnTap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            e.Handled        = true;
            this._sharePopup = new DialogService()
            {
                SetStatusBarBackground = true,
                HideOnNavigation       = false
            };
            WallPost wallPost = this._wallPost;

            this._sharePostUC = new SharePostUC(wallPost != null ? -wallPost.owner_id : 0L);
            this._sharePostUC.SetShareEnabled(this.CanPublish);
            this._sharePostUC.SetShareCommunityEnabled(this.CanRepostToCommunity);
            this._sharePostUC.SendTap += (EventHandler)((o, args) =>
            {
                ShareInternalContentDataProvider contentDataProvider = new ShareInternalContentDataProvider();
                contentDataProvider.Message = this._sharePostUC.Text;
                contentDataProvider.WallPost = this._wallPost;
                contentDataProvider.Video = this._video;
                contentDataProvider.StoreDataToRepository();
                ShareContentDataProviderManager.StoreDataProvider((IShareContentDataProvider)contentDataProvider);
                this._sharePopup.Hide();
                Navigator.Current.NavigateToPickConversation();
            });
            this._sharePostUC.ShareTap         += (EventHandler)((o, args) => this.Share(0, ""));
            this._sharePopup.Child              = (FrameworkElement)this._sharePostUC;
            this._sharePopup.AnimationType      = DialogService.AnimationTypes.None;
            this._sharePopup.AnimationTypeChild = DialogService.AnimationTypes.Swivel;
            this._sharePopup.Show(null);
        }
Beispiel #16
0
        private void ProcessWallPostFeedback()
        {
            if (this._wallPostItem == null)
            {
                WallPost parsedFeedback = this._notification.ParsedFeedback as WallPost;
                if (parsedFeedback.likes != null)
                {
                    parsedFeedback.likes.can_like = 1;
                }
                parsedFeedback.date = this._notification.Date;//todo:bug
                double    width  = this.Width;
                Thickness margin = new Thickness();
                int       num1   = 1;
                NewsItemDataWithUsersAndGroupsInfo wallPostWithInfo = new NewsItemDataWithUsersAndGroupsInfo();
                List <Group> groups = this._groups;
                wallPostWithInfo.Groups = groups;
                List <User> users = this._users;
                wallPostWithInfo.Profiles = users;
                WallPost wallPost = parsedFeedback;
                wallPostWithInfo.WallPost = wallPost;

                int num2 = 1;
                int num3 = 1;
                int num4 = this._showEarlierReplies ? 1 : 0;
                int num5 = 0;
                int num6 = 0;

                this._wallPostItem = new WallPostItem(width, margin, num1 != 0, wallPostWithInfo, null, num2 != 0, null, num3 != 0, num4 != 0, num5 != 0, num6 != 0, null, null);
                base.VirtualizableChildren.Add(this._wallPostItem);
            }
            this._fixedHeight = this._wallPostItem.FixedHeight + 16.0;
        }
 public static void ReportWallPost(WallPost wallPost, string adData = "")
 {
     if (string.IsNullOrEmpty(adData))
     {
         PageBase currentPage = FramePageUtils.CurrentPage;
         if (currentPage != null && currentPage.NavigationContext != null && currentPage.NavigationContext.QueryString.ContainsKey("AdData"))
         {
             adData = currentPage.NavigationContext.QueryString["AdData"];
         }
     }
     if (string.IsNullOrEmpty(adData))
     {
         PickerUC.ShowPickerFor(ReportContentHelper.GetPredefinedReportReasons(), (PickableItem)null, (Action <PickableItem>)(pi =>
         {
             if (wallPost.IsReply)
             {
                 WallService.Current.ReportComment(wallPost.from_id, wallPost.id, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)));
             }
             else
             {
                 WallService.Current.Report(wallPost.to_id, wallPost.id, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)));
             }
         }), (Action <PickableItem>)null, null, CommonResources.PostContains);
     }
     else
     {
         ReportContentHelper.ReportAdWallPost(adData);
     }
 }
        WallPost GetSingleNewsfeedInternal(int id)
        {
            NewsfeedRequest request = new NewsfeedRequest()
            {
                RequestType = RequestType.GetSingle,
                Id          = id
            };

            BaseDto bDto = new BaseDto {
                Type       = DtoType.Newsfeed,
                JsonObject = JsonConvert.SerializeObject(request)
            };
            string result = _remoteConnection.Request(bDto);

            if (String.IsNullOrEmpty(result))
            {
                Log.Error(Tag, "GetSingleWallpost error result is null");
                return(null);
            }

            NewsfeedDto dto = JsonConvert.DeserializeObject <NewsfeedDto>(result);

            if (dto == null)
            {
                Log.Error(Tag, String.Format("Could not parse newsfeeddto {0}", result));
                return(null);
            }

            WallPost post = Mapper.Map <NewsfeedDto, WallPost>(dto);

            return(post);
        }
 public DownloadWallPostLikesBackgroundTask(WallPost wallPost, DynamicListData <WallPostLike> data) : base(data,
                                                                                                           new KinveyDownloadListParameters(KinveyDownloadCountType.All,
                                                                                                                                            QueryBuilder.Instance.GetWallPostsLikesKinveyQuery(wallPost.Id)))
 {
     Post            = wallPost;
     LastUpdatedTime = DateTime.Now;
 }
        private FeedItem CreatePhotoPhotoTagItem(NewsItem newsFeedItem, List <Group> groups, List <User> profiles)
        {
            FeedItem feedItem     = new FeedItem();
            WallPost fromNewsItem = WallPost.CreateFromNewsItem(newsFeedItem);

            feedItem.DefaultTarget       = "/default";
            feedItem.Author.DisplayName  = fromNewsItem.GetAuthorDisplayName(groups, profiles);
            feedItem.Author.RemoteId     = RemoteIdHelper.GenerateUniqueRemoteId(fromNewsItem.from_id.ToString(), RemoteIdHelper.RemoteIdItemType.UserOrGroup);
            feedItem.Author.Username     = feedItem.Author.DisplayName;
            feedItem.ReactionDisplayKind = (ReactionDisplayKind)0;
            feedItem.Timestamp           = new DateTimeOffset(ExtensionsBase.UnixTimeStampToDateTime((double)fromNewsItem.date, true));
            feedItem.Style    = (FeedItemStyle)1;
            feedItem.RemoteId = RemoteIdHelper.GenerateUniqueRemoteId(fromNewsItem.GloballyUniqueId, RemoteIdHelper.RemoteIdItemType.WallPost);
            string photoTagFeedText = this.GetPhotoPhotoTagFeedText(newsFeedItem, groups, profiles);

            if (string.IsNullOrEmpty(photoTagFeedText))
            {
                return(null);
            }
            feedItem.PrimaryContent.Title = photoTagFeedText;
            string photosMode = "Photos";

            if (newsFeedItem.Photo_tags != null && newsFeedItem.Photo_tags.Count > 0)
            {
                photosMode = "PhotoTags";
            }
            this.ProcessAttachmentsIntoFeedItem(fromNewsItem, feedItem, null, null, photosMode);
            if (((ICollection <FeedMediaThumbnail>)feedItem.Thumbnails).Count > 0)
            {
                feedItem.DefaultTarget = feedItem.Thumbnails[0].Target;
            }
            return(feedItem);
        }
Beispiel #21
0
 private void ProcessWallPostFeedback()
 {
     if (this._wallPostItem == null)
     {
         WallPost wallPost = this._notification.ParsedFeedback as WallPost;
         if (wallPost.likes != null)
         {
             wallPost.likes.can_like = 1;
         }
         wallPost.date = this._notification.date;
         double    width  = this.Width;
         Thickness margin = new Thickness();
         int       num1   = 1;
         NewsItemDataWithUsersAndGroupsInfo wallPostWithInfo = new NewsItemDataWithUsersAndGroupsInfo();
         wallPostWithInfo.Groups   = this._groups;
         wallPostWithInfo.Profiles = this._users;
         wallPostWithInfo.WallPost = wallPost;
         object local1 = null;
         int    num2   = 1;
         object local2 = null;
         int    num3   = 1;
         int    num4   = this._showEarlierReplies ? 1 : 0;
         int    num5   = 0;
         int    num6   = 0;
         object local3 = null;
         object local4 = null;
         this._wallPostItem = new WallPostItem(width, margin, num1 != 0, wallPostWithInfo, (Action <WallPostItem>)local1, num2 != 0, (Action <long, User, Group>)local2, num3 != 0, num4 != 0, num5 != 0, num6 != 0, (NewsFeedAdsItem)local3, (Func <List <MenuItem> >)local4);
         this.VirtualizableChildren.Add((IVirtualizable)this._wallPostItem);
     }
     this._fixedHeight = this._wallPostItem.FixedHeight + 16.0;
 }
Beispiel #22
0
        // Editting Wall Post
        public void EditWallPost(WallPost wp)
        {
            WallPost wallPost = this.GetWallPost(wp.WallPostId);

            wallPost.Description = wp.Description;
            db.SaveChanges();
        }
Beispiel #23
0
        public NotificationCollection SaveWallPost(WallPost wallPost)
        {
            var result = NotificationCollection.CreateEmpty();

            result += repository.Save(wallPost);

            return(result);
        }
Beispiel #24
0
        public IActionResult EditWallPost(int GroupId, int WallPostId)
        {
            ViewBag.Me      = userService.GetPersonBasedOnId(User.Identity.GetPersonId());
            ViewBag.GroupId = GroupId;
            WallPost wp = wallService.GetWallPost(WallPostId);

            return(View("_EditWallPostPartial", wp));
        }
 public static long GetChildItemFromId(this WallPost wallPost)
 {
     if (wallPost.copy_history == null || wallPost.copy_history.Count <= 0)
     {
         return(0);
     }
     return(wallPost.copy_history[0].from_id);
 }
 public static string GetFromToString(this WallPost wallPost, List <Group> groups, List <User> users)
 {
     if (wallPost.from_id == wallPost.to_id)
     {
         return("");
     }
     return(string.Format("{0} ▶ {1}", WallPostExtensions.GetUserOrGroupName(wallPost.from_id, groups, users), WallPostExtensions.GetUserOrGroupName(wallPost.to_id, groups, users)));
 }
 public static bool IsRepost(this WallPost wallPost)
 {
     if (wallPost.copy_history != null)
     {
         return(wallPost.copy_history.Count > 0);
     }
     return(false);
 }
Beispiel #28
0
 public static void NavigateToEditWallPost(this WallPost wallPost, int adminLevel)
 {
     if (wallPost == null)
     {
         return;
     }
     ParametersRepository.SetParameterForId("EditWallPost", (object)wallPost);
     Navigator.Current.NavigateToNewWallPost(Math.Abs(wallPost.to_id), wallPost.to_id < 0L, adminLevel, false, false, false);
 }
Beispiel #29
0
        public IActionResult AddWallPost(int id, WallPost wp)
        {
            wp.PosterName = User.Identity.GetName();
            wp.PosterId   = User.Identity.GetPersonId();
            wp.DatePosted = DateTime.Now;
            wallService.AddWallPost(wp);

            return(RedirectToAction(nameof(Index), new { id = wp.PosterId }));
        }
        public PostWallLikeBackgroundTask(User user, WallPost post) :
            base(QueryBuilder.Instance.GetPostWallPostLikeKinveyQuery(),
                 new AddWallPostLike(user.Id, post.Id),
                 true)

        {
            User     = user;
            WallPost = post;
        }