From fc66e69c02f6eccb97fe27dbcdc19170e2be447a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 30 Sep 2019 20:39:58 -0600 Subject: [PATCH] Rename RoomPermalinkCreator -> Permalinks due to scope The file handles more than just a RoomPermalinkCreator, so we should name it accordingly. --- src/HtmlUtils.js | 2 +- src/SlashCommands.js | 2 +- src/autocomplete/CommunityProvider.js | 2 +- src/autocomplete/RoomProvider.js | 2 +- src/autocomplete/UserProvider.js | 2 +- src/components/structures/GroupView.js | 2 +- src/components/structures/RoomView.js | 2 +- src/components/views/dialogs/ShareDialog.js | 2 +- src/components/views/elements/Pill.js | 2 +- src/components/views/elements/ReplyThread.js | 2 +- src/components/views/messages/RoomCreate.js | 2 +- src/components/views/messages/TextualBody.js | 2 +- src/components/views/rooms/MessageComposer.js | 2 +- src/components/views/rooms/MessageComposerInput.js | 2 +- src/components/views/rooms/ReplyPreview.js | 2 +- src/components/views/rooms/SlateMessageComposer.js | 2 +- src/editor/deserialize.js | 2 +- src/editor/serialize.js | 2 +- src/linkify-matrix.js | 2 +- src/utils/permalinks/{RoomPermalinkCreator.js => Permalinks.js} | 0 test/utils/permalinks/RoomPermalinkCreator-test.js | 2 +- 21 files changed, 20 insertions(+), 20 deletions(-) rename src/utils/permalinks/{RoomPermalinkCreator.js => Permalinks.js} (100%) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 3620eb2973..e1bd85a7bb 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -34,7 +34,7 @@ import url from 'url'; import EMOJIBASE from 'emojibase-data/en/compact.json'; import EMOJIBASE_REGEX from 'emojibase-regex'; -import {tryTransformPermalinkToLocalHref} from "./utils/permalinks/RoomPermalinkCreator"; +import {tryTransformPermalinkToLocalHref} from "./utils/permalinks/Permalinks"; linkifyMatrix(linkify); diff --git a/src/SlashCommands.js b/src/SlashCommands.js index 6a329761c8..d9fe28cc6d 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -32,7 +32,7 @@ import Promise from "bluebird"; import { getAddressType } from './UserAddress'; import { abbreviateUrl } from './utils/UrlUtils'; import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from './utils/IdentityServerUtils'; -import {isPermalinkHost, parsePermalink} from "./utils/permalinks/RoomPermalinkCreator"; +import {isPermalinkHost, parsePermalink} from "./utils/permalinks/Permalinks"; const singleMxcUpload = async () => { return new Promise((resolve) => { diff --git a/src/autocomplete/CommunityProvider.js b/src/autocomplete/CommunityProvider.js index 14c0116604..7358fdb8a9 100644 --- a/src/autocomplete/CommunityProvider.js +++ b/src/autocomplete/CommunityProvider.js @@ -23,7 +23,7 @@ import QueryMatcher from './QueryMatcher'; import {PillCompletion} from './Components'; import sdk from '../index'; import _sortBy from 'lodash/sortBy'; -import {makeGroupPermalink} from "../utils/permalinks/RoomPermalinkCreator"; +import {makeGroupPermalink} from "../utils/permalinks/Permalinks"; import type {Completion, SelectionRange} from "./Autocompleter"; import FlairStore from "../stores/FlairStore"; diff --git a/src/autocomplete/RoomProvider.js b/src/autocomplete/RoomProvider.js index 062fb5a5c5..3e87545b70 100644 --- a/src/autocomplete/RoomProvider.js +++ b/src/autocomplete/RoomProvider.js @@ -26,7 +26,7 @@ import {PillCompletion} from './Components'; import {getDisplayAliasForRoom} from '../Rooms'; import sdk from '../index'; import _sortBy from 'lodash/sortBy'; -import {makeRoomPermalink} from "../utils/permalinks/RoomPermalinkCreator"; +import {makeRoomPermalink} from "../utils/permalinks/Permalinks"; import type {Completion, SelectionRange} from "./Autocompleter"; const ROOM_REGEX = /\B#\S*/g; diff --git a/src/autocomplete/UserProvider.js b/src/autocomplete/UserProvider.js index d154e02a9d..6f3eb3e6b8 100644 --- a/src/autocomplete/UserProvider.js +++ b/src/autocomplete/UserProvider.js @@ -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 "../utils/permalinks/RoomPermalinkCreator"; +import {makeUserPermalink} from "../utils/permalinks/Permalinks"; import type {Completion, SelectionRange} from "./Autocompleter"; const USER_REGEX = /\B@\S*/g; diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 6c96dec04f..dd520bb7d4 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -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 "../../utils/permalinks/RoomPermalinkCreator"; +import {makeGroupPermalink, makeUserPermalink} from "../../utils/permalinks/Permalinks"; import {Group} from "matrix-js-sdk"; const LONG_DESC_PLACEHOLDER = _td( diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 057b1f2d80..4d52158dae 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -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 '../../utils/permalinks/RoomPermalinkCreator'; +import {RoomPermalinkCreator} from '../../utils/permalinks/Permalinks'; import MatrixClientPeg from '../../MatrixClientPeg'; import ContentMessages from '../../ContentMessages'; diff --git a/src/components/views/dialogs/ShareDialog.js b/src/components/views/dialogs/ShareDialog.js index ae43ee2ae5..f6d5b65fd6 100644 --- a/src/components/views/dialogs/ShareDialog.js +++ b/src/components/views/dialogs/ShareDialog.js @@ -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 "../../../utils/permalinks/RoomPermalinkCreator"; +import {RoomPermalinkCreator, makeGroupPermalink, makeUserPermalink} from "../../../utils/permalinks/Permalinks"; import * as ContextualMenu from "../../structures/ContextualMenu"; const socials = [ diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index abe570cdcd..12830488b1 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -25,7 +25,7 @@ import PropTypes from 'prop-types'; import MatrixClientPeg from '../../../MatrixClientPeg'; import { getDisplayAliasForRoom } from '../../../Rooms'; import FlairStore from "../../../stores/FlairStore"; -import {getPrimaryPermalinkEntity} from "../../../utils/permalinks/RoomPermalinkCreator"; +import {getPrimaryPermalinkEntity} from "../../../utils/permalinks/Permalinks"; // For URLs of matrix.to links in the timeline which have been reformatted by // HttpUtils transformTags to relative links. This excludes event URLs (with `[^\/]*`) diff --git a/src/components/views/elements/ReplyThread.js b/src/components/views/elements/ReplyThread.js index 5c1d6a3ef4..fac0a71617 100644 --- a/src/components/views/elements/ReplyThread.js +++ b/src/components/views/elements/ReplyThread.js @@ -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 "../../../utils/permalinks/RoomPermalinkCreator"; +import {makeUserPermalink, RoomPermalinkCreator} from "../../../utils/permalinks/Permalinks"; import SettingsStore from "../../../settings/SettingsStore"; // This component does no cycle detection, simply because the only way to make such a cycle would be to diff --git a/src/components/views/messages/RoomCreate.js b/src/components/views/messages/RoomCreate.js index 282ba28b8a..9bb6fcc0d8 100644 --- a/src/components/views/messages/RoomCreate.js +++ b/src/components/views/messages/RoomCreate.js @@ -19,7 +19,7 @@ import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import dis from '../../../dispatcher'; -import { RoomPermalinkCreator } from '../../../utils/permalinks/RoomPermalinkCreator'; +import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; import { _t } from '../../../languageHandler'; import MatrixClientPeg from '../../../MatrixClientPeg'; diff --git a/src/components/views/messages/TextualBody.js b/src/components/views/messages/TextualBody.js index 5b5de531de..a9e0da143e 100644 --- a/src/components/views/messages/TextualBody.js +++ b/src/components/views/messages/TextualBody.js @@ -32,7 +32,7 @@ import SettingsStore from "../../../settings/SettingsStore"; import ReplyThread from "../elements/ReplyThread"; import {pillifyLinks} from '../../../utils/pillify'; import {IntegrationManagers} from "../../../integrations/IntegrationManagers"; -import {isPermalinkHost} from "../../../utils/permalinks/RoomPermalinkCreator"; +import {isPermalinkHost} from "../../../utils/permalinks/Permalinks"; module.exports = createReactClass({ displayName: 'TextualBody', diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 4e7f8825ad..632ca53f82 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -23,7 +23,7 @@ import sdk from '../../../index'; import dis from '../../../dispatcher'; import RoomViewStore from '../../../stores/RoomViewStore'; import Stickerpicker from './Stickerpicker'; -import { makeRoomPermalink } from '../../../utils/permalinks/RoomPermalinkCreator'; +import { makeRoomPermalink } from '../../../utils/permalinks/Permalinks'; import ContentMessages from '../../../ContentMessages'; import classNames from 'classnames'; import E2EIcon from './E2EIcon'; diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 3a51ac19e8..cc92f7c750 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -52,7 +52,7 @@ import EMOJIBASE from 'emojibase-data/en/compact.json'; import EMOTICON_REGEX from 'emojibase-regex/emoticon'; import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore"; -import {getPrimaryPermalinkEntity, makeUserPermalink} from "../../../utils/permalinks/RoomPermalinkCreator"; +import {getPrimaryPermalinkEntity, makeUserPermalink} from "../../../utils/permalinks/Permalinks"; import ReplyPreview from "./ReplyPreview"; import RoomViewStore from '../../../stores/RoomViewStore'; import ReplyThread from "../elements/ReplyThread"; diff --git a/src/components/views/rooms/ReplyPreview.js b/src/components/views/rooms/ReplyPreview.js index 97b29dddee..caf8feeea2 100644 --- a/src/components/views/rooms/ReplyPreview.js +++ b/src/components/views/rooms/ReplyPreview.js @@ -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 "../../../utils/permalinks/RoomPermalinkCreator"; +import {RoomPermalinkCreator} from "../../../utils/permalinks/Permalinks"; function cancelQuoting() { dis.dispatch({ diff --git a/src/components/views/rooms/SlateMessageComposer.js b/src/components/views/rooms/SlateMessageComposer.js index 8b51f8266f..4bb2f29e61 100644 --- a/src/components/views/rooms/SlateMessageComposer.js +++ b/src/components/views/rooms/SlateMessageComposer.js @@ -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 '../../../utils/permalinks/RoomPermalinkCreator'; +import { makeRoomPermalink } from '../../../utils/permalinks/Permalinks'; import ContentMessages from '../../../ContentMessages'; import classNames from 'classnames'; diff --git a/src/editor/deserialize.js b/src/editor/deserialize.js index 2d725af4ac..d41e413dbc 100644 --- a/src/editor/deserialize.js +++ b/src/editor/deserialize.js @@ -17,7 +17,7 @@ limitations under the License. import { walkDOMDepthFirst } from "./dom"; import { checkBlockNode } from "../HtmlUtils"; -import {getPrimaryPermalinkEntity} from "../utils/permalinks/RoomPermalinkCreator"; +import {getPrimaryPermalinkEntity} from "../utils/permalinks/Permalinks"; function parseAtRoomMentions(text, partCreator) { const ATROOM = "@room"; diff --git a/src/editor/serialize.js b/src/editor/serialize.js index 734e2ba030..a55eed97da 100644 --- a/src/editor/serialize.js +++ b/src/editor/serialize.js @@ -16,7 +16,7 @@ limitations under the License. */ import Markdown from '../Markdown'; -import {makeGenericPermalink} from "../utils/permalinks/RoomPermalinkCreator"; +import {makeGenericPermalink} from "../utils/permalinks/Permalinks"; export function mdSerialize(model) { return model.parts.reduce((html, part) => { diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index 0bed83ce84..1ec2434bf0 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -16,7 +16,7 @@ limitations under the License. */ import {baseUrl} from "./utils/permalinks/SpecPermalinkConstructor"; -import {tryTransformPermalinkToLocalHref} from "./utils/permalinks/RoomPermalinkCreator"; +import {tryTransformPermalinkToLocalHref} from "./utils/permalinks/Permalinks"; function matrixLinkify(linkify) { // Text tokens diff --git a/src/utils/permalinks/RoomPermalinkCreator.js b/src/utils/permalinks/Permalinks.js similarity index 100% rename from src/utils/permalinks/RoomPermalinkCreator.js rename to src/utils/permalinks/Permalinks.js diff --git a/test/utils/permalinks/RoomPermalinkCreator-test.js b/test/utils/permalinks/RoomPermalinkCreator-test.js index 09bfaa3974..9b4afcfc05 100644 --- a/test/utils/permalinks/RoomPermalinkCreator-test.js +++ b/test/utils/permalinks/RoomPermalinkCreator-test.js @@ -18,7 +18,7 @@ import { makeRoomPermalink, makeUserPermalink, RoomPermalinkCreator, -} from "../../../src/utils/permalinks/RoomPermalinkCreator"; +} from "../../../src/utils/permalinks/Permalinks"; import * as testUtils from "../../test-utils"; function mockRoom(roomId, members, serverACL) {