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

iOS bindings for chat reactions #892

Merged
merged 10 commits into from
Sep 14, 2020

Conversation

lhr000lhrmega
Copy link
Contributor

No description provided.

@JenkinsMega
Copy link

Can one of the admins verify this patch?

@lhr000lhrmega lhr000lhrmega changed the title WIP: iOS bindings for chat reactions iOS bindings for chat reactions Jun 25, 2020
@lhr000lhrmega lhr000lhrmega self-assigned this Jun 25, 2020
@@ -921,6 +921,26 @@ - (void)removeUnsentMessageForChat:(uint64_t)chatId rowId:(uint64_t)rowId {
self.megaChatApi->removeUnsentMessage(chatId, rowId);
}

- (void)addReactionForChat:(uint64_t)chatId messageId:(uint64_t)messageId reaction:(NSString *)reaction {
self.megaChatApi->addReaction(chatId, messageId, reaction ? [reaction UTF8String] : NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to replace
reaction ? [reaction UTF8String] : NULL
With
reaction.UTF8String
as performing any operation on nil would return nil. I think we don't have to check for the condition. Let me know your thoughts.

If it possible I think we can replace it everywhere on your PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is possible if reaction is nil it will pass NULL as parameter, so we can replace reaction ? [reaction UTF8String] : NULL with reaction.UTF8String

jnavarrom and others added 2 commits September 14, 2020 09:49
Use “get” only for methods that return objects and values indirectly.
@jnavarrom jnavarrom merged commit 38f9e43 into develop Sep 14, 2020
@jnavarrom jnavarrom deleted the task/#12148-Chat-message-emoji-reactions branch September 14, 2020 09:08
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.

4 participants