From 4042afa127d533aa891afa48359a2d63bdf01fbf Mon Sep 17 00:00:00 2001
From: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Mon, 14 Jan 2019 17:15:04 -0500
Subject: [PATCH] account: detect invalid account imports

Change-Id: Ie21bc3772c45ea613884edc23c93af5a6460709a
---
 src/newaccountmodel.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/newaccountmodel.cpp b/src/newaccountmodel.cpp
index 9173cae6..12cf254c 100644
--- a/src/newaccountmodel.cpp
+++ b/src/newaccountmodel.cpp
@@ -405,6 +405,10 @@ NewAccountModelPimpl::updateAccounts()
 void
 NewAccountModelPimpl::slotAccountStatusChanged(const std::string& accountID, const api::account::Status status)
 {
+    if (status == api::account::Status::INVALID) {
+        emit linked.invalidAccountDetected(accountID);
+        return;
+    }
     auto it = accounts.find(accountID);
 
     // If account is not in the map yet, don't add it, it is updateAccounts's job
-- 
GitLab