mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd:Ⓜ️ Add a membership string size constant.
This commit is contained in:
parent
425385265a
commit
80fb8699a1
7 changed files with 14 additions and 9 deletions
|
@ -11,6 +11,11 @@
|
|||
#pragma once
|
||||
#define HAVE_IRCD_M_ROOM_MEMBERS_H
|
||||
|
||||
namespace ircd::m
|
||||
{
|
||||
constexpr size_t MEMBERSHIP_MAX_SIZE {16};
|
||||
}
|
||||
|
||||
/// Interface to the members of a room.
|
||||
///
|
||||
/// This interface focuses specifically on room membership and its routines
|
||||
|
|
|
@ -39,13 +39,13 @@ post__forget(client &client,
|
|||
string_view{room_id}
|
||||
};
|
||||
|
||||
char room_membuf[32];
|
||||
char room_membuf[m::MEMBERSHIP_MAX_SIZE];
|
||||
const string_view &room_membership
|
||||
{
|
||||
room.membership(room_membuf, request.user_id)
|
||||
};
|
||||
|
||||
char user_membuf[32];
|
||||
char user_membuf[m::MEMBERSHIP_MAX_SIZE];
|
||||
string_view user_membership;
|
||||
m::get(std::nothrow, event_idx, "content", [&user_membuf, &user_membership]
|
||||
(const json::object &content)
|
||||
|
|
|
@ -90,7 +90,7 @@ get__initialsync_local(client &client,
|
|||
const m::user &user,
|
||||
json::stack::object &out)
|
||||
{
|
||||
char membership_buf[32];
|
||||
char membership_buf[m::MEMBERSHIP_MAX_SIZE];
|
||||
json::stack::member
|
||||
{
|
||||
out, "membership", room.membership(membership_buf, request.user_id)
|
||||
|
|
|
@ -53,7 +53,7 @@ ircd::m::sync::rooms_linear(data &data)
|
|||
data.room, &room
|
||||
};
|
||||
|
||||
char membuf[32];
|
||||
char membuf[MEMBERSHIP_MAX_SIZE];
|
||||
const string_view &membership
|
||||
{
|
||||
data.room?
|
||||
|
@ -196,7 +196,7 @@ ircd::m::sync::_rooms_polylog(data &data,
|
|||
}
|
||||
|
||||
#if defined(RB_DEBUG)
|
||||
thread_local char tmbuf[32];
|
||||
thread_local char tmbuf[MEMBERSHIP_MAX_SIZE];
|
||||
if(data.stats && rooms.stats_debug) log::debug
|
||||
{
|
||||
log, "polylog %s %s %s in %s",
|
||||
|
|
|
@ -88,7 +88,7 @@ ircd::m::sync::room_account_data_linear_events(data &data,
|
|||
lstrip(json::get<"type"_>(event), type.first)
|
||||
};
|
||||
|
||||
char membuf[32];
|
||||
char membuf[MEMBERSHIP_MAX_SIZE];
|
||||
const auto membership
|
||||
{
|
||||
room.membership(membuf, data.user)
|
||||
|
@ -150,7 +150,7 @@ ircd::m::sync::room_account_data_linear_tags(data &data,
|
|||
lstrip(json::get<"type"_>(event), type.first)
|
||||
};
|
||||
|
||||
char membuf[32];
|
||||
char membuf[MEMBERSHIP_MAX_SIZE];
|
||||
const auto membership
|
||||
{
|
||||
room.membership(membuf, data.user)
|
||||
|
|
|
@ -72,7 +72,7 @@ get__make_leave(client &client,
|
|||
room_id
|
||||
};
|
||||
|
||||
char membuf[32];
|
||||
char membuf[m::MEMBERSHIP_MAX_SIZE];
|
||||
const string_view membership
|
||||
{
|
||||
room.membership(membuf, user_id)
|
||||
|
|
|
@ -22,7 +22,7 @@ _visible_(const m::event &event,
|
|||
const m::room &room,
|
||||
const string_view &history_visibility)
|
||||
{
|
||||
char membership_buf[32];
|
||||
char membership_buf[m::MEMBERSHIP_MAX_SIZE];
|
||||
string_view membership
|
||||
{
|
||||
room.membership(membership_buf, user_id)
|
||||
|
|
Loading…
Reference in a new issue