Skip to content

Commit

Permalink
Adjust to changes in MegaStringListPrivate ctor in SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiohs84 committed Jan 28, 2021
1 parent 912bcce commit 3dea0d2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/megachatapi_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4746,7 +4746,7 @@ MegaStringList* MegaChatApiImpl::getMessageReactions(MegaChatHandle chatid, Mega
return new MegaStringListPrivate();
}

vector<char *> reactList;
string_vector reactions;
const std::vector<Message::Reaction> &confirmedReactions = msg->getReactions();
const Chat::PendingReactions& pendingReactions = (findChatRoom(chatid))->chat().getPendingReactions();

Expand All @@ -4771,7 +4771,7 @@ MegaStringList* MegaChatApiImpl::getMessageReactions(MegaChatHandle chatid, Mega

if (reactUsers > 0)
{
reactList.emplace_back(MegaApi::strdup(auxReact.mReaction.c_str()));
reactions.emplace_back(auxReact.mReaction);
}
}

Expand All @@ -4782,11 +4782,11 @@ MegaStringList* MegaChatApiImpl::getMessageReactions(MegaChatHandle chatid, Mega
&& !msg->getReactionCount(pendingReact.mReactionString)
&& pendingReact.mStatus == OP_ADDREACTION)
{
reactList.emplace_back (MegaApi::strdup(pendingReact.mReactionString.c_str()));
reactions.emplace_back(pendingReact.mReactionString);
}
}

return new MegaStringListPrivate(reactList.data(), static_cast<int>(reactList.size()));
return new MegaStringListPrivate(move(reactions));
}

MegaHandleList* MegaChatApiImpl::getReactionUsers(MegaChatHandle chatid, MegaChatHandle msgid, const char *reaction)
Expand Down Expand Up @@ -4879,13 +4879,13 @@ rtcModule::ICallHandler *MegaChatApiImpl::onGroupCallActive(Id chatid, Id callid

MegaStringList *MegaChatApiImpl::getChatInDevices(const std::set<string> &devices)
{
std::vector<char*> buffer;
string_vector buffer;
for (const std::string &device : devices)
{
buffer.push_back(MegaApi::strdup(device.c_str()));
buffer.push_back(device);
}

return new MegaStringListPrivate(buffer.data(), static_cast<int>(buffer.size()));
return new MegaStringListPrivate(move(buffer));
}

void MegaChatApiImpl::cleanCallHandlerMap()
Expand Down

0 comments on commit 3dea0d2

Please sign in to comment.