public void leaveChannel(string channelName) { Entity entity = new Entity(); entity.id = "chatjoin"; LeaveChat leaveChat = new LeaveChat(); ChatChannel chatChannel = new ChatChannel(); chatChannel.name = channelName; leaveChat.chatChannel.Add(chatChannel); entity.leaveChat = leaveChat; actorSystem.Find("/remote/default").Tell(entity); }
// Simple usage, just sends text public void sendMessage(string senderId, string channelName, string messageText, string messageType) { Entity entity = new Entity(); entity.id = "chatmessage"; ChatMessage chatMessage = new ChatMessage(); ChatChannel chatChannel = new ChatChannel(); chatChannel.name = channelName; chatMessage.chatChannel = chatChannel; chatMessage.message = messageText; chatMessage.type = messageType; chatMessage.senderId = senderId; entity.chatMessage = chatMessage; actorSystem.Find("/remote/default").Tell(entity); }
// flags is a pipe separated list of strings. Currently subscribers is the only flag recognized // If the subscribers flag is set, the status updates from the server will include a list of subscribers // in each channel, instead of just the channel name. public void joinChannel(string channelName, string flags = "") { if (subscriptions.Contains(channelName)) { return; } Entity entity = new Entity(); entity.id = "chatjoin"; JoinChat joinChat = new JoinChat(); ChatChannel chatChannel = new ChatChannel(); chatChannel.name = channelName; chatChannel.flags = flags; joinChat.chatChannel.Add(chatChannel); entity.joinChat = joinChat; actorSystem.Find("/remote/default").Tell(entity); }