1
0
mirror of git://jb55.com/damus synced 2024-09-19 11:43:44 +00:00
Commit Graph

2350 Commits

Author SHA1 Message Date
Terry Yiu
fcd7d2beab
Fix localization issues and export strings for translation 2023-07-09 15:33:15 -04:00
William Casarin
83ef50586a zaps/refactor: use guard instead of if block
not a fan of unncessary nesting
2023-07-09 07:44:33 -07:00
William Casarin
87992f4bb9 Add RelayLog in developer mode
Changelog-Added: Add relay log in developer mode
2023-07-09 07:41:45 -07:00
Bryan Montz
faaa3e3bd9 only show the relay log in developer mode
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-09 07:40:39 -07:00
Bryan Montz
2d9f7128ee fix crash when adding line to log from background thread
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-09 07:40:39 -07:00
Bryan Montz
51d71f11c1 replace RelayMetadatas with RelayModelCache in DamusState
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-09 07:40:39 -07:00
Bryan Montz
f619fef410 add RelayModel and RelayModelCache classes
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-09 07:40:39 -07:00
Bryan Montz
91f02ccff5 add RelayLog to the bottom of the RelayDetailView
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-09 07:40:39 -07:00
Bryan Montz
a63ea1e22b add network state changes to RelayLogs
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-09 07:40:39 -07:00
Bryan Montz
40e5e4a026 add a RelayLog to each RelayConnection and send events to it
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-09 07:40:39 -07:00
Bryan Montz
ef4aeb40e0 add RelayLog class
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-09 07:40:39 -07:00
William Casarin
13f98659a4 Prevent forged profile zap attacks
The fake note zap attack made me realize that there is a way to do fake
profile zaps using a similar technique. Since damus only checks the
first ptag if it is a profile zap, this means you could include multiple
ptags, the first one being the fake profile with the fake zapper, and
the second p tag as the real target.

This would allow a fake zapper to create a fake a zap, while the zap
notification would still appear for the second ptag because damus
listens for zap events via #p, and that would match the second ptag.

To fix this, ensure that zaps only have at most 1 ptag and 0 or 1 etag.
my CLN zapper checks this but if we don't check this here as well then
we run into fake zap issues.

Changelog-Fixed: Fix potential fake profile zap attacks
Cc: Tony Giorgio <tonygiorgio@protonmail.com>
Cc: benthecarman <benthecarman@live.com>
Cc: Vitor Pamplona <vitor@vitorpamplona.com>
2023-07-08 22:10:34 -07:00
William Casarin
f5ba909784 zaps: move pubkey check into standalone function 2023-07-08 22:09:30 -07:00
William Casarin
6031fe0847 Fix fake note zaps with forged p-tags
This fixes a zap issue where someone could send a fake zap with a zapper
that doesn't match the user's nostrPubkey zapper. This is possible
because damus looks up the zapper via the ptag on note zaps.

Fix this by first looking up the cached event's ptag instead. This
prevents zappers from trying to trick Damus into picking the wrong
zapper.

Fixes: #1357
Changelog-Fixed: Fix issue where malicious zappers can send fake zaps to another user's posts
Reported-by: benthecarman <benthecarman@live.com>
Cc: Tony Giorgio <tonygiorgio@protonmail.com>
2023-07-08 21:22:58 -07:00
William Casarin
1be2a9e1b1 ui: remove invalid zap text 2023-07-08 20:47:11 -07:00
cr0bar
4478348d10 Fix profile post button mentions
Fix for second part of issue #1352 where if you submit a reply from the
+ on a profile, it uses the hex nostr url rather than the bech32
version. When typing the @ manually it uses the bech32 so updated to
mirror this.

Changelog-Fixed: Fix profile post button mentions
Closes: #1355
2023-07-08 19:24:35 -07:00
Anthony de Broise
cf4131f867 Minor update to ConfigView.swift to fix key and search icon
Replaced icon names with names existing in assets to avoid them being left blank.

Changelog-Fixed: Fix icons on settings view
Closes: #1353
2023-07-08 08:14:26 -07:00
Bryan Montz
81b69bc2ea add explanatory footer to Developer Mode setting view
Signed-off-by: Bryan Montz <bryanmontz@me.com>
Reviewed-by: William Casarin <jb55@jb55.com>
2023-07-08 08:06:52 -07:00
William Casarin
0c736a18a9 docs: annotate might be causing issues for some people
suhail was having trouble when this option was enabled. let's remove it
just in case.
2023-07-07 09:25:33 -07:00
Bryan Montz
d2efe06610 make "Copy Note JSON" a developer mode setting
Signed-off-by: Bryan Montz <bryanmontz@me.com>
2023-07-07 09:02:52 -07:00
Bryan Montz
ebcfe3c25f add developer mode view and setting
Signed-off-by: Bryan Montz <bryanmontz@me.com>
2023-07-07 09:02:52 -07:00
William Casarin
6dfda93ff9 Fix Invalid Zap bug in reposts
Changelog-Fixed: Fix Invalid Zap bug in reposts
2023-07-04 13:48:49 -07:00
William Casarin
ea50f9214a Switch to navigation stack in BuilderEventView 2023-07-04 13:48:49 -07:00
William Casarin
6c8cf8421c zaps: make zap setting private 2023-07-04 13:47:44 -07:00
Ben Harvie
cbbe203d84 Create SECURITY.md 2023-07-04 12:45:15 -07:00
William Casarin
19217f47a4 v1.6 changelog 2023-07-04 12:21:12 -07:00
William Casarin
3451e7d88f v1.6 2023-07-04 12:18:33 -07:00
William Casarin
b5ea1e011e Revert "profile: make profile loading more lightweight for now"
Changelog-Fixed: Load more content on profile view
2023-07-04 11:51:07 -07:00
William Casarin
a04a401292 nscript: load script view
This allows you to open and run scripts for testing purposes, but only
from external links such as nostr:nscript...
2023-07-04 11:48:27 -07:00
Terry Yiu
640fbf23ea Fix UI bug with user search and fix race conditions on profiles NIP-05 cache
Signed-off-by: Terry Yiu <git@tyiu.xyz>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-04 09:09:14 -07:00
William Casarin
3d0448a929 smaller nostrscript 2023-07-03 17:10:57 -07:00
William Casarin
30e33a01c1 nostrscript: add a helper function 2023-07-03 16:59:50 -07:00
William Casarin
a6cbf50def settings: record bool option keys
so that NostrScripts know which bool settings can be set
2023-07-03 16:28:25 -07:00
prprhyt
94bd194287 Added event id validation 2023-07-03 15:03:33 -07:00
William Casarin
97f10e865f NostrScript
NostrScript is a WebAssembly implementation that interacts with Damus.
It enables dynamic scripting that can be used to power custom list views,
enabling pluggable algorithms.

The web has JavaScript, Damus has NostrScript. NostrScripts can be
written in any language that compiles to WASM.

This commit adds a WASM interpreter I've written as a mostly-single C
file for portability and embeddability. In the future we could
JIT-compile these for optimal performance if NostrScripts get large and
complicated. For now an interpreter is simple enough for algorithm list
view plugins.

Changelog-Added: Add initial NostrScript implementation
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-03 14:31:38 -07:00
Terry Yiu
0c0c58c0cc Fix bug with Trie search
Exact matches were not being returned first in the array of results

Signed-off-by: Terry Yiu <git@tyiu.xyz>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-03 13:37:52 -07:00
William Casarin
7d49d3d9f1 refactor: make guard statement a bit more readible
It's a bit confusing to guard on a negative boolean expression
2023-07-03 12:48:25 -07:00
Terry Yiu
cb1e16b1a4 Fix reports to conform to NIP-56
Changelog-Fixed: Fix reports to conform to NIP-56
Signed-off-by: Terry Yiu <git@tyiu.xyz>
Tested-by: William Casarin <jb55@jb55.com>
2023-07-03 12:25:12 -07:00
Terry Yiu
6e964f71ff Add trie-based user search cache to replace non-performant linear scans
Changelog-Added: Speed up user search
Tested-by: William Casarin <jb55@jb55.com>
Fixes: #1219
Closes: #1342
2023-07-03 12:06:01 -07:00
Terry Yiu
4b7444f338 Fix profile navigation bugs from muted users list and relay list views
Changelog-Fixed: Fix profile navigation bugs from muted users list and relay list views
Signed-off-by: Terry Yiu <git@tyiu.xyz>
Reviewed-by: William Casarin <jb55@jb55.com>
2023-07-03 08:59:28 -07:00
Terry Yiu
57159f7df9 Fix build warnings
Signed-off-by: Terry Yiu <git@tyiu.xyz>
Reviewed-by: William Casarin <jb55@jb55.com>
2023-07-03 08:50:17 -07:00
Terry Yiu
4712c6b288 Fix navigation to translation settings view
Changelog-Fixed: Fix navigation to translation settings view
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2023-07-03 08:25:04 -07:00
William Casarin
6a9b3cad20 Merge remote-tracking branch 'github/translations' 2023-07-02 13:34:04 -07:00
William Casarin
e5bd52b1f6 New paid email patch policy 2023-07-02 13:15:24 -07:00
Bryan Montz
7cd3aef157 Updated test target to deployment target of iOS 16.0
Changelog-Updated: Bumped minimum verison to iOS 16.0
Signed-off-by: Bryan Montz <bryanmontz@me.com>
2023-07-02 13:03:13 -07:00
transifex-integration[bot]
8f3d8ced90
Translate Localizable.stringsdict in es_ES
100% translated source file: 'Localizable.stringsdict'
on 'es_ES'.
2023-07-02 19:51:54 +00:00
transifex-integration[bot]
98ff4ee363
Translate Localizable.stringsdict in es_ES
100% translated source file: 'Localizable.stringsdict'
on 'es_ES'.
2023-07-02 19:51:22 +00:00
transifex-integration[bot]
ce7c4799c9
Translate Localizable.stringsdict in es_ES
100% translated source file: 'Localizable.stringsdict'
on 'es_ES'.
2023-07-02 19:50:09 +00:00
transifex-integration[bot]
11a4a85bdf
Translate Localizable.strings in es_ES
100% translated source file: 'Localizable.strings'
on 'es_ES'.
2023-07-02 19:47:59 +00:00
transifex-integration[bot]
6fe4ac1bd0
Translate Localizable.stringsdict in ja
100% translated source file: 'Localizable.stringsdict'
on 'ja'.
2023-07-02 09:13:54 +00:00