Merge pull request #3323 from vector-im/riot_3321

Highlight Message when Opening from Notification
This commit is contained in:
ismailgulek 2020-06-10 11:39:25 +03:00 committed by GitHub
commit 64680429ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 9 deletions

View file

@ -26,6 +26,7 @@ Bug fix:
* Xcode11: Respect system dark mode setting (#2628).
* Xcode11: Fix noisy notifications (#3316).
* Xcode11: Temporary workaround for navigation bar bg color on emoji selection screen (#3271).
* Xcode11: Pass eventId when navigating to room from notification (#3321).
Changes in 0.11.6 (2020-xx-xx)
===============================================

View file

@ -1170,9 +1170,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
#pragma mark - PushNotificationServiceDelegate
- (void)pushNotificationService:(PushNotificationService *)pushNotificationService shouldNavigateToRoomWithId:(NSString *)roomId
- (void)pushNotificationService:(PushNotificationService *)pushNotificationService shouldNavigateToRoomWithId:(NSString *)roomId eventId:(nonnull NSString *)eventId
{
[self navigateToRoomById:roomId];
[self navigateToRoomById:roomId eventId:eventId];
}
#pragma mark - Badge Count
@ -2839,7 +2839,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
#pragma mark - Matrix Rooms handling
- (void)navigateToRoomById:(NSString *)roomId
- (void)navigateToRoomById:(NSString *)roomId eventId:(NSString *)eventId
{
if (roomId.length)
{
@ -2873,7 +2873,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
{
NSLog(@"[AppDelegate][Push] navigateToRoomById: open the roomViewController %@", roomId);
[self showRoom:roomId andEventId:nil withMatrixSession:dedicatedAccount.mxSession];
[self showRoom:roomId andEventId:eventId withMatrixSession:dedicatedAccount.mxSession];
}
else
{

View file

@ -88,9 +88,11 @@ NS_ASSUME_NONNULL_BEGIN
@param pushNotificationService PushNotificationService object.
@param roomId Room identifier to be navigated.
@param eventId Event identifier to be navigated around.
*/
- (void)pushNotificationService:(PushNotificationService *)pushNotificationService
shouldNavigateToRoomWithId:(NSString *)roomId;
shouldNavigateToRoomWithId:(NSString *)roomId
eventId:(NSString *)eventId;
@end;

View file

@ -140,6 +140,7 @@
UNNotificationContent *content = notification.request.content;
NSString *actionIdentifier = [response actionIdentifier];
NSString *roomId = content.userInfo[@"room_id"];
NSString *eventId = content.userInfo[@"event_id"];
if ([actionIdentifier isEqualToString:@"inline-reply"])
{
@ -176,7 +177,7 @@
}
else if ([actionIdentifier isEqualToString:UNNotificationDefaultActionIdentifier])
{
[self notifyNavigateToRoomById:roomId];
[self notifyNavigateToRoomById:roomId eventId:eventId];
completionHandler();
}
else
@ -317,11 +318,11 @@
#pragma mark - Delegate Notifiers
- (void)notifyNavigateToRoomById:(NSString *)roomId
- (void)notifyNavigateToRoomById:(NSString *)roomId eventId:(NSString *)eventId
{
if ([_delegate respondsToSelector:@selector(pushNotificationService:shouldNavigateToRoomWithId:)])
if ([_delegate respondsToSelector:@selector(pushNotificationService:shouldNavigateToRoomWithId:eventId:)])
{
[_delegate pushNotificationService:self shouldNavigateToRoomWithId:roomId];
[_delegate pushNotificationService:self shouldNavigateToRoomWithId:roomId eventId:eventId];
}
}