Username form process of VSCode

This commit is contained in:
2025-01-31 14:25:34 -07:00
parent 304bf04afe
commit a343243576
5 changed files with 112 additions and 82 deletions

View File

@ -90,6 +90,7 @@ public class Aggregation
private static ReadOnlyCollection<Notification> GetNotifications(Settings settings, string directory)
{
List<Notification> results = new();
string? key;
string text;
string[] files;
Notification? notification;
@ -108,12 +109,13 @@ public class Aggregation
notification = JsonSerializer.Deserialize(text, NotificationSourceGenerationContext.Default.Notification);
if (notification is null || notification.Id == 0)
continue;
if (string.IsNullOrEmpty(notification.RemoteIpAddress))
key = !string.IsNullOrEmpty(notification.Username) ? notification.Username : notification.RemoteIpAddress;
if (string.IsNullOrEmpty(key))
continue;
if (!keyValuePairs.TryGetValue(notification.RemoteIpAddress, out collection))
if (!keyValuePairs.TryGetValue(key, out collection))
{
keyValuePairs.Add(notification.RemoteIpAddress, new());
if (!keyValuePairs.TryGetValue(notification.RemoteIpAddress, out collection))
keyValuePairs.Add(key, new());
if (!keyValuePairs.TryGetValue(key, out collection))
throw new Exception();
}
collection.Add(notification);