-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1165 from freedomofpress/seen
Add Seen/Unseen support at source level
- Loading branch information
Showing
36 changed files
with
20,772 additions
and
1,918 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import List | ||
|
||
from sdclientapi import API | ||
from sqlalchemy.orm.session import Session | ||
|
||
from securedrop_client.api_jobs.base import ApiJob | ||
|
||
|
||
class SeenJob(ApiJob): | ||
def __init__(self, files: List[str], messages: List[str], replies: List[str]) -> None: | ||
super().__init__() | ||
self.files = files | ||
self.messages = messages | ||
self.replies = replies | ||
|
||
def call_api(self, api_client: API, session: Session) -> None: | ||
""" | ||
Override ApiJob. | ||
Mark files, messages, and replies as seen. Do not make the request if there are no items to | ||
be marked as seen. | ||
""" | ||
if not self.files and not self.messages and not self.replies: | ||
return | ||
|
||
api_client.seen(self.files, self.messages, self.replies) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.