-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for read receipts. #53
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I left some smaller comments, but I like the feature
aiohttp.ClientError, | ||
aiohttp.http_exceptions.HttpProcessingError, | ||
): | ||
raise ReactionError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a reaction error?
@@ -93,6 +93,26 @@ async def react( | |||
): | |||
raise ReactionError | |||
|
|||
async def receipt( | |||
self, recipient: str, receipt_type: str, target_author: str, timestamp: int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to introduce literals for parameters like receipt_type
. I know it can take read
as a value. What else?
recipient = message.recipient() | ||
|
||
# can't do groups yet because not supported in signal-cli | ||
if getattr(message, 'group'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line fails the pre-commit
hook
@@ -150,6 +170,9 @@ def _react_rest_uri(self): | |||
def _typing_indicator_uri(self): | |||
return f"http://{self.signal_service}/v1/typing-indicator/{self.phone_number}" | |||
|
|||
def _receipt_rest_uri(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to stay consistent with the methods, I'd call it _receipts_rest_uri
instead
Read receipts for individual messages are available in bbernhard/signal-cli-rest-api#534. This adds support via
Context.receipt("read")
.