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

CHT-428. Comment reactions limitations code #956

Merged
merged 1 commit into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/megachatapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4940,10 +4940,6 @@ class MegaChatApi
* On the onRequestFinish error, the error code associated to the MegaChatError can be:
* - MegaChatError::ERROR_ARGS - if reaction is NULL or the msgid references a management message.
* - MegaChatError::ERROR_NOENT - if the chatroom/message doesn't exists
* - MegaChatError::ERROR_NOENT - if the message has reached the maximum limit of reactions,
* and reaction has not been added yet. MegaChatRequest::getNumber() will return -1
* - MegaChatError::ERROR_NOENT - if our own user has reached the maximum limit of reactions
* MegaChatRequest::getNumber() will return 1
* - MegaChatError::ERROR_ACCESS - if our own privilege is different than MegaChatPeerList::PRIV_STANDARD
* or MegaChatPeerList::PRIV_MODERATOR.
* - MegaChatError::ERROR_EXIST - if our own user has reacted previously with this reaction for this message
Expand Down
17 changes: 9 additions & 8 deletions src/megachatapi_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2022,14 +2022,15 @@ void MegaChatApiImpl::sendPendingRequests()
bool hasReacted = msg.hasReacted(reaction, mClient->myHandle());
if (request->getFlag())
{
// check if max number of reactions has been reached
int res = msg.allowReact(mClient->myHandle(), reaction);
if (res != 0)
{
request->setNumber(res);
errorCode = MegaChatError::ERROR_NOENT;
break;
}
// Uncomment this block upon release of reaction limitations
// // check if max number of reactions has been reached
// int res = msg.allowReact(mClient->myHandle(), reaction);
// if (res != 0)
// {
// request->setNumber(res);
// errorCode = MegaChatError::ERROR_NOENT;
// break;
// }

if ((hasReacted && pendingStatus != OP_DELREACTION)
|| (!hasReacted && pendingStatus == OP_ADDREACTION))
Expand Down