예제 #1
0
        public HttpResponseMessage AddMessage(ChannelAddMessageModel channelModel)
        {
            var responseMsg = this.PerformOperation(() =>
            {
                ChannelsRepository.AddMessage(channelModel.Name, channelModel.Nickname, channelModel.Message);
            });

            pubnub.Publish(channelModel.Name, channelModel.Message);

            return(responseMsg);
        }
예제 #2
0
        public HttpResponseMessage AddMessage(ChannelAddMessageModel channelModel)
        {
            var responseMsg = this.PerformOperation(() =>
            {
                var index   = channelModel.Message.IndexOf(':');
                var message = channelModel.Message.Substring(index + 2);
                ChannelsRepository.AddMessage(channelModel.Name, channelModel.Nickname, message);
            });

            pubnub.Publish(channelModel.Name, channelModel.Message);

            return(responseMsg);
        }