mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 01:45:22 +00:00
Nostr geohash (#276)
* first nostr build * add test file * internet access * fix relay manager * fix serialization * demo service - remove later * fix nostr * event dedupe * dedupe * ui wip * can send messages * subscription works * works * favs * works * delete chat on change * fix mentions * remove autojoin channels * styling * adjust colors * ui changes * live updates working * use local timestamp * message history in background * robust * fixes * nicknames refresh optimization * nostr service * refactor nostr * style * geohash works * centralize colors * refactoring * disable DMs for now: click on peer nickname doesnt open chat list in geohash mode * use local time * less logging * robustness * scroll nickname * adjust some text
This commit is contained in:
@@ -472,6 +472,18 @@ class BluetoothMeshService(private val context: Context) {
|
||||
|
||||
Log.d(TAG, "📨 Sending PM to $recipientPeerID: ${content.take(30)}...")
|
||||
|
||||
// Check if this is a Nostr contact (geohash DM)
|
||||
if (recipientPeerID.startsWith("nostr_")) {
|
||||
// Get NostrGeohashService instance and send via Nostr
|
||||
try {
|
||||
val nostrGeohashService = com.bitchat.android.nostr.NostrGeohashService.getInstance(context.applicationContext as android.app.Application)
|
||||
nostrGeohashService.sendNostrGeohashDM(content, recipientPeerID, finalMessageID, myPeerID)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to send Nostr geohash DM: ${e.message}")
|
||||
}
|
||||
return@launch
|
||||
}
|
||||
|
||||
// Check if we have an established Noise session
|
||||
if (encryptionService.hasEstablishedSession(recipientPeerID)) {
|
||||
try {
|
||||
@@ -537,6 +549,18 @@ class BluetoothMeshService(private val context: Context) {
|
||||
serviceScope.launch {
|
||||
Log.d(TAG, "📖 Sending read receipt for message $messageID to $recipientPeerID")
|
||||
|
||||
// Check if this is a Nostr contact (geohash DM)
|
||||
if (recipientPeerID.startsWith("nostr_")) {
|
||||
// Get NostrGeohashService instance and send read receipt via Nostr
|
||||
try {
|
||||
val nostrGeohashService = com.bitchat.android.nostr.NostrGeohashService.getInstance(context.applicationContext as android.app.Application)
|
||||
nostrGeohashService.sendNostrGeohashReadReceipt(messageID, recipientPeerID, myPeerID)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to send Nostr geohash read receipt: ${e.message}")
|
||||
}
|
||||
return@launch
|
||||
}
|
||||
|
||||
try {
|
||||
// Create read receipt payload using NoisePayloadType exactly like iOS
|
||||
val readReceiptPayload = com.bitchat.android.model.NoisePayload(
|
||||
|
||||
Reference in New Issue
Block a user