Commit 59217403 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

avatarregistry: avoid un-necessary updates

Only update the avatar when the profile changes.

Change-Id: I2b12d31f7a2e379093fe8e900233ebfbd8ab8974
parent 1a14fd27
......@@ -66,9 +66,8 @@ AvatarRegistry::connectAccount()
this,
&AvatarRegistry::onProfileUpdated,
Qt::UniqueConnection);
connect(lrcInstance_->getCurrentConversationModel(),
&ConversationModel::conversationUpdated,
&ConversationModel::profileUpdated,
this,
&AvatarRegistry::addOrUpdateImage,
Qt::UniqueConnection);
......
......@@ -78,7 +78,6 @@ Control {
font.bold: true
visible: (seq === MsgSeq.first || seq === MsgSeq.single) && !isOutgoing
font.pixelSize: JamiTheme.usernameBlockFontSize
font.family: JamiTheme.chatviewFontFamily
color: JamiTheme.chatviewUsernameColor
lineHeight: JamiTheme.usernameBlockLineHeight
leftPadding: JamiTheme.usernameBlockPadding
......
......@@ -429,6 +429,11 @@ Q_SIGNALS:
* @param uid
*/
void conversationUpdated(const QString& uid) const;
/**
* Emitted when conversation's profile has been updated
* @param uid
*/
void profileUpdated(const QString& uid) const;
/**
* Emitted when the conversations list is modified
*/
......
......@@ -2354,8 +2354,7 @@ ConversationModelPimpl::slotMessageReceived(const QString& accountId,
MapStringString details = ConfigurationManager::instance()
.conversationInfos(linked.owner.id, conversationId);
conversation.infos = details;
Q_EMIT linked.conversationUpdated(conversationId);
Q_EMIT linked.dataChanged(indexOf(conversationId));
Q_EMIT linked.profileUpdated(conversationId);
return;
}
if (message["type"] == "initial") {
......
Supports Markdown
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