Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        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);
        }