mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 03:05:19 +00:00
Fix/general queue (#580)
* Fix emote targeting and grammar; add tests Prevent 'system' mis-target via peerID-derived display name in actions sheet. Correct /hug and /slap usage/error grammar by passing base command name. Improve geohash nickname resolution to match displayName with #suffix. Add CommandProcessor tests. * Geohash ordering: strict in-order inserts and timestamp clamp Use channel-aware late-insert threshold with 0s for geohash to keep strict chronological order. Clamp future Nostr event timestamps to 'now' to avoid future-dated items skewing order in geohash timelines. * Trim trailing/leading spaces in geohash nicknames and tag emission Sanitize Nostr 'n' tag values on ingest and emit by trimming whitespace/newlines to prevent trailing spaces in displayed usernames. Local nickname is already trimmed on focus loss and submit. --------- Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -444,7 +444,19 @@ struct ContentView: View {
|
||||
let id = url.path.trimmingCharacters(in: CharacterSet(charactersIn: "/"))
|
||||
let peerID = id.removingPercentEncoding ?? id
|
||||
selectedMessageSenderID = peerID
|
||||
selectedMessageSender = viewModel.messages.last(where: { $0.senderPeerID == peerID })?.sender
|
||||
// Derive a stable display name from the peerID instead of peeking at the last message,
|
||||
// which may be a transformed system action (sender == "system").
|
||||
if peerID.hasPrefix("nostr") {
|
||||
// For geohash senders, resolve display name via mapping (works for "nostr:" and "nostr_" keys)
|
||||
selectedMessageSender = viewModel.geohashDisplayName(for: peerID)
|
||||
} else {
|
||||
// Mesh sender: use current mesh nickname if available; otherwise fall back to last non-system message
|
||||
if let name = viewModel.meshService.peerNickname(peerID: peerID) {
|
||||
selectedMessageSender = name
|
||||
} else {
|
||||
selectedMessageSender = viewModel.messages.last(where: { $0.senderPeerID == peerID && $0.sender != "system" })?.sender
|
||||
}
|
||||
}
|
||||
showMessageActions = true
|
||||
}
|
||||
.onOpenURL { url in
|
||||
|
||||
Reference in New Issue
Block a user