diff --git a/Monal/Classes/PasswordMigration.swift b/Monal/Classes/PasswordMigration.swift index 7ee63a30d7..321aac5768 100644 --- a/Monal/Classes/PasswordMigration.swift +++ b/Monal/Classes/PasswordMigration.swift @@ -28,6 +28,23 @@ struct PasswordMigration: View { DDLogInfo("Migration needed: \(String(describing:self.needingMigration))") } + func updatePassword(_ password: String, for id: Int) { + self.needingMigration[id]?["password"] = password as NSString + if(password.count > 0) { + //first change? --> activate account and use "needs_password_migration" to record + //the fact that we just activated this account automatically + //(making the password field empty will reset this) + if((self.needingMigration[id]?["needs_password_migration"] as! NSNumber).boolValue) { + self.needingMigration[id]?["enabled"] = NSNumber(value:true) + self.needingMigration[id]?["needs_password_migration"] = NSNumber(value:false) + } + //reset our "account automatically activated" flag and deactivate our account + } else { + self.needingMigration[id]?["enabled"] = NSNumber(value:false) + self.needingMigration[id]?["needs_password_migration"] = NSNumber(value:true) + } + } + var body: some View { //ScrollView { VStack { @@ -61,26 +78,11 @@ struct PasswordMigration: View { SecureField(NSLocalizedString("Password", comment: "placeholder when migrating account"), text:Binding( get: { self.needingMigration[id]?["password"] as? String ?? "" }, - set: { - self.needingMigration[id]?["password"] = $0 as NSString - if($0.count > 0) { - //first change? --> activate account and use "needs_password_migration" to record - //the fact that we just activated this account automatically - //(making the password field empty will reset this) - if((self.needingMigration[id]?["needs_password_migration"] as! NSNumber).boolValue) { - self.needingMigration[id]?["enabled"] = NSNumber(value:true) - self.needingMigration[id]?["needs_password_migration"] = NSNumber(value:false) - } - //reset our "account automatically activated" flag and deactivate our account - } else { - self.needingMigration[id]?["enabled"] = NSNumber(value:false) - self.needingMigration[id]?["needs_password_migration"] = NSNumber(value:true) - } - } + set: { updatePassword($0, for:id) } )) .addClearButton(isEditing: true, text:Binding( get: { self.needingMigration[id]?["password"] as? String ?? "" }, - set: { self.needingMigration[id]?["password"] = $0 as NSString } + set: { updatePassword($0, for:id) } )) } } diff --git a/Monal/Classes/xmpp.m b/Monal/Classes/xmpp.m index c3a3863f26..2869b25ca7 100644 --- a/Monal/Classes/xmpp.m +++ b/Monal/Classes/xmpp.m @@ -1380,18 +1380,19 @@ -(void) prepareXMPPParser DDLogWarn(@"Throwing away incoming stanza queued in parse queue, accountState < kStateConnected"); return; } + NSString* loggedStanza = [NSString stringWithFormat:@"%@: %@", parsedStanza.element, nilDefault([parsedStanza findFirst:@"/@id"], parsedStanza)]; [MLNotificationQueue queueNotificationsInBlock:^{ //add whole processing of incoming stanzas to one big transaction //this will make it impossible to leave inconsistent database entries on app crashes or iphone crashes/reboots - DDLogVerbose(@"Starting transaction for: %@", parsedStanza); + DDLogVerbose(@"Starting transaction for: %@", loggedStanza); [[DataLayer sharedInstance] createTransaction:^{ - DDLogVerbose(@"Started transaction for: %@", parsedStanza); + DDLogVerbose(@"Started transaction for: %@", loggedStanza); //don't write data to our tcp stream while inside this db transaction (all effects to the outside world should be transactional, too) [self freezeSendQueue]; [self processInput:parsedStanza withDelayedReplay:NO]; - DDLogVerbose(@"Ending transaction for: %@", parsedStanza); + DDLogVerbose(@"Ending transaction for: %@", loggedStanza); }]; - DDLogVerbose(@"Ended transaction for: %@", parsedStanza); + DDLogVerbose(@"Ended transaction for: %@", loggedStanza); [self unfreezeSendQueue]; //this will flush all stanzas added inside the db transaction and now waiting in the send queue } onQueue:@"receiveQueue"]; [self persistState]; //make sure to persist all state changes triggered by the events in the notification queue @@ -4011,7 +4012,8 @@ -(void) queryExternalServiceCredentialsFor:(NSDictionary*) service completion:(m } andChildren:@[] andData:nil] ] andData:nil]]; [self sendIq:credentialsQuery withResponseHandler:^(XMPPIQ* response) { - completion([response findFirst:@"{urn:xmpp:extdisco:2}credentials/service@@"]); + //ejabberd <= 24.10 incorrectly uses {urn:xmpp:extdisco:2}services/service, support this as fallback + completion(nilDefault([response findFirst:@"{urn:xmpp:extdisco:2}credentials/service@@"], [response findFirst:@"{urn:xmpp:extdisco:2}services/service@@"])); } andErrorHandler:^(XMPPIQ* error) { DDLogWarn(@"Got error while quering for credentials of external service %@: %@", service, error); completion(@{}); diff --git a/Monal/Images.xcassets/AppIcon.appiconset/Monal-ios_1024.png b/Monal/Images.xcassets/AppIcon.appiconset/Monal-ios_1024.png index c695a38b4f..d66ae5773c 100644 Binary files a/Monal/Images.xcassets/AppIcon.appiconset/Monal-ios_1024.png and b/Monal/Images.xcassets/AppIcon.appiconset/Monal-ios_1024.png differ diff --git a/Monal/Images.xcassets/AppIcon.appiconset/Monal-macos-1024.png b/Monal/Images.xcassets/AppIcon.appiconset/Monal-macos-1024.png index d2dd497e96..d58490e29d 100644 Binary files a/Monal/Images.xcassets/AppIcon.appiconset/Monal-macos-1024.png and b/Monal/Images.xcassets/AppIcon.appiconset/Monal-macos-1024.png differ diff --git a/Monal/Images.xcassets/AppIcon.appiconset/Monal-macos-512.png b/Monal/Images.xcassets/AppIcon.appiconset/Monal-macos-512.png index 9a8b63090d..b1799ac14e 100644 Binary files a/Monal/Images.xcassets/AppIcon.appiconset/Monal-macos-512.png and b/Monal/Images.xcassets/AppIcon.appiconset/Monal-macos-512.png differ diff --git a/Monal/Images.xcassets/AppLogo.imageset/Monal-ios_1024.png b/Monal/Images.xcassets/AppLogo.imageset/Monal-ios_1024.png index c695a38b4f..5546f480b2 100644 Binary files a/Monal/Images.xcassets/AppLogo.imageset/Monal-ios_1024.png and b/Monal/Images.xcassets/AppLogo.imageset/Monal-ios_1024.png differ