Skip to content

Commit 06a3102

Browse files
author
Allie Crevier
committed
Remove old way of checking deletion timestamp
Signed-off-by: Allie Crevier <[email protected]>
1 parent c2d1344 commit 06a3102

File tree

1 file changed

+12
-26
lines changed

1 file changed

+12
-26
lines changed

securedrop_client/gui/widgets.py

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,11 +1357,6 @@ def set_snippet(
13571357
if self.deleting or self.deleting_conversation:
13581358
return
13591359

1360-
# If the sync started before the deletion finished, then the sync is stale and we do
1361-
# not want to update the source widget.
1362-
if self.sync_started_timestamp < self.deletion_scheduled_timestamp:
1363-
return
1364-
13651360
# If the source collection is empty yet the interaction_count is greater than zero, then we
13661361
# known that the conversation has been deleted.
13671362
if not self.source.server_collection:
@@ -2984,18 +2979,15 @@ def _on_conversation_deletion_successful(self, source_uuid: str, timestamp: date
29842979
logger.debug(f"Could not update ConversationView: {e}")
29852980

29862981
def update_deletion_markers(self) -> None:
2987-
try:
2988-
if self.source.collection:
2989-
self.scroll.show()
2990-
if self.source.collection[0].file_counter > 1:
2991-
self.deleted_conversation_marker.hide()
2992-
self.deleted_conversation_items_marker.show()
2993-
elif self.source.interaction_count > 0:
2994-
self.scroll.hide()
2995-
self.deleted_conversation_items_marker.hide()
2996-
self.deleted_conversation_marker.show()
2997-
except sqlalchemy.exc.InvalidRequestError as e:
2998-
logger.debug(f"Could not Update deletion markers in the ConversationView: {e}")
2982+
if self.source.collection:
2983+
self.scroll.show()
2984+
if self.source.collection[0].file_counter > 1:
2985+
self.deleted_conversation_marker.hide()
2986+
self.deleted_conversation_items_marker.show()
2987+
elif self.source.interaction_count > 0:
2988+
self.scroll.hide()
2989+
self.deleted_conversation_items_marker.hide()
2990+
self.deleted_conversation_marker.show()
29992991

30002992
def update_conversation(self, collection: list) -> None:
30012993
"""
@@ -3016,11 +3008,6 @@ def update_conversation(self, collection: list) -> None:
30163008
passed into this method in case of a mismatch between where the widget
30173009
has been and now is in terms of its index in the conversation.
30183010
"""
3019-
# If the sync started before the deletion finished, then the sync is stale and we do
3020-
# not want to update the conversation.
3021-
if self.sync_started_timestamp < self.deletion_scheduled_timestamp:
3022-
return
3023-
30243011
self.controller.session.refresh(self.source)
30253012

30263013
# Keep a temporary copy of the current conversation so we can delete any
@@ -3157,7 +3144,7 @@ def add_reply(self, reply: Union[DraftReply, Reply], sender: User, index: int) -
31573144
self.scroll.add_widget_to_conversation(index, conversation_item, Qt.AlignRight)
31583145
self.current_messages[reply.uuid] = conversation_item
31593146

3160-
def on_reply_sent(self, source_uuid: str, reply_uuid: str, reply_text: str) -> None:
3147+
def on_reply_sent(self, source_uuid: str) -> None:
31613148
"""
31623149
Add the reply text sent from ReplyBoxWidget to the conversation.
31633150
"""
@@ -3167,7 +3154,6 @@ def on_reply_sent(self, source_uuid: str, reply_uuid: str, reply_text: str) -> N
31673154
self.update_conversation(self.source.collection)
31683155
except sqlalchemy.exc.InvalidRequestError as e:
31693156
logger.debug(e)
3170-
self.update_deletion_markers()
31713157

31723158

31733159
class SourceConversationWrapper(QWidget):
@@ -3311,7 +3297,7 @@ class ReplyBoxWidget(QWidget):
33113297
A textbox where a journalist can enter a reply.
33123298
"""
33133299

3314-
reply_sent = pyqtSignal(str, str, str)
3300+
reply_sent = pyqtSignal(str)
33153301

33163302
def __init__(self, source: Source, controller: Controller) -> None:
33173303
super().__init__()
@@ -3408,7 +3394,7 @@ def send_reply(self) -> None:
34083394
self.text_edit.setText("")
34093395
reply_uuid = str(uuid4())
34103396
self.controller.send_reply(self.source.uuid, reply_uuid, reply_text)
3411-
self.reply_sent.emit(self.source.uuid, reply_uuid, reply_text)
3397+
self.reply_sent.emit(self.source.uuid)
34123398

34133399
@pyqtSlot(bool)
34143400
def _on_authentication_changed(self, authenticated: bool) -> None:

0 commit comments

Comments
 (0)