diff --git a/Monal/Classes/xmpp.m b/Monal/Classes/xmpp.m index aabe76c..9093bf0 100644 --- a/Monal/Classes/xmpp.m +++ b/Monal/Classes/xmpp.m @@ -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 diff --git a/Monal/Podfile b/Monal/Podfile index dc9e576..56fea76 100644 --- a/Monal/Podfile +++ b/Monal/Podfile @@ -58,6 +58,8 @@ target 'Monal' do end target 'monalxmpp' do + use_frameworks! + inhibit_all_warnings! monalxmpp end