Race between sending and validating private message attachments
When writing a private message, we preview the attachments and remove any attachments that can't be loaded (either because the content provider supplies a MIME type with no known extension, or because Glide can't load the preview, or, in the case of a single attachment, because we can't determine the image size). If the send button is clicked before an invalid attachment has been removed from the list, the invalid attachment will be sent. At the moment this causes two problems:
- Inconsistent behaviour depending on how quickly the attachments load and the user clicks the send button
- False UI feedback (the "Could not attach image" toast is shown but the attachment is sent)
Once the backend for image attachments has been implemented (#1434 (closed)), we may have additional problems:
- The adapter item created for the message may not match the attachments that were actually sent
- We may not be able to display our own messages if invalid attachments were sent
Subtask of #1438 (closed).