Add Timeline switcher button in PostingTimelineView. Switch between your following or NIP-81 favorites. User can favorite a user via ProfileActionSheetView or ProfileView.
Closes: https://github.com/damus-io/damus/issues/2438 Changelog-Added: Add Timeline switcher button for NIP-81-favorites Signed-off-by: Askeew <askeew@hotmail.com>
This commit is contained in:
committed by
Daniel D’Aquino
parent
6605c5e583
commit
61f695b7c6
@@ -872,4 +872,31 @@ extension NostrEvent {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
var debugDescription: String {
|
||||
var output = "🔍 NostrEvent Debug Info\n"
|
||||
output += "═══════════════════════════\n"
|
||||
output += "📝 ID: \(id)\n"
|
||||
output += "👤 Pubkey: \(pubkey)\n"
|
||||
output += "📅 Created: \(Date(timeIntervalSince1970: TimeInterval(created_at))) (\(created_at))\n"
|
||||
output += "🏷️ Kind: \(kind) (\(String(describing: known_kind))\n"
|
||||
output += "✍️ Signature: \(sig)\n"
|
||||
output += "📄 Content (\(content.count) chars):\n"
|
||||
output += " \"\(content.prefix(100))\(content.count > 100 ? "..." : "")\"\n"
|
||||
|
||||
output += "\n🏷️ Tags (\(tags.count) total):\n"
|
||||
for (index, tag) in tags.enumerated() {
|
||||
output += " [\(index)]: ["
|
||||
for (tagIndex, tagElem) in tag.enumerated() {
|
||||
if tagIndex > 0 { output += ", " }
|
||||
output += "\"\(tagElem.string())\""
|
||||
}
|
||||
output += "]\n"
|
||||
}
|
||||
|
||||
output += "═══════════════════════════\n"
|
||||
return output
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -31,5 +31,6 @@ enum NostrKind: UInt32, Codable {
|
||||
case nwc_response = 23195
|
||||
case http_auth = 27235
|
||||
case status = 30315
|
||||
case contact_card = 30_382
|
||||
case follow_list = 39089
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ class DamusState: HeadlessDamusState {
|
||||
let boosts: EventCounter
|
||||
let quote_reposts: EventCounter
|
||||
let contacts: Contacts
|
||||
let contactCards: ContactCard
|
||||
let mutelist_manager: MutelistManager
|
||||
let profiles: Profiles
|
||||
let dms: DirectMessagesModel
|
||||
@@ -39,11 +40,12 @@ class DamusState: HeadlessDamusState {
|
||||
let favicon_cache: FaviconCache
|
||||
private(set) var nostrNetwork: NostrNetworkManager
|
||||
|
||||
init(keypair: Keypair, likes: EventCounter, boosts: EventCounter, contacts: Contacts, mutelist_manager: MutelistManager, profiles: Profiles, dms: DirectMessagesModel, previews: PreviewCache, zaps: Zaps, lnurls: LNUrls, settings: UserSettingsStore, relay_filters: RelayFilters, relay_model_cache: RelayModelCache, drafts: Drafts, events: EventCache, bookmarks: BookmarksManager, replies: ReplyCounter, wallet: WalletModel, nav: NavigationCoordinator, music: MusicController?, video: DamusVideoCoordinator, ndb: Ndb, purple: DamusPurple? = nil, quote_reposts: EventCounter, emoji_provider: EmojiProvider, favicon_cache: FaviconCache) {
|
||||
init(keypair: Keypair, likes: EventCounter, boosts: EventCounter, contacts: Contacts, contactCards: ContactCard, mutelist_manager: MutelistManager, profiles: Profiles, dms: DirectMessagesModel, previews: PreviewCache, zaps: Zaps, lnurls: LNUrls, settings: UserSettingsStore, relay_filters: RelayFilters, relay_model_cache: RelayModelCache, drafts: Drafts, events: EventCache, bookmarks: BookmarksManager, replies: ReplyCounter, wallet: WalletModel, nav: NavigationCoordinator, music: MusicController?, video: DamusVideoCoordinator, ndb: Ndb, purple: DamusPurple? = nil, quote_reposts: EventCounter, emoji_provider: EmojiProvider, favicon_cache: FaviconCache) {
|
||||
self.keypair = keypair
|
||||
self.likes = likes
|
||||
self.boosts = boosts
|
||||
self.contacts = contacts
|
||||
self.contactCards = contactCards
|
||||
self.mutelist_manager = mutelist_manager
|
||||
self.profiles = profiles
|
||||
self.dms = dms
|
||||
@@ -109,6 +111,7 @@ class DamusState: HeadlessDamusState {
|
||||
likes: EventCounter(our_pubkey: pubkey),
|
||||
boosts: EventCounter(our_pubkey: pubkey),
|
||||
contacts: Contacts(our_pubkey: pubkey),
|
||||
contactCards: ContactCardManager(),
|
||||
mutelist_manager: MutelistManager(user_keypair: keypair),
|
||||
profiles: Profiles(ndb: ndb),
|
||||
dms: home.dms,
|
||||
@@ -178,6 +181,7 @@ class DamusState: HeadlessDamusState {
|
||||
likes: EventCounter(our_pubkey: empty_pub),
|
||||
boosts: EventCounter(our_pubkey: empty_pub),
|
||||
contacts: Contacts(our_pubkey: empty_pub),
|
||||
contactCards: ContactCardManagerMock(),
|
||||
mutelist_manager: MutelistManager(user_keypair: kp),
|
||||
profiles: Profiles(ndb: .empty),
|
||||
dms: DirectMessagesModel(our_pubkey: empty_pub),
|
||||
|
||||
Reference in New Issue
Block a user