mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️:room: Add annotate() convenience reaction.
This commit is contained in:
parent
6fa63f8bf0
commit
ba5352e560
2 changed files with 16 additions and 0 deletions
|
@ -71,6 +71,7 @@ namespace ircd::m
|
||||||
|
|
||||||
// [SET] Convenience sends
|
// [SET] Convenience sends
|
||||||
event::id::buf react(const room &, const id::user &sender, const id::event &, const string_view &rel_type, json::iov &relates);
|
event::id::buf react(const room &, const id::user &sender, const id::event &, const string_view &rel_type, json::iov &relates);
|
||||||
|
event::id::buf annotate(const room &, const id::user &sender, const id::event &, const string_view &key);
|
||||||
event::id::buf message(const room &, const id::user &sender, const json::members &content);
|
event::id::buf message(const room &, const id::user &sender, const json::members &content);
|
||||||
event::id::buf message(const room &, const id::user &sender, const string_view &body, const string_view &msgtype = "m.text");
|
event::id::buf message(const room &, const id::user &sender, const string_view &body, const string_view &msgtype = "m.text");
|
||||||
event::id::buf msghtml(const room &, const id::user &sender, const string_view &html, const string_view &alt = {}, const string_view &msgtype = "m.notice");
|
event::id::buf msghtml(const room &, const id::user &sender, const string_view &html, const string_view &alt = {}, const string_view &msgtype = "m.notice");
|
||||||
|
|
|
@ -157,6 +157,21 @@ ircd::m::message(const room &room,
|
||||||
return send(room, sender, "m.room.message", contents);
|
return send(room, sender, "m.room.message", contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::m::event::id::buf
|
||||||
|
ircd::m::annotate(const room &room,
|
||||||
|
const id::user &sender,
|
||||||
|
const id::event &target,
|
||||||
|
const string_view &key)
|
||||||
|
{
|
||||||
|
json::iov relates;
|
||||||
|
const json::iov::push push
|
||||||
|
{
|
||||||
|
relates, { "key", key },
|
||||||
|
};
|
||||||
|
|
||||||
|
return react(room, sender, target, "m.annotation", relates);
|
||||||
|
}
|
||||||
|
|
||||||
ircd::m::event::id::buf
|
ircd::m::event::id::buf
|
||||||
ircd::m::react(const room &room,
|
ircd::m::react(const room &room,
|
||||||
const id::user &sender,
|
const id::user &sender,
|
||||||
|
|
Loading…
Reference in a new issue