Closed sphinxc0re closed 7 years ago
I have a question regarding the underlying data. There are some fields in the response that seem to be missing in the database model:
/// The URL for the room's avatar, if one is set.
pub avatar_url: Option<String>,
/// Whether guest users may join the room and participate in it. If they can, they will be subject to ordinary power level rules like any other user.
pub guest_can_join: Option<bool>,
/// The name of the room, if any. May be null.
pub name: Option<String>,
/// The number of members joined to the room.
pub num_joined_members: Option<usize>,
/// The topic of the room, if any. May be null.
pub topic: Option<String>,
/// Whether the room may be viewed by guest users without joining.
pub world_readable: Option<bool>,
So my question is, where do I get these values from? @mujx
num_joined_members
must be inferred from the room memberships. topic
, avatar_url
and name
you have to look through the events. The most recent RoomTopic
, RoomAvatar
and RoomName
for the given room_id
. Take a look at ruma-events.world_readable
and guests_can_join
check the events RoomGuestAccess
and RoomHistoryVisiblity
on the given room.You can also use synapse as a reference. It has a lot more but you get a feeling of what needs to be done. Here is an example.
Any progress?
I'm sorry, but I don't have much time atm to work on this, because I'm working on several other projects and also have my normal work to do. But I really want to finish this mostly because I want to get to know the code a bit more
No rush at all. Thanks very much for your interest in contributing to the project. When you get back to it, we're here to help however we can!
I'm so sorry this has been open for so long. I kinda forgot about it 😓 I will close this so someone else can take a shot at the issue
No worries. Development of ruma has slowed down a lot in the last few months, so you weren't blocking us or anything. You're still welcome to come back to it whenever you want.
This is just a start to see if I got this the right way