add sending read reciept
This commit is contained in:
parent
d6f56e8b2d
commit
0d18f93410
2 changed files with 9 additions and 0 deletions
|
@ -83,6 +83,7 @@ public:
|
|||
std::string getRoomTopic(std::string roomId);
|
||||
std::string getRoomAvatar(std::string roomId);
|
||||
std::string getCanonicalAlias(std::string roomId);
|
||||
void sendReadReceipt(std::string roomId, std::string eventId);
|
||||
std::string sendEmote(std::string roomId, std::string text);
|
||||
std::string sendNotice(std::string roomId, std::string text);
|
||||
std::string sendText(std::string roomId, std::string text);
|
||||
|
|
|
@ -280,6 +280,14 @@ std::string Client::getCanonicalAlias(std::string roomId) {
|
|||
return aliasStr;
|
||||
}
|
||||
|
||||
void Client::sendReadReceipt(std::string roomId, std::string eventId) {
|
||||
std::string path = "/_matrix/client/r0/rooms/" + urlencode(roomId) + "/receipt/m.read/" + urlencode(eventId);
|
||||
json_t* ret = doRequest("POST", path);
|
||||
if (ret) {
|
||||
json_decref(ret);
|
||||
}
|
||||
}
|
||||
|
||||
std::string Client::sendEmote(std::string roomId, std::string text) {
|
||||
json_t* request = json_object();
|
||||
json_object_set_new(request, "msgtype", json_string("m.emote"));
|
||||
|
|
Loading…
Reference in a new issue