RoomDataSource: Improve live location sharing status verification.

This commit is contained in:
SBiOSoftWhare
2022-05-20 15:14:59 +02:00
parent fe883110c8
commit d8e9049dd2
@@ -1199,16 +1199,18 @@ const CGFloat kTypingCellHeight = 24;
{
MXLocationService *locationService = self.mxSession.locationService;
if (!locationService || !self.roomId)
NSString *roomId = self.roomId;
if (!locationService || !roomId)
{
return;
}
BOOL isUserSharingActiveLocation = [locationService isCurrentUserSharingActiveLocationInRoomWithId:self.roomId];
BOOL isUserSharingActiveLocation = [locationService isCurrentUserSharingActiveLocationInRoomWithId:roomId];
if (isUserSharingActiveLocation != self.isCurrentUserSharingActiveLocation)
{
self.isCurrentUserSharingActiveLocation = [locationService isCurrentUserSharingActiveLocationInRoomWithId:self.roomId];
self.isCurrentUserSharingActiveLocation = isUserSharingActiveLocation;
dispatch_async(dispatch_get_main_queue(), ^{
[self.roomDataSourceDelegate roomDataSourceDidUpdateCurrentUserSharingLocationStatus:self];