1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00
Commit Graph

47 Commits

Author SHA1 Message Date
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
William Casarin
1f5f1e28a4 nostrdb: pull latest, adding flatcc and lmdb 2023-08-25 19:05:34 -07:00
William Casarin
7f313dcbd4 nostrscript: add comment about iOS virtual memory allocs
I'm really just doing this because I forgot a changelog entry

Changelog-Fixed: Fixed nostrscript not working on smaller phones
2023-08-18 08:41:21 -07:00
William Casarin
1dabd88355 nostrscript: reduce size of wasm page allocation
smaller phones don't like this
2023-08-11 07:47:15 -07:00
William Casarin
9e6fbeefcd url: smartparens hack
support urls like (https://jb55.com/something)
2023-08-06 14:16:43 -07:00
William Casarin
53e9269da6 urls: fix wikipedia url detection with parenthesis
Fixes: f0df4aa218 ("Strip common punctuations from URLs")
Fixes: https://github.com/damus-io/damus/issues/1027
Closes: https://github.com/damus-io/damus/pull/1063
Changelog-Fixed: Fix wikipedia url detection with parenthesis
2023-08-06 13:53:28 -07:00
William Casarin
54d40f7ffd ndb: move hexchar into header
since it's used in a few places
2023-07-25 15:23:36 -07:00
William Casarin
6d43754e71 ndb: add pubkey to NdbNote 2023-07-22 17:19:47 -07:00
William Casarin
c74993366b move copyndb to the right folder 2023-07-22 17:19:47 -07:00
William Casarin
ad0e1f28b7 test: fix build and tests 2023-07-21 15:26:03 -07:00
William Casarin
dc7826c4e5 c: add nostrdb c lib 2023-07-21 15:02:01 -07:00
William Casarin
4eee715bcd c: add jsmn json parser
This is used by the nostrdb lib. Let's add it here.
This doesn't unescape things, so we'll still need to do that manually.
2023-07-21 14:56:24 -07:00
William Casarin
08bea16be0 c: add new cursor util
this is used by nostrdb as well. so add it here ahead of time.
2023-07-21 14:55:54 -07:00
William Casarin
8f04b12a90 c: add copy nostrdb devtool 2023-07-21 14:55:54 -07:00
William Casarin
9cfed9f3aa c: update protoverse_cursor to jb55_cursor
Will be using this in the new db implementation
2023-07-21 14:39:21 -07:00
William Casarin
77331644cb Fix issue with emojis next to hashtags and urls
Treat utf8 bytes next to hashtags and urls as boundary conditions

Changelog-Fixed: Fix issue with emojis next to hashtags and urls
2023-07-16 11:46:23 -07:00
William Casarin
db2ec0a00a Fix npub mention bugs, fix slowness when parsing large posts
Switch the post parser to use the same code as the content parser. This
was causing many issues, including performance issues.

Changelog-Fixed: Fix lag when creating large posts
Changelog-Fixed: Fix npub mentions failing to parse in some cases
Changelog-Added: Add r tag when mentioning a url
Changelog-Removed: Remove old @ and & hex key mentions
2023-07-11 09:15:13 -07:00
cr0bar
e83e110adb Fix to is_boundary to support non-latin characters 2023-07-11 06:39:12 -07:00
William Casarin
6ca9bda01e notes: count words in notes during artifact parsing 2023-07-10 17:39:13 -07:00
William Casarin
acb4e6d17e wasm: fix intptr warning 2023-07-10 11:14:03 -07:00
William Casarin
e957c3b703 wasm: fix clz64 warning 2023-07-10 11:14:03 -07:00
William Casarin
82fc4ff15e wasm: comment out some unnused code for now
fixes some warnings
2023-07-10 11:14:03 -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
William Casarin
30e33a01c1 nostrscript: add a helper function 2023-07-03 16:59:50 -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
William Casarin
51cd34c9c2 c: move parse_digit to remove warning 2023-05-15 09:59:10 -07:00
William Casarin
a6745af519 Implement damus zap split donations using NWC 2023-05-15 09:41:26 -07:00
Joshua Jiang
c439100a86 Fix parse mention without space in content
Changelog-Fixed: Fix parse mention without space in content
Closes: #936
Fixes: #992
2023-05-05 11:20:20 -07:00
Bartholomew Joyce
668b0a94df cleanup nostr bech32 entity parsing
Closes: #911
2023-04-15 15:04:13 -07:00
William Casarin
b30d0c01db nip19: allow empty relays in nprofile and nevent 2023-04-11 12:45:45 -07:00
Bartholomew Joyce
ea14099b62 Improved parsing of bech32 entities 2023-04-11 10:23:34 -07:00
William Casarin
cb8585e4f8 Fix naddr crash 2023-04-11 10:03:48 -07:00
William Casarin
13354b0eb5 Refactor NIP19 implementation and add tests
Closes: #837
2023-04-09 22:03:51 -07:00
Bartholomew Joyce
c6f4643b5a Add support for nostr: bech32 urls in posts and DMs (NIP19)
Changelog-Added: Add support for nostr: bech32 urls in posts and DMs (NIP19)
2023-04-09 22:03:27 -07:00
Gert Goet
f0df4aa218 Strip common punctuations from URLs
Changelog-Fixed: Fix punctuation getting included in some urls
Closes: #575
2023-02-13 10:03:35 -08:00
Gert Goet
bb9fc6f905 Always stop at first whitespace 2023-02-13 10:03:17 -08:00
William Casarin
9d2ff2fe65 Fix commas and emojis getting included in hashtags
Changelog-Fixed: Fix commands and emojis getting included in hashtags
2023-01-22 09:57:00 -08:00
Joel Klabo
13ea42a2e2 Don't Parse URL with Only Whitespace 2023-01-22 09:49:41 -08:00
William Casarin
5a956248f9 bolt11: fix bug where text not showing after invoice
Changelog-Fixed: Fix but where text was not showing after invoices
2023-01-01 11:31:36 -08:00
William Casarin
b65d9a49ff c: silence warnings 2023-01-01 10:30:40 -08:00
William Casarin
514d9f4201 bolt11: fix another crash on unknown fields 2022-12-22 16:08:44 -08:00
William Casarin
189b671108 bolt11: don't include prefix when parsing invoices 2022-12-19 22:28:58 -08:00
William Casarin
f351632440 bolt11: parse lightning prefixes on lightning invoice
Changelog-Fixed: Parse lightning prefixes on lightning invoice
2022-12-19 22:24:39 -08:00
William Casarin
9b7057de36 make url and invoice parsing case-insensitive
Signed-off-by: William Casarin <jb55@jb55.com>
2022-10-19 09:51:25 -07:00
William Casarin
c6ab1de639 Add bolt11 parser and Invoice View
Changelog-Added: Display bolt11 invoice widgets on posts
2022-10-19 07:46:05 -07:00
William Casarin
dbe1260b54 damus-c: add bolt11 parser from CLN
We'll need this for our lightning invoice view

Signed-off-by: William Casarin <jb55@jb55.com>
2022-10-19 07:45:06 -07:00
William Casarin
eb99e6c323 Rewrite note parsing in C
This eliminates any parsing choppyness

Fixes: #32
Signed-off-by: William Casarin <jb55@jb55.com>
2022-10-17 15:22:28 -07:00