BugFix for when the private room is with yourself.
This commit is contained in:
@@ -29,16 +29,18 @@ class ChatMessageEvent(
|
|||||||
fun talkingWith(oneSideHex: String): Set<HexKey> {
|
fun talkingWith(oneSideHex: String): Set<HexKey> {
|
||||||
val listedPubKeys = recipientsPubKey()
|
val listedPubKeys = recipientsPubKey()
|
||||||
|
|
||||||
return if (pubKey == oneSideHex) {
|
val result = if (pubKey == oneSideHex) {
|
||||||
if (listedPubKeys.isEmpty()) {
|
listedPubKeys.minus(oneSideHex).toSet()
|
||||||
// talking to myself
|
|
||||||
return setOf(pubKey)
|
|
||||||
} else {
|
|
||||||
listedPubKeys.minus(oneSideHex).toSet()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
listedPubKeys.plus(pubKey).minus(oneSideHex).toSet()
|
listedPubKeys.plus(pubKey).minus(oneSideHex).toSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.isEmpty()) {
|
||||||
|
// talking to myself
|
||||||
|
return setOf(pubKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun chatroomKey(toRemove: String): ChatroomKey {
|
override fun chatroomKey(toRemove: String): ChatroomKey {
|
||||||
|
|||||||
Reference in New Issue
Block a user