mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 09:45:19 +00:00
Add 'Send private message' action to chat user sheet (#649)
* Add 'Send private message' action to chat user sheet * Change 'Send private message' action color to purple * Fix: Resolve short ID against all participants, not just cached nicknames * Fix: Correctly open private chat sheet for mesh peers --------- Co-authored-by: a1denvalu3 <>
This commit is contained in:
co-authored by
a1denvalu3 <>
parent
dac81b2c3b
commit
96b35e957c
@@ -43,6 +43,20 @@ class GeohashRepository(
|
||||
}?.key
|
||||
}
|
||||
|
||||
fun findPubkeyByShortId(shortId: String): String? {
|
||||
// First check cached nicknames (fastest)
|
||||
var found = geoNicknames.keys.firstOrNull { it.startsWith(shortId, ignoreCase = true) }
|
||||
if (found != null) return found
|
||||
|
||||
// If not found in nicknames (e.g. anon user), check all known participants across all geohashes
|
||||
for (participants in geohashParticipants.values) {
|
||||
found = participants.keys.firstOrNull { it.startsWith(shortId, ignoreCase = true) }
|
||||
if (found != null) return found
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
// peerID alias -> nostr pubkey mapping for geohash DMs and temp aliases
|
||||
private val nostrKeyMapping: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user