mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 23:25:20 +00:00
Merge fixes/location-channels into main: resolve LocationChannelsSheet conflict (retain title bolding only)
This commit is contained in:
@@ -136,8 +136,8 @@ class CommandProcessor {
|
|||||||
chatViewModel?.addLocalPrivateSystemMessage(localText, to: targetPeerID)
|
chatViewModel?.addLocalPrivateSystemMessage(localText, to: targetPeerID)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// In public chat: send to mesh and also add a local system echo so sender sees it immediately
|
// In public chat: send to active public channel (mesh or geohash)
|
||||||
meshService?.sendMessage(emoteContent, mentions: [])
|
chatViewModel?.sendPublicRaw(emoteContent)
|
||||||
let publicEcho = "\(emoji) \(myNickname) \(action) \(nickname)\(suffix)"
|
let publicEcho = "\(emoji) \(myNickname) \(action) \(nickname)\(suffix)"
|
||||||
chatViewModel?.addPublicSystemMessage(publicEcho)
|
chatViewModel?.addPublicSystemMessage(publicEcho)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2147,9 +2147,34 @@ class ChatViewModel: ObservableObject, BitchatDelegate {
|
|||||||
trimPrivateChatMessagesIfNeeded(for: peerID)
|
trimPrivateChatMessagesIfNeeded(for: peerID)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// In public chat - send to everyone
|
// In public chat - send to active public channel
|
||||||
|
#if os(iOS)
|
||||||
|
switch activeChannel {
|
||||||
|
case .mesh:
|
||||||
|
meshService.sendMessage(screenshotMessage, mentions: [])
|
||||||
|
case .location(let ch):
|
||||||
|
Task { @MainActor in
|
||||||
|
do {
|
||||||
|
let identity = try NostrIdentityBridge.deriveIdentity(forGeohash: ch.geohash)
|
||||||
|
let event = try NostrProtocol.createEphemeralGeohashEvent(
|
||||||
|
content: screenshotMessage,
|
||||||
|
geohash: ch.geohash,
|
||||||
|
senderIdentity: identity,
|
||||||
|
nickname: self.nickname
|
||||||
|
)
|
||||||
|
NostrRelayManager.shared.sendEvent(event)
|
||||||
|
// Track ourselves as active participant
|
||||||
|
self.recordGeoParticipant(pubkeyHex: identity.publicKeyHex)
|
||||||
|
} catch {
|
||||||
|
SecureLogger.log("❌ Failed to send geohash screenshot message: \(error)", category: SecureLogger.session, level: .error)
|
||||||
|
self.addSystemMessage("failed to send to location channel")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
meshService.sendMessage(screenshotMessage, mentions: [])
|
meshService.sendMessage(screenshotMessage, mentions: [])
|
||||||
|
#endif
|
||||||
|
|
||||||
// Show local notification immediately as system message
|
// Show local notification immediately as system message
|
||||||
let localNotification = BitchatMessage(
|
let localNotification = BitchatMessage(
|
||||||
sender: "system",
|
sender: "system",
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ struct LocationChannelsSheet: View {
|
|||||||
let namePart = nameBase.map { formattedNamePrefix(for: channel.level) + $0 }
|
let namePart = nameBase.map { formattedNamePrefix(for: channel.level) + $0 }
|
||||||
let subtitlePrefix = "#\(channel.geohash) • \(coverage)"
|
let subtitlePrefix = "#\(channel.geohash) • \(coverage)"
|
||||||
let highlight = viewModel.geohashParticipantCount(for: channel.geohash) > 0
|
let highlight = viewModel.geohashParticipantCount(for: channel.geohash) > 0
|
||||||
channelRow(title: geohashTitleWithCount(for: channel), subtitlePrefix: subtitlePrefix, subtitleName: namePart, subtitleNameBold: highlight, isSelected: isSelected(channel), titleBold: highlight) {
|
channelRow(title: geohashTitleWithCount(for: channel), subtitlePrefix: subtitlePrefix, subtitleName: namePart, isSelected: isSelected(channel), titleBold: highlight) {
|
||||||
manager.select(ChannelID.location(channel))
|
manager.select(ChannelID.location(channel))
|
||||||
isPresented = false
|
isPresented = false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user