diff --git a/src/BreCalClient/AppNotification.cs b/src/BreCalClient/AppNotification.cs index 3164052..46faaa5 100644 --- a/src/BreCalClient/AppNotification.cs +++ b/src/BreCalClient/AppNotification.cs @@ -95,11 +95,11 @@ namespace BreCalClient SaveNotifications(); } - internal static bool UpdateNotifications(List notifications, System.Collections.Concurrent.ConcurrentDictionary currentShipcalls, ToastViewModel vm) + internal static bool UpdateNotifications(List notifications, System.Collections.Concurrent.ConcurrentDictionary currentShipcalls, ToastViewModel vm) { bool result = false; - foreach (BreCalClient.misc.Model.Notification notification in notifications) + foreach (Notification notification in notifications) { if (notification.ParticipantId.HasValue && notification.ParticipantId.Value != App.Participant.Id) // not meant for us continue; @@ -107,6 +107,20 @@ namespace BreCalClient if (!currentShipcalls.ContainsKey(notification.ShipcallId)) // not one of our shipcalls (maybe for another port or filtered) continue; + // filter out notifications for shipcalls where we are not nomiated/assigned + if (!notification.ParticipantId.HasValue) + { + bool iAmAssigned = false; + foreach (ParticipantAssignment p in currentShipcalls[notification.ShipcallId].AssignedParticipants.Values) + { + if (p.ParticipantId.Equals(App.Participant.Id)) + { + iAmAssigned = true; break; + } + } + if (!iAmAssigned) continue; + } + if (!_notificationsCollection.Where(x => x.Id == notification.Id).Any()) { List newList = new(_notificationsCollection); diff --git a/src/BreCalClient/NotificationDialog.xaml b/src/BreCalClient/NotificationDialog.xaml index 30a756e..9297083 100644 --- a/src/BreCalClient/NotificationDialog.xaml +++ b/src/BreCalClient/NotificationDialog.xaml @@ -35,6 +35,7 @@ +