diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2021-11-23 03:39:49 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2021-11-23 03:40:37 +0300 |
commit | b1a2cf616e0a4b402c8be45ef62cff34ccd8329f (patch) | |
tree | 735922afae927bcbe1a5d0748885868539a1843a /lib | |
parent | 4902a359725fec716ece01a39862200b1a2c0493 (diff) | |
parent | 0e6caf61ff6d63f8cc185cba6637c73143cfee94 (diff) |
Merge pull request #8302 from SuperTux88/fix-local-sharing-with-me
Fix sharing status of local contacts after an import
Diffstat (limited to 'lib')
-rw-r--r-- | lib/archive_importer/contact_importer.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/archive_importer/contact_importer.rb b/lib/archive_importer/contact_importer.rb index b64dfe7b7..f392d7a21 100644 --- a/lib/archive_importer/contact_importer.rb +++ b/lib/archive_importer/contact_importer.rb @@ -13,6 +13,8 @@ class ArchiveImporter attr_reader :user def import + return unless json.fetch("receiving") + @imported_contact = create_contact add_to_aspects rescue ActiveRecord::RecordInvalid => e @@ -34,7 +36,8 @@ class ArchiveImporter def create_contact person = Person.by_account_identifier(json.fetch("account_id")) - user.contacts.create!(person_id: person.id, sharing: json.fetch("sharing"), receiving: json.fetch("receiving")) + # see AccountMigration#dispatch_contacts for the other half of this when the contact is sharing with the user + user.contacts.create!(person_id: person.id, sharing: false, receiving: true) end end end |