509 Commits

Author SHA1 Message Date
ekzyis
f523c9b55d Refactor avatar upload control flow 2023-11-02 01:48:34 +01:00
ekzyis
619461c15d Update upload limits 2023-11-02 01:48:34 +01:00
ekzyis
fe267cd3b9 Calculate image fee info in postgres function
* we now calculate image fee info in a postgres function which is much cleaner
* we use this function inside `create_item` and `update_item`: image fees are now deducted in the same transaction as creating/updating the item!
* reversed changes in `serializeInvoiceable`
2023-11-02 01:48:34 +01:00
ekzyis
6b840258c0 Fix NULL returned for size24h, sizeNow 2023-11-02 01:48:34 +01:00
ekzyis
30a413e494 Fix multiplication with feesPerImage 2023-11-02 01:48:34 +01:00
ekzyis
d8511ba6d2 Fix bad image fee return statements 2023-11-02 01:48:34 +01:00
ekzyis
cb56ee8b58 Fix free upload quota 2023-11-02 01:48:34 +01:00
ekzyis
fe7d78038b Add schedule to delete unused images 2023-11-02 01:48:34 +01:00
ekzyis
b71f320b59 Fix fees in sats deducted from msats 2023-11-02 01:48:34 +01:00
ekzyis
28bde328fc Show amount of unpaid images in receipt 2023-11-02 01:48:34 +01:00
ekzyis
221dd5bb1d Show image fees in frontend 2023-11-02 01:48:34 +01:00
ekzyis
1af6a5c98d Remove unnecessary avatar check during image fees calculation 2023-11-02 01:48:34 +01:00
ekzyis
e7175fbe87 Use megabytes in error message 2023-11-02 01:48:34 +01:00
ekzyis
78c756a42c Add comments regarding avatar upload 2023-11-02 01:48:34 +01:00
ekzyis
726f10c396 Allow anons to get presigned URLs 2023-11-02 01:48:34 +01:00
ekzyis
ed3a681950 Add image fees during item creation/update
* we calculate image fees during item creation and update now
* function imageFees returns queries which deduct fees from user and mark images as paid + fees
* queries need to be run inside same transaction as item creation/update
2023-11-02 01:48:34 +01:00
ekzyis
30aed4e805 Use Github style upload
* removed upfront fees
* removed images provider since we no longer need to keep track of unsubmitted images on the client
* removed User.images resolver
* removed deleteImage mutation
* use Github style upload where it shows ![Uploading <filename>...]() first and then replaces that with ![<filename>](<url>) after successful upload
2023-11-02 01:48:34 +01:00
ekzyis
167a4189ca Add fees for presigned URLs 2023-11-02 01:48:34 +01:00
ekzyis
eb4700070f Overwrite old avatar 2023-11-02 01:48:34 +01:00
ekzyis
51bc4b82d0 Also delete objects in S3 2023-11-02 01:48:34 +01:00
ekzyis
a61d00ba8b Fetch unsubmitted images from database 2023-11-02 01:48:34 +01:00
ekzyis
64cf40a04c
Additionally compare user ids during bookmark privacy check (#587)
Co-authored-by: ekzyis <ek@stacker.news>
2023-10-25 13:04:13 -05:00
keyan
a0216788b4 remove debug log message 2023-10-24 14:10:54 -05:00
keyan
a85af82460 make rewards query less aggressive 2023-10-23 19:46:51 -05:00
keyan
d2697477a0 saner lastSeenAt checking 2023-10-23 18:19:36 -05:00
keyan
53a8af8d20 improve delete bot ux 2023-10-23 17:55:48 -05:00
keyan
67ec82b6d9 disambiguate preimage after payment from hold preimage 2023-10-23 16:44:09 -05:00
keyan
3160a3f66f prevent redoing queries for notifications 2023-10-22 17:51:07 -05:00
keyan
f9f13cc752 update checkedNotesAt when there are none 2023-10-22 17:38:24 -05:00
keyan
1a33c8778b hasnewnotes query cleanup 2023-10-22 12:47:46 -05:00
keyan
4d7d4c28f9 user new create_item and remove double check for replies 2023-10-22 12:19:11 -05:00
SatsAllDay
1d394bebe1
Ephemeral item support (#570)
backend impl and some of the UI for ephemeral item support

more to come, this is just a WIP so far

Consolidate client-side ephemeral fee logic in FeeButton components for easier reuse

* update the update_item function to handle the case where an item was not
ephemeral, but now is, so we charge the user accordingly

* introduce `hasDeleteCommand` for a better logical abstraction for some use cases in the code

* introduce `EPHEMERAL_FEE_SATS` which is derived from `EPHEMERAL_FEE_MSATS`, so we don't
have to the same calculation over and over

Remove fees for ephemeral items

* remove unused markdownField prop in FeeButton

* remove empty migration

minor code cleanup

Centralize delete item by author code to reduce duplication
2023-10-22 11:02:58 -05:00
rleed
e713387920
migrate to ThreadSubscription model and enable self-unsubscribe (#569)
Co-authored-by: rleed <rleed1@pm.me>
2023-10-22 11:00:23 -05:00
rleed
92c5303d81
Add optional text input for link posts (#558)
* add link comment functionality

* handle anon case

* revise info text

* simplify by using item.text

* remove hint

* cleanup

---------

Co-authored-by: rleed <rleed1@pm.me>
2023-10-22 10:55:50 -05:00
SatsAllDay
56111efd6a
SN wallet transaction details (#550)
* display bolt11 info and preimage for invoices

* Remove preimage attempt for wdrwl, since it doesn't make sense

Other various code cleanup

* Only include preimage for confirmed paid and settled invoices
2023-10-20 19:25:22 -05:00
rleed
72b8b5b634
Attempt to get publication year when auto-titling links (#520)
* port date scraper from python

* bug fixes and cleanup

* bug fixes and cleanup

* refactor

* address comments

* make it intuitive

* Update timedate-scraper.js - lint

* address review comments

* cleanup

* simplfy and don't use side effects

---------

Co-authored-by: rleed <rleed1@pm.me>
2023-10-20 19:23:50 -05:00
ekzyis
dd36155b04
Fix duplicate push notifications on item edit if mentioned (#563)
* Refactor service worker event listeners into own file

* Refactor service worker onPush listener

* Only show one MENTION push notification per item

* Update index.js to have newline

---------

Co-authored-by: ekzyis <ek@ekzyis.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-10-20 19:21:44 -05:00
rleed
c1c1240eab
Add a setting for Default Withdrawal max fee (#552)
* add setting for default withdrawal max fee

* Update pages/settings.js

Co-authored-by: ekzyis <27162016+ekzyis@users.noreply.github.com>

* remove extraneous fallback of 21

---------

Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: ekzyis <27162016+ekzyis@users.noreply.github.com>
2023-10-20 19:09:41 -05:00
Keyan
ca9b60b0fb
Merge pull request #564 from SatsAllDay/ignore-own-comments-new-notes-thread-subscribe
hasNewNotes for your own comments in subscribed threads
2023-10-20 19:06:55 -05:00
Keyan
8bbd480ca3
Merge branch 'master' into fix-magic-numbers-in-update-item 2023-10-20 19:04:27 -05:00
keyan
d73d3fda74 personal wot 2023-10-19 18:45:07 -05:00
Satoshi Nakamoto
a6d3ca09e9 Don't include your own comments when determining if there are new thread
subscription replies for user hasNewNotes
2023-10-13 20:23:57 -04:00
ekzyis
dcfcbfb0ad Refactor typeof check with isJob function 2023-10-13 22:37:41 +02:00
ekzyis
78745379aa Fix magic numbers in item update logic 2023-10-13 22:27:27 +02:00
Satoshi Nakamoto
0b8316d08c Don't create mentions when mentioning yourself
By extension, also don't send yourself a push notification when
mentioning yourself
2023-10-11 16:07:48 -04:00
Satoshi Nakamoto
e9c0c06779 Various LUD-18 fixes
* Debounce the `onAddrChange` event handler when sending to a LN Address,
so we more accurately display the input form for LUD-12 and LUD-18 options

* Remove explicit URI encoding of Payer Data when sending to a LN Addr, since we're getting encoding for free via URLSearchParams

* Append `@stacker.news` to identifier values sent in payer data

* Don't do extra decoding when receiving LUD-18 data
2023-10-05 10:27:01 -04:00
keyan
c77d761ab6 Merge branch 'fix' 2023-10-04 19:35:09 -05:00
keyan
0767b23d80 remove payer data encoding before going to db 2023-10-04 19:34:32 -05:00
ekzyis
425220d8cb
More push notification types (#530)
* Add push notifications for referrals

* Add push notifications for daily rewards

* Add push notifications for deposits

* Add push notifications for earning cowboy hats

* Use streak id to synchronize blurb

* Fix usage of magic number for blurbs

* Fix missing catch

* Add push notification for losing cowboy hats

* Fix null in deposit push notification

* Add push notification for invites

* Don't replace streak push notifications

* Fix missing unit in daily reward push notification title

* Attach sats to payload options instead of parsing title

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-10-04 18:20:52 -05:00
SatsAllDay
502bfee072
Mention auto-complete (#532)
* uber rough first pass at mention autocompletes

* support custom limit on topUsers query

* hot keys for selecting user suggestion in markdown input

* query top stackers for mentions with no search query

* refactor UserSuggestion to help with reusability

textarea-caret for placing the user suggest dropdown appropriately

other various code cleanup items to make it easier to use

off by one errors are fun!

various code cleanup and reuse the UserSuggest component in InputUserSuggest to reduce duplication

* change default users to week query

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-10-04 15:10:56 -05:00