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

Commit

Permalink
Merge pull request #2634 from matrix-org/travis/better-room-sorting
Browse files Browse the repository at this point in the history
"Breadcrumb" room sorting algorithm
  • Loading branch information
turt2live authored Feb 21, 2019
2 parents ab9bf4c + 64103b7 commit ade9ee3
Show file tree
Hide file tree
Showing 6 changed files with 379 additions and 225 deletions.
19 changes: 19 additions & 0 deletions src/actions/MatrixActionCreators.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ function createRoomTagsAction(matrixClient, roomTagsEvent, room) {
return { action: 'MatrixActions.Room.tags', room };
}

/**
* Create a MatrixActions.Room.receipt action that represents a MatrixClient
* `Room.receipt` event, each parameter mapping to a key-value in the action.
*
* @param {MatrixClient} matrixClient the matrix client
* @param {MatrixEvent} event the receipt event.
* @param {Room} room the room the receipt happened in.
* @returns {Object} an action of type MatrixActions.Room.receipt.
*/
function createRoomReceiptAction(matrixClient, event, room) {
return {
action: 'MatrixActions.Room.receipt',
event,
room,
matrixClient,
};
}

/**
* @typedef RoomTimelineAction
* @type {Object}
Expand Down Expand Up @@ -233,6 +251,7 @@ export default {
this._addMatrixClientListener(matrixClient, 'Room.accountData', createRoomAccountDataAction);
this._addMatrixClientListener(matrixClient, 'Room', createRoomAction);
this._addMatrixClientListener(matrixClient, 'Room.tags', createRoomTagsAction);
this._addMatrixClientListener(matrixClient, 'Room.receipt', createRoomReceiptAction);
this._addMatrixClientListener(matrixClient, 'Room.timeline', createRoomTimelineAction);
this._addMatrixClientListener(matrixClient, 'Room.myMembership', createSelfMembershipAction);
this._addMatrixClientListener(matrixClient, 'Event.decrypted', createEventDecryptedAction);
Expand Down
8 changes: 0 additions & 8 deletions src/components/views/settings/tabs/PreferencesSettingsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export default class PreferencesSettingsTab extends React.Component {
'sendTypingNotifications',
];

static ROOM_LIST_SETTINGS = [
'pinUnreadRooms',
'pinMentionedRooms',
];

static TIMELINE_SETTINGS = [
'autoplayGifsAndVideos',
'urlPreviewsEnabled',
Expand Down Expand Up @@ -106,9 +101,6 @@ export default class PreferencesSettingsTab extends React.Component {
<span className="mx_SettingsTab_subheading">{_t("Composer")}</span>
{this._renderGroup(PreferencesSettingsTab.COMPOSER_SETTINGS)}

<span className="mx_SettingsTab_subheading">{_t("Room list")}</span>
{this._renderGroup(PreferencesSettingsTab.ROOM_LIST_SETTINGS)}

<span className="mx_SettingsTab_subheading">{_t("Timeline")}</span>
{this._renderGroup(PreferencesSettingsTab.TIMELINE_SETTINGS)}

Expand Down
3 changes: 0 additions & 3 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,6 @@
"Enable URL previews for this room (only affects you)": "Enable URL previews for this room (only affects you)",
"Enable URL previews by default for participants in this room": "Enable URL previews by default for participants in this room",
"Room Colour": "Room Colour",
"Pin rooms I'm mentioned in to the top of the room list": "Pin rooms I'm mentioned in to the top of the room list",
"Pin unread rooms to the top of the room list": "Pin unread rooms to the top of the room list",
"Enable widget screenshots on supported widgets": "Enable widget screenshots on supported widgets",
"Prompt before sending invites to potentially invalid matrix IDs": "Prompt before sending invites to potentially invalid matrix IDs",
"Show developer tools": "Show developer tools",
Expand Down Expand Up @@ -552,7 +550,6 @@
"Start automatically after system login": "Start automatically after system login",
"Preferences": "Preferences",
"Composer": "Composer",
"Room list": "Room list",
"Timeline": "Timeline",
"Autocomplete delay (ms)": "Autocomplete delay (ms)",
"To change the room's avatar, you must be a": "To change the room's avatar, you must be a",
Expand Down
10 changes: 0 additions & 10 deletions src/settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,6 @@ export const SETTINGS = {
default: true,
controller: new AudioNotificationsEnabledController(),
},
"pinMentionedRooms": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Pin rooms I'm mentioned in to the top of the room list"),
default: true,
},
"pinUnreadRooms": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Pin unread rooms to the top of the room list"),
default: true,
},
"enableWidgetScreenshots": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Enable widget screenshots on supported widgets'),
Expand Down
Loading

0 comments on commit ade9ee3

Please sign in to comment.