mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 18:25:21 +00:00
fix: MessageRouter uses stale BluetoothMeshService reference
This commit is contained in:
@@ -11,7 +11,7 @@ import com.bitchat.android.nostr.NostrTransport
|
|||||||
*/
|
*/
|
||||||
class MessageRouter private constructor(
|
class MessageRouter private constructor(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
private val mesh: BluetoothMeshService,
|
private var mesh: BluetoothMeshService,
|
||||||
private val nostr: NostrTransport
|
private val nostr: NostrTransport
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
@@ -23,6 +23,7 @@ class MessageRouter private constructor(
|
|||||||
val nostr = NostrTransport.getInstance(context)
|
val nostr = NostrTransport.getInstance(context)
|
||||||
INSTANCE?.also {
|
INSTANCE?.also {
|
||||||
// Update mesh reference if needed and keep senderPeerID in sync
|
// Update mesh reference if needed and keep senderPeerID in sync
|
||||||
|
it.mesh = mesh
|
||||||
it.nostr.senderPeerID = mesh.myPeerID
|
it.nostr.senderPeerID = mesh.myPeerID
|
||||||
return it
|
return it
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user