refresh peer list more often

This commit is contained in:
callebtc
2026-01-05 10:40:23 +07:00
parent 27c6dc5ed9
commit ee4b2610f9
4 changed files with 36 additions and 3 deletions
@@ -81,6 +81,7 @@ class WifiAwareMeshService(private val context: Context) : MeshService, Transpor
field = value
if (::meshCore.isInitialized) {
meshCore.delegate = value
meshCore.refreshPeerList()
}
}
private val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
@@ -114,6 +115,9 @@ class WifiAwareMeshService(private val context: Context) : MeshService, Transpor
try { meshCore.gossipSyncManager.scheduleInitialSyncToPeer(pid, 1_000) } catch (_: Exception) { }
}
},
announcementNicknameProvider = {
try { com.bitchat.android.services.NicknameProvider.getNickname(context, myPeerID) } catch (_: Exception) { null }
},
leavePayloadProvider = {
(delegate?.getNickname() ?: myPeerID).toByteArray(Charsets.UTF_8)
}