-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live Location Sharing - Update beacon info state event when sharing is ended #5758
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just added small comments to improve code.
@@ -140,6 +145,25 @@ class LocationSharingService : VectorService(), LocationTracker.Callback { | |||
} | |||
} | |||
|
|||
private fun updateStoppedBeaconInfo(roomId: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify namings what do you think about renaming this method to sendStoppedBeaconInfo()
and the method sendBeaconInfo()
to sendLivedBeaconInfo()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
override fun onServiceConnected(className: ComponentName, binder: IBinder) { | ||
locationSharingService = (binder as LocationSharingService.LocalBinder).getService() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we reset locationSharingService
to null
in onServiceDisconnected
for safety reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, done.
?.let { session -> | ||
session.coroutineScope.launch(session.coroutineDispatchers.io) { | ||
val room = session.getRoom(roomId) | ||
EventType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need to add a filter to get all state events with lived=true
. Normally there should be only a single live beacon per user per room. Maybe we need to extract it into a dedicated method to use it also in sendLiveLocation
. I see in this last method 2 missing filters: the state_key=userId and lived=true which will be solved by this new method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to an helper function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay for me.
No description provided.