Add support for text message delivery report
@ndufresne
Submitted by Nicolas Dufresne Assigned to Telepathy bugs list
Description
The logger should support text message delivery report. Many feature can be added through that support.
Proper support for delivery report would enable the Logger to detect message echo that has been sent by other client store. Those echo are presented by a delivery report of a message that was not sent by current client. In that case, we would simply store a new message.
It would also enable the logger to provide a delivery status (if protocol supports delivery report). This way, people could see in the log viewer which message have been sent with success and ones that failed.
While I do think it would be easier to implement on top of a SQL storage, there is a way to do it with the XML log store. Essentially, the delivery reports would be stored in a separate XML file. When parsing a date (messages are split into dates) the XML log store would first load the delivery reports and store them into a hash table. The for each message we would look into the delivery report hash table (using the message-token has key) and fill in proper delivery status the text event. For sure, this require adding the message-token into the TextEvent for log-store usage (will probably remain private). It is not as efficient as if we could edit the message events, but the overhead is not too excessive.
Note that delivery report support is currently missing in TpTextChannel class, having this support would be very helpful.
We would also need a short term delivery report cache in the SQLite database for the same reason we need one for pending messages, nicely handle logger or other component crash.
Version: git master