mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +00:00
Skip empty nickname in self persona state callback
This commit is contained in:
parent
8bb48d829e
commit
e0f9fe3555
2 changed files with 4 additions and 3 deletions
|
@ -320,7 +320,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
|
|||
SignedInWithSteam = true;
|
||||
}
|
||||
|
||||
Bot.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Localization.Strings.ListingAnnouncing, Bot.SteamID, nickname, assetsForListing.Count));
|
||||
Bot.ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Localization.Strings.ListingAnnouncing, Bot.SteamID, nickname ?? Bot.SteamID.ToString(CultureInfo.InvariantCulture), assetsForListing.Count));
|
||||
|
||||
// ReSharper disable once RedundantSuppressNullableWarningExpression - required for .NET Framework
|
||||
BasicResponse? response = await Backend.AnnounceForListing(Bot.SteamID, WebBrowser, assetsForListing, acceptedMatchableTypes, (uint) inventory.Count, matchEverything, tradeToken!, nickname, avatarHash).ConfigureAwait(false);
|
||||
|
|
|
@ -3000,11 +3000,12 @@ public sealed class Bot : IAsyncDisposable, IDisposable {
|
|||
return;
|
||||
}
|
||||
|
||||
Nickname = callback.Name;
|
||||
// Empty name should be converted to null, this is actually lack of value, but it's transmitted as empty in protobufs
|
||||
Nickname = !string.IsNullOrEmpty(callback.Name) ? callback.Name : null;
|
||||
|
||||
string? avatarHash = null;
|
||||
|
||||
if ((callback.AvatarHash?.Length > 0) && callback.AvatarHash.Any(static singleByte => singleByte != 0)) {
|
||||
if ((callback.AvatarHash?.Length > 0) && callback.AvatarHash.Any(static singleByte => singleByte > 0)) {
|
||||
#pragma warning disable CA1308 // False positive, we're intentionally converting this part to lowercase and it's not used for any security decisions based on the result of the normalization
|
||||
avatarHash = Convert.ToHexString(callback.AvatarHash).ToLowerInvariant();
|
||||
#pragma warning restore CA1308 // False positive, we're intentionally converting this part to lowercase and it's not used for any security decisions based on the result of the normalization
|
||||
|
|
Loading…
Reference in a new issue