refactor: add Pubkey, Privkey, NoteId string aliases

This is a non-behavioral change in preparation for the actual switchover
from Strings to Ids. The purpose of this kit is to reduce the size of
the switchover commit which is going to be very large.
This commit is contained in:
William Casarin
2023-07-31 03:57:26 -07:00
parent f9d21ef901
commit 7040235605
101 changed files with 427 additions and 426 deletions

View File

@@ -9,9 +9,9 @@ import SwiftUI
struct SearchedUser: Identifiable {
let profile: Profile?
let pubkey: String
var id: String {
let pubkey: Pubkey
var id: Pubkey {
return pubkey
}
}
@@ -151,7 +151,7 @@ func append_user_tag(tag: NSAttributedString, post: NSMutableAttributedString, w
}
/// Generate a mention attributed string, including the internal damus:nostr: link
func user_tag_attr_string(profile: Profile?, pubkey: String) -> NSMutableAttributedString {
func user_tag_attr_string(profile: Profile?, pubkey: Pubkey) -> NSMutableAttributedString {
let display_name = Profile.displayName(profile: profile, pubkey: pubkey)
let name = display_name.username.truncate(maxLength: 50)
let tagString = "@\(name)"