Share forums with contacts
Looks like this:
It makes probably most sense to review the two commits individually: the first one contains major refactoring to separate PendingContactItem from (real) ContactItem so that we don't load pending contacts for forum sharing status and for the introduction drawer. The second one then adds the UI and logic for sharing forums.
There are still two bugs remaining:
- There are different reasons a forum cannot be shared with a contact: 1. the contact's client does not support forums, 2. the forum is already shared with that contact or 3. an invitation to the forum was already sent to the contact (there cannot be more than one at a time, apparently).
canBeShared()
only returns a boolean, so it is difficult to tell (and inform the user) why the forum cannot be shared with a certain contact. I've covered cases 1 and 2, but not 3. Briar Android always shows "Already shared" if sharing is not possible and thus does not properly cover case 1. @akwizgran Is there currently any way of distinguishing between case 1 and 3, or should I consider adding a more informativecanBeShared()
method that returns an enum instead of a boolean? Also, are the mentioned three cases all of them, or did I miss some more? - For some reason,
canBeShared()
does not return true for contacts right from the beginning/start of the app, and it is most of the times necessary to switch to a different forum and back to be able to share a forum with a contact. I suspected this might have to do with the forum client not properly instantiated on the app start, so I added an eventlistener that should react on clientversionupdate-events, but that didn't help. This will probably need some more investigation.
Also, draft since based on !276 (merged)
Closes #431 (closed)
Edited by Mikolai Gütschow