davx5-ose
davx5-ose copied to clipboard
Remove concept of main accounts
Purpose
Right now a LocalAddressBook still holds a reference to it's main account, but this is obsolete. We already have a relation between an address book account and the main account it belongs to via the corresponding database collection:
"main" account ↔ DB collection ↔ address book ↔ address book account
In the future we want to rely on system accounts as little as possible. Therefore this PR removes the direct relation between an address book account to its "main" account where possible.
Short description
- Acquire account settings via address book account - Adddress book settings are still stored in the settings of the main account.
- Create address book account name only from collection info - Although it might be more userfriendly, we don't need the name of the main account here and instead of a hash we can use the collection ID for uniqueness.
- Extract the code to find an address books main account to the account repository
- Remove the "mainAccount" property from
LocalAddressBook - Stop storing main account name and type in address book account settings
Note: Until #603 is done, the relation "DB collection 🠔 address book" is only possible with url AND service (id). Because we don't have the service ID available in the address book (LocalAddressBook) for the time being we can extract the collection ID from the new address book account name like so. This is of course quite hacky and not good. The alternative is to do #603 first and use a common ID field as link.
Checklist
- [x] The PR has a proper title, description and label.
- [x] I have self-reviewed the PR.
- [x] I have added documentation to complex functions and functions that can be used by other modules.
- [x] I have added reasonable tests or consciously decided to not add tests.