damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit e40d5b3e83cb5dd410fe01d3720c32bd651fc064
parent 4bf8a68c9c13e4af3548a55e7f40a92476a13d4e
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  4 Dec 2023 13:25:02 -0800

damus/c: fix a few warnings

Diffstat:
Mdamus-c/damus.c | 9++++-----
Mdamus/Views/Onboarding/SuggestedUsersViewModel.swift | 2+-
Mdamus/Views/Profile/ProfilePicView.swift | 2+-
3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/damus-c/damus.c b/damus-c/damus.c @@ -172,7 +172,6 @@ static int parse_url(struct cursor *cur, struct note_block *block) { u8 *host; int host_len; struct cursor path_cur; - struct nostr_bech32 bech32; if (!parse_str(cur, "http")) return 0; @@ -198,7 +197,7 @@ static int parse_url(struct cursor *cur, struct note_block *block) { } // get the length of the host string - host_len = cur->p - host; + host_len = (int)(cur->p - host); // save the current parse state so that we can continue from here when // parsing the bech32 in the damus.io link if we have it @@ -228,14 +227,14 @@ static int parse_url(struct cursor *cur, struct note_block *block) { } // save the bech32 string pos in case we hit a damus.io link - block->block.str.start = path_cur.p; + block->block.str.start = (const char *)path_cur.p; // if we have a damus link, make it a mention if (host_len == 8 - && !strncmp(host, "damus.io", 8) + && !strncmp((const char *)host, "damus.io", 8) && parse_nostr_bech32(&path_cur, &block->block.mention_bech32.bech32)) { - block->block.str.end = path_cur.p; + block->block.str.end = (const char *)path_cur.p; block->type = BLOCK_MENTION_BECH32; return 1; } diff --git a/damus/Views/Onboarding/SuggestedUsersViewModel.swift b/damus/Views/Onboarding/SuggestedUsersViewModel.swift @@ -86,7 +86,7 @@ class SuggestedUsersViewModel: ObservableObject { } switch nev { - case .event(let sub_id, let ev): + case .event: break case .notice(let msg): diff --git a/damus/Views/Profile/ProfilePicView.swift b/damus/Views/Profile/ProfilePicView.swift @@ -135,7 +135,7 @@ func get_profile_url(picture: String?, pubkey: Pubkey, profiles: Profiles) -> UR func make_preview_profiles(_ pubkey: Pubkey) -> Profiles { let profiles = Profiles(ndb: test_damus_state.ndb) - let picture = "http://cdn.jb55.com/img/red-me.jpg" + //let picture = "http://cdn.jb55.com/img/red-me.jpg" //let profile = Profile(name: "jb55", display_name: "William Casarin", about: "It's me", picture: picture, banner: "", website: "https://jb55.com", lud06: nil, lud16: nil, nip05: "jb55.com", damus_donation: nil) //let ts_profile = TimestampedProfile(profile: profile, timestamp: 0, event: test_note) //profiles.add(id: pubkey, profile: ts_profile)