chore: Follow up notification actions

This commit is contained in:
Christian Kußowski 2025-10-03 09:14:53 +02:00
commit a88849c2db
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
3 changed files with 103 additions and 8 deletions

View file

@ -315,11 +315,30 @@ Future<void> _tryPushHelper(
title,
body,
platformChannelSpecifics,
payload: event.roomId,
payload:
FluffyChatPushPayload(client.clientName, event.room.id, event.eventId)
.toString(),
);
Logs().v('Push helper has been completed!');
}
class FluffyChatPushPayload {
final String? clientName, roomId, eventId;
FluffyChatPushPayload(this.clientName, this.roomId, this.eventId);
factory FluffyChatPushPayload.fromString(String payload) {
final parts = payload.split('|');
if (parts.length != 3) {
return FluffyChatPushPayload(null, null, null);
}
return FluffyChatPushPayload(parts[0], parts[1], parts[2]);
}
@override
String toString() => '$clientName|$roomId|$eventId';
}
/// Creates a shortcut for Android platform but does not block displaying the
/// notification. This is optional but provides a nicer view of the
/// notification popup.