0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd:Ⓜ️:rooms: Add interface to remove entries from the !public room list.

This commit is contained in:
Jason Volk 2019-03-14 15:07:19 -07:00
parent b1bf848155
commit 2070a72850
3 changed files with 33 additions and 0 deletions

View file

@ -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 &);
}

View file

@ -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<prototype> 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)
{

View file

@ -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)