mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 03:53:23 +02:00
swarm: fix unhandled exception when invoking the context menu
Querying peers should be done the with peersForConversation api. Change-Id: Ia28d19b68e040f7fbd822e0781b3ad8c91186f27
This commit is contained in:
parent
e18c329741
commit
ccd7e08c3f
1 changed files with 15 additions and 9 deletions
|
@ -45,19 +45,25 @@ public:
|
|||
{
|
||||
auto list = id.split('_', Qt::SkipEmptyParts);
|
||||
if (list.size() < 2)
|
||||
return {QrType::Account, ""};
|
||||
return {QrType::Account, {}};
|
||||
if (list.contains("account") && list.size() > 1) {
|
||||
return {QrType::Account, list[1]};
|
||||
} else if (list.contains("contact") && list.size() > 1) {
|
||||
/*
|
||||
* For contact_xxx, xxx is "" initially
|
||||
*/
|
||||
const auto& convInfo = lrcInstance_->getConversationFromConvUid(list[1]);
|
||||
auto contact = lrcInstance_->getCurrentAccountInfo().contactModel->getContact(
|
||||
convInfo.participants.at(0));
|
||||
return {QrType::Contact, contact.profileInfo.uri};
|
||||
// For contact_xxx, xxx is "" initially
|
||||
try {
|
||||
const auto& convInfo = lrcInstance_->getConversationFromConvUid(list[1]);
|
||||
if (convInfo.mode == conversation::Mode::ONE_TO_ONE
|
||||
|| convInfo.mode == conversation::Mode::NON_SWARM) {
|
||||
auto peerUri = lrcInstance_->getCurrentAccountInfo()
|
||||
.conversationModel->peersForConversation(convInfo.uid)
|
||||
.at(0);
|
||||
return {QrType::Contact, peerUri};
|
||||
}
|
||||
} catch (...) {
|
||||
}
|
||||
return {QrType::Contact, {}};
|
||||
}
|
||||
return {QrType::Account, ""};
|
||||
return {QrType::Account, {}};
|
||||
}
|
||||
|
||||
QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize) override
|
||||
|
|
Loading…
Add table
Reference in a new issue