♻️ Refactor notification meta

This commit is contained in:
2025-07-29 23:23:40 +08:00
parent 409c83b030
commit 51697c31cb
5 changed files with 10 additions and 6 deletions

View File

@@ -91,7 +91,7 @@ public class PusherServiceGrpc(
request.Notification.Title,
request.Notification.Subtitle,
request.Notification.Body,
GrpcTypeHelper.ConvertFromValueMap(request.Notification.Meta),
GrpcTypeHelper.ConvertByteStringToObject<Dictionary<string, object?>>(request.Notification.Meta) ?? [],
request.Notification.ActionUri,
request.Notification.IsSilent,
request.Notification.IsSavable
@@ -108,7 +108,8 @@ public class PusherServiceGrpc(
Title = request.Notification.Title,
Subtitle = request.Notification.Subtitle,
Content = request.Notification.Body,
Meta = GrpcTypeHelper.ConvertFromValueMap(request.Notification.Meta)
Meta = GrpcTypeHelper.ConvertByteStringToObject<Dictionary<string, object?>>(request.Notification.Meta) ??
[]
};
if (request.Notification.ActionUri is not null)
notification.Meta["action_uri"] = request.Notification.ActionUri;