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

ircd:Ⓜ️:user::room: Add a one-liner is(user_room) test.

This commit is contained in:
Jason Volk 2019-08-16 23:54:04 -07:00
parent 5f4b6d5f1a
commit 3a0bfc8db9
2 changed files with 10 additions and 0 deletions

View file

@ -29,4 +29,6 @@ struct ircd::m::user::room
room() = default;
room(const room &) = delete;
room &operator=(const room &) = delete;
static bool is(const room::id &, const user::id &);
};

View file

@ -2620,6 +2620,14 @@ ircd::m::user::room::room(const m::user &user,
};
}
bool
ircd::m::user::room::is(const room::id &room_id,
const user::id &user_id)
{
const user::room user_room{user_id};
return user_room.room_id == room_id;
}
///////////////////////////////////////////////////////////////////////////////
//
// m/txn.h