mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
misc: fix "Can't find contact..." warning
Scenario, create a swarm with self. As a warning, it will show "Can't find contact YOUR_ID this is a bug, please report" because your account is not in your contacts. Change-Id: I6f49f8fa77132daf00396b62da9ded470df49f98
This commit is contained in:
parent
f81dc754c1
commit
8dda44b562
2 changed files with 19 additions and 3 deletions
|
@ -173,10 +173,26 @@ ConversationListModelBase::dataForItem(item_t item, int role) const
|
|||
|
||||
if (item.isCoreDialog()) {
|
||||
auto peerUriList = model_->peersForConversation(item.uid);
|
||||
if (peerUriList.isEmpty()) {
|
||||
if (peerUriList.isEmpty())
|
||||
return {};
|
||||
}
|
||||
auto peerUri = peerUriList.at(0);
|
||||
if (peerUri == lrcInstance_->getCurrentAccountInfo().profileInfo.uri) {
|
||||
// Conversation alone with self
|
||||
switch (role) {
|
||||
case Role::BestId:
|
||||
return QVariant(lrcInstance_->accountModel().bestIdForAccount(peerUri));
|
||||
case Role::Alias:
|
||||
return QVariant(lrcInstance_->getCurrentAccountInfo().profileInfo.alias);
|
||||
case Role::RegisteredName:
|
||||
return QVariant(lrcInstance_->getCurrentAccountInfo().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));
|
||||
}
|
||||
}
|
||||
ContactModel* contactModel;
|
||||
contact::Info contact {};
|
||||
contactModel = lrcInstance_->getCurrentAccountInfo().contactModel.get();
|
||||
|
|
|
@ -777,7 +777,7 @@ ContactModelPimpl::slotNewBuddySubscription(const QString& accountId,
|
|||
void
|
||||
ContactModelPimpl::slotContactAdded(const QString& accountId,
|
||||
const QString& contactUri,
|
||||
bool confirmed)
|
||||
bool)
|
||||
{
|
||||
if (accountId != linked.owner.id)
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue