Merge pull request #6190 from vector-im/steve/6189_roomdatasource_crash

RoomDataSource: Improve live location sharing status verification
This commit is contained in:
SBiOSoftWhare 2022-05-20 15:58:06 +02:00 committed by GitHub
commit 2e0e90eed1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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];