Skip to content

Show read receipts #1706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
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
Binary file modified assets/icons/ZulipIcons.ttf
Binary file not shown.
4 changes: 4 additions & 0 deletions assets/icons/check_check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,29 @@
"num": {"type": "int", "example": "2"}
}
},
"actionSheetOptionViewReadReceipts": "View read receipts",
"@actionSheetOptionViewReadReceipts": {
"description": "Label for the 'View read receipts' button in the message action sheet."
},
"actionSheetReadReceipts": "Read receipts",
"@actionSheetReadReceipts": {
"description": "Title for the \"Read receipts\" bottom sheet."
},
"actionSheetReadReceiptsReadCount": "{count, plural, =1{This message has been <z-link>read</z-link> by {count} person:} other{This message has been <z-link>read</z-link> by {count} people:}}",
"@actionSheetReadReceiptsReadCount": {
"description": "Label in the \"Read receipts\" bottom sheet when one or more people have read the message.",
"placeholders": {
"count": {"type": "int", "example": "1"}
}
},
"actionSheetReadReceiptsZeroReadCount": "No one has read this message yet.",
"@actionSheetReadReceiptsZeroReadCount": {
"description": "Label in the \"Read receipts\" bottom sheet when no one has read the message."
},
"actionSheetReadReceiptsErrorReadCount": "Failed to load read receipts.",
"@actionSheetReadReceiptsErrorReadCount": {
"description": "Label in the \"Read receipts\" bottom sheet when loading read receipts failed."
},
"actionSheetOptionCopyMessageText": "Copy message text",
"@actionSheetOptionCopyMessageText": {
"description": "Label for copy message text button on action sheet."
Expand Down
3 changes: 3 additions & 0 deletions lib/api/model/initial_snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class InitialSnapshot {
final bool realmAllowMessageEditing;
final int? realmMessageContentEditLimitSeconds;

final bool realmEnableReadReceipts;

final bool realmPresenceDisabled;

final Map<String, RealmDefaultExternalAccount> realmDefaultExternalAccounts;
Expand Down Expand Up @@ -158,6 +160,7 @@ class InitialSnapshot {
required this.realmWaitingPeriodThreshold,
required this.realmAllowMessageEditing,
required this.realmMessageContentEditLimitSeconds,
required this.realmEnableReadReceipts,
required this.realmPresenceDisabled,
required this.realmDefaultExternalAccounts,
required this.maxFileUploadSizeMib,
Expand Down
2 changes: 2 additions & 0 deletions lib/api/model/initial_snapshot.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions lib/api/route/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,23 @@ class UpdateMessageFlagsForNarrowResult {

Map<String, dynamic> toJson() => _$UpdateMessageFlagsForNarrowResultToJson(this);
}

/// https://zulip.com/api/get-read-receipts
Future<GetReadReceiptsResult> getReadReceipts(ApiConnection connection, {
required int messageId,
}) {
return connection.get('getReadReceipts', GetReadReceiptsResult.fromJson,
'messages/$messageId/read_receipts', null);
}

@JsonSerializable(fieldRename: FieldRename.snake)
class GetReadReceiptsResult {
const GetReadReceiptsResult({required this.userIds});

final List<int> userIds;

factory GetReadReceiptsResult.fromJson(Map<String, dynamic> json) =>
_$GetReadReceiptsResultFromJson(json);

Map<String, dynamic> toJson() => _$GetReadReceiptsResultToJson(this);
}
12 changes: 12 additions & 0 deletions lib/api/route/messages.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 32 additions & 2 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ abstract class ZulipLocalizations {
/// **'To upload files, please grant Zulip additional permissions in Settings.'**
String get permissionsDeniedReadExternalStorage;

/// Label in the channel context menu for subscribing to the channel.
/// Label in the channel action sheet for subscribing to the channel.
///
/// In en, this message translates to:
/// **'Subscribe'**
Expand Down Expand Up @@ -305,7 +305,7 @@ abstract class ZulipLocalizations {
/// **'List of topics'**
String get actionSheetOptionListOfTopics;

/// Label in the channel context menu for unsubscribing from the channel.
/// Label in the channel action sheet for unsubscribing from the channel.
///
/// In en, this message translates to:
/// **'Unsubscribe'**
Expand Down Expand Up @@ -413,6 +413,36 @@ abstract class ZulipLocalizations {
/// **'Votes for {emojiName} ({num})'**
String seeWhoReactedSheetUserListLabel(String emojiName, int num);

/// Label for the 'View read receipts' button in the message action sheet.
///
/// In en, this message translates to:
/// **'View read receipts'**
String get actionSheetOptionViewReadReceipts;

/// Title for the "Read receipts" bottom sheet.
///
/// In en, this message translates to:
/// **'Read receipts'**
String get actionSheetReadReceipts;

/// Label in the "Read receipts" bottom sheet when one or more people have read the message.
///
/// In en, this message translates to:
/// **'{count, plural, =1{This message has been <z-link>read</z-link> by {count} person:} other{This message has been <z-link>read</z-link> by {count} people:}}'**
String actionSheetReadReceiptsReadCount(int count);

/// Label in the "Read receipts" bottom sheet when no one has read the message.
///
/// In en, this message translates to:
/// **'No one has read this message yet.'**
String get actionSheetReadReceiptsZeroReadCount;

/// Label in the "Read receipts" bottom sheet when loading read receipts failed.
///
/// In en, this message translates to:
/// **'Failed to load read receipts.'**
String get actionSheetReadReceiptsErrorReadCount;

/// Label for copy message text button on action sheet.
///
/// In en, this message translates to:
Expand Down
25 changes: 25 additions & 0 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,31 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
return 'Votes for $emojiName ($num)';
}

@override
String get actionSheetOptionViewReadReceipts => 'View read receipts';

@override
String get actionSheetReadReceipts => 'Read receipts';

@override
String actionSheetReadReceiptsReadCount(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'This message has been <z-link>read</z-link> by $count people:',
one: 'This message has been <z-link>read</z-link> by $count person:',
);
return '$_temp0';
}

@override
String get actionSheetReadReceiptsZeroReadCount =>
'No one has read this message yet.';

@override
String get actionSheetReadReceiptsErrorReadCount =>
'Failed to load read receipts.';

@override
String get actionSheetOptionCopyMessageText => 'Copy message text';

Expand Down
25 changes: 25 additions & 0 deletions lib/generated/l10n/zulip_localizations_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,31 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
return 'Votes for $emojiName ($num)';
}

@override
String get actionSheetOptionViewReadReceipts => 'View read receipts';

@override
String get actionSheetReadReceipts => 'Read receipts';

@override
String actionSheetReadReceiptsReadCount(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'This message has been <z-link>read</z-link> by $count people:',
one: 'This message has been <z-link>read</z-link> by $count person:',
);
return '$_temp0';
}

@override
String get actionSheetReadReceiptsZeroReadCount =>
'No one has read this message yet.';

@override
String get actionSheetReadReceiptsErrorReadCount =>
'Failed to load read receipts.';

@override
String get actionSheetOptionCopyMessageText => 'Nachrichtentext kopieren';

Expand Down
25 changes: 25 additions & 0 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,31 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
return 'Votes for $emojiName ($num)';
}

@override
String get actionSheetOptionViewReadReceipts => 'View read receipts';

@override
String get actionSheetReadReceipts => 'Read receipts';

@override
String actionSheetReadReceiptsReadCount(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'This message has been <z-link>read</z-link> by $count people:',
one: 'This message has been <z-link>read</z-link> by $count person:',
);
return '$_temp0';
}

@override
String get actionSheetReadReceiptsZeroReadCount =>
'No one has read this message yet.';

@override
String get actionSheetReadReceiptsErrorReadCount =>
'Failed to load read receipts.';

@override
String get actionSheetOptionCopyMessageText => 'Copy message text';

Expand Down
25 changes: 25 additions & 0 deletions lib/generated/l10n/zulip_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,31 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
return 'Votes for $emojiName ($num)';
}

@override
String get actionSheetOptionViewReadReceipts => 'View read receipts';

@override
String get actionSheetReadReceipts => 'Read receipts';

@override
String actionSheetReadReceiptsReadCount(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'This message has been <z-link>read</z-link> by $count people:',
one: 'This message has been <z-link>read</z-link> by $count person:',
);
return '$_temp0';
}

@override
String get actionSheetReadReceiptsZeroReadCount =>
'No one has read this message yet.';

@override
String get actionSheetReadReceiptsErrorReadCount =>
'Failed to load read receipts.';

@override
String get actionSheetOptionCopyMessageText => 'Copy message text';

Expand Down
25 changes: 25 additions & 0 deletions lib/generated/l10n/zulip_localizations_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,31 @@ class ZulipLocalizationsIt extends ZulipLocalizations {
return 'Votes for $emojiName ($num)';
}

@override
String get actionSheetOptionViewReadReceipts => 'View read receipts';

@override
String get actionSheetReadReceipts => 'Read receipts';

@override
String actionSheetReadReceiptsReadCount(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'This message has been <z-link>read</z-link> by $count people:',
one: 'This message has been <z-link>read</z-link> by $count person:',
);
return '$_temp0';
}

@override
String get actionSheetReadReceiptsZeroReadCount =>
'No one has read this message yet.';

@override
String get actionSheetReadReceiptsErrorReadCount =>
'Failed to load read receipts.';

@override
String get actionSheetOptionCopyMessageText => 'Copia il testo del messaggio';

Expand Down
25 changes: 25 additions & 0 deletions lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,31 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
return 'Votes for $emojiName ($num)';
}

@override
String get actionSheetOptionViewReadReceipts => 'View read receipts';

@override
String get actionSheetReadReceipts => 'Read receipts';

@override
String actionSheetReadReceiptsReadCount(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'This message has been <z-link>read</z-link> by $count people:',
one: 'This message has been <z-link>read</z-link> by $count person:',
);
return '$_temp0';
}

@override
String get actionSheetReadReceiptsZeroReadCount =>
'No one has read this message yet.';

@override
String get actionSheetReadReceiptsErrorReadCount =>
'Failed to load read receipts.';

@override
String get actionSheetOptionCopyMessageText => 'メッセージ本文をコピー';

Expand Down
25 changes: 25 additions & 0 deletions lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,31 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
return 'Votes for $emojiName ($num)';
}

@override
String get actionSheetOptionViewReadReceipts => 'View read receipts';

@override
String get actionSheetReadReceipts => 'Read receipts';

@override
String actionSheetReadReceiptsReadCount(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'This message has been <z-link>read</z-link> by $count people:',
one: 'This message has been <z-link>read</z-link> by $count person:',
);
return '$_temp0';
}

@override
String get actionSheetReadReceiptsZeroReadCount =>
'No one has read this message yet.';

@override
String get actionSheetReadReceiptsErrorReadCount =>
'Failed to load read receipts.';

@override
String get actionSheetOptionCopyMessageText => 'Copy message text';

Expand Down
Loading