mirror of
https://github.com/krille-chan/fluffychat
synced 2024-10-03 19:12:41 +00:00
Merge pull request #827 from krille-chan/krille/private-read-receipts
feat: Implement private read receipts
This commit is contained in:
commit
601220c18f
7 changed files with 26 additions and 3 deletions
|
@ -2416,5 +2416,6 @@
|
|||
"placeholders": {
|
||||
"roomName": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sendReadReceipts": "Send read receipts"
|
||||
}
|
|
@ -47,6 +47,7 @@ abstract class AppConfig {
|
|||
static bool separateChatTypes = false;
|
||||
static bool autoplayImages = true;
|
||||
static bool sendTypingNotifications = true;
|
||||
static bool sendPublicReadReceipts = true;
|
||||
static bool? sendOnEnter;
|
||||
static bool experimentalVoip = false;
|
||||
static const bool hideTypingUsernames = false;
|
||||
|
|
|
@ -24,6 +24,8 @@ abstract class SettingKeys {
|
|||
static const String autoplayImages = 'chat.fluffy.autoplay_images';
|
||||
static const String sendTypingNotifications =
|
||||
'chat.fluffy.send_typing_notifications';
|
||||
static const String sendPublicReadReceipts =
|
||||
'chat.fluffy.send_public_read_receipts';
|
||||
static const String sendOnEnter = 'chat.fluffy.send_on_enter';
|
||||
static const String experimentalVoip = 'chat.fluffy.experimental_voip';
|
||||
}
|
||||
|
|
|
@ -388,7 +388,12 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
|
||||
Logs().d('Set read marker...', eventId);
|
||||
// ignore: unawaited_futures
|
||||
_setReadMarkerFuture = timeline.setReadMarker(eventId: eventId).then((_) {
|
||||
_setReadMarkerFuture = timeline
|
||||
.setReadMarker(
|
||||
eventId: eventId,
|
||||
public: AppConfig.sendPublicReadReceipts,
|
||||
)
|
||||
.then((_) {
|
||||
_setReadMarkerFuture = null;
|
||||
});
|
||||
if (eventId == null || eventId == timeline.room.lastEvent?.eventId) {
|
||||
|
|
|
@ -70,6 +70,12 @@ class SettingsChatView extends StatelessWidget {
|
|||
storeKey: SettingKeys.sendTypingNotifications,
|
||||
defaultValue: AppConfig.sendTypingNotifications,
|
||||
),
|
||||
SettingsSwitchListTile.adaptive(
|
||||
title: L10n.of(context)!.sendReadReceipts,
|
||||
onChanged: (b) => AppConfig.sendPublicReadReceipts = b,
|
||||
storeKey: SettingKeys.sendPublicReadReceipts,
|
||||
defaultValue: AppConfig.sendPublicReadReceipts,
|
||||
),
|
||||
SettingsSwitchListTile.adaptive(
|
||||
title: L10n.of(context)!.sendOnEnter,
|
||||
onChanged: (b) => AppConfig.sendOnEnter = b,
|
||||
|
|
|
@ -111,7 +111,11 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
.singleWhere((a) => a.name == actionStr);
|
||||
switch (action) {
|
||||
case DesktopNotificationActions.seen:
|
||||
room.setReadMarker(event.eventId, mRead: event.eventId);
|
||||
room.setReadMarker(
|
||||
event.eventId,
|
||||
mRead: event.eventId,
|
||||
public: AppConfig.sendPublicReadReceipts,
|
||||
);
|
||||
break;
|
||||
case DesktopNotificationActions.openChat:
|
||||
context.go('/rooms/${room.id}');
|
||||
|
|
|
@ -459,6 +459,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
store.getBool(SettingKeys.sendTypingNotifications) ??
|
||||
AppConfig.sendTypingNotifications;
|
||||
|
||||
AppConfig.sendPublicReadReceipts =
|
||||
store.getBool(SettingKeys.sendPublicReadReceipts) ??
|
||||
AppConfig.sendPublicReadReceipts;
|
||||
|
||||
AppConfig.sendOnEnter =
|
||||
store.getBool(SettingKeys.sendOnEnter) ?? AppConfig.sendOnEnter;
|
||||
|
||||
|
|
Loading…
Reference in a new issue