cuvent / react-native-matrix-sdk

(Inofficial) React Native SDK for Matrix.org
MIT License
25 stars 5 forks source link

How can I get rooms list and last messages of each member? #6

Closed ghost closed 4 years ago

ghost commented 4 years ago

I need to show list of members with the name, profile pic and last message I'd begun chat with. Please suggest.

hannojg commented 4 years ago

getJoinedRooms() - gets list of rooms the user joined getInvitedRooms() - gets list of rooms the user is invited

Those methods return an array of MXRoomAttributes, which has a members property from which you can read user information. Also, it contains a last_message property which contains the last message in the room.

If you need more reference, check the typings file: https://github.com/cuvent/react-native-matrix-sdk/blob/master/types/index.d.ts#L83