1
0
mirror of git://jb55.com/damus synced 2024-09-29 08:20:45 +00:00
Commit Graph

3248 Commits

Author SHA1 Message Date
Daniel D’Aquino
d694c26b83 iap: move StoreKit logic out of DamusPurpleView and into a new PurpleStoreKitManager
This commit moves most of StoreKit-specific logic that was embedded into
DamusPurpleView and places it into a new PurpleStoreKitManager struct,
to make code more reusable and readable by separating view concerns from
StoreKit-specific concerns.

Most of the code here should be in feature parity with the previous
behavior. However, a few logical improvements were made alongside this
refactoring:

- Improved StoreKit transaction update monitoring logic: Previously the
  view would stop listening for purchase updates after the first update.
  However, I made the program continuously listen for purchase updates,
  as recommended by Apple's documentation
  (https://developer.apple.com/documentation/storekit/transaction/3851206-updates)

- Improved/simplified logic around getting extra information from the
  products: Information and the handling of product information was
  spread in a few separate places. I incorporated those bits of
  information into central and uniform interfaces on DamusPurpleType, to
  simplify logic and future changes.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 10:38:43 -08:00
Daniel D’Aquino
2525799c8a refactor: split views from DamusPurpleView into separate files
This refactoring commit splits several view blocks from DamusPurpleView
into separate files.

- New view structs were defined within the DamusPurpleView namespace, to
  avoid polluting the global namespace

- No logical changes were made. The functionality should have stayed
  equivalent

- Changes were made conservatively, and as semantically as possible, to
  make the code easier to work with.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 10:38:21 -08:00
Daniel D’Aquino
b3b6fdc29e refactor: move primitive views from DamusPurpleView into a separate file
This refactoring commit moves primitive, low complexity, helper views
from DamusPurpleView into a separate file, to reduce complexity on
DamusPurpleView.swift.

Although functions were changed into View structs, no logical changes
were made. (New version is functionally equivalent)

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 10:38:13 -08:00
Daniel D’Aquino
1a131cd179 refactor: re-order items in DamusPurpleView
This is a purely non-functional refactor of DamusPurpleView consisting
only of code mark section comments, and re-ordering for better
organization and to facilitate further refactoring.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-19 10:37:55 -08:00
transifex-integration[bot]
adb6f66a4f
Translate Localizable.strings in zh_TW
100% translated source file: 'Localizable.strings'
on 'zh_TW'.
2024-02-13 07:39:33 +00:00
transifex-integration[bot]
a5f438b9c7
Translate Localizable.strings in zh_HK
100% translated source file: 'Localizable.strings'
on 'zh_HK'.
2024-02-13 07:34:28 +00:00
transifex-integration[bot]
d7f04d9ab9
Translate Localizable.strings in zh_HK
100% translated source file: 'Localizable.strings'
on 'zh_HK'.
2024-02-13 07:34:05 +00:00
transifex-integration[bot]
0b2ea46ef4
Translate Localizable.strings in zh_HK
100% translated source file: 'Localizable.strings'
on 'zh_HK'.
2024-02-13 07:29:25 +00:00
transifex-integration[bot]
331ed96d57
Translate Localizable.strings in zh_CN
100% translated source file: 'Localizable.strings'
on 'zh_CN'.
2024-02-13 07:29:00 +00:00
transifex-integration[bot]
701a747ed6
Translate Localizable.strings in cs
100% translated source file: 'Localizable.strings'
on 'cs'.
2024-02-12 06:16:42 +00:00
William Casarin
ab529c43eb profile: fix bug where profile does not update
Changelog-Fixed: Fix profile not updating bug
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-11 09:05:41 -08:00
William Casarin
b486d5e102 add some more close guards
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-11 08:52:29 -08:00
William Casarin
881dae0954 v1.7 (10)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-11 08:52:03 -08:00
transifex-integration[bot]
118c2bf2b2
Translate Localizable.stringsdict in cs
100% translated source file: 'Localizable.stringsdict'
on 'cs'.
2024-02-09 19:28:54 +00:00
transifex-integration[bot]
7a4f82c97b
Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2024-02-09 17:59:18 +00:00
transifex-integration[bot]
d1e3a06cc6
Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2024-02-09 17:58:50 +00:00
transifex-integration[bot]
b9d960b54b
Translate InfoPlist.strings in cs
100% translated source file: 'InfoPlist.strings'
on 'cs'.
2024-02-09 10:05:08 +00:00
Daniel D’Aquino
da82663634 Add option for custom test host in Damus Purple developer settings
This commit adds a developer setting that allows the use of a custom
host for testing. This was added to allow testing on real devices
without the need for pushing changes into staging.

========
Testing
========

Test 1: Production not affected
-------------------------------

PASS

Device: iPhone 13 Mini
iOS: 17.3
Damus: This version
Steps:
1. Run app on a device logged into a real Damus Purple account
2. Scroll down the home feed. Make sure that other Purple members still show up with a star next to their profile. PASS
3. Go to the Damus Purple screen. Ensure that account info shows up and is correct. PASS
4. Ensure auto-translations appear. PASS

Test 2: Check custom test URL
-----------------------------

PASS

(Continued from test 1)
1. Run local damus-api and damus-website on the same computer
2. Change developer purple env setting to local test
3. Set the host url to the local IP address of the test server
4. Go through LN purchase flow. Ensure it works correctly. PASS

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-08 10:08:59 -08:00
Daniel D’Aquino
aeafdccb02 Non-functional auto-formatter refactor
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-08 10:08:24 -08:00
William Casarin
f37957f47e Merge remote-tracking branch 'github/translations' 2024-02-06 10:14:55 -08:00
alltheseas
b5f31ef714
Update README.md
added how Damus and nostr win
2024-02-06 10:06:07 -06:00
alltheseas
907a49813f
Update README.md
added funding disclosure
2024-02-06 09:57:36 -06:00
alltheseas
eb383c6bf0
Update README.md
grammar, typos
2024-02-06 09:54:36 -06:00
alltheseas
e72e7b7196
Update README.md
-added purple
-added DM privacy warning
-updated NIPs
-added comparison vs twitter
2024-02-06 09:53:08 -06:00
transifex-integration[bot]
449b9f9f1e
Translate Localizable.strings in ja
100% translated source file: 'Localizable.strings'
on 'ja'.
2024-02-06 06:28:48 +00:00
Daniel D’Aquino
035181b02a Fix local test Purple landing page URL
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-05 11:40:02 -08:00
transifex-integration[bot]
0ab5040caa
Translate Localizable.strings in hu_HU
100% translated source file: 'Localizable.strings'
on 'hu_HU'.
2024-02-03 18:58:08 -05:00
transifex-integration[bot]
21cafc8f23
Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2024-02-03 18:58:07 -05:00
transifex-integration[bot]
6c0ea0bb17
Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2024-02-03 18:58:07 -05:00
transifex-integration[bot]
a1f3c481c5
Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2024-02-03 18:58:07 -05:00
transifex-integration[bot]
cee5bd1a97
Translate Localizable.strings in nl
100% translated source file: 'Localizable.strings'
on 'nl'.
2024-02-03 18:58:07 -05:00
transifex-integration[bot]
a43fa7349c
Translate Localizable.strings in sv_SE
100% translated source file: 'Localizable.strings'
on 'sv_SE'.
2024-02-03 18:58:07 -05:00
Terry Yiu
611cef712f
Fix localization issues and export strings for translation 2024-02-03 18:58:07 -05:00
William Casarin
28f292f692 nostrscript: fix nscripts not loading
This was broken by the recent nip19 changes, let's fix it again

Fixes: cb4adf06f1 ("nip19: added swift enums")
Changelog-Fixed: Fix nostrscripts not loading
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-02 12:02:21 -08:00
William Casarin
4defab73d0 v1.7 (9)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 11:28:32 -08:00
William Casarin
3d190a7388 purple: fix crash in account cache
otherwise there is contention and tends to crash

Fixes: f06b882139 ("purple: consolidate UserBadgeInfo with Account")
Changelog-Fixed: Fix crash when accessing cached purple accounts
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 11:08:07 -08:00
William Casarin
4a40c9987d v1.7 (8)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 10:46:21 -08:00
William Casarin
9735a28b44 mention: add note about text suggestion mention inteference
Also doing this so I can add a changelog entry

Changelog-Changed: Disable inline text suggestions on 17.0 as they interfere with mention generation
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 10:46:21 -08:00
kernelkind
48e8c11929 media: remove minWidth on Load Media formatting
Minimum width is not needed since we rely on maxWidth set to .infinity
to fill the screen bounds.

Lightning-address: kernelkind@getalby.com
Signed-off-by: kernelkind <kernelkind@gmail.com>
Reviewed-by: William Casarin <jb55@jb55.com>
Link: 20240131165008.61990-1-kernelkind@gmail.com
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 10:42:02 -08:00
kernelkind
6ca6a76fdb repost: hide member signup date
The purple membership badge should be displayed as compact view
everywhere except the user's profile.

Lightning-address: kernelkind@getalby.com
Changelog-Fixed: Hide member signup date on reposts
Signed-off-by: kernelkind <kernelkind@gmail.com>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 09:52:49 -08:00
ericholguin
504b21e91c note: fix previews not rendering
Fixes: dfcef0ba95 ("Fix previews not rendering")
Closes: https://github.com/damus-io/damus/issues/1932
Changelog-Fixed: Fixed previews not rendering
Signed-off-by: ericholguin <ericholguin@apache.org>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 09:51:29 -08:00
kernelkind
afec694432 post: disable inline text prediction
Inline text suggestions interfere with mentions generation so they
should be disabled.

Closes: https://github.com/damus-io/damus/issues/1970
Lightning-address: kernelkind@getalby.com
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-01 09:51:18 -08:00
William Casarin
3c24e707fc translate: disable translate DMs
It's just a bad idea until we have local translations

Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-31 09:34:15 -08:00
William Casarin
28d6715fda v1.7 (7)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-31 09:24:55 -08:00
William Casarin
b25d7d1c0d enable purple
Changelog-Added: Damus Purple membership!
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-31 09:24:46 -08:00
William Casarin
528d1b89b6 profile: show subscriber date instead of number
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 19:02:24 -08:00
William Casarin
f05cd1b7e6 split up date formatting
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 19:01:31 -08:00
William Casarin
b73b1da46e purple: prevent screen dismiss on purple welcome view
Suggested-by: Daniel Daquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 17:38:42 -08:00
William Casarin
f06b882139 purple: consolidate UserBadgeInfo with Account
Rename get_account to fetch_account to make it clear that it is always a
call to the server.

Add get_maybe_cached_account method that checks cached before calling
fetch_account.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 17:30:12 -08:00
William Casarin
fe177bdb9e purple: speed up continue button fade-in
Cc: Daniel Daquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 16:31:55 -08:00