mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-05 23:35:50 +02:00
conversationsadapter: recover avatar update for conversations
1. Remove unused conversationSmartListModel 2. Properly update conversation model by using onProfileUpdated Change-Id: I8d6f3a3a5fea2cee38258ca0cc5bd6ca6f447395
This commit is contained in:
parent
872fbeb5d3
commit
1e7f407e3c
2 changed files with 8 additions and 18 deletions
|
@ -135,12 +135,6 @@ ConversationsAdapter::safeInit()
|
||||||
{
|
{
|
||||||
// TODO: remove these safeInits, they are possibly called
|
// TODO: remove these safeInits, they are possibly called
|
||||||
// multiple times during qml component inits
|
// multiple times during qml component inits
|
||||||
conversationSmartListModel_ = new SmartListModel(this,
|
|
||||||
SmartListModel::Type::CONVERSATION,
|
|
||||||
lrcInstance_);
|
|
||||||
|
|
||||||
Q_EMIT modelChanged(QVariant::fromValue(conversationSmartListModel_));
|
|
||||||
|
|
||||||
connect(&lrcInstance_->behaviorController(),
|
connect(&lrcInstance_->behaviorController(),
|
||||||
&BehaviorController::newUnreadInteraction,
|
&BehaviorController::newUnreadInteraction,
|
||||||
this,
|
this,
|
||||||
|
@ -276,16 +270,20 @@ ConversationsAdapter::onTrustRequestTreated(const QString& accountId, const QStr
|
||||||
void
|
void
|
||||||
ConversationsAdapter::onModelChanged()
|
ConversationsAdapter::onModelChanged()
|
||||||
{
|
{
|
||||||
conversationSmartListModel_->fillConversationsList();
|
|
||||||
updateConversationFilterData();
|
updateConversationFilterData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ConversationsAdapter::onProfileUpdated(const QString& contactUri)
|
ConversationsAdapter::onProfileUpdated(const QString& contactUri)
|
||||||
{
|
{
|
||||||
// TODO: this will need a dataChanged call to keep the avatar
|
auto& convInfo = lrcInstance_->getConversationFromPeerUri(contactUri);
|
||||||
// updated. previously, 'reload-smartlist' was invoked here
|
if (convInfo.uid.isEmpty())
|
||||||
conversationSmartListModel_->updateContactAvatarUid(contactUri);
|
return;
|
||||||
|
auto row = lrcInstance_->indexOf(convInfo.uid);
|
||||||
|
const auto index = convSrcModel_->index(row, 0);
|
||||||
|
|
||||||
|
convSrcModel_->updateContactAvatarUid(contactUri);
|
||||||
|
Q_EMIT convSrcModel_->dataChanged(index, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -297,7 +295,6 @@ ConversationsAdapter::onConversationUpdated(const QString&)
|
||||||
void
|
void
|
||||||
ConversationsAdapter::onFilterChanged()
|
ConversationsAdapter::onFilterChanged()
|
||||||
{
|
{
|
||||||
conversationSmartListModel_->fillConversationsList();
|
|
||||||
updateConversationFilterData();
|
updateConversationFilterData();
|
||||||
if (!lrcInstance_->get_selectedConvUid().isEmpty())
|
if (!lrcInstance_->get_selectedConvUid().isEmpty())
|
||||||
Q_EMIT indexRepositionRequested();
|
Q_EMIT indexRepositionRequested();
|
||||||
|
@ -306,7 +303,6 @@ ConversationsAdapter::onFilterChanged()
|
||||||
void
|
void
|
||||||
ConversationsAdapter::onNewConversation(const QString& convUid)
|
ConversationsAdapter::onNewConversation(const QString& convUid)
|
||||||
{
|
{
|
||||||
conversationSmartListModel_->fillConversationsList();
|
|
||||||
updateConversationForNewContact(convUid);
|
updateConversationForNewContact(convUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,9 +325,6 @@ ConversationsAdapter::onSearchStatusChanged(const QString& status)
|
||||||
void
|
void
|
||||||
ConversationsAdapter::onSearchResultUpdated()
|
ConversationsAdapter::onSearchResultUpdated()
|
||||||
{
|
{
|
||||||
// currently for contact pickers
|
|
||||||
conversationSmartListModel_->fillConversationsList();
|
|
||||||
|
|
||||||
// smartlist search results
|
// smartlist search results
|
||||||
searchSrcModel_->onSearchResultsUpdated();
|
searchSrcModel_->onSearchResultsUpdated();
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,6 @@ Q_SIGNALS:
|
||||||
void showConversation(const QString& accountId, const QString& convUid);
|
void showConversation(const QString& accountId, const QString& convUid);
|
||||||
void showSearchStatus(const QString& status);
|
void showSearchStatus(const QString& status);
|
||||||
|
|
||||||
void modelChanged(const QVariant& model);
|
|
||||||
void navigateToWelcomePageRequested();
|
void navigateToWelcomePageRequested();
|
||||||
void indexRepositionRequested();
|
void indexRepositionRequested();
|
||||||
|
|
||||||
|
@ -89,8 +88,6 @@ private Q_SLOTS:
|
||||||
private:
|
private:
|
||||||
void updateConversationForNewContact(const QString& convUid);
|
void updateConversationForNewContact(const QString& convUid);
|
||||||
|
|
||||||
SmartListModel* conversationSmartListModel_;
|
|
||||||
|
|
||||||
SystemTray* systemTray_;
|
SystemTray* systemTray_;
|
||||||
|
|
||||||
QScopedPointer<ConversationListModel> convSrcModel_;
|
QScopedPointer<ConversationListModel> convSrcModel_;
|
||||||
|
|
Loading…
Add table
Reference in a new issue