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

Commit

Permalink
Remove hosting link provider from Element (#10270)
Browse files Browse the repository at this point in the history
* Remove hosting link provider from Element

* fix whitespace
  • Loading branch information
Half-Shot authored Mar 2, 2023
1 parent 0e52729 commit 2d2b40d
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 703 deletions.
1 change: 0 additions & 1 deletion res/css/_components.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
@import "./views/dialogs/_FeedbackDialog.pcss";
@import "./views/dialogs/_ForwardDialog.pcss";
@import "./views/dialogs/_GenericFeatureFeedbackDialog.pcss";
@import "./views/dialogs/_HostSignupDialog.pcss";
@import "./views/dialogs/_IncomingSasDialog.pcss";
@import "./views/dialogs/_InviteDialog.pcss";
@import "./views/dialogs/_JoinRuleDropdown.pcss";
Expand Down
10 changes: 1 addition & 9 deletions res/css/structures/_UserMenu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,8 @@ limitations under the License.
justify-content: center;
}

&.mx_UserMenu_contextMenu_guestPrompts,
&.mx_UserMenu_contextMenu_hostingLink {
padding-top: 0;
}

&.mx_UserMenu_contextMenu_guestPrompts {
padding-top: 0;
display: inline-block;

> span {
Expand Down Expand Up @@ -190,10 +186,6 @@ limitations under the License.
mask-image: url("$(res)/img/element-icons/roomlist/dnd-cross.svg");
}

.mx_UserMenu_iconHosting::before {
mask-image: url("$(res)/img/element-icons/brands/element.svg");
}

.mx_UserMenu_iconBell::before {
mask-image: url("$(res)/img/element-icons/notifications.svg");
}
Expand Down
132 changes: 0 additions & 132 deletions res/css/views/dialogs/_HostSignupDialog.pcss

This file was deleted.

13 changes: 0 additions & 13 deletions src/IConfigOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,6 @@ export interface IConfigOptions {
analytics_owner?: string; // defaults to `brand`
privacy_policy_url?: string; // location for cookie policy

// Server hosting upsell options
hosting_signup_link?: string; // slightly different from `host_signup`
host_signup?: {
brand?: string; // acts as the enabled flag too (truthy == show)

// Required-ness denotes when `brand` is truthy
cookie_policy_url: string;
privacy_policy_url: string;
terms_of_service_url: string;
url: string;
domains?: string[];
};

enable_presence_by_hs_url?: Record<string, boolean>; // <HomeserverName, Enabled>

terms_and_conditions_links?: { url: string; text: string }[];
Expand Down
54 changes: 0 additions & 54 deletions src/components/structures/HostSignupAction.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/components/structures/LoggedInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import NonUrgentToastContainer from "./NonUrgentToastContainer";
import { IOOBData, IThreepidInvite } from "../../stores/ThreepidInviteStore";
import Modal from "../../Modal";
import { ICollapseConfig } from "../../resizer/distributors/collapse";
import HostSignupContainer from "../views/host_signup/HostSignupContainer";
import { getKeyBindingsManager } from "../../KeyBindingsManager";
import { IOpts } from "../../createRoom";
import SpacePanel from "../views/spaces/SpacePanel";
Expand Down Expand Up @@ -695,7 +694,6 @@ class LoggedInView extends React.Component<IProps, IState> {
</div>
<PipContainer />
<NonUrgentToastContainer />
<HostSignupContainer />
{audioFeedArraysForCalls}
</MatrixClientContext.Provider>
);
Expand Down
11 changes: 0 additions & 11 deletions src/components/structures/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import IconizedContextMenu, {
IconizedContextMenuOptionList,
} from "../views/context_menus/IconizedContextMenu";
import { UIFeature } from "../../settings/UIFeature";
import HostSignupAction from "./HostSignupAction";
import SpaceStore from "../../stores/spaces/SpaceStore";
import { UPDATE_SELECTED_SPACE } from "../../stores/spaces";
import UserIdentifierCustomisations from "../../customisations/UserIdentifier";
Expand Down Expand Up @@ -290,7 +289,6 @@ export default class UserMenu extends React.Component<IProps, IState> {
if (!this.state.contextMenuPosition) return null;

let topSection;
const hostSignupConfig = SdkConfig.getObject("host_signup");
if (MatrixClientPeg.get().isGuest()) {
topSection = (
<div className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_guestPrompts">
Expand Down Expand Up @@ -318,15 +316,6 @@ export default class UserMenu extends React.Component<IProps, IState> {
)}
</div>
);
} else if (hostSignupConfig?.get("url")) {
// If hostSignup.domains is set to a non-empty array, only show
// dialog if the user is on the domain or a subdomain.
const hostSignupDomains = hostSignupConfig.get("domains") || [];
const mxDomain = MatrixClientPeg.get().getDomain();
const validDomains = hostSignupDomains.filter((d) => d === mxDomain || mxDomain.endsWith(`.${d}`));
if (!hostSignupConfig.get("domains") || validDomains.length > 0) {
topSection = <HostSignupAction onClick={this.onCloseMenu} />;
}
}

let homeButton = null;
Expand Down
Loading

0 comments on commit 2d2b40d

Please sign in to comment.