mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-04 17:15:31 -05: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
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user