diff --git a/libresapi/src/api/ChatHandler.cpp b/libresapi/src/api/ChatHandler.cpp index f50eaae9e..68f0bd356 100644 --- a/libresapi/src/api/ChatHandler.cpp +++ b/libresapi/src/api/ChatHandler.cpp @@ -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 >::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 >::iterator mit = mMsgs.find(id); diff --git a/libresapi/src/api/IdentityHandler.cpp b/libresapi/src/api/IdentityHandler.cpp index 9f01442df..1a43211ea 100644 --- a/libresapi/src/api/IdentityHandler.cpp +++ b/libresapi/src/api/IdentityHandler.cpp @@ -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); }