damus/c: fix a few warnings

This commit is contained in:
William Casarin
2023-12-04 13:25:02 -08:00
parent 4bf8a68c9c
commit e40d5b3e83
3 changed files with 6 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -86,7 +86,7 @@ class SuggestedUsersViewModel: ObservableObject {
}
switch nev {
case .event(let sub_id, let ev):
case .event:
break
case .notice(let msg):

View File

@@ -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)