mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 14:55:43 +02:00
chatviewheader: show description with title
For multiple swarms, the description will be shown from the profile, for core dialogs, the best Id is used. Change-Id: Ieb7d5f143c1a85c4c629a5a8a03850fa1ebddf63
This commit is contained in:
parent
9adddd0d89
commit
5cf6125fd0
4 changed files with 11 additions and 2 deletions
|
@ -430,6 +430,7 @@ ConversationsAdapter::getConvInfoMap(const QString& convId)
|
|||
return {{"convId", convId},
|
||||
{"bestId", bestId},
|
||||
{"title", lrcInstance_->getCurrentConversationModel()->title(convId)},
|
||||
{"description", lrcInstance_->getCurrentConversationModel()->description(convId)},
|
||||
{"uri", peerUri},
|
||||
{"uris", accountInfo.conversationModel->peersForConversation(convId)},
|
||||
{"isSwarm", convInfo.isSwarm()},
|
||||
|
|
|
@ -182,6 +182,7 @@ Rectangle {
|
|||
if (item.convId === undefined)
|
||||
return
|
||||
chatView.headerUserAliasLabelText = item.title
|
||||
chatView.headerUserUserNameLabelText = item.description
|
||||
if (item.callStackViewShouldShow) {
|
||||
if (inSettingsView) {
|
||||
toggleSettingsView()
|
||||
|
|
|
@ -33,6 +33,7 @@ Rectangle {
|
|||
id: root
|
||||
|
||||
property string headerUserAliasLabelText: ""
|
||||
property string headerUserUserNameLabelText: ""
|
||||
|
||||
property bool allMessagesLoaded
|
||||
|
||||
|
@ -63,6 +64,7 @@ Rectangle {
|
|||
Layout.minimumWidth: JamiTheme.chatViewHeaderMinimumWidth
|
||||
|
||||
userAliasLabelText: headerUserAliasLabelText
|
||||
userUserNameLabelText: headerUserUserNameLabelText
|
||||
|
||||
DropArea {
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -1082,10 +1082,15 @@ QString
|
|||
ConversationModel::description(const QString& conversationId) const
|
||||
{
|
||||
auto conversationOpt = getConversationForUid(conversationId);
|
||||
if (!conversationOpt.has_value()) {
|
||||
if (!conversationOpt.has_value())
|
||||
return {};
|
||||
}
|
||||
auto& conversation = conversationOpt->get();
|
||||
if (conversation.isCoreDialog()) {
|
||||
auto peer = pimpl_->peersForConversation(conversation);
|
||||
if (peer.isEmpty())
|
||||
return {};
|
||||
return owner.contactModel->bestIdForContact(peer.front());
|
||||
}
|
||||
return conversation.infos["description"];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue