Skip to content
Snippets Groups Projects
Commit 07e7ae53 authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

misc: fix right click on self contact

Change-Id: I003bad0416c541e7e02f80d01734d71ccd453818
GitLab: #992
parent f95b0e2e
No related branches found
No related tags found
No related merge requests found
......@@ -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&) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment