Fixed: backward comptiblity

This commit is contained in:
Konrad 2017-03-26 19:12:04 +02:00
parent bef75408da
commit c33107c1cc
2 changed files with 8 additions and 13 deletions

View File

@ -933,18 +933,15 @@ void ChatHandler::handleMessages(Request &req, Response &resp)
* doing it? */
tick();
std::string chat_id;
req.mStream << makeKeyValueReference("chat_id", chat_id);
ChatId id(chat_id);
{
RS_STACK_MUTEX(mMtx); /********** LOCKED **********/
ChatId id(req.mPath.top());
// make response a list
resp.mDataStream.getStreamToMember();
if(id.isNotSet())
{
resp.setFail("\""+chat_id+"\" is not a valid chat id");
resp.setFail("\""+req.mPath.top()+"\" is not a valid chat id");
return;
}
std::map<ChatId, std::list<Msg> >::iterator mit = mMsgs.find(id);
@ -982,14 +979,11 @@ void ChatHandler::handleSendMessage(Request &req, Response &resp)
void ChatHandler::handleMarkChatAsRead(Request &req, Response &resp)
{
RS_STACK_MUTEX(mMtx); /********** LOCKED **********/
std::string chat_id;
req.mStream << makeKeyValueReference("chat_id", chat_id);
ChatId id(chat_id);
ChatId id(req.mPath.top());
if(id.isNotSet())
{
resp.setFail("\""+chat_id+"\" is not a valid chat id");
resp.setFail("\""+req.mPath.top()+"\" is not a valid chat id");
return;
}
std::map<ChatId, std::list<Msg> >::iterator mit = mMsgs.find(id);

View File

@ -102,9 +102,10 @@ IdentityHandler::IdentityHandler(StateTokenServer *sts, RsNotify *notify, RsIden
mNotify->registerNotifyClient(this);
addResourceHandler("*", this, &IdentityHandler::handleWildcard);
//addResourceHandler("own", this, &IdentityHandler::handleOwn);
addResourceHandler("own", this, &IdentityHandler::handleOwnIdsRequest);
addResourceHandler("notown", this, &IdentityHandler::handleNotOwnIdsRequest);
addResourceHandler("own", this, &IdentityHandler::handleOwn);
addResourceHandler("own_ids", this, &IdentityHandler::handleOwnIdsRequest);
addResourceHandler("notown_ids", this, &IdentityHandler::handleNotOwnIdsRequest);
addResourceHandler("create_identity", this, &IdentityHandler::handleCreateIdentity);
}