Hotfix 0.1.9.1 - Update API & Double notification & Update Penumbra API Ref

This commit is contained in:
2025-09-29 02:10:03 +02:00
parent fca730557e
commit 7706ef1fa7
9 changed files with 54 additions and 26 deletions

View File

@@ -117,7 +117,7 @@ public record NearbyDetectionToggled(bool Enabled) : MessageBase;
public record AllowPairRequestsToggled(bool Enabled) : MessageBase;
public record ApplyDefaultPairPermissionsMessage(UserPairDto Pair) : MessageBase;
public record ApplyDefaultGroupPermissionsMessage(GroupPairFullInfoDto GroupPair) : MessageBase;
public record ApplyDefaultsToAllSyncsMessage : MessageBase;
public record ApplyDefaultsToAllSyncsMessage(string? Context = null, bool? Disabled = null) : MessageBase;
public record PairSyncOverrideChanged(string Uid, bool? DisableSounds, bool? DisableAnimations, bool? DisableVfx) : MessageBase;
public record GroupSyncOverrideChanged(string Gid, bool? DisableSounds, bool? DisableAnimations, bool? DisableVfx) : MessageBase;

View File

@@ -33,7 +33,7 @@ public sealed class SyncDefaultsService : DisposableMediatorSubscriberBase
Mediator.Subscribe<ApplyDefaultPairPermissionsMessage>(this, OnApplyPairDefaults);
Mediator.Subscribe<ApplyDefaultGroupPermissionsMessage>(this, OnApplyGroupDefaults);
Mediator.Subscribe<ApplyDefaultsToAllSyncsMessage>(this, _ => ApplyDefaultsToAll());
Mediator.Subscribe<ApplyDefaultsToAllSyncsMessage>(this, msg => ApplyDefaultsToAll(msg));
Mediator.Subscribe<PairSyncOverrideChanged>(this, OnPairOverrideChanged);
Mediator.Subscribe<GroupSyncOverrideChanged>(this, OnGroupOverrideChanged);
}
@@ -63,7 +63,7 @@ public sealed class SyncDefaultsService : DisposableMediatorSubscriberBase
_ = _apiController.GroupChangeIndividualPermissionState(new GroupPairUserPermissionDto(message.GroupPair.Group, message.GroupPair.User, permissions));
}
private async Task ApplyDefaultsToAllAsync()
private async Task ApplyDefaultsToAllAsync(ApplyDefaultsToAllSyncsMessage message)
{
try
{
@@ -107,7 +107,10 @@ public sealed class SyncDefaultsService : DisposableMediatorSubscriberBase
}
}
Mediator.Publish(new DualNotificationMessage("Préférences appliquées", BuildSummaryMessage(updatedPairs, updatedGroups), NotificationType.Info));
var summary = BuildSummaryMessage(updatedPairs, updatedGroups);
var primary = BuildPrimaryMessage(message);
var combined = string.IsNullOrEmpty(primary) ? summary : string.Concat(primary, ' ', summary);
Mediator.Publish(new DualNotificationMessage("Préférences appliquées", combined, NotificationType.Info));
}
catch (Exception ex)
{
@@ -116,7 +119,16 @@ public sealed class SyncDefaultsService : DisposableMediatorSubscriberBase
}
}
private void ApplyDefaultsToAll() => _ = ApplyDefaultsToAllAsync();
private void ApplyDefaultsToAll(ApplyDefaultsToAllSyncsMessage message) => _ = ApplyDefaultsToAllAsync(message);
private static string? BuildPrimaryMessage(ApplyDefaultsToAllSyncsMessage message)
{
if (string.IsNullOrEmpty(message.Context) || message.Disabled == null)
return null;
var state = message.Disabled.Value ? "désactivée" : "activée";
return $"Synchronisation {message.Context} par défaut {state}.";
}
private static string BuildSummaryMessage(int pairs, int groups)
{