Goodbye, aliases
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@ import { Facepile } from "../Facepile";
|
||||
import { Avatar, Size } from "../Avatar";
|
||||
import styles from "./CallList.module.css";
|
||||
import { getRoomUrl } from "../matrix-utils";
|
||||
import { Body, Caption } from "../typography/Typography";
|
||||
import { Body } from "../typography/Typography";
|
||||
import { GroupCallRoom } from "./useGroupCallRooms";
|
||||
import { useRoomSharedKey } from "../e2ee/sharedKeyManagement";
|
||||
|
||||
@@ -42,7 +42,6 @@ export function CallList({ rooms, client, disableFacepile }: CallListProps) {
|
||||
client={client}
|
||||
name={roomName}
|
||||
avatarUrl={avatarUrl}
|
||||
roomAlias={roomAlias}
|
||||
roomId={room.roomId}
|
||||
participants={participants}
|
||||
disableFacepile={disableFacepile}
|
||||
@@ -61,7 +60,6 @@ export function CallList({ rooms, client, disableFacepile }: CallListProps) {
|
||||
interface CallTileProps {
|
||||
name: string;
|
||||
avatarUrl: string;
|
||||
roomAlias: string;
|
||||
roomId: string;
|
||||
participants: RoomMember[];
|
||||
client: MatrixClient;
|
||||
@@ -70,7 +68,6 @@ interface CallTileProps {
|
||||
function CallTile({
|
||||
name,
|
||||
avatarUrl,
|
||||
roomAlias,
|
||||
roomId,
|
||||
participants,
|
||||
client,
|
||||
@@ -80,10 +77,7 @@ function CallTile({
|
||||
|
||||
return (
|
||||
<div className={styles.callTile}>
|
||||
<Link
|
||||
to={`/${roomAlias.substring(1).split(":")[0]}`}
|
||||
className={styles.callTileLink}
|
||||
>
|
||||
<Link to={`/room/#?roomId=${roomId}`} className={styles.callTileLink}>
|
||||
<Avatar
|
||||
size={Size.LG}
|
||||
bgKey={name}
|
||||
@@ -95,7 +89,6 @@ function CallTile({
|
||||
<Body overflowEllipsis fontWeight="semiBold">
|
||||
{name}
|
||||
</Body>
|
||||
<Caption overflowEllipsis>{getRoomUrl(roomAlias)}</Caption>
|
||||
{participants && !disableFacepile && (
|
||||
<Facepile
|
||||
className={styles.facePile}
|
||||
@@ -109,7 +102,7 @@ function CallTile({
|
||||
<CopyButton
|
||||
className={styles.copyButton}
|
||||
variant="icon"
|
||||
value={getRoomUrl(roomAlias, roomSharedKey ?? undefined)}
|
||||
value={getRoomUrl(roomId, roomSharedKey ?? undefined)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -80,7 +80,7 @@ export function RegisteredView({ client, isPasswordlessUser }: Props) {
|
||||
randomString(32)
|
||||
);
|
||||
|
||||
history.push(`/${roomAlias.substring(1).split(":")[0]}`);
|
||||
history.push(`/room/#?roomId=${roomId}`);
|
||||
}
|
||||
|
||||
submit().catch((error) => {
|
||||
@@ -103,7 +103,7 @@ export function RegisteredView({ client, isPasswordlessUser }: Props) {
|
||||
|
||||
const [existingRoomId, setExistingRoomId] = useState<string>();
|
||||
const onJoinExistingRoom = useCallback(() => {
|
||||
history.push(`/${existingRoomId}`);
|
||||
history.push(`/room/#?roomId=${existingRoomId}`);
|
||||
}, [history, existingRoomId]);
|
||||
|
||||
const callNameLabel =
|
||||
|
||||
@@ -110,7 +110,7 @@ export const UnauthenticatedView: FC = () => {
|
||||
}
|
||||
|
||||
setClient({ client, session });
|
||||
history.push(`/${roomAlias.substring(1).split(":")[0]}`);
|
||||
history.push(`/room/#?roomId=${roomId}`);
|
||||
}
|
||||
|
||||
submit().catch((error) => {
|
||||
|
||||
@@ -89,8 +89,7 @@ export function useGroupCallRooms(client: MatrixClient): GroupCallRoom[] {
|
||||
|
||||
const groupCalls = client.groupCallEventHandler.groupCalls.values();
|
||||
const rooms = Array.from(groupCalls).map((groupCall) => groupCall.room);
|
||||
const filteredRooms = rooms.filter((r) => r.getCanonicalAlias()); // We don't display rooms without an alias
|
||||
const sortedRooms = sortRooms(client, filteredRooms);
|
||||
const sortedRooms = sortRooms(client, rooms);
|
||||
const items = sortedRooms.map((room) => {
|
||||
const groupCall = client.getGroupCallForRoom(room.roomId)!;
|
||||
|
||||
|
||||
@@ -461,11 +461,7 @@ export function InCallView({
|
||||
/>
|
||||
)}
|
||||
{inviteModalState.isOpen && (
|
||||
<InviteModal
|
||||
roomAlias={groupCall.room.getCanonicalAlias() ?? undefined}
|
||||
roomId={groupCall.room.roomId}
|
||||
{...inviteModalProps}
|
||||
/>
|
||||
<InviteModal roomId={groupCall.room.roomId} {...inviteModalProps} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -24,11 +24,10 @@ import styles from "./InviteModal.module.css";
|
||||
import { useRoomSharedKey } from "../e2ee/sharedKeyManagement";
|
||||
|
||||
interface Props extends Omit<ModalProps, "title" | "children"> {
|
||||
roomAlias?: string;
|
||||
roomId: string;
|
||||
}
|
||||
|
||||
export const InviteModal: FC<Props> = ({ roomAlias, roomId, ...rest }) => {
|
||||
export const InviteModal: FC<Props> = ({ roomId, ...rest }) => {
|
||||
const { t } = useTranslation();
|
||||
const [roomSharedKey] = useRoomSharedKey(roomId);
|
||||
|
||||
@@ -43,7 +42,7 @@ export const InviteModal: FC<Props> = ({ roomAlias, roomId, ...rest }) => {
|
||||
<p>{t("Copy and share this call link")}</p>
|
||||
<CopyButton
|
||||
className={styles.copyButton}
|
||||
value={getRoomUrl(roomAlias ?? roomId, roomSharedKey ?? undefined)}
|
||||
value={getRoomUrl(roomId, roomSharedKey ?? undefined)}
|
||||
data-testid="modal_inviteLink"
|
||||
/>
|
||||
</ModalContent>
|
||||
|
||||
@@ -82,10 +82,7 @@ export const LobbyView: FC<Props> = ({
|
||||
<Body>Or</Body>
|
||||
<CopyButton
|
||||
variant="secondaryCopy"
|
||||
value={getRoomUrl(
|
||||
matrixInfo.roomAlias ?? matrixInfo.roomId,
|
||||
roomSharedKey ?? undefined
|
||||
)}
|
||||
value={getRoomUrl(matrixInfo.roomId, roomSharedKey ?? undefined)}
|
||||
className={styles.copyButton}
|
||||
copiedMessage={t("Call link copied")}
|
||||
data-testid="lobby_inviteLink"
|
||||
|
||||
Reference in New Issue
Block a user