mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-24 09:25:33 +02:00
misc: fix right click on self contact
Change-Id: I003bad0416c541e7e02f80d01734d71ccd453818 GitLab: #992
This commit is contained in:
parent
f95b0e2ed2
commit
07e7ae5310
1 changed files with 7 additions and 6 deletions
|
@ -169,27 +169,28 @@ ConversationListModelBase::dataForItem(item_t item, int role) const
|
|||
if (peerUriList.isEmpty())
|
||||
return {};
|
||||
auto peerUri = peerUriList.at(0);
|
||||
if (peerUri == lrcInstance_->getCurrentAccountInfo().profileInfo.uri) {
|
||||
auto& accInfo = lrcInstance_->getCurrentAccountInfo();
|
||||
if (peerUri == accInfo.profileInfo.uri) {
|
||||
// Conversation alone with self
|
||||
switch (role) {
|
||||
case Role::BestId:
|
||||
return QVariant(lrcInstance_->accountModel().bestIdForAccount(peerUri));
|
||||
return QVariant(lrcInstance_->accountModel().bestIdForAccount(accInfo.id));
|
||||
case Role::Alias:
|
||||
return QVariant(lrcInstance_->getCurrentAccountInfo().profileInfo.alias);
|
||||
return QVariant(accInfo.profileInfo.alias);
|
||||
case Role::RegisteredName:
|
||||
return QVariant(lrcInstance_->getCurrentAccountInfo().registeredName);
|
||||
return QVariant(accInfo.registeredName);
|
||||
case Role::URI:
|
||||
return QVariant(peerUri);
|
||||
case Role::IsBanned:
|
||||
return QVariant(false);
|
||||
case Role::ContactType:
|
||||
return QVariant(
|
||||
static_cast<int>(lrcInstance_->getCurrentAccountInfo().profileInfo.type));
|
||||
static_cast<int>(accInfo.profileInfo.type));
|
||||
}
|
||||
}
|
||||
ContactModel* contactModel;
|
||||
contact::Info contact {};
|
||||
contactModel = lrcInstance_->getCurrentAccountInfo().contactModel.get();
|
||||
contactModel = accInfo.contactModel.get();
|
||||
try {
|
||||
contact = contactModel->getContact(peerUri);
|
||||
} catch (const std::exception&) {
|
||||
|
|
Loading…
Add table
Reference in a new issue