1
0
mirror of git://jb55.com/damus synced 2024-09-05 21:03:51 +00:00
Commit Graph

2714 Commits

Author SHA1 Message Date
William Casarin
fc9b9f2940 ndb: switch profile queries to use transactions
this should ensure no crashing occurs when querying profiles
2023-09-21 09:10:06 -04:00
William Casarin
622a436589 ndb: add NdbTxn transaction class
This will be used for transactions
2023-09-21 09:10:06 -04:00
William Casarin
9398877415 nostrdb/c: update to include transaction support 2023-09-21 09:10:06 -04:00
William Casarin
129d3ff101 ids: introduce NoteKey
These will be used to reference nostr notes from nostrdb
2023-09-21 09:10:06 -04:00
William Casarin
bb4fd75576 nostrdb: add profiles to nostrdb
This adds profiles to nostrdb

- Remove in-memory Profiles caches, nostrdb is as fast as an in-memory cache
- Remove ProfileDatabase and just use nostrdb directly

Changelog-Changed: Use nostrdb for profiles
2023-09-21 09:10:06 -04:00
Daniel D’Aquino
8586eed635 ui: add followed hashtags to FollowingView
When users view who a certain person follows, now they will see an extra
tab to see the hashtags that they follow.

This new tab contains a list of followed hashtags, each of which
includes an option to follow/unfollow the hashtag, as well as the
ability to visit the hashtag timeline

Testing

**iOS:** 17.0 (iPhone 14 Pro Simulator)
**Damus:** (This commit)
**Test steps:**
1. Go to search view, search for a couple of hashtags: #apple, #orange, #kiwi
2. Go to the test accounts own profile via the drawer menu
3. Click on "Following". Make sure there are two tabs now.
4. Scroll down, switch tabs between "People" and "Hashtags". Make sure that scrolling and switching tabs work
5. Unfollow and follow a user. Make sure that this still works
6. Make sure that #apple, #orange, #kiwi hashtags are visible under the "Hashtags" tab
7. Unfollow "#kiwi". Check that the button label now switches from "Unfollow" to "Follow"
8. Click on "#kiwi". Make sure that it takes you to the page where posts with that hashtag appears
9. Go to @jb55's profile
10. Click on "Following"
11. Ensure that there is a "Hashtags" tab
12. Check that @jb55's followed hashtags are shown (not your own)
13. Follow one of the same hashtags as @jb55's
14. Go back to your own profile and go to your own following view again.
15. Make sure that this newly added tag is present on the list, and that #kiwi is not.

Closes: https://github.com/damus-io/damus/issues/606
Changelog-Added: Add followed hashtags to your following list
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-21 09:10:06 -04:00
William Casarin
440e37c1d3 filters: generalize ContentFilter
This simplifies our content filters so that it is a bit more flexible
for future additions.

Fixes: 0957cc896cc8 ("Add "Do not show #nsfw tagged posts" setting")
2023-09-21 09:10:06 -04:00
Daniel D’Aquino
49283f2bb2 filters: add "Do not show #nsfw tagged posts" setting
This commit adds a setting where the user can choose to hide notes with
a #nsfw hashtag. This setting was implemented to allow users to filter
out adult or other unsafe content.

I moved the code logic for content filtering into a new file, and
defined a protocol for content filters. Although the logic is still
simple, this might help in developing a flexible API in case we have
more complex filtering needs in the future.

I also modified the name of the "Appearance" setting to "Appearance and
filters", to make it easier for users to intuitively find this setting.
(Note: Re-translations of this string might be necessary)

**PASS**
**iOS:**
- iOS 17.0 (iPhone 14 Pro)

**Damus:** (This commit)
**Steps:**
1. Follow another account that you control (Account B)
2. On account B, post a note saying "#test this is a test". This note should show up on the home feed.
3. On account B, post a note saying "#nsfw this is a test". This note should NOT show up on the home feed
4. Go to settings and disable the NSFW filter. Go back to the home view. The #nsfw post should now show up.
5. Close app and reopen. NSFW post should still show up (i.e. Setting should be persistent)
6. Unfollow account B
7. Close app and reopen.
8. Follow the "#grownostr" hashtag
9. Turn on the NSFW filter
10. On account B, post a note saying "#grownostr this is a test". This note should show up on the home view.
11. On account B, post a note saying "#grownostr #nsfw this is a test". This note should NOT show up.
12. Double-check the "notes and replies" tab. Note should NOT show up there either.
12. Turn off NSFW filter
13. Note from step 11 should now show up.
14. Go to Universe view and find a post with a hashtag. Remember where the post is.
14. Locally change the tag keyword from "nsfw" to that hashtag (Note: I had to test this way because my posts were not showing up in the Universe view)
15. Turn off the filter. Check post is there, in the Universe view.
16. Turn on the filter. Check post is no longer there in the Universe view. (Check the neighboring posts are the same, to make sure)
17. Bring back the code to its normal state.
18. Search for "#nsfw". Make sure that #nsfw appears (I believe this is ok, because it means the person is purposefully searching for it)

Closes: https://github.com/damus-io/damus/issues/1412
Changelog-Added: Add "Do not show #nsfw tagged posts" setting
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-21 09:10:06 -04:00
William Casarin
305ee03b0e relays: fix tld extraction performance issues
This uses a simpler variant that doesn't require a library. It is also
much faster and doesn't cause a delay when you open the relay view.

Not sure why I needed to touch other parts of the code to make the build
work. Probably xcode beta thing?
2023-09-21 09:10:06 -04:00
William Casarin
a88f5db10b Revert "deps: add tldextract"
This reverts commit 4263b9690f.
2023-09-21 08:48:20 -04:00
Suhail Saqan
d39a3da3b7 util: add separate_images and separate_invoices 2023-09-21 08:37:42 -04:00
ericholguin
40459e247e relays: user relay design 2023-09-16 14:15:27 -05:00
ericholguin
fff4549933 relays: remove usage of show action button binding 2023-09-16 14:15:27 -05:00
ericholguin
c4dfae9ede relays: update relay view to use new design
Changelog-Changed: Updated relay view
Closes: https://github.com/damus-io/damus/pull/1543
2023-09-16 14:15:27 -05:00
Daniel D’Aquino
bfda0d1b74 ui: increase size of the hitbox on note ellipsis button
Changelog-Changed: Increase size of the hitbox on note ellipsis button
Closes: https://github.com/damus-io/damus/issues/1454
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-16 14:15:20 -05:00
Daniel D’Aquino
01b8e43a6e compose: fix text wrapping issue when mentioning npub
Closes: https://github.com/damus-io/damus/issues/1211
Changelog-Fixed: Fix text composer wrapping issue when mentioning npub
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-16 13:58:27 -05:00
Jon Marrs
aa4ecc2139 test: add test cases for ASCII and UTF-8 characters in hashtags
Closes: https://github.com/damus-io/damus/pull/1546
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-15 12:31:17 -05:00
Jon Marrs
617dee3e6b damus-c: remove UTF-8 punctuation from hashtags
Check for UTF-8 punctuation (such as ellipsis) in addition to regular punctuation in hashtags.

Closes: https://github.com/damus-io/damus/issues/1518

Closes: https://github.com/damus-io/damus/pull/1546
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-15 12:31:17 -05:00
Daniel D’Aquino
510432bb98 ui: make blurred videos viewable by allowing blur to disappear once tapped
Closes: https://github.com/damus-io/damus/issues/1247
Changelog-Fixed: Make blurred videos viewable by allowing blur to disappear once tapped
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-15 12:31:05 -05:00
Jericho Hasselbush
c4a9f2fdb2 ui: hold tap to preview status URL
Applied a WKWebkitView inside a .contextMenu to show preview status for
URL links in user status messages.

Closes: https://github.com/damus-io/damus/issues/1523
Changelog-Added: Hold tap to preview status URL
Signed-off-by: Jericho Hasselbush <jericho@sal-et-lucem.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-15 12:30:26 -05:00
Daniel D’Aquino
b1e0a62109 nwc: fix parsing issue with NIP-47 compliant NWC urls without double-slashes
Closes: https://github.com/damus-io/damus/issues/1547
Changelog-Fixed: Fix parsing issue with NIP-47 compliant NWC urls without double-slashes
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-13 12:59:21 -06:00
William Casarin
1fc5ceff3b relays: fix withAnimation on older versions
Maybe this is an iOS17 thing?
2023-09-13 05:41:08 -07:00
William Casarin
16edc3fe13 relays: bouncy edit animation 2023-09-11 14:39:44 -07:00
William Casarin
6a88ca2777 relays: fix crash in new RelayPicView 2023-09-11 14:36:08 -07:00
William Casarin
e3ccf95780 ui: fix padding of username next to pfp on some views
Changelog-Fixed: Fix padding of username next to pfp on some views
2023-09-11 14:36:08 -07:00
Bryan Montz
9bac83352b ui: improve bottom spacing for ImageView's tab indicator dots
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-11 14:36:08 -07:00
Bryan Montz
0803594553 ui: make ImageView's tab indicator dots tappable
Changelog-Changed: Make carousel tab dots tappable
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-11 14:35:50 -07:00
Jericho Hasselbush
8dad8e6703 posting: fix issue with username and multiple emojis
Fixes issue where username with multiple emojis would place cursor in
strange position. Now properly moves the cursor to space past the
multiple emoji user name.

Any amount would be great. Not a complex issue to fix!

Tipjar: lnbc1pj0eddtpp5km07jgrfm47nfswqqp33ngv374gzad2hshkra7zm3l0cmpusnp3qdqqcqzzsxqyz5vqsp5rklkzj9upf32z3c3nmc9xg4pdlz5p5mp3s332ygefexf79tq8ucs9qyyssqxfh4kz3sg9zczsnj49w23aw35z87jwyx9m5su8kkyxlspyjk4ajy7vhxuw2rzw4lz8vfutfakm2rggvpzhzs9ehfus4nl683dl99f4sqgm9zkq
Changelog-Fixed: Fixes issue where username with multiple emojis would place cursor in strange position.
Signed-off-by: Jericho Hasselbush <jericho@sal-et-lucem.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-11 07:48:36 -07:00
William Casarin
e30d38e69f router: use tap gestures instead of nav links
I was hoping this would fix something but it did not
2023-09-10 18:27:37 -07:00
William Casarin
c13f29e98c router: hash bytes for a quick sanity check
probably a no-op
2023-09-10 18:27:37 -07:00
William Casarin
5b901656f3 perf: fix weird lag when switching timelines 2023-09-10 18:25:35 -07:00
William Casarin
36acdf420e perf: remove zstack on profile pictures
helps a bit? I think?
2023-09-10 18:25:35 -07:00
William Casarin
76a6dbc406 perf: remove unused zstack on like button 2023-09-10 18:25:35 -07:00
William Casarin
1b1d4bd6d1 perf: use plain images for actionbar buttons
The action bar is really slow to render for some reason, start
removing stuff
2023-09-10 18:25:35 -07:00
William Casarin
14586b616c log: remove some verbose preload logs 2023-09-10 18:25:35 -07:00
ericholguin
7baf7e66dc relays: add relay pic view for displaying relay icons 2023-09-10 09:54:35 -07:00
William Casarin
4263b9690f deps: add tldextract
This is needed for the new relay view
2023-09-10 09:52:54 -07:00
Suhail Saqan
7f6a702412 emojis: make width dynamic and font bigger
add calculateOverlayWidth to support this

Closes: https://github.com/damus-io/damus/pull/1542
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-09 10:24:14 -07:00
ericholguin
6f35de65f9 relays: add icon field to metadata 2023-09-09 09:48:18 -07:00
ericholguin
65f3651896 ui: dont display globe image for free relay types 2023-09-09 09:45:45 -07:00
ericholguin
94ce604b9d components: add neutral button style component 2023-09-09 09:45:16 -07:00
ericholguin
b934d66f64 components: add lighter gradient 2023-09-09 09:45:16 -07:00
ericholguin
20b6627799 colors: add variables for the new color assets 2023-09-09 09:45:16 -07:00
ericholguin
3e15f15a57 colors: add color sets from figma 2023-09-09 09:45:15 -07:00
petrikaj
5c87b8e610 transations: add finnish translation
Changelog-Added: Finnish translations
Closes: https://github.com/damus-io/damus/pull/1535
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-07 10:33:37 -07:00
William Casarin
42234b1cf3 remove timeline render logs 2023-09-07 10:33:37 -07:00
Bryan Montz
54ba64535d video: remove GSPlayer dependency
Changelog-Fixed: Fixed audio in video playing twice
Closes: https://github.com/damus-io/damus/pull/1539
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-07 10:33:34 -07:00
Bryan Montz
9cf53a9e93 video: remove VideoPlayer and switch to VideoController for cache
Closes: https://github.com/damus-io/damus/pull/1539
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-07 10:33:31 -07:00
Bryan Montz
3569da5687 video: switch player to use new view model
pass VideoController through containing views

Closes: https://github.com/damus-io/damus/pull/1539
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-07 10:33:19 -07:00
Bryan Montz
f1f3abfb98 video: add DamusVideoPlayerViewModel
Closes: https://github.com/damus-io/damus/pull/1539
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-07 10:33:14 -07:00