From cd2aabec799636a266c3d0fb40ad5dcb0bc3ed6e Mon Sep 17 00:00:00 2001
From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Date: Mon, 20 Jun 2016 16:51:29 -0400
Subject: [PATCH] accountmodel: fix Ring contacts not showing up

This fixes the contacts with RingIDs being hidden in the
CategorizedContactModel when setUnreachableHidden is true. This was
due to a regression introduced in an earlier patch which made it
that only the SIP protocol was marked as enabled and only if there
was an IP2IP account.

Change-Id: Ia59c5c6826fdc8cf2513807685204b2b38072ba9
Tuleap: #720
---
 src/accountmodel.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/accountmodel.cpp b/src/accountmodel.cpp
index 2ad0697f..06949100 100644
--- a/src/accountmodel.cpp
+++ b/src/accountmodel.cpp
@@ -450,7 +450,7 @@ void AccountModel::update()
          connect(a,SIGNAL(presenceEnabledChanged(bool)),d_ptr,SLOT(slotAccountPresenceEnabledChanged(bool)));
          emit layoutChanged();
 
-         if (a->isIp2ip())
+         if (!a->isIp2ip())
             d_ptr->enableProtocol(a->protocol());
       }
    }
@@ -473,7 +473,7 @@ void AccountModel::updateAccounts()
          connect(a,SIGNAL(presenceEnabledChanged(bool)),d_ptr,SLOT(slotAccountPresenceEnabledChanged(bool)));
          emit dataChanged(index(size()-1,0),index(size()-1,0));
 
-         if (a->isIp2ip())
+         if (!a->isIp2ip())
             d_ptr->enableProtocol(a->protocol());
 
          emit accountAdded(a);
@@ -913,7 +913,7 @@ Account* AccountModel::add(const QString& alias, const Account::Protocol proto)
       d_ptr->m_pSelectionModel->setCurrentIndex(index(d_ptr->m_lAccounts.size()-1,0), QItemSelectionModel::ClearAndSelect);
    }
 
-   if (a->isIp2ip())
+   if (!a->isIp2ip())
       d_ptr->enableProtocol(proto);
 
 // Override ringtone path
-- 
GitLab