Skip to content

Commit

Permalink
Update error messages in invalidation handlers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lissine0 authored and tmolitor-stud-tu committed Jan 4, 2025
1 parent c907070 commit 1bf01d4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Monal/Classes/MLMucProcessor.m
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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];
$$
Expand Down

0 comments on commit 1bf01d4

Please sign in to comment.