updateChannelActivityTimeThenSend function

This commit is contained in:
islam
2025-09-18 02:09:05 +01:00
parent 588cef72ce
commit 2bc875dee5
+6 -7
View File
@@ -1464,22 +1464,21 @@ final class ChatViewModel: ObservableObject, BitchatDelegate {
// Force immediate UI update for user's own messages // Force immediate UI update for user's own messages
objectWillChange.send() objectWillChange.send()
// Update channel activity time on send updateChannelActivityTimeThenSend(content: content, trimmed: trimmed, mentions: mentions)
}
private func updateChannelActivityTimeThenSend(content: String, trimmed: String, mentions: [String]) {
switch activeChannel { switch activeChannel {
case .mesh: case .mesh:
lastPublicActivityAt["mesh"] = Date() lastPublicActivityAt["mesh"] = Date()
// Send via mesh with mentions
meshService.sendMessage(content, mentions: mentions)
case .location(let ch): case .location(let ch):
lastPublicActivityAt["geo:\(ch.geohash)"] = Date() lastPublicActivityAt["geo:\(ch.geohash)"] = Date()
}
if case .location(let ch) = activeChannel {
// Send to geohash channel via Nostr ephemeral // Send to geohash channel via Nostr ephemeral
Task { @MainActor in Task { @MainActor in
sendGeohash(ch: ch, content: trimmed) sendGeohash(ch: ch, content: trimmed)
} }
} else {
// Send via mesh with mentions
meshService.sendMessage(content, mentions: mentions)
} }
} }