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); }
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); }