Skip to content

Commit

Permalink
Fix: leave should not execute kick as user can't kick itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwalkalone69 committed May 2, 2023
1 parent 533f27c commit 94cbbb6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/intent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,7 @@ export class Intent {
* @param reason An optional string to explain why the user left the room.
*/
public async leave(roomId: string, reason?: string) {
if (reason) {
await this.botSdkIntent.ensureRegistered();
return this.botSdkIntent.underlyingClient.kickUser(this.userId, roomId, reason);
}
await this.botSdkIntent.ensureRegistered();
return this.botSdkIntent.leaveRoom(roomId);
}

Expand Down

0 comments on commit 94cbbb6

Please sign in to comment.