Commit Graph

44 Commits

Author SHA1 Message Date
ekzyis b2b38d8924
Images v2 (#513) 2023-10-01 18:03:52 -05:00
keyan 7b4a3c056b decrease comment depth to 8 2023-09-28 17:06:07 -05:00
keyan 4bd489a36a mutes 2023-09-28 15:02:25 -05:00
ekzyis b9461b7eb3
Allow zapping, posting and commenting without funds or an account (#336)
* Add anon zaps

* Add anon comments and posts (link, discussion, poll)

* Use payment hash instead of invoice id as proof of payment

Our invoice IDs can be enumerated.
So there is a - even though very rare - chance that an attacker could find a paid invoice which is not used yet and use it for himself.
Random payment hashes prevent this.

Also, since we delete invoices after use, using database IDs as proof of payments are not suitable.
If a user tells us an invoice ID after we deleted it, we can no longer tell if the invoice was paid or not since the LN node only knows about payment hashes but nothing about the database IDs.

* Allow pay per invoice for stackers

The modal which pops up if the stacker does not have enough sats now has two options: "fund wallet" and "pay invoice"

* Fix onSuccess called twice

For some reason, when calling `showModal`, `useMemo` in modal.js and the code for the modal component (here: <Invoice>) is called twice.

This leads to the `onSuccess` callback being called twice and one failing since the first one deletes the invoice.

* Keep invoice modal open if focus is lost

* Skip anon user during trust calculation

* Add error handling

* Skip 'invoice not found' errors

* Remove duplicate insufficient funds handling

* Fix insufficient funds error detection

* Fix invoice amount for comments

* Allow pay per invoice for bounty and job posts

* Also strike on payment after short press

* Fix unexpected token 'export'

* Fix eslint

* Remove unused id param

* Fix comment copy-paste error

* Rename to useInvoiceable

* Fix unexpected token 'export'

* Fix onConfirmation called at every render

* Add invoice HMAC

This prevents entities which know the invoice hash (like all LN nodes on the payment path) from using the invoice hash on SN.

Only the user which created the invoice knows the HMAC and thus can use the invoice hash.

* make anon posting less hidden, add anon info button explainer

* Fix anon users can't zap other anon users

* Always show repeat and contacts on action error

* Keep track of modal stack

* give anon an icon

* add generic date pivot helper

* make anon user's invoices expire in 5 minutes

* fix forgotten find and replace

* use datePivot more places

* add sat amounts to invoices

* reduce anon invoice expiration to 3 minutes

* don't abbreviate

* Fix [object Object] as error message

Any errors thrown here are already objects of shape { message: string }

* Fix empty invoice creation attempts

I stumbled across this while checking if anons can edit their items.

I monkey patched the code to make it possible (so they can see the 'edit' button) and tried to edit an item but I got this error:

  Variable "$amount" of required type "Int!" was not provided.

I fixed this even though this function should never be called without an amount anyway. It will return a sane error in that case now.

* anon func mods, e.g. inv limits

* anon tips should be denormalized

* remove redundant meTotalSats

* correct overlay zap text for anon

* exclude anon from trust graph before algo runs

* remove balance limit on anon

* give anon a bio and remove cowboy hat/top stackers;

* make anon hat appear on profile

* concat hash and hmac and call it a token

* Fix localStorage cleared because error were swallowed

* fix qr layout shift

* restyle fund error modal

* Catch invoice errors in fund error modal

* invoice check backoff

* anon info typo

* make invoice expiration times have saner defaults

* add comma to anon info

* use builtin copy input label

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-11 18:50:57 -05:00
keyan 8ab018af88 fix nested comment sorting 2023-07-25 19:45:35 -05:00
keyan 59f7b6ff26 Revert "Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades""
This reverts commit 18910fa2ed.
2023-07-23 10:08:43 -05:00
keyan 18910fa2ed Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades"
This reverts commit d0314ab73c.
2023-07-23 09:16:12 -05:00
keyan d0314ab73c shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades 2023-07-21 17:33:11 -05:00
keyan 369bd82a84 make freebie comments visible case by case 2023-06-03 20:01:50 -05:00
ekzyis 0c251ca376
Add thread subscriptions (#293)
* Add thread subscriptions

* remove dead code: reply only notifications

* break out thread subscription queries to reduce search space

* one db dip for item lists/threads re:meSubscription

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-05-31 19:44:06 -05:00
keyan 347a6a54d2 improve comment performance 2023-05-06 16:51:17 -05:00
keyan b406f0c340 avoid db dip for sub 2023-05-05 12:39:57 -05:00
keyan abd9555792 fix recent comments 2023-05-04 19:20:48 -05:00
keyan 4be5286122 hide cowboy hat setting 2023-05-01 16:52:02 -05:00
keyan a241d683d8 nostr sub 2023-05-01 15:58:30 -05:00
keyan 0c2b9a31b2 ots timestamp link on comments 2023-02-24 10:02:20 -06:00
ekzyis 7b838cdeb2
Implement bookmarking of posts and comments (#235) 2023-02-16 16:23:59 -06:00
keyan 072e60c954 streaks 2023-02-01 17:40:49 -06:00
Austin Kelsay e13e37744e
stackernews bounties (#227)
bounties
2023-01-26 10:11:55 -06:00
keyan 10ff3fa1c3 delete 2023-01-13 11:52:18 -06:00
keyan 6c9f4f1c3a for top users constrain other stats 2022-10-26 09:56:22 -05:00
keyan a398784f26 improved top 2022-10-25 16:35:32 -05:00
keyan d9d426e5c3 add freebies 2022-09-27 16:19:15 -05:00
keyan 2c7c237fc7 show when items are outlawed 2022-09-22 13:44:50 -05:00
keyan 7faae425b3 wild west mode 2022-09-21 14:57:36 -05:00
keyan 0f5fc31803 show comment sats on hover 2022-09-02 08:19:25 -05:00
keyan f65f6c1b28 remove meComments and clean up sats title 2022-09-01 16:20:20 -05:00
keyan 388c7d0240 full powered editing 2022-08-18 13:15:24 -05:00
keyan cef8a33267 limit displayed comment depth 2022-05-17 17:09:15 -05:00
keyan 89fb68f746 multiple comments with the same parent are exp in cost 2022-04-17 08:13:52 -05:00
keyan 5d49ecc536 refine tipping experience, removing notion of upvote from UX 2022-01-20 17:04:12 -06:00
keyan 8e5327022d WIP top comments and users 2021-12-16 17:05:31 -06:00
keyan 1a3fdda382 new bolt 2021-12-05 11:37:55 -06:00
keyan 996d0a9352 click to comment goes to root thread 2021-11-27 12:01:02 -06:00
keyan da4c65aeba OP indicator 2021-10-27 13:26:34 -05:00
keyan 07b9da353b smarter use of SSR and caching 2021-10-26 15:49:37 -05:00
keyan 2dd49171e2 complete tips 2021-09-10 16:13:52 -05:00
keyan b4be2c613b comment edit spagetti 2021-08-10 17:59:06 -05:00
keyan 68e80b615c working previews 2021-07-07 19:15:27 -05:00
keyan 01922e4b88 notifications done 2021-06-24 18:56:01 -05:00
keyan d4d1169058 small ui stuff 2021-05-05 13:13:14 -05:00
keyan 84b69fc481 ranking mostly 2021-04-27 16:30:58 -05:00
keyan c626998952 attempts at voting before running into cache issues 2021-04-26 16:55:15 -05:00
keyan ec3f6b922d a bunch of new stuff 2021-04-22 17:14:32 -05:00