The UI combines private messages, introduction messages and forum sharing messages into a single conversation. This requires various parts of the UI (contact list, conversation view, notification manager) to combine messages from the messaging, introduction, and forum sharing clients. Create a ConversationManager in the core that deals with combining these messages and presents a unified API (including events) to the UI.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
This conversation manager could also get the timestamp of the latest message from the group metadata that I suggested in #373 (closed).
However, I am not sure how storing this information there could work. If we choose the private conversation group to store this information, should the MessagingManager or the ConversationManager offer a public method to update the timestamp there?
Perhaps we could store one timestamp per client, and the conversation manager returns the latest of all the timestamps? It's not as efficient as a single timestamp but it keeps the clients decoupled, and it's still much more efficient than iterating over the messages.
@str4d when working on this, maybe consider whether the new ConversationManager can not only handle private messages and timestamp of latest message, but also the unread count.
Perhaps we could store one timestamp per client, and the conversation manager returns the latest of all the timestamps? It's not as efficient as a single timestamp but it keeps the clients decoupled, and it's still much more efficient than iterating over the messages.
It makes sense for the manager that interacts with the database to be where the timestamp metadata is stored. Being a higher abstraction, the ConversationManager should operate on the metadata provided by the underlying managers.
when working on this, maybe consider whether the new ConversationManager can not only handle private messages and timestamp of latest message, but also the unread count.
Yes, I was planning on this. One of the current limitations of the notification system is it only shows unread private messages, not invitations etc that are rendered as messages.
While I was working on #309 (closed), I came across the MessagesSentEvent and MessagesAckedEvent. Both are currently generic for all sorts of messages and their use should be replaced by client layer events in the ConversationActivity. However, since they are needed for outgoing private message, introductions and forum invitations, I don't think it makes sense to handle these in the respective clients. Wouldn't it be better to also to this in the ConversationManager?