Fix key consistency

This commit is contained in:
2024-01-10 12:04:09 +00:00
parent 788fad7d05
commit fe060f1e4d

View File

@ -39,7 +39,16 @@ public class RedisStore
return await _database.GetAsync<CompactProfile>(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; }