Example #1
0
        public void Comment(string statusId, string cmtMessage)
        {
            this.Init();
            var commentId = SequentialGuid.Create();
            var comment = new DemoSignalRChat.Models.Comment
            {
                CommentId = commentId,
                Content = cmtMessage,
                StatusId = statusId,
                UserId = this._curUserChat.UserId,
                TimeComment = DateTime.Now
            };

            this._commentRepository.AddComment(comment);

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

            string commentDisplay = ProcessComment.ProcessNewComment(this._curUserChat, cmtMessage);

            Clients.Clients(this._allUserRelate_ConnectionId).comment(this._curUserChat.Displayname, statusId, commentDisplay);
        }
Example #2
0
        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);
        }
Example #3
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);
        }
Example #4
0
        public void Like(string statusId)
        {
            this.Init();
            var like = new Like { TimeLiked = DateTime.Now, StatusId = statusId, UserId = this._curUserChat.UserId };
            this._likeRepository.Like(like);

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

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

            Clients.Clients(this._allUserRelate_ConnectionId).like(this._curUserChat.Displayname, statusId);
            Clients.Clients(this._friendListConnectionId_Online).likeNewFeeds(this._curUserChat, statusId, ownerStatus.UserOwner.Displayname);
        }