Send updated room in room update notification.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2020-03-12 16:57:17 +01:00
Родитель 18a6d354f9
Коммит 8c1c51d4cf
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -266,7 +266,6 @@ NSString * const NCRoomsManagerDidReceiveChatMessagesNotification = @"ChatMess
[[NCAPIController sharedInstance] getRoomForAccount:[[NCDatabaseManager sharedInstance] activeAccount] withToken:token withCompletionBlock:^(NSDictionary *roomDict, NSError *error) {
NSMutableDictionary *userInfo = [NSMutableDictionary new];
if (!error) {
[userInfo setObject:[NCRoom roomWithDictionary:roomDict] forKey:@"room"];
RLMRealm *realm = [RLMRealm defaultRealm];
[realm transactionWithBlock:^{
TalkAccount *account = [[NCDatabaseManager sharedInstance] activeAccount];
@ -276,6 +275,8 @@ NSString * const NCRoomsManagerDidReceiveChatMessagesNotification = @"ChatMess
}
NSLog(@"Room updated");
}];
NCRoom *updatedRoom = [self roomWithToken:token forAccountId:activeAccount.accountId];
[userInfo setObject:updatedRoom forKey:@"room"];
} else {
[userInfo setObject:error forKey:@"error"];
NSLog(@"Could not update rooms. Error: %@", error.description);