/// <summary> /// Method to remove a user's membership with the current user /// </summary> public void RemoveUser() { if (this.relationship != ProviderUserRelationship.Linked) { throw new ApplicationException("User is not in the Linked relationship state"); } // Need to get the account information so we can Remove the member Account account = AccountManagement.GetAccountByName(this.accountName); account.RemoveUser(this.id, String.Empty); ProviderUserManager.RemoveProviderUser(this.uri, this.protocol); }
/// <summary> /// Method to revoke an outstanding invitation /// </summary> public void RevokeInvitation() { if (this.relationship != ProviderUserRelationship.SentInvitation) { throw new ApplicationException("User is not in the SentInvitation relationship state"); } // Need to get the account information so we can AddMember // to the correct group Account account = AccountManagement.GetAccountByName(this.accountName); account.RemoveUser(this.id, String.Empty); this.relationship = ProviderUserRelationship.Unknown; ProviderUserManager.RemoveProviderUser(this.uri, this.protocol); }
/// <summary> /// Deny a user who is requesting authorization to chat /// </summary> public void DenyAuthorization(string message) { if (this.relationship != ProviderUserRelationship.ReceivedInvitation) { throw new ApplicationException("User is not in the ReceivedInvitation state"); } // Need to get the account information so we can AddMember // to the correct group Account account = AccountManagement.GetAccountByName(this.accountName); account.AuthorizeUser(false, this.id, message); this.relationship = ProviderUserRelationship.Unknown; ProviderUserManager.RemoveProviderUser(this.uri, this.protocol); }