1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Add getMember() to CallFeed

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-04-04 08:33:51 +02:00
parent ff1379fd29
commit e78b415832
2 changed files with 11 additions and 1 deletions

View File

@@ -424,7 +424,7 @@ export class MatrixCall extends EventEmitter {
if (feed) { if (feed) {
feed.setNewStream(stream); feed.setNewStream(stream);
} else { } else {
this.feeds.push(new CallFeed(stream, userId, type, this.client)); this.feeds.push(new CallFeed(stream, userId, type, this.client, this.roomId));
this.emit(CallEvent.FeedsChanged, this.feeds); this.emit(CallEvent.FeedsChanged, this.feeds);
} }
} }

View File

@@ -31,10 +31,20 @@ export class CallFeed extends EventEmitter {
public userId: string, public userId: string,
public type: CallFeedType, public type: CallFeedType,
private client: any, // Fix when client is TSified private client: any, // Fix when client is TSified
private roomId: string,
) { ) {
super() super()
} }
/**
* Returns callRoom member
* @returns member of the callRoom
*/
public getMember() {
const callRoom = this.client.getRoom(this.roomId);
return callRoom.getMember(this.userId);
}
/** /**
* Returns true if CallFeed is local, otherwise returns false * Returns true if CallFeed is local, otherwise returns false
* @returns {boolean} is local? * @returns {boolean} is local?