Move matrix-to.js to utils/permalinks/RoomPermalinkCreator
Just a little bit of refactoring to make the feature of custom prefixes a bit easier.pull/21833/head
parent
0ce227fc58
commit
64aa6695f5
|
@ -23,7 +23,7 @@ import QueryMatcher from './QueryMatcher';
|
|||
import {PillCompletion} from './Components';
|
||||
import sdk from '../index';
|
||||
import _sortBy from 'lodash/sortBy';
|
||||
import {makeGroupPermalink} from "../matrix-to";
|
||||
import {makeGroupPermalink} from "../utils/permalinks/RoomPermalinkCreator";
|
||||
import type {Completion, SelectionRange} from "./Autocompleter";
|
||||
import FlairStore from "../stores/FlairStore";
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import {PillCompletion} from './Components';
|
|||
import {getDisplayAliasForRoom} from '../Rooms';
|
||||
import sdk from '../index';
|
||||
import _sortBy from 'lodash/sortBy';
|
||||
import {makeRoomPermalink} from "../matrix-to";
|
||||
import {makeRoomPermalink} from "../utils/permalinks/RoomPermalinkCreator";
|
||||
import type {Completion, SelectionRange} from "./Autocompleter";
|
||||
|
||||
const ROOM_REGEX = /\B#\S*/g;
|
||||
|
|
|
@ -28,7 +28,7 @@ import _sortBy from 'lodash/sortBy';
|
|||
import MatrixClientPeg from '../MatrixClientPeg';
|
||||
|
||||
import type {MatrixEvent, Room, RoomMember, RoomState} from 'matrix-js-sdk';
|
||||
import {makeUserPermalink} from "../matrix-to";
|
||||
import {makeUserPermalink} from "../utils/permalinks/RoomPermalinkCreator";
|
||||
import type {Completion, SelectionRange} from "./Autocompleter";
|
||||
|
||||
const USER_REGEX = /\B@\S*/g;
|
||||
|
|
|
@ -36,7 +36,7 @@ import classnames from 'classnames';
|
|||
import GroupStore from '../../stores/GroupStore';
|
||||
import FlairStore from '../../stores/FlairStore';
|
||||
import { showGroupAddRoomDialog } from '../../GroupAddressPicker';
|
||||
import {makeGroupPermalink, makeUserPermalink} from "../../matrix-to";
|
||||
import {makeGroupPermalink, makeUserPermalink} from "../../utils/permalinks/RoomPermalinkCreator";
|
||||
import {Group} from "matrix-js-sdk";
|
||||
|
||||
const LONG_DESC_PLACEHOLDER = _td(
|
||||
|
|
|
@ -31,7 +31,7 @@ import Promise from 'bluebird';
|
|||
import classNames from 'classnames';
|
||||
import {Room} from "matrix-js-sdk";
|
||||
import { _t } from '../../languageHandler';
|
||||
import {RoomPermalinkCreator} from '../../matrix-to';
|
||||
import {RoomPermalinkCreator} from '../../utils/permalinks/RoomPermalinkCreator';
|
||||
|
||||
import MatrixClientPeg from '../../MatrixClientPeg';
|
||||
import ContentMessages from '../../ContentMessages';
|
||||
|
|
|
@ -20,7 +20,7 @@ import {Room, User, Group, RoomMember, MatrixEvent} from 'matrix-js-sdk';
|
|||
import sdk from '../../../index';
|
||||
import { _t } from '../../../languageHandler';
|
||||
import QRCode from 'qrcode-react';
|
||||
import {RoomPermalinkCreator, makeGroupPermalink, makeUserPermalink} from "../../../matrix-to";
|
||||
import {RoomPermalinkCreator, makeGroupPermalink, makeUserPermalink} from "../../../utils/permalinks/RoomPermalinkCreator";
|
||||
import * as ContextualMenu from "../../structures/ContextualMenu";
|
||||
|
||||
const socials = [
|
||||
|
|
|
@ -21,7 +21,7 @@ import PropTypes from 'prop-types';
|
|||
import dis from '../../../dispatcher';
|
||||
import {wantsDateSeparator} from '../../../DateUtils';
|
||||
import {MatrixEvent, MatrixClient} from 'matrix-js-sdk';
|
||||
import {makeUserPermalink, RoomPermalinkCreator} from "../../../matrix-to";
|
||||
import {makeUserPermalink, RoomPermalinkCreator} from "../../../utils/permalinks/RoomPermalinkCreator";
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
|
||||
// This component does no cycle detection, simply because the only way to make such a cycle would be to
|
||||
|
|
|
@ -19,7 +19,7 @@ import PropTypes from 'prop-types';
|
|||
import createReactClass from 'create-react-class';
|
||||
|
||||
import dis from '../../../dispatcher';
|
||||
import { RoomPermalinkCreator } from '../../../matrix-to';
|
||||
import { RoomPermalinkCreator } from '../../../utils/permalinks/RoomPermalinkCreator';
|
||||
import { _t } from '../../../languageHandler';
|
||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import { _t } from '../../../languageHandler';
|
|||
import * as ContextualMenu from '../../structures/ContextualMenu';
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import ReplyThread from "../elements/ReplyThread";
|
||||
import {host as matrixtoHost} from '../../../matrix-to';
|
||||
import {host as matrixtoHost} from '../../../utils/permalinks/RoomPermalinkCreator';
|
||||
import {pillifyLinks} from '../../../utils/pillify';
|
||||
import {IntegrationManagers} from "../../../integrations/IntegrationManagers";
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import sdk from '../../../index';
|
|||
import dis from '../../../dispatcher';
|
||||
import RoomViewStore from '../../../stores/RoomViewStore';
|
||||
import Stickerpicker from './Stickerpicker';
|
||||
import { makeRoomPermalink } from '../../../matrix-to';
|
||||
import { makeRoomPermalink } from '../../../utils/permalinks/RoomPermalinkCreator';
|
||||
import ContentMessages from '../../../ContentMessages';
|
||||
import classNames from 'classnames';
|
||||
import E2EIcon from './E2EIcon';
|
||||
|
|
|
@ -54,7 +54,7 @@ import EMOJIBASE from 'emojibase-data/en/compact.json';
|
|||
import EMOTICON_REGEX from 'emojibase-regex/emoticon';
|
||||
|
||||
import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore";
|
||||
import {makeUserPermalink} from "../../../matrix-to";
|
||||
import {makeUserPermalink} from "../../../utils/permalinks/RoomPermalinkCreator";
|
||||
import ReplyPreview from "./ReplyPreview";
|
||||
import RoomViewStore from '../../../stores/RoomViewStore';
|
||||
import ReplyThread from "../elements/ReplyThread";
|
||||
|
|
|
@ -21,7 +21,7 @@ import { _t } from '../../../languageHandler';
|
|||
import RoomViewStore from '../../../stores/RoomViewStore';
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import PropTypes from "prop-types";
|
||||
import {RoomPermalinkCreator} from "../../../matrix-to";
|
||||
import {RoomPermalinkCreator} from "../../../utils/permalinks/RoomPermalinkCreator";
|
||||
|
||||
function cancelQuoting() {
|
||||
dis.dispatch({
|
||||
|
|
|
@ -25,7 +25,7 @@ import dis from '../../../dispatcher';
|
|||
import RoomViewStore from '../../../stores/RoomViewStore';
|
||||
import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore";
|
||||
import Stickerpicker from './Stickerpicker';
|
||||
import { makeRoomPermalink } from '../../../matrix-to';
|
||||
import { makeRoomPermalink } from '../../../utils/permalinks/RoomPermalinkCreator';
|
||||
import ContentMessages from '../../../ContentMessages';
|
||||
import classNames from 'classnames';
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import {baseUrl} from "./matrix-to";
|
||||
import {baseUrl} from "./utils/permalinks/RoomPermalinkCreator";
|
||||
|
||||
function matrixLinkify(linkify) {
|
||||
// Text tokens
|
||||
|
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import MatrixClientPeg from "./MatrixClientPeg";
|
||||
import MatrixClientPeg from "../../MatrixClientPeg";
|
||||
import isIp from "is-ip";
|
||||
import utils from 'matrix-js-sdk/lib/utils';
|
||||
|
|
@ -11,15 +11,15 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import expect from 'expect';
|
||||
import peg from '../src/MatrixClientPeg';
|
||||
import expect from 'expect/build/index';
|
||||
import peg from '../../../src/MatrixClientPeg';
|
||||
import {
|
||||
makeGroupPermalink,
|
||||
makeRoomPermalink,
|
||||
makeUserPermalink,
|
||||
RoomPermalinkCreator,
|
||||
} from "../src/matrix-to";
|
||||
import * as testUtils from "./test-utils";
|
||||
} from "../../../src/utils/permalinks/RoomPermalinkCreator";
|
||||
import * as testUtils from "../../test-utils";
|
||||
|
||||
function mockRoom(roomId, members, serverACL) {
|
||||
members.forEach(m => m.membership = "join");
|
Loading…
Reference in New Issue