0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd:Ⓜ️ Add convenience notice(room) suite.

This commit is contained in:
Jason Volk 2018-03-02 03:42:16 -08:00
parent 6dbb1864dd
commit f7034d0bf5
2 changed files with 19 additions and 2 deletions

View file

@ -55,6 +55,8 @@ namespace ircd::m
event::id::buf redact(const room &, const m::id::user &sender, const m::id::event &, const string_view &reason);
event::id::buf message(const room &, const m::id::user &sender, const json::members &content);
event::id::buf message(const room &, const m::id::user &sender, const string_view &body, const string_view &msgtype = "m.text");
event::id::buf notice(const room &, const m::id::user &sender, const string_view &body);
event::id::buf notice(const room &, const string_view &body); // sender is @ircd
event::id::buf leave(const room &, const m::id::user &);
event::id::buf join(const room &, const m::id::user &);

View file

@ -232,8 +232,8 @@ ircd::m::init::bootstrap()
_keys.bootstrap();
message(control, me.user_id, "Welcome to the control room.");
message(control, me.user_id, "I am the daemon. You can talk to me in this room by highlighting me.");
notice(control, me.user_id, "Welcome to the control room.");
notice(control, me.user_id, "I am the daemon. You can talk to me in this room by highlighting me.");
}
bool
@ -345,6 +345,21 @@ ircd::m::redact(const room &room,
return function(room, sender, event_id, reason);
}
ircd::m::event::id::buf
ircd::m::notice(const room &room,
const string_view &body)
{
return message(room, me.user_id, body, "m.notice");
}
ircd::m::event::id::buf
ircd::m::notice(const room &room,
const m::id::user &sender,
const string_view &body)
{
return message(room, sender, body, "m.notice");
}
ircd::m::event::id::buf
ircd::m::message(const room &room,
const m::id::user &sender,