Correctly filtering out the channel id from the reply to list

pull/55/head
Vitor Pamplona 2023-01-27 22:04:45 -03:00
rodzic 11cfc90d36
commit 59dc19720f
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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) }
}