allow unblocking mailinglists using the existing api #2259
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
for review: only the last commit contains the logic (only one file affected), the other commits are cleanup, a fix and a test. some in advance:
to get #1964 in, we postponed the question about unblocking mailing lists - on current master, they can be blocked but there is no method to unblock them.
this pr picks up the original idea and keeps the existing api (therefore, no adaption is needed in ui, see comment 3. at 3c0d1a5).
however, instead of introducing a "pseudo contact" that is always added to the mailing list, we add such a contact only if the mailing list is actually blocked and if the blocked-list is requested.
Origin::MailinglistAddress
makes sure, the contact is not created through other channels.in the usual Mailinglist processing, the special contact is not needed and is not assigned eg. as a "member". that preserves the option to do sth. else with the member list, eg. show recent senders there, if we want to.
if we decide to go for another unblock api someday, this is easily possible by just doing a "DELETE FROM contacts WHERE origin=MailinglistAddress", same if we need to tweak the current approach.
however, for now, i think the big advantage is that the api stays unchanged and no adaptions in the UI are needed for this bit (that is not even used in most of the cases).
also, i am not sure that a "block chat", as discussed here and there, is really superior over "block contact" - and to have both is maybe a bit much ux wise - esp. for mailing lists, where the user does not see a big difference imho. for all of these reasons, i like to postpone the discussion wrt another unblock api :)