This PR removes much of the need to query the db for the last sent message.
Initial query is moved into the background as the loader is being fetched.
Basing on timestamps, as sms and mms ids can collide if id is not paired with isMms.
onSend we put that new message into the cache.
Subsequent queries are only performed if the previous lastSentTimestamp was deleted.
This PR also will not force Sent status to be visible for outgoing messages if it is 20 messages old. We could make this older, but there's little point going excessively far into history to show the Sent status if it impacts performance.
This PR also fixes a logic error that caused onAttachmentNeedsDownload to run AttachmentDownloadJobs more than intended.
This PR removes much of the need to query the db for the last sent message.
isMms
.This PR also fixes a logic error that caused
onAttachmentNeedsDownload
to runAttachmentDownloadJob
s more than intended.