in client/securedrop_client/gui/widgets.py [0:0]
def _on_conversation_deletion_successful(self, source_uuid: str, timestamp: datetime) -> None:
if self.source_uuid != source_uuid:
return
self.deletion_scheduled_timestamp = timestamp
# Now that we know the deletion is scheduled, hide conversation items until they are
# removed from the local database.
try:
draft_reply_exists = False
for item in self.source.collection:
if isinstance(item, DraftReply):
draft_reply_exists = True
continue
item_widget = self.current_messages.get(item.uuid)
if item_widget:
item_widget.hide()
# If a draft reply exists then show the tear pattern above the draft replies.
# Otherwise, show that the entire conversation is deleted.
if draft_reply_exists:
self._scroll.show()
self.deleted_conversation_items_marker.show()
self.deleted_conversation_marker.hide()
else:
self._scroll.hide()
self.deleted_conversation_items_marker.hide()
self.deleted_conversation_marker.show()
except sqlalchemy.exc.InvalidRequestError as e:
logger.debug(f"Could not update ConversationView: {e}")