mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 22:05:21 +00:00
updateChannelActivityTimeThenSend function
This commit is contained in:
@@ -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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user