public fun Channel.isOneToOne(currentUser: User?): Boolean { return isDistinct() && members.size == 2 && members.any { it.user.id == currentUser?.id } }
Checks if the channel is a direct conversation between the current user and some other user. A one-to-one chat is basically a corner case of a distinct channel with only 2 members.