* Local contacts also start sharing again with imported user if they
were sharing with the old account
* Don't create empty contact entities for contacts which the imported
user doesn't share with and also maybe the contact doesn't share with
the importer
* Ensure people which were a contact in the archive still receive the
migration, even when the importer doesn't share with them, so they can
resend their contact message
fixes#8106 for real this time
This implements archive import feature.
The feature is divided in two main subfeatures: archive validation and archive import.
Archive validation performs different validation on input user archive. This can be
used without actually running import, e.g. when user wants to check the archive
before import from the frontend. Validators may add messages and modify the archive.
Validators are separated in two types: critical validators and non-critical validators.
If validations by critical validators fail it means we can't import archive.
If non-critical validations fail, we can import archive, but some warning messages
are rendered.
Also validators may change archive contents, e.g. when some entity can't be
imported it may be removed from the archive.
Validators' job is to take away complexity from the importer and perform the validations
which are not implemented in other parts of the system, e.g. DB validations or
diaspora_federation entity validations.
Archive importer then takes the modified archive from the validator and imports it.
In order to incapsulate high-level migration logic a MigrationService is
introduced. MigrationService links ArchiveValidator, ArchiveImporter and
AccountMigration.
Also here is introduced a rake task which may be used by podmins to run archive
import.