Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions commet/lib/config/preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ class Preferences {
BoolPreference showRoomPreviewsInSpaceSidebar =
BoolPreference("show_room_previews_in_space_sidebar", defaultValue: true);

BoolPreference showUserIdInTimeline =
BoolPreference("show_user_id_in_timeline", defaultValue: false);

BoolPreference autoFocusMessageTextBox = BoolPreference(
"auto_focus_message_textbox",
defaultGetter: () => Layout.mobile ? false : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class _TimelineEventViewMessageState extends State<TimelineEventViewMessage>
return TimelineEventLayoutMessage(
senderName: senderName,
senderColor: senderColor,
senderId: preferences.showUserIdInTimeline.value ? senderId : null,
senderAvatar: senderAvatar,
showSender: showSender,
formattedContent: formattedContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class TimelineEventLayoutMessage extends StatelessWidget {
{super.key,
required this.senderName,
required this.senderColor,
this.senderId,
this.senderAvatar,
this.formattedContent,
this.attachments,
Expand All @@ -26,6 +27,7 @@ class TimelineEventLayoutMessage extends StatelessWidget {
this.avatarBuilder,
this.showSender = true});
final String senderName;
final String? senderId;
final Color senderColor;
final ImageProvider? senderAvatar;
final Widget? formattedContent;
Expand Down Expand Up @@ -70,7 +72,15 @@ class TimelineEventLayoutMessage extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
name(),
Row(
mainAxisAlignment: MainAxisAlignment.start,
spacing: 3,
children: [
name(),
if(senderId != null)
tiamat.Text.labelLow(senderId!, color: Color.from(alpha: 1.0, red: 0.5, green: 0.5, blue: 0.5),)
]
),
if (timestamp != null)
tiamat.Text.labelLow(timestamp!),
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ class _AppearanceSettingsPageState extends State<AppearanceSettingsPage> {
desc:
"Description for enabling using the preview list in the space sidebar");

String get labelShowUserIdInMessage => Intl.message(
"Show User ID in Timeline",
name: "labelShowUserIdInMessage",
desc: "Label for showing full user ID in message rendering");

String get labelShowUserIdInMessageDescription => Intl.message(
"Show the full address of a user next to their name in the timeline",
name: "labelShowUserIdInMessageDescription",
desc: "Description for showing full user ID in message rendering");

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -128,6 +138,12 @@ class _AppearanceSettingsPageState extends State<AppearanceSettingsPage> {
preference: preferences.usePlaceholderRoomAvatars,
title: labelUseRoomAvatarPlaceholders,
description: labelUseRoomAvatarPlaceholdersDescription,
),
const Seperator(),
BooleanPreferenceToggle(
preference: preferences.showUserIdInTimeline,
title: labelShowUserIdInMessage,
description: labelShowUserIdInMessageDescription,
)
],
),
Expand Down