Check federated flag for typing indicators

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Marcel Müller 2024-07-25 19:50:40 +02:00
Родитель a27c8ded4b
Коммит 26d915d1e7
2 изменённых файлов: 13 добавлений и 3 удалений

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

@ -1184,8 +1184,10 @@ import UIKit
let activeAccount = NCDatabaseManager.sharedInstance().activeAccount()
let userId = notification.userInfo?["userId"] as? String
let isFederated = notification.userInfo?["isFederated"] as? Bool ?? false
if userId == activeAccount.userId || serverCapabilities.typingPrivacy {
// Since our own userId can exist on other servers, only suppress the notification if it's not federated
if (userId == activeAccount.userId && !isFederated) || serverCapabilities.typingPrivacy {
return
}

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

@ -676,8 +676,10 @@ NSString * const NCExternalSignalingControllerDidReceiveStoppedTypingNotificatio
NSString *messageType = [[messageDict objectForKey:@"data"] objectForKey:@"type"];
if ([messageType isEqualToString:@"startedTyping"] || [messageType isEqualToString:@"stoppedTyping"]) {
NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];
NSString *fromSession = [[messageDict objectForKey:@"sender"] objectForKey:@"sessionid"];
NSString *fromUser = [[messageDict objectForKey:@"sender"] objectForKey:@"userid"];
NSDictionary *sender = [messageDict objectForKey:@"sender"];
NSString *fromSession = [sender objectForKey:@"sessionid"];
NSString *fromUser = [sender objectForKey:@"userid"];
if (_currentRoom && fromSession){
[userInfo setObject:_currentRoom forKey:@"roomToken"];
@ -687,6 +689,12 @@ NSString * const NCExternalSignalingControllerDidReceiveStoppedTypingNotificatio
[userInfo setObject:fromUser forKey:@"userId"];
}
NSDictionary *participant = [_participantsMap objectForKey:fromSession];
if (participant) {
BOOL isFederated = [[participant objectForKey:@"federated"] boolValue];
[userInfo setObject:@(isFederated) forKey:@"isFederated"];
}
NSString *displayName = [self getDisplayNameFromSessionId:fromSession];
if (displayName) {