mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd:Ⓜ️ Unconditionally use a hash of user's mxid for user_room.
This commit is contained in:
parent
8b7b8bb584
commit
a6814dd696
1 changed files with 5 additions and 16 deletions
|
@ -158,30 +158,19 @@ ircd::m::id::room::buf
|
|||
ircd::m::user::room_id()
|
||||
const
|
||||
{
|
||||
char buf[256];
|
||||
return room_id(buf);
|
||||
ircd::m::id::room::buf buf;
|
||||
return buf.assigned(room_id(buf));
|
||||
}
|
||||
|
||||
/// Generates a room MXID of the following form: `!@user:host` If the user
|
||||
/// is on my_host(), then the room localpart is literally "!@user" but if
|
||||
/// the user is not on my_host, the full user_id is hashed and the room_id
|
||||
/// is the b58 hash on my_host.
|
||||
///
|
||||
/// This is the "user's room" essentially serving as a database mechanism for
|
||||
/// this specific user.
|
||||
/// This generates a room mxid for the "user's room" essentially serving as
|
||||
/// a database mechanism for this specific user. This room_id is a hash of
|
||||
/// the user's full mxid.
|
||||
///
|
||||
ircd::m::id::room
|
||||
ircd::m::user::room_id(const mutable_buffer &buf)
|
||||
const
|
||||
{
|
||||
assert(!empty(user_id));
|
||||
|
||||
if(my(user_id))
|
||||
return
|
||||
{
|
||||
buf, user_id.local(), my_host()
|
||||
};
|
||||
|
||||
const sha256::buf hash
|
||||
{
|
||||
sha256{user_id}
|
||||
|
|
Loading…
Reference in a new issue