-
Notifications
You must be signed in to change notification settings - Fork 3
fix: baileys send message with jid #32
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
fix: baileys send message with jid #32
Conversation
WalkthroughThis update refactors the message sending logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WhatsappBaileysService
participant HTTParty
User->>WhatsappBaileysService: send_message(phone_number, message)
alt message has attachments
WhatsappBaileysService->>WhatsappBaileysService: attachment_message_content(message)
WhatsappBaileysService->>WhatsappBaileysService: contact_jid(phone_number)
WhatsappBaileysService->>HTTParty: send_message_request(jid, attachment_content)
else message has text
WhatsappBaileysService->>WhatsappBaileysService: contact_jid(phone_number)
WhatsappBaileysService->>HTTParty: send_message_request(jid, text_content)
else unsupported message
WhatsappBaileysService->>WhatsappBaileysService: set content_attributes['is_unsupported'] = true
WhatsappBaileysService->>WhatsappBaileysService: update status to failed
WhatsappBaileysService-->>User: return nil
end
HTTParty-->>WhatsappBaileysService: response
WhatsappBaileysService-->>User: message_id or error
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 RuboCop (1.73)app/services/whatsapp/providers/whatsapp_baileys_service.rbError: spec/services/whatsapp/providers/whatsapp_baileys_service_spec.rbError: 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @CayoPOliveira)
…hanges
Pull Request Template
Description
Please include a summary of the change and issue(s) fixed. Also, mention relevant motivation, context, and any dependencies that this change requires.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Checklist:
This change is
Summary by CodeRabbit
Refactor
Tests