This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expire video member events after 1 hour (#8776)
* Expire video member events after 1 hour * Iterate based on feedback * Validate the types of video member events better * Even more parentheses
- Loading branch information
Showing
12 changed files
with
344 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
Copyright 2022 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
.mx_VideoRoomSummary { | ||
.mx_VideoRoomSummary_indicator { | ||
&::before { | ||
display: inline-block; | ||
vertical-align: text-bottom; | ||
content: ''; | ||
background-color: $secondary-content; | ||
mask-image: url('$(res)/img/element-icons/call/video-call.svg'); | ||
mask-size: 16px; | ||
width: 16px; | ||
height: 16px; | ||
margin-right: 4px; | ||
} | ||
|
||
&.mx_VideoRoomSummary_indicator_active { | ||
color: $accent; | ||
|
||
&::before { | ||
background-color: $accent; | ||
} | ||
} | ||
} | ||
|
||
.mx_VideoRoomSummary_participants::before { | ||
display: inline-block; | ||
vertical-align: text-bottom; | ||
content: ''; | ||
background-color: $secondary-content; | ||
mask-image: url('$(res)/img/element-icons/group-members.svg'); | ||
mask-size: 16px; | ||
width: 16px; | ||
height: 16px; | ||
margin-right: 2px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
Copyright 2022 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import React, { FC } from "react"; | ||
import classNames from "classnames"; | ||
import { Room } from "matrix-js-sdk/src/models/room"; | ||
|
||
import { _t, TranslatedString } from "../../../languageHandler"; | ||
import { | ||
ConnectionState, | ||
useConnectionState, | ||
useConnectedMembers, | ||
useJitsiParticipants, | ||
} from "../../../utils/VideoChannelUtils"; | ||
|
||
interface IProps { | ||
room: Room; | ||
} | ||
|
||
const VideoRoomSummary: FC<IProps> = ({ room }) => { | ||
const connectionState = useConnectionState(room); | ||
const videoMembers = useConnectedMembers(room, connectionState === ConnectionState.Connected); | ||
const jitsiParticipants = useJitsiParticipants(room); | ||
|
||
let indicator: TranslatedString; | ||
let active: boolean; | ||
let participantCount: number; | ||
|
||
switch (connectionState) { | ||
case ConnectionState.Disconnected: | ||
indicator = _t("Video"); | ||
active = false; | ||
participantCount = videoMembers.size; | ||
break; | ||
case ConnectionState.Connecting: | ||
indicator = _t("Joining…"); | ||
active = true; | ||
participantCount = videoMembers.size; | ||
break; | ||
case ConnectionState.Connected: | ||
indicator = _t("Joined"); | ||
active = true; | ||
participantCount = jitsiParticipants.length; | ||
break; | ||
} | ||
|
||
return <span className="mx_VideoRoomSummary"> | ||
<span | ||
className={classNames( | ||
"mx_VideoRoomSummary_indicator", | ||
{ "mx_VideoRoomSummary_indicator_active": active }, | ||
)} | ||
> | ||
{ indicator } | ||
</span> | ||
{ participantCount ? <> | ||
{ " · " } | ||
<span | ||
className="mx_VideoRoomSummary_participants" | ||
aria-label={_t("%(count)s participants", { count: participantCount })} | ||
> | ||
{ participantCount } | ||
</span> | ||
</> : null } | ||
</span>; | ||
}; | ||
|
||
export default VideoRoomSummary; |
Oops, something went wrong.