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) {
XMPPIQ* query = [[XMPPIQ alloc] initWithType:kiqSetType];
if(contact.isMuc)
if(isMuc)
{
if(!before)
before = [[DataLayer sharedInstance] lastStanzaIdForMuc:contact.contactJid andAccount:self.accountID];
[query setiqTo:contact.contactJid];
before = [[DataLayer sharedInstance] lastStanzaIdForMuc:jid andAccount:accId];
[query setiqTo:jid];
[query setMAMQueryLatestMessagesForJid:nil before:before];
}
else
{
if(!before)
before = [[DataLayer sharedInstance] lastStanzaIdForAccount:self.accountID];
[query setMAMQueryLatestMessagesForJid:contact.contactJid before:before];
before = [[DataLayer sharedInstance] lastStanzaIdForAccount:accId];
[query setMAMQueryLatestMessagesForJid:jid 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

View file

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