matrix-js-sdk icon indicating copy to clipboard operation
matrix-js-sdk copied to clipboard

Who sent the invitation?

Open senukartur opened this issue 6 years ago • 3 comments

Hi all. Is there a way to recognize who sent the invitation to join a public room? According to documentation, if a user creates a room with options {invite: [userId], is_direct: true} I can call getDMInviter of RoomMember. But if a user creates a simple public room I can't use this method.

senukartur avatar Oct 09 '19 17:10 senukartur

You want to see how a given user joined a room (who invited them) or who sent an existing pending invite?

t3chguy avatar Oct 09 '19 17:10 t3chguy

I would like to know who sent an existing pending invite. For example, I want to show a notification like You have got the invitation to join the 'Crazy developers' room from 'Alex Pupkin'(or just show userId who sent the invitation instead of 'Alex Pupkin') .

senukartur avatar Oct 09 '19 17:10 senukartur

should be a case of room.currentState.getStateEvents("m.room.member", matrixClient.getUserId()).sender

t3chguy avatar Oct 09 '19 17:10 t3chguy