Skip to content

Commit

Permalink
修正无法群发消息的问题(不是群聊发送)。
Browse files Browse the repository at this point in the history
  • Loading branch information
balloonwj committed Jun 26, 2019
1 parent 1defcb1 commit 9133ce7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flamingoserver/chatserversrc/ChatSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,18 +1212,18 @@ void ChatSession::OnMultiChatResponse(const std::string& targets, const std::str
Json::CharReader* reader(b.newCharReader());
Json::Value jsonRoot;
JSONCPP_STRING errs;
bool ok = reader->parse(data.c_str(), data.c_str() + data.length(), &jsonRoot, &errs);
bool ok = reader->parse(targets.c_str(), targets.c_str() + targets.length(), &jsonRoot, &errs);
if (!ok || errs.size() != 0)
{
LOGE("invalid json: targets: %s, data: %s, userid: %d, , client: %s", targets.c_str(), data.c_str(), m_userinfo.userid, conn->peerAddress().toIpPort().c_str());
LOGE("invalid targets string: targets: %s, data: %s, userid: %d, , client: %s", targets.c_str(), data.c_str(), m_userinfo.userid, conn->peerAddress().toIpPort().c_str());
delete reader;
return;
}
delete reader;

if (!jsonRoot["targets"].isArray())
{
LOGE("invalid json: targets: %s, data: %s, userid: %d, , client: %s", targets.c_str(), data.c_str(), m_userinfo.userid, conn->peerAddress().toIpPort().c_str());
LOGE("[targets] node is not array in targets string: targets: %s, data: %s, userid: %d, client: %s", targets.c_str(), data.c_str(), m_userinfo.userid, conn->peerAddress().toIpPort().c_str());
return;
}

Expand Down

0 comments on commit 9133ce7

Please sign in to comment.