mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Skip empty nickname in self persona state callback
This commit is contained in:
@@ -320,7 +320,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
|
|||||||
SignedInWithSteam = true;
|
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
|
// 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);
|
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;
|
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;
|
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
|
#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();
|
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
|
#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
|
||||||
|
|||||||
Reference in New Issue
Block a user