This commit is contained in:
Woit 2024-12-16 08:00:23 +01:00
parent 413d4f1c72
commit 9b91add453
2 changed files with 10 additions and 5 deletions

View file

@ -4431,20 +4431,23 @@ NSString* const kStanza = @"stanza";
} }
} }
}; };
NSString *jid = contact.contactJid;
BOOL isMuc = contact.isMuc;
NSNumber *accId = self.accountID;
query = ^(NSString* _Nullable before) { query = ^(NSString* _Nullable before) {
XMPPIQ* query = [[XMPPIQ alloc] initWithType:kiqSetType]; XMPPIQ* query = [[XMPPIQ alloc] initWithType:kiqSetType];
if(contact.isMuc) if(isMuc)
{ {
if(!before) if(!before)
before = [[DataLayer sharedInstance] lastStanzaIdForMuc:contact.contactJid andAccount:self.accountID]; before = [[DataLayer sharedInstance] lastStanzaIdForMuc:jid andAccount:accId];
[query setiqTo:contact.contactJid]; [query setiqTo:jid];
[query setMAMQueryLatestMessagesForJid:nil before:before]; [query setMAMQueryLatestMessagesForJid:nil before:before];
} }
else else
{ {
if(!before) if(!before)
before = [[DataLayer sharedInstance] lastStanzaIdForAccount:self.accountID]; before = [[DataLayer sharedInstance] lastStanzaIdForAccount:accId];
[query setMAMQueryLatestMessagesForJid:contact.contactJid before:before]; [query setMAMQueryLatestMessagesForJid:jid before:before];
} }
DDLogDebug(@"Loading (next) mam:2 page before: %@", before); DDLogDebug(@"Loading (next) mam:2 page before: %@", before);
//we always want to use blocks here because we want to make sure we get not interrupted by an app crash/restart //we always want to use blocks here because we want to make sure we get not interrupted by an app crash/restart

View file

@ -58,6 +58,8 @@ target 'Monal' do
end end
target 'monalxmpp' do target 'monalxmpp' do
use_frameworks!
inhibit_all_warnings!
monalxmpp monalxmpp
end end