Example #1
0
        public void Share(string statusId)
        {
            this.Init();
            var share = new Share { TimeShared = DateTime.Now, StatusId = statusId, UserId = this._curUserChat.UserId };
            this._shareRepository.AddShare(share);

            var message = this._statusMessageRepository.GetMessageByStatusId(statusId);

            var messageProcessed = ProcessMessage.ProcessMessageStatus(statusId, this._curUserChat, message, null);

            var newFeedId = SequentialGuid.Create();
            NewFeeds newfeed = new NewFeeds
            {
                UserId = this._curUserChat.UserId,
                NewFeedId = newFeedId,
                TypeActionId = TypeAction.SHARE,
                StatusId_Or_UserId = statusId
            };
            this._newFeedRepository.AddNewFeed(newfeed);

            var ownerStatus = this._statusRepository.GetShortStatusByStatusId(statusId);

            Clients.Clients(this._allUserRelate_ConnectionId).share(this._curUserChat.Displayname, messageProcessed);
            Clients.Clients(this._friendListConnectionId_Online).likeNewFeeds(this._curUserChat, statusId, ownerStatus.UserOwner.Displayname);
        }
 public void AddShare(Share share)
 {
     this._db.Shares.Add(share);
     this.Save();
 }