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