Commit e3f3f374 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

fix: update chat view for a new contact.

This patch update conversation id after the conversation become
permanent, so view could be updated properly with new interactions.

Change-Id: Ic1b8b20cb9af03fef890aaa8f129b0a3ad54fd74
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent f1d21907
......@@ -48,7 +48,7 @@
QMetaObject::Connection modelSortedSignal_;
QMetaObject::Connection filterChangedSignal_;
QMetaObject::Connection interactionStatusUpdatedSignal_;
QMetaObject::Connection conversationClearedSignal;
QMetaObject::Connection newConversationConnection;
}
@property (nonatomic, strong, readonly) INDSequentialTextSelectionManager* selectionManager;
......@@ -90,7 +90,7 @@ NSInteger const GENERIC_INT_TEXT_TAG = 100;
// Signal triggered when messages are received or their status updated
QObject::disconnect(newInteractionSignal_);
QObject::disconnect(interactionStatusUpdatedSignal_);
QObject::disconnect(conversationClearedSignal);
QObject::disconnect(newConversationConnection);
newInteractionSignal_ = QObject::connect(convModel_, &lrc::api::ConversationModel::newInteraction,
[self](const std::string& uid, uint64_t interactionId, const lrc::api::interaction::Info& interaction){
if (uid != convUid_)
......@@ -107,12 +107,10 @@ NSInteger const GENERIC_INT_TEXT_TAG = 100;
[conversationView reloadData];
[conversationView scrollToEndOfDocument:nil];
});
conversationClearedSignal = QObject::connect(convModel_, &lrc::api::ConversationModel::conversationCleared,
[self](){
cachedConv_ = nil;
[conversationView reloadData];
[conversationView scrollToEndOfDocument:nil];
});
newConversationConnection = QObject::connect(convModel_, &lrc::api::ConversationModel::newConversation,
[self](const std::string& uid){
convUid_ = uid;
});
// Signals tracking changes in conversation list, we need them as cached conversation can be invalid
// after a reordering.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment