@@ -47,6 +47,8 @@ public struct BuzzPushCachedChannel: Codable, Equatable, Sendable {
4747 public let channelType : String ?
4848 /// Whether relay metadata marks this as a private Solo stream (`buzz.solo` label).
4949 public let isSolo : Bool ?
50+ /// Relay-authored creator (`P`), lowercased, when it is a valid pubkey.
51+ public let creatorPubkey : String ?
5052 /// Exact unique-member count when bounded, or a value above the bound when oversized.
5153 public let memberCount : Int ?
5254 /// Complete community-and-channel-scoped member digests, when within bounds.
@@ -69,6 +71,7 @@ public struct BuzzPushCachedChannel: Codable, Equatable, Sendable {
6971 displayName : String ? ,
7072 channelType : String ? = nil ,
7173 isSolo : Bool ? = nil ,
74+ creatorPubkey : String ? = nil ,
7275 memberCount : Int ? = nil ,
7376 memberDigests : [ String ] ? = nil ,
7477 membershipEventID : String ? = nil ,
@@ -85,6 +88,7 @@ public struct BuzzPushCachedChannel: Codable, Equatable, Sendable {
8588 self . displayName = displayName
8689 self . channelType = channelType
8790 self . isSolo = isSolo
91+ self . creatorPubkey = creatorPubkey
8892 self . memberCount = memberCount
8993 self . memberDigests = memberDigests
9094 self . membershipEventID = membershipEventID
@@ -332,6 +336,7 @@ public final class BuzzPushPresentationCacheStore: @unchecked Sendable {
332336 displayName : Self . normalizedDisplayName ( Self . tagValue ( " name " , in : event ) ) ,
333337 channelType : Self . normalizedChannelType ( Self . tagValue ( " t " , in : event ) ) ,
334338 isSolo : Self . isSoloChannel ( event ) ,
339+ creatorPubkey : Self . normalizedCreator ( event ) ,
335340 memberCount : hasCurrentAuthority ? existing ? . memberCount : nil ,
336341 memberDigests : hasCurrentAuthority ? existing ? . memberDigests : nil ,
337342 membershipEventID : hasCurrentAuthority ? existing ? . membershipEventID : nil ,
@@ -384,6 +389,7 @@ public final class BuzzPushPresentationCacheStore: @unchecked Sendable {
384389 displayName : existing . displayName ,
385390 channelType : existing . channelType ,
386391 isSolo : existing . isSolo ,
392+ creatorPubkey : existing . creatorPubkey ,
387393 memberCount : membership . count ,
388394 memberDigests : membership . digests ,
389395 membershipEventID : event . id ,
@@ -548,6 +554,13 @@ public final class BuzzPushPresentationCacheStore: @unchecked Sendable {
548554 return types . first == " stream " && isPrivate && types . dropFirst ( ) . contains ( " buzz.solo " )
549555 }
550556
557+ /// The relay-authored creator `P` tag, lowercased, when it is a valid pubkey.
558+ static func normalizedCreator ( _ event : VerifiedNostrEvent ) -> String ? {
559+ guard let creator = tagValue ( " P " , in : event ) ? . lowercased ( ) , isHexPubkey ( creator )
560+ else { return nil }
561+ return creator
562+ }
563+
551564 static func normalizedChannelType ( _ value : String ? ) -> String ? {
552565 guard let value , [ " stream " , " forum " , " dm " ] . contains ( value ) else { return nil }
553566 return value
@@ -731,6 +744,7 @@ public final class BuzzPushPresentationCacheStore: @unchecked Sendable {
731744 displayName : channel . displayName ,
732745 channelType : channel . channelType ,
733746 isSolo : channel . isSolo ,
747+ creatorPubkey : channel . creatorPubkey ,
734748 memberCount : channel . memberCount ,
735749 memberDigests : nil ,
736750 membershipEventID : channel . membershipEventID ,
0 commit comments