Use the room avatar as a placeholder in calls (#10231)
* Use the room avatar as a placeholder in calls Rather than the image for the user we're in a call with. This makes it work correctly with virtual rooms easily since we'll get the avatar for the correct room. * Prettier * TS strict errors * More TS strict fixes * More strict TS * Prettier * Even more TS strict * more stricter
This commit is contained in:
parent
c22971e542
commit
62cd0f1beb
3 changed files with 102 additions and 8 deletions
|
@ -430,7 +430,8 @@ export default class LegacyCallView extends React.Component<IProps, IState> {
|
|||
const { pipMode, call, onResize } = this.props;
|
||||
const { isLocalOnHold, isRemoteOnHold, sidebarShown, primaryFeed, secondaryFeed, sidebarFeeds } = this.state;
|
||||
|
||||
const callRoom = MatrixClientPeg.get().getRoom(call.roomId) ?? undefined;
|
||||
const callRoomId = LegacyCallHandler.instance.roomIdForCall(call);
|
||||
const callRoom = (callRoomId ? MatrixClientPeg.get().getRoom(callRoomId) : undefined) ?? undefined;
|
||||
const avatarSize = pipMode ? 76 : 160;
|
||||
const transfereeCall = LegacyCallHandler.instance.getTransfereeForCallId(call.callId);
|
||||
const isOnHold = isLocalOnHold || isRemoteOnHold;
|
||||
|
@ -527,23 +528,44 @@ export default class LegacyCallView extends React.Component<IProps, IState> {
|
|||
</div>
|
||||
);
|
||||
} else if (pipMode) {
|
||||
// We've already checked that we have feeds so we cast away the optional when passing the feed
|
||||
return (
|
||||
<div className="mx_LegacyCallView_content" onMouseMove={this.onMouseMove}>
|
||||
<VideoFeed feed={primaryFeed} call={call} pipMode={pipMode} onResize={onResize} primary={true} />
|
||||
<VideoFeed
|
||||
feed={primaryFeed as CallFeed}
|
||||
call={call}
|
||||
pipMode={pipMode}
|
||||
onResize={onResize}
|
||||
primary={true}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
} else if (secondaryFeed) {
|
||||
return (
|
||||
<div className="mx_LegacyCallView_content" onMouseMove={this.onMouseMove}>
|
||||
<VideoFeed feed={primaryFeed} call={call} pipMode={pipMode} onResize={onResize} primary={true} />
|
||||
<VideoFeed
|
||||
feed={primaryFeed as CallFeed}
|
||||
call={call}
|
||||
pipMode={pipMode}
|
||||
onResize={onResize}
|
||||
primary={true}
|
||||
/>
|
||||
{secondaryFeedElement}
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<div className="mx_LegacyCallView_content" onMouseMove={this.onMouseMove}>
|
||||
<VideoFeed feed={primaryFeed} call={call} pipMode={pipMode} onResize={onResize} primary={true} />
|
||||
{sidebarShown && <LegacyCallViewSidebar feeds={sidebarFeeds} call={call} pipMode={pipMode} />}
|
||||
<VideoFeed
|
||||
feed={primaryFeed as CallFeed}
|
||||
call={call}
|
||||
pipMode={pipMode}
|
||||
onResize={onResize}
|
||||
primary={true}
|
||||
/>
|
||||
{sidebarShown && (
|
||||
<LegacyCallViewSidebar feeds={sidebarFeeds} call={call} pipMode={Boolean(pipMode)} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue