Skip to content

Commit

Permalink
[Core] Fix the error when some accounts have no nicknames and qid (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishkong authored Dec 6, 2024
1 parent 6ec9012 commit f3ddb19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lagrange.Core/Internal/Service/System/FetchFriendsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected override bool Parse(Span<byte> input, BotKeystore keystore, BotAppInfo
{
var additional = raw.Additional.First(x => x.Type == 1);
var properties = Property(additional.Layer1.Properties);
friends.Add(new BotFriend(raw.Uin, raw.Uid, properties[20002], properties[103], properties[102], properties[27394], new(raw.CustomGroup, "")));
friends.Add(new BotFriend(raw.Uin, raw.Uid, properties.ContainsKey(20002) ? properties[20002] : raw.Uin.ToString(), properties[103], properties[102], properties.ContainsKey(27394) ? properties[27394] : "", new(raw.CustomGroup, "")));
}

output = FetchFriendsEvent.Result(0, friends, packet.Body.Groups.ToDictionary(k => k.Code, v => v.Value), packet.Body.Next?.Uin); // 全家4完了才能想出来这种分页的逻辑
Expand All @@ -69,4 +69,4 @@ private static Dictionary<uint, string> Property(List<OidbFriendProperty> proper
foreach (var property in properties) dict[property.Code] = property.Value;
return dict;
}
}
}

0 comments on commit f3ddb19

Please sign in to comment.