mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 23:05:48 +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},
|
return {{"convId", convId},
|
||||||
{"bestId", bestId},
|
{"bestId", bestId},
|
||||||
{"title", lrcInstance_->getCurrentConversationModel()->title(convId)},
|
{"title", lrcInstance_->getCurrentConversationModel()->title(convId)},
|
||||||
|
{"description", lrcInstance_->getCurrentConversationModel()->description(convId)},
|
||||||
{"uri", peerUri},
|
{"uri", peerUri},
|
||||||
{"uris", accountInfo.conversationModel->peersForConversation(convId)},
|
{"uris", accountInfo.conversationModel->peersForConversation(convId)},
|
||||||
{"isSwarm", convInfo.isSwarm()},
|
{"isSwarm", convInfo.isSwarm()},
|
||||||
|
|
|
@ -182,6 +182,7 @@ Rectangle {
|
||||||
if (item.convId === undefined)
|
if (item.convId === undefined)
|
||||||
return
|
return
|
||||||
chatView.headerUserAliasLabelText = item.title
|
chatView.headerUserAliasLabelText = item.title
|
||||||
|
chatView.headerUserUserNameLabelText = item.description
|
||||||
if (item.callStackViewShouldShow) {
|
if (item.callStackViewShouldShow) {
|
||||||
if (inSettingsView) {
|
if (inSettingsView) {
|
||||||
toggleSettingsView()
|
toggleSettingsView()
|
||||||
|
|
|
@ -33,6 +33,7 @@ Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property string headerUserAliasLabelText: ""
|
property string headerUserAliasLabelText: ""
|
||||||
|
property string headerUserUserNameLabelText: ""
|
||||||
|
|
||||||
property bool allMessagesLoaded
|
property bool allMessagesLoaded
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ Rectangle {
|
||||||
Layout.minimumWidth: JamiTheme.chatViewHeaderMinimumWidth
|
Layout.minimumWidth: JamiTheme.chatViewHeaderMinimumWidth
|
||||||
|
|
||||||
userAliasLabelText: headerUserAliasLabelText
|
userAliasLabelText: headerUserAliasLabelText
|
||||||
|
userUserNameLabelText: headerUserUserNameLabelText
|
||||||
|
|
||||||
DropArea {
|
DropArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -1082,10 +1082,15 @@ QString
|
||||||
ConversationModel::description(const QString& conversationId) const
|
ConversationModel::description(const QString& conversationId) const
|
||||||
{
|
{
|
||||||
auto conversationOpt = getConversationForUid(conversationId);
|
auto conversationOpt = getConversationForUid(conversationId);
|
||||||
if (!conversationOpt.has_value()) {
|
if (!conversationOpt.has_value())
|
||||||
return {};
|
return {};
|
||||||
}
|
|
||||||
auto& conversation = conversationOpt->get();
|
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"];
|
return conversation.infos["description"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue