diff --git a/src/ConversationVC.mm b/src/ConversationVC.mm index a3838a4f483abefa190ee1a87dcd4dcc441da54b..1200a6c5a2e1bc7c733c3ee1468bf35b34c73324 100644 --- a/src/ConversationVC.mm +++ b/src/ConversationVC.mm @@ -287,7 +287,7 @@ NSInteger const SEND_PANEL_MAX_HEIGHT = 120; - (void)updateInvitationView:(const lrc::api::conversation::Info*) conversation { self.isRequest = conversation->isRequest || conversation->needsSyncing; NSString* bestName = bestNameForConversation(*conversation, *convModel_); - bool showInvitationView = conversation->isRequest || (convModel_->owner.profileInfo.type == lrc::api::profile::Type::JAMI && conversation->interactions.size() == 0); + bool showInvitationView = conversation->isRequest || (convModel_->owner.profileInfo.type == lrc::api::profile::Type::JAMI && conversation->interactions->size() == 0); invitationView.hidden = !showInvitationView; invitationBlock.enabled = !conversation->needsSyncing && conversation->isRequest; invitationRefuse.enabled = !conversation->needsSyncing && conversation->isRequest; diff --git a/src/MessagesVC.mm b/src/MessagesVC.mm index 970237098195a4ac1a49318446eb83fb194285dc..0921941ee5c4934e299d2eb40762f4d483ccf9d2 100644 --- a/src/MessagesVC.mm +++ b/src/MessagesVC.mm @@ -442,7 +442,7 @@ typedef NS_ENUM(NSInteger, MessageSequencing) { -(void)reloadMessages { auto* conv = [self getCurrentConversation]; messages = {}; - for (auto& interaction : conv->interactions) { + for (auto& interaction : *conv->interactions) { bool transferForOtherDevice = interaction.second.type == lrc::api::interaction::Type::DATA_TRANSFER && interaction.second.body.isEmpty() && lrc::api::interaction::isOutgoing(interaction.second); if (interaction.second.type != lrc::api::interaction::Type::MERGE && !transferForOtherDevice) { messages.push_back(std::make_pair(interaction.first, interaction.second)); @@ -650,8 +650,8 @@ typedef NS_ENUM(NSInteger, MessageSequencing) { } -(NSString*) getFilePath:(const QString&) interId { - auto it = [self getCurrentConversation]->interactions.find(interId); - if (it == [self getCurrentConversation]->interactions.end()) { + auto it = [self getCurrentConversation]->interactions->find(interId); + if (it == [self getCurrentConversation]->interactions->end()) { return @""; } auto& interaction = it->second; @@ -699,12 +699,12 @@ typedef NS_ENUM(NSInteger, MessageSequencing) { - (void)deleteMessage:(id)sender { auto interId = QString::fromNSString([sender representedObject]); auto conv = [self getCurrentConversation]; - auto it = conv->interactions.find(interId); - if (it == conv->interactions.end()) { + auto it = conv->interactions->find(interId); + if (it == conv->interactions->end()) { return; } - auto itIndex = std::distance(conv->interactions.begin(),it); - if (itIndex >= ([conversationView numberOfRows] - 1) || itIndex >= conv->interactions.size()) { + auto itIndex = std::distance(conv->interactions->begin(),it); + if (itIndex >= ([conversationView numberOfRows] - 1) || itIndex >= conv->interactions->size()) { return; } NSIndexSet* indexSet = [NSIndexSet indexSetWithIndex: itIndex]; diff --git a/src/SmartViewVC.mm b/src/SmartViewVC.mm index 9ae51499ea2838c42af3e0ddaedbe30838d4c812..e75c951451a9720259852b43843a5b71d47c3b0e 100755 --- a/src/SmartViewVC.mm +++ b/src/SmartViewVC.mm @@ -573,9 +573,9 @@ NSInteger const REQUEST_SEG = 1; [interactionSnippet setHidden:true]; return result; } - if (conversation.interactions.find(lastUid) != conversation.interactions.end()) { + if (conversation.interactions->find(lastUid) != conversation.interactions->end()) { // last interaction snippet - auto lastInteractionSnippet = conversation.interactions[lastUid].body.trimmed().replace("\r","").replace("\n",""); + auto lastInteractionSnippet = (*conversation.interactions)[lastUid].body.trimmed().replace("\r","").replace("\n",""); NSString* lastInteractionSnippetFixedString = [lastInteractionSnippet.toNSString() stringByReplacingOccurrencesOfString:@"🕽" withString:@""]; lastInteractionSnippetFixedString = [lastInteractionSnippetFixedString stringByReplacingOccurrencesOfString:@"📞" withString:@""]; @@ -583,7 +583,7 @@ NSInteger const REQUEST_SEG = 1; // last interaction date/time NSString *timeString = @""; - NSDate* msgTime = [NSDate dateWithTimeIntervalSince1970:conversation.interactions[lastUid].timestamp]; + NSDate* msgTime = [NSDate dateWithTimeIntervalSince1970:(*conversation.interactions)[lastUid].timestamp]; NSDate *today = [NSDate date]; NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init]; [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:[[NSLocale currentLocale] localeIdentifier]]];