Delete all invitation/introduction messages for completed sessions
Subtask of #68 (closed)
-
Implement the no-ops from #1625 (closed) in the remaining ConversationClient
s that deletes all completed sessions. A session is complete if it is in a completed state and all messages have been ACKed.-
Introductions: If the session isn't in the start state or there are sent-but-unacked messages, refuse to delete the session. Otherwise delete all messages and their metadata, but leave the session storage message -
Blogs/Forums: If the session has an invite available to answer, refuse to delete the session. Otherwise delete all visible messages and their metadata, but leave invisible messages and the session storage message -
Private Groups: If the session has an invite available to answer, refuse to delete the session. Otherwise delete all visible messages and their metadata, but leave invisible messages and the session storage message
-
-
Update UI dialog to explain that ongoing invitations/introductions can't be deleted
Implementation plan:
- look up all the message metadata
- look up all message states
- loop over all message states and create hash set of message ids that are sent but not acked
- loop over all the message metadata finding session storage objects messages and creating session objects
- loop over it again assigning protocol messages to their sessions
- loop over all sessions: If session state is completed and all messages were ACKed, delete entire session, else remember non-deletion
- return false if at least one session could not be deleted