mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 06:45:45 +02:00
smartlist: show all swarm and draw items
Change-Id: Ib3e01a0af51736727b8056ed9eaa8ce9170c2d6c GitLab: #438
This commit is contained in:
parent
4e3cf29eb6
commit
6439832824
7 changed files with 17 additions and 18 deletions
|
@ -93,7 +93,7 @@ ContactAdapter::setSearchFilter(const QString& filter)
|
||||||
selectableProxyModel_->setPredicate(
|
selectableProxyModel_->setPredicate(
|
||||||
[this, filter](const QModelIndex& index, const QRegExp&) {
|
[this, filter](const QModelIndex& index, const QRegExp&) {
|
||||||
return (!defaultModerators_.contains(index.data(Role::URI).toString())
|
return (!defaultModerators_.contains(index.data(Role::URI).toString())
|
||||||
&& index.data(Role::BestName).toString().contains(filter));
|
&& index.data(Role::Title).toString().contains(filter));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
selectableProxyModel_->setFilterRegExp(
|
selectableProxyModel_->setFilterRegExp(
|
||||||
|
|
|
@ -59,14 +59,13 @@ ConversationListModelBase::dataForItem(item_t item, int role) const
|
||||||
contactModel = accountInfo.contactModel.get();
|
contactModel = accountInfo.contactModel.get();
|
||||||
contact = contactModel->getContact(peerUri);
|
contact = contactModel->getContact(peerUri);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return QVariant(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since we are using image provider right now, image url representation should be unique to
|
// Since we are using image provider right now, image url representation should be unique to
|
||||||
// be able to use the image cache, account avatar will only be updated once PictureUid changed
|
// be able to use the image cache, account avatar will only be updated once PictureUid changed
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Role::BestName:
|
case Role::Title:
|
||||||
return QVariant(contactModel->bestNameForContact(peerUri));
|
return QVariant(model_->title(item.uid));
|
||||||
case Role::BestId:
|
case Role::BestId:
|
||||||
return QVariant(contactModel->bestIdForContact(peerUri));
|
return QVariant(contactModel->bestIdForContact(peerUri));
|
||||||
case Role::Presence:
|
case Role::Presence:
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
// TODO: many of these roles should probably be factored out
|
// TODO: many of these roles should probably be factored out
|
||||||
#define CONV_ROLES \
|
#define CONV_ROLES \
|
||||||
X(BestName) \
|
X(Title) \
|
||||||
X(BestId) \
|
X(BestId) \
|
||||||
X(Presence) \
|
X(Presence) \
|
||||||
X(Alias) \
|
X(Alias) \
|
||||||
|
|
|
@ -384,7 +384,6 @@ ConversationsAdapter::getConvInfoMap(const QString& convId)
|
||||||
contactModel = accountInfo.contactModel.get();
|
contactModel = accountInfo.contactModel.get();
|
||||||
contact = contactModel->getContact(peerUri);
|
contact = contactModel->getContact(peerUri);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
bool isAudioOnly {false};
|
bool isAudioOnly {false};
|
||||||
if (!convInfo.uid.isEmpty()) {
|
if (!convInfo.uid.isEmpty()) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ ItemDelegate {
|
||||||
font: contactPickerContactName.font
|
font: contactPickerContactName.font
|
||||||
elide: Text.ElideMiddle
|
elide: Text.ElideMiddle
|
||||||
elideWidth: contactPickerContactInfoRect.width
|
elideWidth: contactPickerContactInfoRect.width
|
||||||
text: BestName
|
text: Title
|
||||||
}
|
}
|
||||||
|
|
||||||
color: JamiTheme.textColor
|
color: JamiTheme.textColor
|
||||||
|
@ -90,7 +90,7 @@ ItemDelegate {
|
||||||
font: contactPickerContactId.font
|
font: contactPickerContactId.font
|
||||||
elide: Text.ElideMiddle
|
elide: Text.ElideMiddle
|
||||||
elideWidth: contactPickerContactInfoRect.width
|
elideWidth: contactPickerContactInfoRect.width
|
||||||
text: BestId == BestName ? "" : BestId
|
text: BestId == Title ? "" : BestId
|
||||||
}
|
}
|
||||||
|
|
||||||
text: textMetricsContactPickerContactId.elidedText
|
text: textMetricsContactPickerContactId.elidedText
|
||||||
|
|
|
@ -83,7 +83,7 @@ ItemDelegate {
|
||||||
Layout.preferredHeight: 20
|
Layout.preferredHeight: 20
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
text: BestName === undefined ? "" : BestName
|
text: Title === undefined ? "" : Title
|
||||||
font.pointSize: JamiTheme.smartlistItemFontSize
|
font.pointSize: JamiTheme.smartlistItemFontSize
|
||||||
font.weight: UnreadMessagesCount ? Font.Bold : Font.Normal
|
font.weight: UnreadMessagesCount ? Font.Bold : Font.Normal
|
||||||
color: JamiTheme.textColor
|
color: JamiTheme.textColor
|
||||||
|
|
|
@ -90,7 +90,7 @@ MessagesAdapter::setupChatView(const QString& convUid)
|
||||||
|
|
||||||
QMetaObject::invokeMethod(qmlObj_,
|
QMetaObject::invokeMethod(qmlObj_,
|
||||||
"setSendContactRequestButtonVisible",
|
"setSendContactRequestButtonVisible",
|
||||||
Q_ARG(QVariant, convInfo.isNotASwarm() && isPending));
|
Q_ARG(QVariant, convInfo.isNotASwarm() && convInfo.isRequest));
|
||||||
QMetaObject::invokeMethod(qmlObj_,
|
QMetaObject::invokeMethod(qmlObj_,
|
||||||
"setMessagingHeaderButtonsVisible",
|
"setMessagingHeaderButtonsVisible",
|
||||||
Q_ARG(QVariant,
|
Q_ARG(QVariant,
|
||||||
|
@ -510,13 +510,7 @@ MessagesAdapter::setConversationProfileData(const lrc::api::conversation::Info&
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
auto& contact = accInfo->contactModel->getContact(contactUri);
|
auto title = accInfo->conversationModel->title(convInfo.uid);
|
||||||
auto bestName = accInfo->contactModel->bestNameForContact(contactUri);
|
|
||||||
bool isPending = contact.profileInfo.type == profile::Type::TEMPORARY;
|
|
||||||
|
|
||||||
QMetaObject::invokeMethod(qmlObj_,
|
|
||||||
"setSendContactRequestButtonVisible",
|
|
||||||
Q_ARG(QVariant, convInfo.isNotASwarm() && isPending));
|
|
||||||
QMetaObject::invokeMethod(qmlObj_,
|
QMetaObject::invokeMethod(qmlObj_,
|
||||||
"setMessagingHeaderButtonsVisible",
|
"setMessagingHeaderButtonsVisible",
|
||||||
Q_ARG(QVariant,
|
Q_ARG(QVariant,
|
||||||
|
@ -524,10 +518,17 @@ MessagesAdapter::setConversationProfileData(const lrc::api::conversation::Info&
|
||||||
&& (convInfo.isRequest || convInfo.needsSyncing))));
|
&& (convInfo.isRequest || convInfo.needsSyncing))));
|
||||||
|
|
||||||
setInvitation(convInfo.isRequest or convInfo.needsSyncing,
|
setInvitation(convInfo.isRequest or convInfo.needsSyncing,
|
||||||
bestName,
|
title,
|
||||||
contactUri,
|
contactUri,
|
||||||
!convInfo.isNotASwarm(),
|
!convInfo.isNotASwarm(),
|
||||||
convInfo.needsSyncing);
|
convInfo.needsSyncing);
|
||||||
|
if (!convInfo.isNotASwarm())
|
||||||
|
return;
|
||||||
|
auto& contact = accInfo->contactModel->getContact(contactUri);
|
||||||
|
bool isPending = contact.profileInfo.type == profile::Type::TEMPORARY;
|
||||||
|
QMetaObject::invokeMethod(qmlObj_,
|
||||||
|
"setSendContactRequestButtonVisible",
|
||||||
|
Q_ARG(QVariant, isPending));
|
||||||
if (!contact.profileInfo.avatar.isEmpty()) {
|
if (!contact.profileInfo.avatar.isEmpty()) {
|
||||||
setSenderImage(contactUri, contact.profileInfo.avatar);
|
setSenderImage(contactUri, contact.profileInfo.avatar);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue