From 1bf01d4e703b1f94205d8ed60fcef7284c00fc87 Mon Sep 17 00:00:00 2001 From: lissine Date: Fri, 3 Jan 2025 14:24:40 +0100 Subject: [PATCH] Update error messages in invalidation handlers The invalidation handlers are not called because of a timeout, but because of a non-smacks reconnect that can be triggered by a multitude of things. --- Monal/Classes/MLMucProcessor.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Monal/Classes/MLMucProcessor.m b/Monal/Classes/MLMucProcessor.m index 069600191..97a8177e6 100644 --- a/Monal/Classes/MLMucProcessor.m +++ b/Monal/Classes/MLMucProcessor.m @@ -524,7 +524,7 @@ -(void) configureMuc:(NSString*) roomJid withMandatoryOptions:(NSDictionary*) ma } else DDLogError(@"Config form fetch failed for muc '%@'!", roomJid); - [self handleError:[NSString stringWithFormat:NSLocalizedString(@"Could fetch room config form for '%@': timeout", @""), roomJid] forMuc:roomJid withNode:nil andIsSevere:YES]; + [self handleError:[NSString stringWithFormat:NSLocalizedString(@"Could not fetch room config form for '%@': please try again", @""), roomJid] forMuc:roomJid withNode:nil andIsSevere:YES]; $$ $$instance_handler(handleRoomConfigForm, account.mucProcessor, $$ID(xmpp*, account), $$ID(XMPPIQ*, iqNode), $$ID(NSString*, roomJid), $$ID(NSDictionary*, mandatoryOptions), $$ID(NSDictionary*, optionalOptions), $$BOOL(deleteOnError), $$BOOL(joinOnSuccess)) @@ -599,7 +599,7 @@ -(void) configureMuc:(NSString*) roomJid withMandatoryOptions:(NSDictionary*) ma } else DDLogError(@"Config form submit failed for muc '%@'!", roomJid); - [self handleError:[NSString stringWithFormat:NSLocalizedString(@"Could not configure group '%@': timeout", @""), roomJid] forMuc:roomJid withNode:nil andIsSevere:YES]; + [self handleError:[NSString stringWithFormat:NSLocalizedString(@"Could not configure group '%@': please try again", @""), roomJid] forMuc:roomJid withNode:nil andIsSevere:YES]; $$ $$instance_handler(handleRoomConfigResult, account.mucProcessor, $$ID(xmpp*, account), $$ID(XMPPIQ*, iqNode), $$ID(NSString*, roomJid), $$ID(NSDictionary*, mandatoryOptions), $$ID(NSDictionary*, optionalOptions), $$BOOL(deleteOnError), $$BOOL(joinOnSuccess)) @@ -1053,11 +1053,11 @@ -(void) destroyRoom:(NSString*) room } $$instance_handler(handleRoomDestroyResultInvalidation, account.mucProcessor, $$ID(xmpp*, account), $$ID(NSString*, room)) - DDLogError(@"Could not destroy room '%@' on account %@: invalidation called", room, account); + DDLogError(@"Could not destroy room '%@' on account %@", room, account); @synchronized(_stateLockObject) { [_destroying removeObject:room]; } - [self handleError:[NSString stringWithFormat:NSLocalizedString(@"Failed to destroy group/channel '%@': timeout", @""), room] forMuc:room withNode:nil andIsSevere:YES]; + [self handleError:[NSString stringWithFormat:NSLocalizedString(@"Failed to destroy group/channel '%@': please try again", @""), room] forMuc:room withNode:nil andIsSevere:YES]; $$ $$instance_handler(handleRoomDestroyResult, account.mucProcessor, $$ID(xmpp*, account), $$ID(XMPPIQ*, iqNode), $$ID(NSString*, room)) @@ -1257,8 +1257,8 @@ -(void) setAffiliation:(NSString*) affiliation ofUser:(NSString*) jid inMuc:(NSS } $$instance_handler(handleAffiliationUpdateResultInvalidation, account.mucProcessor, $$ID(xmpp*, account), $$ID(NSString*, affiliation), $$ID(NSString*, jid), $$ID(NSString*, roomJid)) - DDLogError(@"Failed to change affiliation of '%@' in '%@' to '%@': timeout", jid, roomJid, affiliation); - [self handleError:[NSString stringWithFormat:NSLocalizedString(@"Failed to change affiliation of '%@' in '%@' to '%@': timeout", @""), jid, roomJid, affiliation] forMuc:roomJid withNode:nil andIsSevere:YES]; + DDLogError(@"Failed to change affiliation of '%@' in '%@' to '%@'", jid, roomJid, affiliation); + [self handleError:[NSString stringWithFormat:NSLocalizedString(@"Failed to change affiliation of '%@' in '%@' to '%@': please try again", @""), jid, roomJid, affiliation] forMuc:roomJid withNode:nil andIsSevere:YES]; $$ $$instance_handler(handleAffiliationUpdateResult, account.mucProcessor, $$ID(xmpp*, account), $$ID(XMPPIQ*, iqNode), $$ID(NSString*, affiliation), $$ID(NSString*, jid), $$ID(NSString*, roomJid)) @@ -1312,7 +1312,7 @@ -(AnyPromise*) publishAvatar:(UIImage* _Nullable) image forMuc:(NSString*) room } $$instance_handler(handleAvatarPublishResultInvalidation, account.mucProcessor, $$ID(xmpp*, account), $$ID(NSString*, room), $$ID(MLPromise*, promise)) - NSString* errorString = [NSString stringWithFormat:NSLocalizedString(@"Publishing avatar for muc '%@' returned timeout", @""), room]; + NSString* errorString = [NSString stringWithFormat:NSLocalizedString(@"Failed to publish avatar image for group/channel %@: please try again", @""), room]; NSError* error = [NSError errorWithDomain:@"Monal" code:0 userInfo:@{NSLocalizedDescriptionKey: errorString}]; [promise reject:error]; $$