Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brettp
Copy link
Contributor

@brettp brettp commented May 11, 2024

Read receipts for individual messages are available in bbernhard/signal-cli-rest-api#534. This adds support via Context.receipt("read").

Copy link
Owner

@filipre filipre left a 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
Copy link
Owner

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
Copy link
Owner

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'):
Copy link
Owner

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):
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants