зеркало из https://github.com/nextcloud/talk-ios.git
Check federated flag for typing indicators
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Родитель
a27c8ded4b
Коммит
26d915d1e7
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче