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

31 Commits

Author SHA1 Message Date
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