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

Added convenient toIdMessageRecipient method #795

Open
wants to merge 1 commit into
base: dev-2.0
Choose a base branch
from
Open

Added convenient toIdMessageRecipient method #795

wants to merge 1 commit into from

Conversation

marceloverdijk
Copy link
Contributor

@nbartels I don't know if you like this PR as it might mix some concerns (webhook/sendapi).
So I can understand if you reject it.
But if accepted it gives a easier api to use a sugar syntax to use the MessagingParticipant sender as input for the send api.

@nbartels
Copy link
Contributor

@marceloverdijk can you explain why this is useful. I don't see it ATM, because the new method is a renamed "clone" method :)

@marceloverdijk
Copy link
Contributor Author

Instead of

MessagingItem item = ..
MessagingParticipant sender = item.getSender();
IdMessageRecipient recipient = new IdMessageRecipient(sender.getId());

I could do something like:

MessagingItem item = ..
MessagingParticipant sender = item.getSender();
IdMessageRecipient recipient = sender.toIdMessageRecipient()

This gives a shorter/easier notation (without passing in the id manually) to create a recipient.

@nbartels
Copy link
Contributor

Okay, I see. Let me think about it ...

@marceloverdijk
Copy link
Contributor Author

No worries if you don't want to add it.
It would be my personal preference, but I also see the reasoning for not adding it.

@restfb restfb deleted a comment from Rama3214 Jul 5, 2020
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.

None yet

2 participants