Fixing Ephemeral Chat interface

This commit is contained in:
Vitor Pamplona
2025-07-10 19:42:18 -04:00
parent e3acf4c250
commit a94c8673d5
6 changed files with 46 additions and 161 deletions
@@ -26,8 +26,17 @@ import com.vitorpamplona.quartz.nip01Core.relay.normalizer.displayUrl
data class RoomId(
val id: String,
val relayUrl: NormalizedRelayUrl,
) {
) : Comparable<RoomId> {
fun toKey() = "$id@$relayUrl"
fun toDisplayKey() = id + "@" + relayUrl.displayUrl()
override fun compareTo(other: RoomId): Int {
val result = id.compareTo(other.id)
return if (result == 0) {
relayUrl.url.compareTo(other.relayUrl.url)
} else {
result
}
}
}
@@ -39,7 +39,7 @@ class RelayTag {
ensure(tag[0] == TAG_NAME) { return null }
ensure(tag[1].isNotEmpty()) { return null }
return RelayUrlNormalizer.normalizeOrNull(tag[1]) ?: return null
return RelayUrlNormalizer.normalizeOrNull(tag[1])
}
@JvmStatic
@@ -149,7 +149,6 @@ open class BasicRelayClient(
override fun onMessage(text: String) {
// Log.d(logTag, "Receiving: $text")
stats.addBytesReceived(text.bytesUsedInMemory())
try {