Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Delete the remainder of groups #9357

Merged
merged 2 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 0 additions & 3 deletions src/IConfigOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ export interface IConfigOptions {

sync_timeline_limit?: number;
dangerously_allow_unsafe_and_insecure_passwords?: boolean; // developer option

// XXX: Undocumented URL for the "Learn more about spaces" link in the "Communities don't exist" messaging.
spaces_learn_more_url?: string;
}

export interface ISsoRedirectOptions {
Expand Down
1 change: 0 additions & 1 deletion src/PageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ enum PageType {
HomePage = "home_page",
RoomView = "room_view",
UserView = "user_view",
LegacyGroupView = "legacy_group_view",
}

export default PageType;
1 change: 0 additions & 1 deletion src/PosthogTrackers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const loggedInPageTypeMap: Record<PageType, ScreenName> = {
[PageType.HomePage]: "Home",
[PageType.RoomView]: "Room",
[PageType.UserView]: "User",
[PageType.LegacyGroupView]: "Group",
};

export default class PosthogTrackers {
Expand Down
1 change: 0 additions & 1 deletion src/SdkConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const DEFAULTS: IConfigOptions = {
logo: require("../res/img/element-desktop-logo.svg").default,
url: "https://element.io/get-started",
},
spaces_learn_more_url: "https://element.io/blog/spaces-blast-out-of-beta/",
};

export default class SdkConfig {
Expand Down
51 changes: 0 additions & 51 deletions src/components/structures/LegacyGroupView.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions src/components/structures/LoggedInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import RightPanelStore from '../../stores/right-panel/RightPanelStore';
import { TimelineRenderingType } from "../../contexts/RoomContext";
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
import { SwitchSpacePayload } from "../../dispatcher/payloads/SwitchSpacePayload";
import LegacyGroupView from "./LegacyGroupView";
import { IConfigOptions } from "../../IConfigOptions";
import LeftPanelLiveShareWarning from '../views/beacon/LeftPanelLiveShareWarning';
import { UserOnboardingPage } from '../views/user-onboarding/UserOnboardingPage';
Expand Down Expand Up @@ -103,8 +102,6 @@ interface IProps {
justRegistered?: boolean;
roomJustCreatedOpts?: IOpts;
forceTimeline?: boolean; // see props on MatrixChat

currentGroupId?: string;
}

interface IState {
Expand Down Expand Up @@ -641,10 +638,6 @@ class LoggedInView extends React.Component<IProps, IState> {
case PageTypes.UserView:
pageElement = <UserView userId={this.props.currentUserId} resizeNotifier={this.props.resizeNotifier} />;
break;

case PageTypes.LegacyGroupView:
pageElement = <LegacyGroupView groupId={this.props.currentGroupId} />;
break;
}

const wrapperClasses = classNames({
Expand Down
21 changes: 0 additions & 21 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ interface IState {
currentRoomId?: string;
// If we're trying to just view a user ID (i.e. /user URL), this is it
currentUserId?: string;
// Group ID for legacy "communities don't exist" page
currentGroupId?: string;
// this is persisted as mx_lhs_size, loaded in LoggedInView
collapseLhs: boolean;
// Parameters used in the registration dance with the IS
Expand Down Expand Up @@ -679,9 +677,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
}
break;
}
case 'view_legacy_group':
this.viewLegacyGroup(payload.groupId);
break;
case Action.ViewUserSettings: {
const tabPayload = payload as OpenToTabPayload;
Modal.createDialog(UserSettingsDialog,
Expand Down Expand Up @@ -1023,16 +1018,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
});
}

private viewLegacyGroup(groupId: string) {
this.setStateForNewView({
view: Views.LOGGED_IN,
currentRoomId: null,
currentGroupId: groupId,
});
this.notifyNewScreen('group/' + groupId);
this.setPage(PageType.LegacyGroupView);
}

private async createRoom(defaultPublic = false, defaultName?: string, type?: RoomType) {
const modal = Modal.createDialog(CreateRoomDialog, {
type,
Expand Down Expand Up @@ -1803,12 +1788,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
userId: userId,
subAction: params.action,
});
} else if (screen.indexOf('group/') === 0) {
const groupId = screen.substring(6);
dis.dispatch({
action: 'view_legacy_group',
groupId: groupId,
});
} else {
logger.info("Ignoring showScreen for '%s'", screen);
}
Expand Down
45 changes: 0 additions & 45 deletions src/group_helpers.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions src/linkify-matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ import dis from './dispatcher/dispatcher';
import { Action } from './dispatcher/actions';
import { ViewUserPayload } from './dispatcher/payloads/ViewUserPayload';
import { ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload";
import { showGroupReplacedWithSpacesDialog } from "./group_helpers";

export enum Type {
URL = "url",
UserId = "userid",
RoomAlias = "roomalias",
GroupId = "groupid",
}

// Linkify stuff doesn't type scanner/parser/utils properly :/
Expand Down Expand Up @@ -115,11 +113,6 @@ function onUserClick(event: MouseEvent, userId: string) {
});
}

function onGroupClick(event: MouseEvent, groupId: string) {
event.preventDefault();
showGroupReplacedWithSpacesDialog(groupId);
}

function onAliasClick(event: MouseEvent, roomAlias: string) {
event.preventDefault();
dis.dispatch<ViewRoomPayload>({
Expand Down Expand Up @@ -192,23 +185,13 @@ export const options = {
onAliasClick(e, alias);
},
};

case Type.GroupId:
return {
// @ts-ignore see https://linkify.js.org/docs/options.html
click: function(e: MouseEvent) {
const groupId = parsePermalink(href).groupId;
onGroupClick(e, groupId);
},
};
}
},

formatHref: function(href: string, type: Type | string): string {
switch (type) {
case Type.RoomAlias:
case Type.UserId:
case Type.GroupId:
default: {
return tryTransformEntityToPermalink(href);
}
Expand Down Expand Up @@ -255,17 +238,6 @@ registerPlugin(Type.RoomAlias, ({ scanner, parser, utils }) => {
});
});

registerPlugin(Type.GroupId, ({ scanner, parser, utils }) => {
const token = scanner.tokens.PLUS as '+';
matrixOpaqueIdLinkifyParser({
scanner,
parser,
utils,
token,
name: Type.GroupId,
});
});

registerPlugin(Type.UserId, ({ scanner, parser, utils }) => {
const token = scanner.tokens.AT as '@';
matrixOpaqueIdLinkifyParser({
Expand Down
8 changes: 0 additions & 8 deletions src/utils/permalinks/ElementPermalinkConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,11 @@ export default class ElementPermalinkConstructor extends PermalinkConstructor {
return `${this.elementUrl}/#/user/${userId}`;
}

forGroup(groupId: string): string {
return `${this.elementUrl}/#/group/${groupId}`;
}

forEntity(entityId: string): string {
if (entityId[0] === '!' || entityId[0] === '#') {
return this.forRoom(entityId);
} else if (entityId[0] === '@') {
return this.forUser(entityId);
} else if (entityId[0] === '+') {
return this.forGroup(entityId);
} else throw new Error("Unrecognized entity");
}

Expand Down Expand Up @@ -107,8 +101,6 @@ export default class ElementPermalinkConstructor extends PermalinkConstructor {
const eventId = parts.length > 2 ? parts.slice(2).join('/') : "";
const via = query.split(/&?via=/).filter(p => !!p);
return PermalinkParts.forEvent(entity, eventId, via);
} else if (entityType === 'group') {
return PermalinkParts.forGroup(entity);
} else {
throw new Error("Unknown entity type in permalink");
}
Expand Down
4 changes: 0 additions & 4 deletions src/utils/permalinks/MatrixSchemePermalinkConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ export default class MatrixSchemePermalinkConstructor extends PermalinkConstruct
return `matrix:${this.encodeEntity(userId)}`;
}

forGroup(groupId: string): string {
throw new Error("Deliberately not implemented");
}

forEntity(entityId: string): string {
return `matrix:${this.encodeEntity(entityId)}`;
}
Expand Down
6 changes: 0 additions & 6 deletions src/utils/permalinks/MatrixToPermalinkConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export default class MatrixToPermalinkConstructor extends PermalinkConstructor {
return `${baseUrl}/#/${userId}`;
}

forGroup(groupId: string): string {
return `${baseUrl}/#/${groupId}`;
}

forEntity(entityId: string): string {
return `${baseUrl}/#/${entityId}`;
}
Expand Down Expand Up @@ -82,8 +78,6 @@ export default class MatrixToPermalinkConstructor extends PermalinkConstructor {
const via = query.split(/&?via=/g).filter(p => !!p);

return PermalinkParts.forEvent(entity, eventId, via);
} else if (entity[0] === '+') {
return PermalinkParts.forGroup(entity);
} else {
throw new Error("Unknown entity type in permalink");
}
Expand Down
18 changes: 4 additions & 14 deletions src/utils/permalinks/PermalinkConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ export default class PermalinkConstructor {
throw new Error("Not implemented");
}

forGroup(groupId: string): string {
throw new Error("Not implemented");
}

forUser(userId: string): string {
throw new Error("Not implemented");
}
Expand All @@ -55,30 +51,24 @@ export class PermalinkParts {
eventId: string;
userId: string;
viaServers: string[];
groupId: string;

constructor(roomIdOrAlias: string, eventId: string, userId: string, groupId: string, viaServers: string[]) {
constructor(roomIdOrAlias: string, eventId: string, userId: string, viaServers: string[]) {
this.roomIdOrAlias = roomIdOrAlias;
this.eventId = eventId;
this.userId = userId;
this.groupId = groupId;
this.viaServers = viaServers;
}

static forUser(userId: string): PermalinkParts {
return new PermalinkParts(null, null, userId, null, null);
}

static forGroup(groupId: string): PermalinkParts {
return new PermalinkParts(null, null, null, groupId, null);
return new PermalinkParts(null, null, userId, null);
}

static forRoom(roomIdOrAlias: string, viaServers: string[] = []): PermalinkParts {
return new PermalinkParts(roomIdOrAlias, null, null, null, viaServers);
return new PermalinkParts(roomIdOrAlias, null, null, viaServers);
}

static forEvent(roomId: string, eventId: string, viaServers: string[] = []): PermalinkParts {
return new PermalinkParts(roomId, eventId, null, null, viaServers);
return new PermalinkParts(roomId, eventId, null, viaServers);
}

get primaryEntityId(): string {
Expand Down
Loading