This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 833
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add customisation point for mxid display (#7595)
* add wrapping component for hiding UI Signed-off-by: Kerry Archibald <kerrya@element.io> * add Setting Signed-off-by: Kerry Archibald <kerrya@element.io> * apply setting to profile settings, user menu, invite dialog, userinfo Signed-off-by: Kerry Archibald <kerrya@element.io> * hide mxids in user autocomplete * remove mxids from title in memeber list and timeline Signed-off-by: Kerry Archibald <kerrya@element.io> * hide mxid in ConfirmUserActionDialog Signed-off-by: Kerry Archibald <kerrya@element.io> * use name in power level event message when displayMxids is falsy Signed-off-by: Kerry Archibald <kerrya@element.io> * add customisation point for mxid display Signed-off-by: Kerry Archibald <kerrya@element.io> * use userid customisation Signed-off-by: Kerry Archibald <kerrya@element.io> * use customisation in sender profile Signed-off-by: Kerry Archibald <kerrya@element.io> * hide profile settings mxid if falsy Signed-off-by: Kerry Archibald <kerrya@element.io> * rename and move to components Signed-off-by: Kerry Archibald <kerrya@element.io> * remove change to UIFeature.ts Signed-off-by: Kerry Archibald <kerrya@element.io> * improvements from pr Signed-off-by: Kerry Archibald <kerrya@element.io> * lint fix Signed-off-by: Kerry Archibald <kerrya@element.io>
- Loading branch information
Kerry
authored
Jan 25, 2022
1 parent
b481fc0
commit 502b805
Showing
15 changed files
with
154 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
Copyright 2022 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
/** | ||
* Customise display of the user identifier | ||
* hide userId for guests, display 3pid | ||
* | ||
* Set withDisplayName to true when user identifier will be displayed alongside user name | ||
*/ | ||
function getDisplayUserIdentifier( | ||
userId: string, | ||
{ roomId, withDisplayName }: { roomId?: string, withDisplayName?: boolean }, | ||
): string | null { | ||
return userId; | ||
} | ||
|
||
// This interface summarises all available customisation points and also marks | ||
// them all as optional. This allows customisers to only define and export the | ||
// customisations they need while still maintaining type safety. | ||
export interface IUserIdentifierCustomisations { | ||
getDisplayUserIdentifier?: typeof getDisplayUserIdentifier; | ||
} | ||
|
||
// A real customisation module will define and export one or more of the | ||
// customisation points that make up `IUserIdentifierCustomisations`. | ||
export default { | ||
getDisplayUserIdentifier, | ||
} as IUserIdentifierCustomisations; |
Oops, something went wrong.