mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-08 06:32:55 -04:00
libresapi: added chat/send_status
usage: $ curl --data "{\"chat_id\":\"<chat_id>\",\"status\":\"Hi there\"}" http://<host:port>/api/v2/chat/send_status
This commit is contained in:
parent
2c2c7936e5
commit
3d814b7926
1 changed files with 13 additions and 2 deletions
|
@ -771,9 +771,20 @@ void ChatHandler::handleTypingLabel(Request &/*req*/, Response &/*resp*/)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatHandler::handleSendStatus(Request &/*req*/, Response &/*resp*/)
|
void ChatHandler::handleSendStatus(Request &req, Response &resp)
|
||||||
{
|
{
|
||||||
|
std::string chat_id;
|
||||||
|
std::string status;
|
||||||
|
req.mStream << makeKeyValueReference("chat_id", chat_id)
|
||||||
|
<< makeKeyValueReference("status", status);
|
||||||
|
ChatId id(chat_id);
|
||||||
|
if(id.isNotSet())
|
||||||
|
{
|
||||||
|
resp.setFail("chat_id is invalid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mRsMsgs->sendStatusString(id, status);
|
||||||
|
resp.setOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatHandler::handleUnreadMsgs(Request &/*req*/, Response &resp)
|
void ChatHandler::handleUnreadMsgs(Request &/*req*/, Response &resp)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue