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 PostStatus(string message, string location) { this.Init(); var statusId = SequentialGuid.Create(); Status status = new Status { StatusId = statusId, UserId = this._curUserChat.UserId }; this._statusRepository.AddStatus(status); this._statusMessageRepository.AddMessage(new StatusMessage { StatusId = statusId, Message = message }); if (!string.IsNullOrEmpty(location)) { this._statusLocationRepository.AddLocation(statusId, location); } var newFeedId = SequentialGuid.Create(); NewFeeds newfeed = new NewFeeds { UserId = this._curUserChat.UserId, NewFeedId = newFeedId, TypeActionId = TypeAction.POST_STATUS, StatusId_Or_UserId = statusId }; this._newFeedRepository.AddNewFeed(newfeed); message = ProcessMessage.ProcessMessageStatus(statusId, this._curUserChat, message, null); Clients.Clients(this._allUserRelate_ConnectionId).postCastStatus(this._curUserChat.Displayname, message); Clients.Clients(this._friendListConnectionId_Online).statusNewFeeds(this._curUserChat); }
public void PostImage(string message, string[] imageNames) { this.Init(); var statusId = SequentialGuid.Create(); Status status = new Status { StatusId = statusId, UserId = this._curUserChat.UserId }; this._statusRepository.AddStatus(status); this._statusMessageRepository.AddMessage(new StatusMessage { StatusId = statusId, Message = message }); message = ProcessMessage.ProcessMessageStatus(statusId, this._curUserChat, message, imageNames); this._statusImageRepository.AddRangeImage(statusId, imageNames); Clients.Clients(this._allUserRelate_ConnectionId).postImage(this._curUserChat.Displayname, message); }