diff --git a/NostrServices/Services/RedisStore.cs b/NostrServices/Services/RedisStore.cs index e129fe8..d23a1bb 100644 --- a/NostrServices/Services/RedisStore.cs +++ b/NostrServices/Services/RedisStore.cs @@ -39,7 +39,16 @@ public class RedisStore return await _database.GetAsync(ProfileKey(id)); } - private string EventKey(NostrIdentifier id) => $"event:{id.ToBech32()}"; + private string EventKey(NostrIdentifier id) + { + if (id is NostrAddressIdentifier naddr) + { + return $"event:{naddr.Kind}:{naddr.Pubkey}:{naddr.Identifier}"; + } + + return $"event:{id.Special}"; + } + private string ProfileKey(string id) => $"profile:{id}"; } @@ -73,7 +82,7 @@ public class CompactEvent [ProtoMember(6)] public byte[] Sig { get; init; } = null!; - + [ProtoMember(7)] public long Kind { get; init; }