Merge pull request #6146 from vector-im/maximee/PSF-986_lls_fix_live_banner_visibility

6111: add refresh of live banner visibility when receive beacon from …
This commit is contained in:
MaximeEvrard42 2022-05-12 14:56:48 +02:00 committed by GitHub
commit e0237d421b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View file

@ -67,7 +67,7 @@
@property (nonatomic, nullable) NSString *highlightedEventId;
/// Is current user sharing is location in the room
@property(nonatomic, readonly) BOOL isCurrentUserSharingIsLocation;
@property(nonatomic, readonly) BOOL isCurrentUserSharingActiveLocation;
/**
Check if there is an active jitsi widget in the room and return it.

View file

@ -59,7 +59,7 @@ const CGFloat kTypingCellHeight = 24;
@property (nonatomic) NSInteger typingCellIndex;
@property(nonatomic, readwrite) BOOL isCurrentUserSharingIsLocation;
@property(nonatomic, readwrite) BOOL isCurrentUserSharingActiveLocation;
@end
@ -767,6 +767,7 @@ const CGFloat kTypingCellHeight = 24;
MXWeakify(self);
self.beaconInfoSummaryListener = [self.mxSession.aggregations.beaconAggregations listenToBeaconInfoSummaryUpdateInRoomWithId:self.roomId handler:^(id<MXBeaconInfoSummaryProtocol> beaconInfoSummary) {
MXStrongifyAndReturnIfNil(self);
[self updateCurrentUserLocationSharingStatus];
[self refreshFirstCellWithBeaconInfoSummary:beaconInfoSummary];
}];
}
@ -1203,11 +1204,11 @@ const CGFloat kTypingCellHeight = 24;
return;
}
BOOL isUserSharingIsLocation = [locationService isCurrentUserSharingIsLocationInRoomWithId:self.roomId];
BOOL isUserSharingActiveLocation = [locationService isCurrentUserSharingActiveLocationInRoomWithId:self.roomId];
if (isUserSharingIsLocation != self.isCurrentUserSharingIsLocation)
if (isUserSharingActiveLocation != self.isCurrentUserSharingActiveLocation)
{
self.isCurrentUserSharingIsLocation = [locationService isCurrentUserSharingIsLocationInRoomWithId:self.roomId];
self.isCurrentUserSharingActiveLocation = [locationService isCurrentUserSharingActiveLocationInRoomWithId:self.roomId];
dispatch_async(dispatch_get_main_queue(), ^{
[self.roomDataSourceDelegate roomDataSourceDidUpdateCurrentUserSharingLocationStatus:self];

View file

@ -1531,7 +1531,7 @@ static CGSize kThreadListBarButtonItemImageSize;
- (BOOL)shouldShowLiveLocationSharingBannerView
{
return self.customizedRoomDataSource.isCurrentUserSharingIsLocation;
return self.customizedRoomDataSource.isCurrentUserSharingActiveLocation;
}
#pragma mark - Internals

1
changelog.d/6111.bugfix Normal file
View file

@ -0,0 +1 @@
Location sharing: handle correctly visibility of the live banner in room