Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate audio and video call based on featureflag #856

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions config.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"show_labs_settings": false,
"features": {
"feature_video_rooms": false,
"feature_notification_settings2": false
"feature_notification_settings2": false,
"feature_new_room_decoration_ui": true
},
"feedback": {
"existing_issues_url": "https://github.com/tchapgouv/tchap-web-v4/issues?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc",
Expand All @@ -51,7 +52,7 @@
},
"setting_defaults": {
"breadcrumbs": true,
"UIFeature.voip": false,
"UIFeature.voip": true,
"UIFeature.shareSocial": false,
"UIFeature.registration": true,
"UIFeature.urlPreviews": false,
Expand Down Expand Up @@ -112,6 +113,12 @@
"ext01.tchap.incubateur.net"
],
"feature_space": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"],
"feature_thread": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"]
"feature_thread": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"],
"feature_audio_call": [
"dev01.tchap.incubateur.net",
"dev02.tchap.incubateur.net",
"ext01.tchap.incubateur.net"
],
"feature_video_call": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"]
}
}
9 changes: 6 additions & 3 deletions config.preprod.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"show_labs_settings": false,
"features": {
"feature_video_rooms": false,
"feature_notification_settings2": false
"feature_notification_settings2": false,
"feature_new_room_decoration_ui": true
},
"feedback": {
"existing_issues_url": "https://github.com/tchapgouv/tchap-web-v4/issues?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc",
Expand All @@ -46,7 +47,7 @@
},
"setting_defaults": {
"breadcrumbs": true,
"UIFeature.voip": false,
"UIFeature.voip": true,
"UIFeature.shareSocial": false,
"UIFeature.registration": true,
"UIFeature.urlPreviews": false,
Expand Down Expand Up @@ -103,6 +104,8 @@
"tchap_features": {
"feature_email_notification": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"],
"feature_thread": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"],
"feature_space": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"]
"feature_space": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"],
"feature_audio_call": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"],
"feature_video_call": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"]
}
}
9 changes: 6 additions & 3 deletions config.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"show_labs_settings": false,
"features": {
"feature_video_rooms": false,
"feature_notification_settings2": false
"feature_notification_settings2": false,
"feature_new_room_decoration_ui": true
},
"feedback": {
"existing_issues_url": "https://github.com/tchapgouv/tchap-web-v4/issues?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc",
Expand Down Expand Up @@ -139,7 +140,7 @@
},
"setting_defaults": {
"breadcrumbs": true,
"UIFeature.voip": false,
"UIFeature.voip": true,
"UIFeature.shareSocial": false,
"UIFeature.registration": true,
"UIFeature.urlPreviews": false,
Expand Down Expand Up @@ -190,6 +191,8 @@
"tchap_features": {
"feature_email_notification": ["agent.dinum.tchap.gouv.fr"],
"feature_thread": [],
"feature_space": []
"feature_space": [],
"feature_audio_call": ["agent.dinum.tchap.gouv.fr"],
"feature_video_call": ["agent.dinum.tchap.gouv.fr"]
}
}
7 changes: 5 additions & 2 deletions config.prod.lab.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"show_labs_settings": false,
"features": {
"feature_video_rooms": false,
"feature_notification_settings2": false
"feature_notification_settings2": false,
"feature_new_room_decoration_ui": true
},
"feedback": {
"existing_issues_url": "https://github.com/tchapgouv/tchap-web-v4/issues?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc",
Expand Down Expand Up @@ -190,6 +191,8 @@
"tchap_features": {
"feature_email_notification": ["agent.dinum.tchap.gouv.fr"],
"feature_thread": ["agent.dinum.tchap.gouv.fr"],
"feature_space": ["agent.dinum.tchap.gouv.fr"]
"feature_space": ["agent.dinum.tchap.gouv.fr"],
"feature_audio_call": ["agent.dinum.tchap.gouv.fr"],
"feature_video_call": ["agent.dinum.tchap.gouv.fr"]
}
}

This file was deleted.

108 changes: 108 additions & 0 deletions patches/customize-room-header-bar/matrix-react-sdk+3.81.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
diff --git a/node_modules/matrix-react-sdk/res/css/views/rooms/_RoomHeader.pcss b/node_modules/matrix-react-sdk/res/css/views/rooms/_RoomHeader.pcss
index 2614e17..79fe37e 100644
--- a/node_modules/matrix-react-sdk/res/css/views/rooms/_RoomHeader.pcss
+++ b/node_modules/matrix-react-sdk/res/css/views/rooms/_RoomHeader.pcss
@@ -68,3 +68,17 @@ limitations under the License.
background: var(--cpd-color-bg-subtle-primary);
}
}
+
+/* :tchap: largely inspired from ;mx_RoomHeader_topic but I couldn't get this add-on to work with $variable */
+.tc_RoomHeader_external {
+ color: var(--external-color);
+ width: 80px;
+ font-weight: 400;
+ font-size: 0.8125rem;
+ line-height: 0.8125rem;
+ max-height: calc(0.8125rem * 2);
+ overflow: hidden;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ display: -webkit-box;
+}
diff --git a/node_modules/matrix-react-sdk/src/components/views/rooms/RoomHeader.tsx b/node_modules/matrix-react-sdk/src/components/views/rooms/RoomHeader.tsx
index bb8dd49..df46713 100644
--- a/node_modules/matrix-react-sdk/src/components/views/rooms/RoomHeader.tsx
+++ b/node_modules/matrix-react-sdk/src/components/views/rooms/RoomHeader.tsx
@@ -48,6 +48,9 @@ import RoomAvatar from "../avatars/RoomAvatar";
import { formatCount } from "../../../utils/FormattingUtils";
import RightPanelStore from "../../../stores/right-panel/RightPanelStore";

+import TchapUIFeature from "../../../../../../src/tchap/util/TchapUIFeature";
+import TchapExternalRoomHeader from "../../../../../../src/tchap/components/views/rooms/TchapExternalRoomHeader";
+
/**
* A helper to transform a notification color to the what the Compound Icon Button
* expects
@@ -111,6 +114,9 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element {
}}
>
<RoomAvatar room={room} size="40px" />
+ {/* :tchap: Add external caption when room is open to external */}
+ <TchapExternalRoomHeader room={room}></TchapExternalRoomHeader>
+ {/* :tchap: end */}
<Box flex="1" className="mx_RoomHeader_info">
<BodyText
as="div"
@@ -124,7 +130,8 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element {
>
{roomName}

- {!isDirectMessage && roomState.getJoinRule() === JoinRule.Public && (
+ {/* :tchap: remove public forum icon */}
+ {false && !isDirectMessage && roomState.getJoinRule() === JoinRule.Public && (
<Tooltip label={_t("Public room")}>
<PublicIcon
width="16px"
@@ -135,7 +142,8 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element {
</Tooltip>
)}

- {isDirectMessage && e2eStatus === E2EStatus.Verified && (
+ {/* :tchap: do not show e2eStatus */}
+ {false && isDirectMessage && e2eStatus === E2EStatus.Verified && (
<Tooltip label={_t("common|verified")}>
<VerifiedIcon
width="16px"
@@ -146,7 +154,8 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element {
</Tooltip>
)}

- {isDirectMessage && e2eStatus === E2EStatus.Warning && (
+ {/* :tchap: do not show E2EStatus.Warning */}
+ {false && isDirectMessage && e2eStatus === E2EStatus.Warning && (
<Tooltip label={_t("Untrusted")}>
<ErrorIcon
width="16px"
@@ -164,7 +173,10 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element {
)}
</Box>
<Flex as="nav" align="center" gap="var(--cpd-space-2x)">
- {!useElementCallExclusively && (
+ {
+ //:tchap: activate audio call only if directmessage and if feature is activated on homeserver
+ !useElementCallExclusively && isDirectMessage && TchapUIFeature.isFeatureActiveForHomeserver("feature_audio_call") && (
+ //:tchap: end
<Tooltip label={!voiceCallDisabledReason ? _t("voip|voice_call") : voiceCallDisabledReason!}>
<IconButton
disabled={!!voiceCallDisabledReason}
@@ -175,6 +187,10 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element {
</IconButton>
</Tooltip>
)}
+ {
+ //:tchap: activate video call only if directmessage and if feature is activated on homeserver
+ isDirectMessage && TchapUIFeature.isFeatureActiveForHomeserver("feature_video_call") && (
+ //:tchap: end
<Tooltip label={!videoCallDisabledReason ? _t("voip|video_call") : videoCallDisabledReason!}>
<IconButton
disabled={!!videoCallDisabledReason}
@@ -183,7 +199,7 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element {
>
<VideoCallIcon />
</IconButton>
- </Tooltip>
+ </Tooltip>)}
<Tooltip label={_t("common|threads")}>
<IconButton
indicator={notificationColorToIndicator(threadNotifications)}
17 changes: 9 additions & 8 deletions patches/patches.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"are-external-users-allowed-in-room": {
"package": "matrix-react-sdk",
"files": [
"src/components/views/rooms/LegacyRoomHeader.tsx",
"res/css/views/rooms/_LegacyRoomHeader.pcss"
],
"description": "Adds 'External users allowed' in room header, if necessary. LegacyRoomHeader will be replaced by RoomHeader, initially as a lab feature. Track issue: https://github.com/vector-im/element-web/issues/25883"
},
"show-icon-on-public-room": {
"package": "matrix-react-sdk",
"files": [
Expand Down Expand Up @@ -247,5 +239,14 @@
"src/components/views/messages/DecryptionFailureBody.tsx",
"src/components/views/rooms/ThreadSummary.tsx"
]
},
"customize-room-header-bar": {
"package": "matrix-react-sdk",
"files": [
"src/components/views/rooms/RoomHeader.tsx",
"res/css/views/rooms/_RoomHeader.pcss"
],
"github-issue": "https://github.com/tchapgouv/tchap-web-v4/issues/844",
"comments": "audio feature flag, external room header, hide some icons"
}
}