diff --git a/include/ircd/m/rooms.h b/include/ircd/m/rooms.h index 507bed8cd..34d0eb777 100644 --- a/include/ircd/m/rooms.h +++ b/include/ircd/m/rooms.h @@ -44,4 +44,5 @@ namespace ircd::m::rooms json::object summary_chunk(const m::room &, const mutable_buffer &out); event::id::buf summary_set(const m::room::id &, const json::object &summary); event::id::buf summary_set(const m::room &); + event::id::buf summary_del(const m::room &); } diff --git a/ircd/m.cc b/ircd/m.cc index 557e214a5..483b1998b 100644 --- a/ircd/m.cc +++ b/ircd/m.cc @@ -2160,6 +2160,19 @@ ircd::m::event_filter::event_filter(const mutable_buffer &buf, // m/rooms.h // +ircd::m::event::id::buf +ircd::m::rooms::summary_del(const m::room &r) +{ + using prototype = event::id::buf (const m::room &); + + static mods::import call + { + "m_rooms", "ircd::m::rooms::summary_del" + }; + + return call(r); +} + ircd::m::event::id::buf ircd::m::rooms::summary_set(const m::room &room) { diff --git a/modules/m_rooms.cc b/modules/m_rooms.cc index 117a19b2a..424baee07 100644 --- a/modules/m_rooms.cc +++ b/modules/m_rooms.cc @@ -398,6 +398,25 @@ ircd::m::rooms::_fetch_update_(const net::hostport &hp, }; } +ircd::m::event::id::buf +IRCD_MODULE_EXPORT +ircd::m::rooms::summary_del(const m::room &room) +{ + char state_key_buf[m::event::STATE_KEY_MAX_SIZE]; + const m::room::state state{public_room_id}; + const m::event::idx &event_idx + { + state.get("ircd.rooms", make_state_key(state_key_buf, room.room_id)) + }; + + const m::event::id::buf event_id + { + m::event_id(event_idx) + }; + + return redact(public_room_id, m::me, event_id, "delisted"); +} + ircd::m::event::id::buf ircd::m::rooms::_summary_set(const m::room::id &room_id, const json::object &summary)