Remove welcome bot welcome_user_id
support (#12153)
* Remove welcome bot `welcome_user_id` support Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * i18n Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Remove unused prop Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
86b3564b54
commit
9b5401dcec
7 changed files with 11 additions and 137 deletions
|
@ -27,7 +27,6 @@ import { _t, _td } from "../../../languageHandler";
|
|||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import { makeRoomPermalink, makeUserPermalink } from "../../../utils/permalinks/Permalinks";
|
||||
import DMRoomMap from "../../../utils/DMRoomMap";
|
||||
import SdkConfig from "../../../SdkConfig";
|
||||
import * as Email from "../../../email";
|
||||
import { getDefaultIdentityServerUrl, setToDefaultIdentityServer } from "../../../utils/IdentityServerUtils";
|
||||
import { buildActivityScores, buildMemberScores, compareMembers } from "../../../utils/SortMembers";
|
||||
|
@ -369,9 +368,6 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
|||
this.profilesStore = SdkContextClass.instance.userProfilesStore;
|
||||
|
||||
const excludedIds = new Set([MatrixClientPeg.safeGet().getUserId()!]);
|
||||
const welcomeUserId = SdkConfig.get("welcome_user_id");
|
||||
if (welcomeUserId) excludedIds.add(welcomeUserId);
|
||||
|
||||
if (isRoomInvite(props)) {
|
||||
const room = MatrixClientPeg.safeGet().getRoom(props.roomId);
|
||||
const isFederated = room?.currentState.getStateEvents(EventType.RoomCreate, "")?.getContent()["m.federate"];
|
||||
|
|
|
@ -189,7 +189,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
UserTab.Help,
|
||||
_td("setting|help_about|title"),
|
||||
"mx_UserSettingsDialog_helpIcon",
|
||||
<HelpUserSettingsTab closeSettingsFn={() => this.props.onFinished()} />,
|
||||
<HelpUserSettingsTab />,
|
||||
"UserSettingsHelpAbout",
|
||||
),
|
||||
);
|
||||
|
|
|
@ -18,9 +18,8 @@ import React, { ReactNode } from "react";
|
|||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import AccessibleButton from "../../../elements/AccessibleButton";
|
||||
import { _t, getCurrentLanguage } from "../../../../../languageHandler";
|
||||
import { _t } from "../../../../../languageHandler";
|
||||
import SdkConfig from "../../../../../SdkConfig";
|
||||
import createRoom from "../../../../../createRoom";
|
||||
import Modal from "../../../../../Modal";
|
||||
import PlatformPeg from "../../../../../PlatformPeg";
|
||||
import UpdateCheckButton from "../../UpdateCheckButton";
|
||||
|
@ -32,9 +31,7 @@ import SettingsSubsection, { SettingsSubsectionText } from "../../shared/Setting
|
|||
import ExternalLink from "../../../elements/ExternalLink";
|
||||
import MatrixClientContext from "../../../../../contexts/MatrixClientContext";
|
||||
|
||||
interface IProps {
|
||||
closeSettingsFn: () => void;
|
||||
}
|
||||
interface IProps {}
|
||||
|
||||
interface IState {
|
||||
appVersion: string | null;
|
||||
|
@ -96,14 +93,6 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
|
|||
Modal.createDialog(BugReportDialog, {});
|
||||
};
|
||||
|
||||
private onStartBotChat = (): void => {
|
||||
this.props.closeSettingsFn();
|
||||
createRoom(this.context, {
|
||||
dmUserId: SdkConfig.get("welcome_user_id"),
|
||||
andView: true,
|
||||
});
|
||||
};
|
||||
|
||||
private renderLegal(): ReactNode {
|
||||
const tocLinks = SdkConfig.get().terms_and_conditions_links;
|
||||
if (!tocLinks) return null;
|
||||
|
@ -224,7 +213,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
|
|||
public render(): React.ReactNode {
|
||||
const brand = SdkConfig.get().brand;
|
||||
|
||||
let faqText = _t(
|
||||
const faqText = _t(
|
||||
"setting|help_about|help_link",
|
||||
{
|
||||
brand,
|
||||
|
@ -233,34 +222,6 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
|
|||
a: (sub) => <ExternalLink href={SdkConfig.get("help_url")}>{sub}</ExternalLink>,
|
||||
},
|
||||
);
|
||||
if (SdkConfig.get("welcome_user_id") && getCurrentLanguage().startsWith("en")) {
|
||||
faqText = (
|
||||
<div>
|
||||
{_t(
|
||||
"setting|help_about|help_link_chat_bot",
|
||||
{
|
||||
brand,
|
||||
},
|
||||
{
|
||||
a: (sub) => (
|
||||
<ExternalLink
|
||||
href={SdkConfig.get("help_url")}
|
||||
rel="noreferrer noopener"
|
||||
target="_blank"
|
||||
>
|
||||
{sub}
|
||||
</ExternalLink>
|
||||
),
|
||||
},
|
||||
)}
|
||||
<div>
|
||||
<AccessibleButton onClick={this.onStartBotChat} kind="primary">
|
||||
{_t("setting|help_about|chat_bot", { brand })}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
let updateButton: JSX.Element | undefined;
|
||||
if (this.state.canUpdate) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue