Username form process of VSCode
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user