Correctly filtering out the channel id from the reply to list

This commit is contained in:
Vitor Pamplona
2023-01-27 22:04:45 -03:00
parent 11cfc90d36
commit 59dc19720f

View File

@@ -19,7 +19,7 @@ class ChannelMessageEvent (
init {
channel = tags.firstOrNull { it[0] == "e" && it.size > 3 && it[3] == "root" }?.getOrNull(1) ?: tags.firstOrNull { it.firstOrNull() == "e" }?.getOrNull(1)
replyTos = tags.filter { it.firstOrNull() == "e" && (it.size < 3 || (it.size > 3 && it[3] != "root")) }.mapNotNull { it.getOrNull(1) }
replyTos = tags.filter { it.getOrNull(1) != channel }.mapNotNull { it.getOrNull(1) }
mentions = tags.filter { it.firstOrNull() == "p" }.mapNotNull { it.getOrNull(1) }
}