Merge lp:~renatofilho/address-book-service/fix-facebook-account-import into lp:address-book-service

Proposed by Renato Araujo Oliveira Filho on 2015-10-20
Status: Merged
Approved by: Michael Sheldon on 2015-10-20
Approved revision: 176
Merged at revision: 171
Proposed branch: lp:~renatofilho/address-book-service/fix-facebook-account-import
Merge into: lp:address-book-service
Diff against target: 51 lines (+13/-3)
2 files modified
lib/addressbook.cpp (+3/-3)
updater/ab-update-buteo-import.cpp (+10/-0)
To merge this branch: bzr merge lp:~renatofilho/address-book-service/fix-facebook-account-import
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-10-21
Michael Sheldon (community) 2015-10-20 Approve on 2015-10-20
Review via email: mp+275076@code.launchpad.net

Commit Message

Skip non google accounts.

because of the bug #1503373 online account report facebook as contacts account for some users. To avoid problems with that, we skip non google accounts from the update.

Description of the Change

= HOW TO TEST - Sync evolution migration (all accounts disabled) =
==================================================================

 * Install OTA7 or older image on phone with --wipe option to make sure all accounts and data deleted

 * Create a new google account using system settings page, make sure that contact sync is disabled
 * Create a facebook account
 * flash proposed image (without flash)
 * Install the silo packages
 * reboot the phone
 * Check if contact sync get update correct, and you can use address-book-app as normal.

To post a comment you must log in.
172. By Renato Araujo Oliveira Filho on 2015-10-20

Fix build.

173. By Renato Araujo Oliveira Filho on 2015-10-20

Use providerName function.

174. By Renato Araujo Oliveira Filho on 2015-10-20

Typo fixed.

175. By Renato Araujo Oliveira Filho on 2015-10-20

Reduced message to fit on messaging menu.

176. By Renato Araujo Oliveira Filho on 2015-10-20

Fix update when all accounts is disabled.

Michael Sheldon (michael-sheldon) wrote :

Looks good :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/addressbook.cpp'
2--- lib/addressbook.cpp 2015-10-14 18:35:26 +0000
3+++ lib/addressbook.cpp 2015-10-20 23:22:44 +0000
4@@ -697,7 +697,7 @@
5 Source src;
6 e_source_registry_commit_source_finish(E_SOURCE_REGISTRY(source), res, &error);
7 if (error) {
8- qWarning() << "Fail to create source" << error->message;
9+ qWarning() << "Failed to create source" << error->message;
10 g_error_free(error);
11 } else {
12 // set as primary if necessary
13@@ -1001,9 +1001,9 @@
14 if (isSafeMode()) {
15 m_messagingMenuMessage = messaging_menu_message_new("address-book-service-safe-mode",
16 icon,
17- C::gettext("Contact sync update required"),
18+ C::gettext("Update required"),
19 NULL,
20- C::gettext("Your Contact sync accounts need to be upgraded. Only local contacts will be editable until the contact sync upgrade is complete."),
21+ C::gettext("Only local contacts will be editable until the contact sync upgrade is complete."),
22 QDateTime::currentMSecsSinceEpoch() * 1000); // the value is expected to be in microseconds
23 } else {
24 m_messagingMenuMessage = messaging_menu_message_new("address-book-service-safe-mode",
25
26=== modified file 'updater/ab-update-buteo-import.cpp'
27--- updater/ab-update-buteo-import.cpp 2015-10-15 19:05:08 +0000
28+++ updater/ab-update-buteo-import.cpp 2015-10-20 23:22:44 +0000
29@@ -486,6 +486,11 @@
30 Q_FOREACH(Accounts::AccountId accountId, accounts) {
31 QScopedPointer<Accounts::Account> acc(mgr.account(accountId));
32
33+ if (acc->providerName() != "google") {
34+ qDebug() << "Skip non google account" << acc->displayName();
35+ continue;
36+ }
37+
38 QString oldSourceId;
39 QString newSourceId;
40 bool isEmpty;
41@@ -569,6 +574,11 @@
42 }
43 }
44
45+ if (m_buteoQueue.isEmpty()) {
46+ qDebug() << "No account to update";
47+ QTimer::singleShot(0, this, SIGNAL(updated()));
48+ }
49+
50 return true;
51 }
52

Subscribers

People subscribed via source and target branches