public void Join(MssgsConversation conversation) { if (this.InConversation) { throw new Exception("Already in conversation!"); } this.ExecuteCommand(new JoinConversationCommand(conversation.Id, this.Name), (UsernameInfo info) => { if (info.Used) { throw new MssgsApiException("This username is already being used!"); } if (!info.Valid) { throw new MssgsApiException("This username isn't valid!"); } this.Name = info.Username; this.InConversation = true; this.Conversation = conversation; if (this.ConversationJoined != null) { this.ConversationJoined(conversation); } } ); }
public void Join(MssgsConversation conversation, string name) { this.Name = name; this.Join(conversation); }