mirror of
				https://github.com/tooot-app/app
				synced 2025-06-05 22:19:13 +02:00 
			
		
		
		
	Merge branch 'main' into candidate
This commit is contained in:
		| @@ -1,4 +1 @@ | |||||||
| Enjoy toooting! This version includes following improvements and fixes: | Enjoy toooting! This version includes following improvements and fixes: | ||||||
| - Supports mute duration |  | ||||||
| - Long press to copy toot |  | ||||||
| - Button to fetch latest on load |  | ||||||
| @@ -1,5 +1 @@ | |||||||
| tooot-ing愉快!此版本包括以下改进和修复: | tooot-ing愉快!此版本包括以下改进和修复: | ||||||
| - 新增neodb.social演出卡片 |  | ||||||
| - 支持选择隐藏用户时限 |  | ||||||
| - 长按复制嘟文 |  | ||||||
| - 新增获取最新嘟文按钮 |  | ||||||
| @@ -3,24 +3,24 @@ PODS: | |||||||
|   - DoubleConversion (1.1.6) |   - DoubleConversion (1.1.6) | ||||||
|   - EXApplication (5.3.0): |   - EXApplication (5.3.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - EXAV (13.4.1): |   - EXAV (13.5.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|     - ReactCommon/turbomodule/core |     - ReactCommon/turbomodule/core | ||||||
|   - EXConstants (14.4.2): |   - EXConstants (14.5.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - EXFileSystem (15.4.2): |   - EXFileSystem (15.5.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - EXFont (11.4.0): |   - EXFont (11.4.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - EXNotifications (0.20.1): |   - EXNotifications (0.20.1): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - Expo (49.0.3): |   - Expo (49.0.6): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - ExpoCrypto (12.4.1): |   - ExpoCrypto (12.5.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - ExpoHaptics (12.4.0): |   - ExpoHaptics (12.4.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - ExpoImage (1.3.2): |   - ExpoImage (1.4.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|     - SDWebImage (~> 5.15.8) |     - SDWebImage (~> 5.15.8) | ||||||
|     - SDWebImageAVIFCoder (~> 0.10.0) |     - SDWebImageAVIFCoder (~> 0.10.0) | ||||||
| @@ -30,13 +30,13 @@ PODS: | |||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - ExpoLocalization (14.3.0): |   - ExpoLocalization (14.3.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - ExpoModulesCore (1.5.7): |   - ExpoModulesCore (1.5.9): | ||||||
|     - RCT-Folly (= 2021.07.22.00) |     - RCT-Folly (= 2021.07.22.00) | ||||||
|     - React-Core |     - React-Core | ||||||
|     - React-NativeModulesApple |     - React-NativeModulesApple | ||||||
|     - React-RCTAppDelegate |     - React-RCTAppDelegate | ||||||
|     - ReactCommon/turbomodule/core |     - ReactCommon/turbomodule/core | ||||||
|   - ExpoScreenOrientation (6.0.3): |   - ExpoScreenOrientation (6.1.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|     - RCT-Folly (= 2021.07.22.00) |     - RCT-Folly (= 2021.07.22.00) | ||||||
|     - React-Core |     - React-Core | ||||||
| @@ -46,11 +46,11 @@ PODS: | |||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - ExpoVideoThumbnails (7.4.0): |   - ExpoVideoThumbnails (7.4.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - ExpoWebBrowser (12.3.2): |   - ExpoWebBrowser (12.4.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - EXScreenCapture (5.3.0): |   - EXScreenCapture (5.3.0): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|   - EXSplashScreen (0.20.4): |   - EXSplashScreen (0.20.5): | ||||||
|     - ExpoModulesCore |     - ExpoModulesCore | ||||||
|     - RCT-Folly (= 2021.07.22.00) |     - RCT-Folly (= 2021.07.22.00) | ||||||
|     - React-Core |     - React-Core | ||||||
| @@ -77,15 +77,18 @@ PODS: | |||||||
|     - libavif/core |     - libavif/core | ||||||
|   - libevent (2.1.12) |   - libevent (2.1.12) | ||||||
|   - libvmaf (2.3.1) |   - libvmaf (2.3.1) | ||||||
|   - libwebp (1.2.4): |   - libwebp (1.3.1): | ||||||
|     - libwebp/demux (= 1.2.4) |     - libwebp/demux (= 1.3.1) | ||||||
|     - libwebp/mux (= 1.2.4) |     - libwebp/mux (= 1.3.1) | ||||||
|     - libwebp/webp (= 1.2.4) |     - libwebp/sharpyuv (= 1.3.1) | ||||||
|   - libwebp/demux (1.2.4): |     - libwebp/webp (= 1.3.1) | ||||||
|  |   - libwebp/demux (1.3.1): | ||||||
|     - libwebp/webp |     - libwebp/webp | ||||||
|   - libwebp/mux (1.2.4): |   - libwebp/mux (1.3.1): | ||||||
|     - libwebp/demux |     - libwebp/demux | ||||||
|   - libwebp/webp (1.2.4) |   - libwebp/sharpyuv (1.3.1) | ||||||
|  |   - libwebp/webp (1.3.1): | ||||||
|  |     - libwebp/sharpyuv | ||||||
|   - MMKV (1.3.0): |   - MMKV (1.3.0): | ||||||
|     - MMKVCore (~> 1.3.0) |     - MMKVCore (~> 1.3.0) | ||||||
|   - MMKVCore (1.3.0) |   - MMKVCore (1.3.0) | ||||||
| @@ -406,10 +409,10 @@ PODS: | |||||||
|     - React-Core |     - React-Core | ||||||
|   - react-native-pager-view (6.2.0): |   - react-native-pager-view (6.2.0): | ||||||
|     - React-Core |     - React-Core | ||||||
|   - react-native-paste-input (0.6.2): |   - react-native-paste-input (0.6.4): | ||||||
|     - React-Core |     - React-Core | ||||||
|     - Swime (= 3.0.6) |     - Swime (= 3.0.6) | ||||||
|   - react-native-quick-base64 (2.0.6): |   - react-native-quick-base64 (2.0.7): | ||||||
|     - React-Core |     - React-Core | ||||||
|   - react-native-safe-area-context (4.7.1): |   - react-native-safe-area-context (4.7.1): | ||||||
|     - React-Core |     - React-Core | ||||||
| @@ -531,7 +534,7 @@ PODS: | |||||||
|     - React-Core |     - React-Core | ||||||
|   - RNGestureHandler (2.12.0): |   - RNGestureHandler (2.12.0): | ||||||
|     - React-Core |     - React-Core | ||||||
|   - RNReanimated (3.3.0): |   - RNReanimated (3.4.1): | ||||||
|     - DoubleConversion |     - DoubleConversion | ||||||
|     - FBLazyVector |     - FBLazyVector | ||||||
|     - glog |     - glog | ||||||
| @@ -560,12 +563,12 @@ PODS: | |||||||
|     - React-RCTText |     - React-RCTText | ||||||
|     - ReactCommon/turbomodule/core |     - ReactCommon/turbomodule/core | ||||||
|     - Yoga |     - Yoga | ||||||
|   - RNScreens (3.22.1): |   - RNScreens (3.23.0): | ||||||
|     - React-Core |     - React-Core | ||||||
|     - React-RCTImage |     - React-RCTImage | ||||||
|   - RNSentry (5.7.1): |   - RNSentry (5.8.0): | ||||||
|     - React-Core |     - React-Core | ||||||
|     - Sentry/HybridSDK (= 8.8.0) |     - Sentry/HybridSDK (= 8.9.3) | ||||||
|   - RNShareMenu (6.0.0): |   - RNShareMenu (6.0.0): | ||||||
|     - React |     - React | ||||||
|   - RNSVG (13.10.0): |   - RNSVG (13.10.0): | ||||||
| @@ -573,7 +576,7 @@ PODS: | |||||||
|   - SDWebImage (5.15.8): |   - SDWebImage (5.15.8): | ||||||
|     - SDWebImage/Core (= 5.15.8) |     - SDWebImage/Core (= 5.15.8) | ||||||
|   - SDWebImage/Core (5.15.8) |   - SDWebImage/Core (5.15.8) | ||||||
|   - SDWebImageAVIFCoder (0.10.0): |   - SDWebImageAVIFCoder (0.10.1): | ||||||
|     - libavif (>= 0.11.0) |     - libavif (>= 0.11.0) | ||||||
|     - SDWebImage (~> 5.10) |     - SDWebImage (~> 5.10) | ||||||
|   - SDWebImageSVGCoder (1.7.0): |   - SDWebImageSVGCoder (1.7.0): | ||||||
| @@ -581,9 +584,9 @@ PODS: | |||||||
|   - SDWebImageWebPCoder (0.11.0): |   - SDWebImageWebPCoder (0.11.0): | ||||||
|     - libwebp (~> 1.0) |     - libwebp (~> 1.0) | ||||||
|     - SDWebImage/Core (~> 5.15) |     - SDWebImage/Core (~> 5.15) | ||||||
|   - Sentry/HybridSDK (8.8.0): |   - Sentry/HybridSDK (8.9.3): | ||||||
|     - SentryPrivate (= 8.8.0) |     - SentryPrivate (= 8.9.3) | ||||||
|   - SentryPrivate (8.8.0) |   - SentryPrivate (8.9.3) | ||||||
|   - SocketRocket (0.6.1) |   - SocketRocket (0.6.1) | ||||||
|   - Swime (3.0.6) |   - Swime (3.0.6) | ||||||
|   - Yoga (1.14.0) |   - Yoga (1.14.0) | ||||||
| @@ -855,25 +858,25 @@ SPEC CHECKSUMS: | |||||||
|   boost: 57d2868c099736d80fcd648bf211b4431e51a558 |   boost: 57d2868c099736d80fcd648bf211b4431e51a558 | ||||||
|   DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 |   DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 | ||||||
|   EXApplication: 02655a251434d564bb0e73291f5a490c74b5b76f |   EXApplication: 02655a251434d564bb0e73291f5a490c74b5b76f | ||||||
|   EXAV: f393dfc0b28214d62855a31e06eb21d426d6e2da |   EXAV: 0f6f47ecd4d4aff93f486be494e28f8bdb3c9514 | ||||||
|   EXConstants: ce5bbea779da8031ac818c36bea41b10e14d04e1 |   EXConstants: ea6e3ff17f5c8926a4a7f35467d88b8af3230052 | ||||||
|   EXFileSystem: d7f59869885cfeab3ac771e2a8d0f5ed98cd3fdb |   EXFileSystem: 6acc93642ad8c3c3ffabd7adbd86f7af4d8eca52 | ||||||
|   EXFont: 738c44c390953ebcbab075a4848bfbef025fd9ee |   EXFont: 738c44c390953ebcbab075a4848bfbef025fd9ee | ||||||
|   EXNotifications: 09394cbd7165f9a4a00a53328aa09bf874bae717 |   EXNotifications: 09394cbd7165f9a4a00a53328aa09bf874bae717 | ||||||
|   Expo: d5956de70d4076190861f6730b93e75478b6faf8 |   Expo: 5601f86edc81c7e7e1772b9af9ae58fa3b45ad53 | ||||||
|   ExpoCrypto: a382ab9a2fa91f0b511ce1fe4d6baecee40a1615 |   ExpoCrypto: 2347fbf8a5d80676b4266548df62df397fbb537c | ||||||
|   ExpoHaptics: 360af6898407ee4e8265d30a1a8fb16491a660eb |   ExpoHaptics: 360af6898407ee4e8265d30a1a8fb16491a660eb | ||||||
|   ExpoImage: e3170a9043c6a80080efbf2268b3df2334021949 |   ExpoImage: d940c1a403aa25cb4461a7e082f74676a3f7af0f | ||||||
|   ExpoKeepAwake: be4cbd52d9b177cde0fd66daa1913afa3161fc1d |   ExpoKeepAwake: be4cbd52d9b177cde0fd66daa1913afa3161fc1d | ||||||
|   ExpoLocalization: be37fdd0b5930c6a49cd307b4542f4b426d6134c |   ExpoLocalization: be37fdd0b5930c6a49cd307b4542f4b426d6134c | ||||||
|   ExpoModulesCore: f8f3cac222bb0f574c77664d7e05817eaa97434b |   ExpoModulesCore: e4e437139259c5a73530a8895af69774ff8ec12d | ||||||
|   ExpoScreenOrientation: ddf6968471e781c6b3f9e10824292b996f07f777 |   ExpoScreenOrientation: 786cb014ccf2ba54ac3f9b3214a9e20a9170cfff | ||||||
|   ExpoSecureStore: 57db3b6da8b59046e2057e95bf7738a8027b47c3 |   ExpoSecureStore: 57db3b6da8b59046e2057e95bf7738a8027b47c3 | ||||||
|   ExpoStoreReview: f154c9fdf3dbd877ca0115757f0b2b6f43dd9db4 |   ExpoStoreReview: f154c9fdf3dbd877ca0115757f0b2b6f43dd9db4 | ||||||
|   ExpoVideoThumbnails: 3b5ec2a802a67b6e1a22d38b4526ef4619dd3938 |   ExpoVideoThumbnails: 3b5ec2a802a67b6e1a22d38b4526ef4619dd3938 | ||||||
|   ExpoWebBrowser: 2c788f9c07718a780fe6d8bf2f6195c47609faaa |   ExpoWebBrowser: 682823428c10629836f97f7c5fbf85825b6ac5b3 | ||||||
|   EXScreenCapture: 81002ba5fb40a367fba9047d223068abb558594d |   EXScreenCapture: 81002ba5fb40a367fba9047d223068abb558594d | ||||||
|   EXSplashScreen: 89586b0961acd173b04713b7457949b063a659da |   EXSplashScreen: c0e7f2d4a640f3b875808ed0b88575538daf6d82 | ||||||
|   FBLazyVector: 4cce221dd782d3ff7c4172167bba09d58af67ccb |   FBLazyVector: 4cce221dd782d3ff7c4172167bba09d58af67ccb | ||||||
|   FBReactNativeSpec: c6bd9e179757b3c0ecf815864fae8032377903ef |   FBReactNativeSpec: c6bd9e179757b3c0ecf815864fae8032377903ef | ||||||
|   fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 |   fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 | ||||||
| @@ -883,7 +886,7 @@ SPEC CHECKSUMS: | |||||||
|   libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7 |   libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7 | ||||||
|   libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 |   libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 | ||||||
|   libvmaf: 27f523f1e63c694d14d534cd0fddd2fab0ae8711 |   libvmaf: 27f523f1e63c694d14d534cd0fddd2fab0ae8711 | ||||||
|   libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef |   libwebp: 33dc822fbbf4503668d09f7885bbfedc76c45e96 | ||||||
|   MMKV: 9c6c3fa4ddd849f28c7b9a5c9d23aab84f14ee35 |   MMKV: 9c6c3fa4ddd849f28c7b9a5c9d23aab84f14ee35 | ||||||
|   MMKVCore: 9bb7440b170181ac5b81f542ac258103542e693d |   MMKVCore: 9bb7440b170181ac5b81f542ac258103542e693d | ||||||
|   RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 |   RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 | ||||||
| @@ -909,8 +912,8 @@ SPEC CHECKSUMS: | |||||||
|   react-native-mmkv: dea675cf9697ad35940f1687e98e133e1358ef9f |   react-native-mmkv: dea675cf9697ad35940f1687e98e133e1358ef9f | ||||||
|   react-native-netinfo: fefd4e98d75cbdd6e85fc530f7111a8afdf2b0c5 |   react-native-netinfo: fefd4e98d75cbdd6e85fc530f7111a8afdf2b0c5 | ||||||
|   react-native-pager-view: 0ccb8bf60e2ebd38b1f3669fa3650ecce81db2df |   react-native-pager-view: 0ccb8bf60e2ebd38b1f3669fa3650ecce81db2df | ||||||
|   react-native-paste-input: 3392800944a47c00dddbff23c31c281482209679 |   react-native-paste-input: 09f14cbfb646ad9d2ef79cdc6f3d45f337c10ad1 | ||||||
|   react-native-quick-base64: 62290829c619fbabca4c41cfec75ae759d08fc1c |   react-native-quick-base64: a5dbe4528f1453e662fcf7351029500b8b63e7bb | ||||||
|   react-native-safe-area-context: 9697629f7b2cda43cf52169bb7e0767d330648c2 |   react-native-safe-area-context: 9697629f7b2cda43cf52169bb7e0767d330648c2 | ||||||
|   react-native-segmented-control: 2221962f5073e2e809aa3691e8e410fc10b60578 |   react-native-segmented-control: 2221962f5073e2e809aa3691e8e410fc10b60578 | ||||||
|   React-NativeModulesApple: c57f3efe0df288a6532b726ad2d0322a9bf38472 |   React-NativeModulesApple: c57f3efe0df288a6532b726ad2d0322a9bf38472 | ||||||
| @@ -933,17 +936,17 @@ SPEC CHECKSUMS: | |||||||
|   RNCAsyncStorage: 09fc8595e6d6f6d5abf16b23a56b257d9c6b7c5b |   RNCAsyncStorage: 09fc8595e6d6f6d5abf16b23a56b257d9c6b7c5b | ||||||
|   RNCClipboard: 3f0451a8100393908bea5c5c5b16f96d45f30bfc |   RNCClipboard: 3f0451a8100393908bea5c5c5b16f96d45f30bfc | ||||||
|   RNGestureHandler: dec4645026e7401a0899f2846d864403478ff6a5 |   RNGestureHandler: dec4645026e7401a0899f2846d864403478ff6a5 | ||||||
|   RNReanimated: 9f7068e43b9358a46a688d94a5a3adb258139457 |   RNReanimated: 53ca20eee770c41173703f5948cd8898aa08262c | ||||||
|   RNScreens: 50ffe2fa2342eabb2d0afbe19f7c1af286bc7fb3 |   RNScreens: 6a8a3c6b808aa48dca1780df7b73ea524f602c63 | ||||||
|   RNSentry: 4e4fc87b53002c015f644cb7207d4b598bc3703f |   RNSentry: f9e637773502a61c7b455c4ce65bc7008ce22a6e | ||||||
|   RNShareMenu: cb9dac548c8bf147d06f0bf07296ad51ea9f5fc3 |   RNShareMenu: cb9dac548c8bf147d06f0bf07296ad51ea9f5fc3 | ||||||
|   RNSVG: 80584470ff1ffc7994923ea135a3e5ad825546b9 |   RNSVG: 80584470ff1ffc7994923ea135a3e5ad825546b9 | ||||||
|   SDWebImage: cb032eba469c54e0000e78bcb0a13cdde0a52798 |   SDWebImage: cb032eba469c54e0000e78bcb0a13cdde0a52798 | ||||||
|   SDWebImageAVIFCoder: 4aeea8fdf65af5c18525ecb5bdd8b8ed9bb45019 |   SDWebImageAVIFCoder: 8348fef6d0ec69e129c66c9fe4d74fbfbf366112 | ||||||
|   SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c |   SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c | ||||||
|   SDWebImageWebPCoder: 295a6573c512f54ad2dd58098e64e17dcf008499 |   SDWebImageWebPCoder: 295a6573c512f54ad2dd58098e64e17dcf008499 | ||||||
|   Sentry: 927dfb29d18a14d924229a59cc2ad149f43349f2 |   Sentry: 97161cac725da1ecbe77d1445bf8a61c1e5667f1 | ||||||
|   SentryPrivate: 4350d865f898224ab9fa02b37d6ee7fbb623f47e |   SentryPrivate: 9a76def09fb08f9501997b8df946e8097947b94f | ||||||
|   SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 |   SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 | ||||||
|   Swime: d7b2c277503b6cea317774aedc2dce05613f8b0b |   Swime: d7b2c277503b6cea317774aedc2dce05613f8b0b | ||||||
|   Yoga: 8796b55dba14d7004f980b54bcc9833ee45b28ce |   Yoga: 8796b55dba14d7004f980b54bcc9833ee45b28ce | ||||||
|   | |||||||
							
								
								
									
										47
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										47
									
								
								package.json
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "tooot", |   "name": "tooot", | ||||||
|   "version": "4.10.0", |   "version": "4.10.1", | ||||||
|   "description": "tooot for Mastodon", |   "description": "tooot for Mastodon", | ||||||
|   "author": "xmflsct <me@xmflsct.com>", |   "author": "xmflsct <me@xmflsct.com>", | ||||||
|   "license": "GPL-3.0-or-later", |   "license": "GPL-3.0-or-later", | ||||||
| @@ -25,45 +25,45 @@ | |||||||
|     "@formatjs/intl-numberformat": "^8.7.0", |     "@formatjs/intl-numberformat": "^8.7.0", | ||||||
|     "@formatjs/intl-pluralrules": "^5.2.4", |     "@formatjs/intl-pluralrules": "^5.2.4", | ||||||
|     "@formatjs/intl-relativetimeformat": "^11.2.4", |     "@formatjs/intl-relativetimeformat": "^11.2.4", | ||||||
|     "@mattermost/react-native-paste-input": "^0.6.2", |     "@mattermost/react-native-paste-input": "^0.6.4", | ||||||
|     "@neverdull-agency/expo-unlimited-secure-store": "^1.0.10", |     "@neverdull-agency/expo-unlimited-secure-store": "^1.0.10", | ||||||
|     "@react-native-async-storage/async-storage": "~1.17.11", |     "@react-native-async-storage/async-storage": "~1.17.11", | ||||||
|     "@react-native-camera-roll/camera-roll": "^5.7.2", |     "@react-native-camera-roll/camera-roll": "^5.7.2", | ||||||
|     "@react-native-clipboard/clipboard": "^1.11.2", |     "@react-native-clipboard/clipboard": "^1.11.2", | ||||||
|     "@react-native-community/blur": "^4.3.2", |     "@react-native-community/blur": "^4.3.2", | ||||||
|     "@react-native-community/netinfo": "^9.4.1", |     "@react-native-community/netinfo": "^9.4.1", | ||||||
|     "@react-native-firebase/app": "^18.1.0", |     "@react-native-firebase/app": "^18.3.0", | ||||||
|     "@react-native-menu/menu": "^0.8.0", |     "@react-native-menu/menu": "^0.8.0", | ||||||
|     "@react-native-segmented-control/segmented-control": "^2.4.2", |     "@react-native-segmented-control/segmented-control": "^2.4.2", | ||||||
|     "@react-navigation/bottom-tabs": "^6.5.8", |     "@react-navigation/bottom-tabs": "^6.5.8", | ||||||
|     "@react-navigation/native": "^6.1.7", |     "@react-navigation/native": "^6.1.7", | ||||||
|     "@react-navigation/native-stack": "^6.9.13", |     "@react-navigation/native-stack": "^6.9.13", | ||||||
|     "@react-navigation/stack": "^6.3.17", |     "@react-navigation/stack": "^6.3.17", | ||||||
|     "@sentry/react-native": "^5.7.1", |     "@sentry/react-native": "^5.8.0", | ||||||
|     "@sharcoux/slider": "^7.0.1", |     "@sharcoux/slider": "^7.0.1", | ||||||
|     "@tanstack/react-query": "^4.29.19", |     "@tanstack/react-query": "^4.32.0", | ||||||
|     "axios": "^1.4.0", |     "axios": "^1.4.0", | ||||||
|     "diff": "^5.1.0", |     "diff": "^5.1.0", | ||||||
|     "expo": "^49.0.3", |     "expo": "^49.0.6", | ||||||
|     "expo-auth-session": "^5.0.2", |     "expo-auth-session": "^5.1.0", | ||||||
|     "expo-av": "^13.4.1", |     "expo-av": "^13.5.0", | ||||||
|     "expo-constants": "^14.4.2", |     "expo-constants": "^14.5.0", | ||||||
|     "expo-crypto": "^12.4.1", |     "expo-crypto": "^12.5.0", | ||||||
|     "expo-file-system": "^15.4.2", |     "expo-file-system": "^15.5.0", | ||||||
|     "expo-haptics": "^12.4.0", |     "expo-haptics": "^12.4.0", | ||||||
|     "expo-image": "^1.3.2", |     "expo-image": "^1.4.0", | ||||||
|     "expo-linking": "^5.0.2", |     "expo-linking": "^5.0.2", | ||||||
|     "expo-localization": "^14.3.0", |     "expo-localization": "^14.3.0", | ||||||
|     "expo-notifications": "^0.20.1", |     "expo-notifications": "^0.20.1", | ||||||
|     "expo-screen-capture": "^5.3.0", |     "expo-screen-capture": "^5.3.0", | ||||||
|     "expo-screen-orientation": "^6.0.3", |     "expo-screen-orientation": "^6.1.0", | ||||||
|     "expo-secure-store": "^12.3.1", |     "expo-secure-store": "^12.3.1", | ||||||
|     "expo-splash-screen": "^0.20.4", |     "expo-splash-screen": "^0.20.5", | ||||||
|     "expo-store-review": "^6.4.0", |     "expo-store-review": "^6.4.0", | ||||||
|     "expo-video-thumbnails": "^7.4.0", |     "expo-video-thumbnails": "^7.4.0", | ||||||
|     "expo-web-browser": "^12.3.2", |     "expo-web-browser": "^12.4.0", | ||||||
|     "htmlparser2": "^9.0.0", |     "htmlparser2": "^9.0.0", | ||||||
|     "i18next": "^23.2.11", |     "i18next": "^23.4.1", | ||||||
|     "linkify-it": "^4.0.1", |     "linkify-it": "^4.0.1", | ||||||
|     "lodash": "^4.17.21", |     "lodash": "^4.17.21", | ||||||
|     "react": "^18.2.0", |     "react": "^18.2.0", | ||||||
| @@ -78,11 +78,11 @@ | |||||||
|     "react-native-language-detection": "^0.2.2", |     "react-native-language-detection": "^0.2.2", | ||||||
|     "react-native-mmkv": "^2.10.1", |     "react-native-mmkv": "^2.10.1", | ||||||
|     "react-native-pager-view": "^6.2.0", |     "react-native-pager-view": "^6.2.0", | ||||||
|     "react-native-quick-base64": "^2.0.6", |     "react-native-quick-base64": "^2.0.7", | ||||||
|     "react-native-reanimated": "^3.3.0", |     "react-native-reanimated": "^3.4.1", | ||||||
|     "react-native-reanimated-zoom": "^0.3.3", |     "react-native-reanimated-zoom": "^0.3.3", | ||||||
|     "react-native-safe-area-context": "^4.7.1", |     "react-native-safe-area-context": "^4.7.1", | ||||||
|     "react-native-screens": "^3.22.1", |     "react-native-screens": "^3.23.0", | ||||||
|     "react-native-share-menu": "^6.0.0", |     "react-native-share-menu": "^6.0.0", | ||||||
|     "react-native-svg": "^13.10.0", |     "react-native-svg": "^13.10.0", | ||||||
|     "react-native-swipe-list-view": "^3.2.9", |     "react-native-swipe-list-view": "^3.2.9", | ||||||
| @@ -91,21 +91,20 @@ | |||||||
|     "zeego": "^1.6.2" |     "zeego": "^1.6.2" | ||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "@babel/core": "^7.22.8", |     "@babel/core": "^7.22.9", | ||||||
|     "@babel/plugin-proposal-optional-chaining": "^7.21.0", |     "@babel/plugin-proposal-optional-chaining": "^7.21.0", | ||||||
|     "@babel/preset-typescript": "^7.22.5", |     "@babel/preset-typescript": "^7.22.5", | ||||||
|     "@expo/config": "^8.1.2", |     "@expo/config": "^8.2.0", | ||||||
|     "@react-native/metro-config": "^0.72.9", |     "@react-native/metro-config": "^0.72.9", | ||||||
|     "@types/diff": "^5.0.3", |     "@types/diff": "^5.0.3", | ||||||
|     "@types/linkify-it": "^3.0.2", |     "@types/linkify-it": "^3.0.2", | ||||||
|     "@types/lodash": "^4.14.195", |     "@types/lodash": "^4.14.196", | ||||||
|     "@types/react": "^18.2.14", |     "@types/react": "^18.2.17", | ||||||
|     "@types/react-dom": "^18.2.7", |     "@types/react-dom": "^18.2.7", | ||||||
|     "@types/react-native-share-menu": "^5.0.2", |     "@types/react-native-share-menu": "^5.0.2", | ||||||
|     "babel-plugin-module-resolver": "^5.0.0", |     "babel-plugin-module-resolver": "^5.0.0", | ||||||
|     "babel-plugin-transform-remove-console": "^6.9.4", |     "babel-plugin-transform-remove-console": "^6.9.4", | ||||||
|     "chalk": "^4.1.2", |     "chalk": "^4.1.2", | ||||||
|     "deprecated-react-native-prop-types": "^4.1.0", |  | ||||||
|     "dotenv": "^16.3.1", |     "dotenv": "^16.3.1", | ||||||
|     "react-native-clean-project": "^4.0.1", |     "react-native-clean-project": "^4.0.1", | ||||||
|     "typescript": "^5.1.6" |     "typescript": "^5.1.6" | ||||||
|   | |||||||
| @@ -380,8 +380,8 @@ const Timeline: React.FC<Props> = ({ | |||||||
|                   if (readMarker) { |                   if (readMarker) { | ||||||
|                     setAccountStorage([{ key: readMarker, value: undefined }]) |                     setAccountStorage([{ key: readMarker, value: undefined }]) | ||||||
|                   } |                   } | ||||||
|  |                   flRef.current?.scrollToOffset({ offset: 0 }) | ||||||
|                   await refetch() |                   await refetch() | ||||||
|                   setTimeout(() => flRef.current?.scrollToOffset({ offset: 0 }), 50) |  | ||||||
|                 }} |                 }} | ||||||
|               > |               > | ||||||
|                 <CustomText |                 <CustomText | ||||||
|   | |||||||
| @@ -418,13 +418,13 @@ | |||||||
|       "name": "Bearbeitungsverlauf" |       "name": "Bearbeitungsverlauf" | ||||||
|     }, |     }, | ||||||
|     "mute": { |     "mute": { | ||||||
|       "name": "", |       "name": "@{{acct}} stummschalten", | ||||||
|       "mute": "", |       "mute": "Stummschalten", | ||||||
|       "description": "", |       "description": "Verstecke Tröts des Users und solche, in denen das Konto erwähnt wird. Die Person wird weiterhin deine Beiträge lesen und dir folgen können.", | ||||||
|       "notification": "", |       "notification": "Benachrichtigungen dieses Profils ebenfalls ausblenden", | ||||||
|       "duration": { |       "duration": { | ||||||
|         "heading": "", |         "heading": "Für die Dauer", | ||||||
|         "0": "", |         "0": "Dauerhaft", | ||||||
|         "1800": "30 Minuten", |         "1800": "30 Minuten", | ||||||
|         "3600": "1 Stunde", |         "3600": "1 Stunde", | ||||||
|         "86400": "1 Tag", |         "86400": "1 Tag", | ||||||
|   | |||||||
| @@ -418,10 +418,10 @@ | |||||||
|       "name": "Geschiedenis bewerken" |       "name": "Geschiedenis bewerken" | ||||||
|     }, |     }, | ||||||
|     "mute": { |     "mute": { | ||||||
|       "name": "", |       "name": "Demp {{acct}}", | ||||||
|       "mute": "", |       "mute": "Dempen", | ||||||
|       "description": "", |       "description": "Verberg berichten van deze gebruiker en berichten die hen vermelden, maar het geeft hen nog steeds de mogelijkheid om je posts te zien en je te volgen.", | ||||||
|       "notification": "", |       "notification": "Verberg ook meldingen van deze gebruiker", | ||||||
|       "duration": { |       "duration": { | ||||||
|         "heading": "Voor duur", |         "heading": "Voor duur", | ||||||
|         "0": "Onbepaalde tijd", |         "0": "Onbepaalde tijd", | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ | |||||||
|     "delete": "Excluir", |     "delete": "Excluir", | ||||||
|     "done": "Concluído", |     "done": "Concluído", | ||||||
|     "confirm": "Confirmar", |     "confirm": "Confirmar", | ||||||
|     "add": "" |     "add": "Adicionar" | ||||||
|   }, |   }, | ||||||
|   "customEmoji": { |   "customEmoji": { | ||||||
|     "accessibilityLabel": "Emoji personalizado {{emoji}}" |     "accessibilityLabel": "Emoji personalizado {{emoji}}" | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
|   "HTML": { |   "HTML": { | ||||||
|     "accessibilityHint": "Toque para expandir ou recolher conteúdo", |     "accessibilityHint": "Toque para expandir ou recolher conteúdo", | ||||||
|     "expanded": "{{hint}}{{moreLines}}", |     "expanded": "{{hint}}{{moreLines}}", | ||||||
|     "moreLines": "", |     "moreLines": " ({{count}} mais linhas)", | ||||||
|     "defaultHint": "Toot longo" |     "defaultHint": "Toot longo" | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @@ -37,7 +37,7 @@ | |||||||
|         "notification": "{{name}} deu boost no teu toot" |         "notification": "{{name}} deu boost no teu toot" | ||||||
|       }, |       }, | ||||||
|       "update": "Toot foi editado", |       "update": "Toot foi editado", | ||||||
|       "admin.sign_up": "", |       "admin.sign_up": "{{name}} entrou na instância", | ||||||
|       "admin.report": "" |       "admin.report": "" | ||||||
|     }, |     }, | ||||||
|     "actions": { |     "actions": { | ||||||
|   | |||||||
| @@ -11,13 +11,13 @@ | |||||||
|       "segments": { |       "segments": { | ||||||
|         "federated": "Global", |         "federated": "Global", | ||||||
|         "local": "Local", |         "local": "Local", | ||||||
|         "explore": "" |         "explore": "Explorar" | ||||||
|       }, |       }, | ||||||
|       "exploring": { |       "exploring": { | ||||||
|         "heading": "", |         "heading": "Explorando", | ||||||
|         "trending": "", |         "trending": "", | ||||||
|         "followRemote": "", |         "followRemote": "", | ||||||
|         "noTitle": "", |         "noTitle": "Sem título", | ||||||
|         "errors": { |         "errors": { | ||||||
|           "existed": "Você já está seguindo esta instância.", |           "existed": "Você já está seguindo esta instância.", | ||||||
|           "notAvailable": "A linha do tempo desta instância não é acessível ao público. Por favor, tente outra instância." |           "notAvailable": "A linha do tempo desta instância não é acessível ao público. Por favor, tente outra instância." | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ | |||||||
|     "delete": "Radera", |     "delete": "Radera", | ||||||
|     "done": "Klar", |     "done": "Klar", | ||||||
|     "confirm": "Bekräfta", |     "confirm": "Bekräfta", | ||||||
|     "add": "" |     "add": "Lägg till" | ||||||
|   }, |   }, | ||||||
|   "customEmoji": { |   "customEmoji": { | ||||||
|     "accessibilityLabel": "Anpassad emoji {{emoji}}" |     "accessibilityLabel": "Anpassad emoji {{emoji}}" | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ | |||||||
|       "action_true": "Sluta tysta användare" |       "action_true": "Sluta tysta användare" | ||||||
|     }, |     }, | ||||||
|     "followAs": { |     "followAs": { | ||||||
|       "trigger": "", |       "trigger": "Följ som ...", | ||||||
|       "succeed_default": "Följer nu @{{target}} med @{{source}}", |       "succeed_default": "Följer nu @{{target}} med @{{source}}", | ||||||
|       "succeed_locked": "Följförfrågan skickades till @{{target}} med {{source}}, väntar på godkännande", |       "succeed_locked": "Följförfrågan skickades till @{{target}} med {{source}}, väntar på godkännande", | ||||||
|       "failed": "Följ som" |       "failed": "Följ som" | ||||||
| @@ -56,7 +56,7 @@ | |||||||
|   }, |   }, | ||||||
|   "hashtag": { |   "hashtag": { | ||||||
|     "follow": { |     "follow": { | ||||||
|       "action_false": "", |       "action_false": "Följ", | ||||||
|       "action_true": "" |       "action_true": "" | ||||||
|     }, |     }, | ||||||
|     "filter": { |     "filter": { | ||||||
| @@ -100,7 +100,7 @@ | |||||||
|     }, |     }, | ||||||
|     "filter": { |     "filter": { | ||||||
|       "action_false": "", |       "action_false": "", | ||||||
|       "action_true": "" |       "action_true": "Hantera filter ..." | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @@ -89,7 +89,7 @@ | |||||||
|         "name": "" |         "name": "" | ||||||
|       }, |       }, | ||||||
|       "preferencesFilterEdit": { |       "preferencesFilterEdit": { | ||||||
|         "name": "" |         "name": "Redigera filter" | ||||||
|       }, |       }, | ||||||
|       "profile": { |       "profile": { | ||||||
|         "name": "Redigera profil" |         "name": "Redigera profil" | ||||||
| @@ -195,16 +195,16 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "preferencesFilter": { |     "preferencesFilter": { | ||||||
|       "name": "", |       "name": "Namn", | ||||||
|       "expiration": "", |       "expiration": "", | ||||||
|       "expirationOptions": { |       "expirationOptions": { | ||||||
|         "0": "", |         "0": "Aldrig", | ||||||
|         "1800": "", |         "1800": "Efter 30 minuter", | ||||||
|         "3600": "", |         "3600": "Efter 1 timme", | ||||||
|         "43200": "", |         "43200": "Efter 12 timmar", | ||||||
|         "86400": "", |         "86400": "Efter 1 dag", | ||||||
|         "604800": "", |         "604800": "Efter 1 vecka", | ||||||
|         "18144000": "" |         "18144000": "Efter 1 månad" | ||||||
|       }, |       }, | ||||||
|       "context": "", |       "context": "", | ||||||
|       "contexts": { |       "contexts": { | ||||||
| @@ -425,10 +425,10 @@ | |||||||
|       "duration": { |       "duration": { | ||||||
|         "heading": "", |         "heading": "", | ||||||
|         "0": "", |         "0": "", | ||||||
|         "1800": "", |         "1800": "30 minuter", | ||||||
|         "3600": "", |         "3600": "1 timme", | ||||||
|         "86400": "", |         "86400": "1 dag", | ||||||
|         "604800": "" |         "604800": "1 vecka" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "report": { |     "report": { | ||||||
|   | |||||||
| @@ -418,10 +418,10 @@ | |||||||
|       "name": "編輯歷史" |       "name": "編輯歷史" | ||||||
|     }, |     }, | ||||||
|     "mute": { |     "mute": { | ||||||
|       "name": "", |       "name": "靜音{{acct}}", | ||||||
|       "mute": "", |       "mute": "靜音", | ||||||
|       "description": "", |       "description": "該使用者的嘟文及提到該使用者的嘟文都會被隱藏,但他們仍然可以看到你的嘟文,也可以關注你。", | ||||||
|       "notification": "", |       "notification": "同時隱藏來自該使用者的通知", | ||||||
|       "duration": { |       "duration": { | ||||||
|         "heading": "時限", |         "heading": "時限", | ||||||
|         "0": "無限期", |         "0": "無限期", | ||||||
|   | |||||||
| @@ -23,6 +23,20 @@ import { useTranslation } from 'react-i18next' | |||||||
| import { AppState, Linking, Platform, ScrollView, View } from 'react-native' | import { AppState, Linking, Platform, ScrollView, View } from 'react-native' | ||||||
| import { fromByteArray } from 'react-native-quick-base64' | import { fromByteArray } from 'react-native-quick-base64' | ||||||
|  |  | ||||||
|  | export const getPushPath = ({ | ||||||
|  |   expoToken, | ||||||
|  |   domain, | ||||||
|  |   accountId | ||||||
|  | }: { | ||||||
|  |   expoToken?: string | ||||||
|  |   domain: string | ||||||
|  |   accountId: string | number | ||||||
|  | }) => `${expoToken}/${domain}/${accountId}` | ||||||
|  | export const getPushendpoint = (pushPath: string) => | ||||||
|  |   `https://${TOOOT_API_DOMAIN}/push/send/${pushPath}/${(Math.random() + 1) | ||||||
|  |     .toString(36) | ||||||
|  |     .substring(2)}` | ||||||
|  |  | ||||||
| const TabMePush: React.FC = () => { | const TabMePush: React.FC = () => { | ||||||
|   const { colors } = useTheme() |   const { colors } = useTheme() | ||||||
|   const { t } = useTranslation('screenTabs') |   const { t } = useTranslation('screenTabs') | ||||||
| @@ -116,7 +130,7 @@ const TabMePush: React.FC = () => { | |||||||
|         )) |         )) | ||||||
|       : null |       : null | ||||||
|  |  | ||||||
|   const pushPath = `${expoToken}/${domain}/${accountId}` |   const pushPath = getPushPath({ expoToken, domain, accountId }) | ||||||
|   const accountFull = `@${accountAcct}@${accountDomain}` |   const accountFull = `@${accountAcct}@${accountDomain}` | ||||||
|  |  | ||||||
|   return appsQuery.isFetched ? ( |   return appsQuery.isFetched ? ( | ||||||
| @@ -176,17 +190,13 @@ const TabMePush: React.FC = () => { | |||||||
|                       if (push.key?.length <= 10) { |                       if (push.key?.length <= 10) { | ||||||
|                         authKey = fromByteArray(Crypto.getRandomBytes(16)) |                         authKey = fromByteArray(Crypto.getRandomBytes(16)) | ||||||
|                       } |                       } | ||||||
|                       // Turning on |  | ||||||
|                       const randomPath = (Math.random() + 1).toString(36).substring(2) |  | ||||||
|  |  | ||||||
|                       const endpoint = `https://${TOOOT_API_DOMAIN}/push/send/${pushPath}/${randomPath}` |  | ||||||
|  |  | ||||||
|                       const body: { |                       const body: { | ||||||
|                         subscription: any |                         subscription: any | ||||||
|                         data: { alerts: Mastodon.PushSubscription['alerts'] } |                         data: { alerts: Mastodon.PushSubscription['alerts'] } | ||||||
|                       } = { |                       } = { | ||||||
|                         subscription: { |                         subscription: { | ||||||
|                           endpoint, |                           endpoint: getPushendpoint(pushPath), | ||||||
|                           keys: { |                           keys: { | ||||||
|                             p256dh: |                             p256dh: | ||||||
|                               'BMn2PLpZrMefG981elzG6SB1EY9gU7QZwmtZ/a/J2vUeWG+zXgeskMPwHh4T/bxsD4l7/8QT94F57CbZqYRRfJo=', |                               'BMn2PLpZrMefG981elzG6SB1EY9gU7QZwmtZ/a/J2vUeWG+zXgeskMPwHh4T/bxsD4l7/8QT94F57CbZqYRRfJo=', | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ import { useNavigation } from '@react-navigation/native' | |||||||
| import { androidActionSheetStyles } from '@utils/helpers/androidActionSheetStyles' | import { androidActionSheetStyles } from '@utils/helpers/androidActionSheetStyles' | ||||||
| import { urlMatcher } from '@utils/helpers/urlMatcher' | import { urlMatcher } from '@utils/helpers/urlMatcher' | ||||||
| import { storage } from '@utils/storage' | import { storage } from '@utils/storage' | ||||||
| import { getGlobalStorage, useGlobalStorage } from '@utils/storage/actions' | import { getGlobalStorage, setGlobalStorage, useGlobalStorage } from '@utils/storage/actions' | ||||||
| import { StyleConstants } from '@utils/styles/constants' | import { StyleConstants } from '@utils/styles/constants' | ||||||
| import { useTheme } from '@utils/styles/ThemeManager' | import { useTheme } from '@utils/styles/ThemeManager' | ||||||
| import React from 'react' | import React from 'react' | ||||||
| @@ -59,6 +59,17 @@ const SettingsDev: React.FC = () => { | |||||||
|         }} |         }} | ||||||
|         onPress={() => displayMessage({ message: 'This is a testing message' })} |         onPress={() => displayMessage({ message: 'This is a testing message' })} | ||||||
|       /> |       /> | ||||||
|  |       <Button | ||||||
|  |         type='text' | ||||||
|  |         content={'Set ExpoToken wrapped'} | ||||||
|  |         style={{ | ||||||
|  |           marginHorizontal: StyleConstants.Spacing.Global.PagePadding * 2, | ||||||
|  |           marginBottom: StyleConstants.Spacing.Global.PagePadding * 2 | ||||||
|  |         }} | ||||||
|  |         onPress={() => { | ||||||
|  |           setGlobalStorage('app.expo_token', 'ExponentPushToken[DEVELOPMENT_1]') | ||||||
|  |         }} | ||||||
|  |       /> | ||||||
|       <Button |       <Button | ||||||
|         type='text' |         type='text' | ||||||
|         content={'Purge MMKV'} |         content={'Purge MMKV'} | ||||||
| @@ -87,7 +98,7 @@ const SettingsDev: React.FC = () => { | |||||||
|         content={'Crash test'} |         content={'Crash test'} | ||||||
|         style={{ |         style={{ | ||||||
|           marginHorizontal: StyleConstants.Spacing.Global.PagePadding * 2, |           marginHorizontal: StyleConstants.Spacing.Global.PagePadding * 2, | ||||||
|           marginBottom: StyleConstants.Spacing.Global.PagePadding * 2 |           marginBottom: StyleConstants.Spacing.Global.PagePadding | ||||||
|         }} |         }} | ||||||
|         destructive |         destructive | ||||||
|         onPress={() => { |         onPress={() => { | ||||||
|   | |||||||
| @@ -4,6 +4,9 @@ import { getGlobalStorage, setGlobalStorage } from '@utils/storage/actions' | |||||||
| import * as Notifications from 'expo-notifications' | import * as Notifications from 'expo-notifications' | ||||||
| import { Platform } from 'react-native' | import { Platform } from 'react-native' | ||||||
|  |  | ||||||
|  | export const toRawExpoToken = (token: string): string => | ||||||
|  |   token.replace('ExponentPushToken[', '').replace(']', '') | ||||||
|  |  | ||||||
| export const updateExpoToken = async (): Promise<string> => { | export const updateExpoToken = async (): Promise<string> => { | ||||||
|   const expoToken = getGlobalStorage.string('app.expo_token') |   const expoToken = getGlobalStorage.string('app.expo_token') | ||||||
|  |  | ||||||
| @@ -11,25 +14,26 @@ export const updateExpoToken = async (): Promise<string> => { | |||||||
|     await setChannels() |     await setChannels() | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   const getAndSetToken = () => |   const getAndSetToken = () => { | ||||||
|     Notifications.getExpoPushTokenAsync({ |     if (isDevelopment) { | ||||||
|  |       const devToken = toRawExpoToken('ExponentPushToken[DEVELOPMENT_1]') | ||||||
|  |       setGlobalStorage('app.expo_token', devToken) | ||||||
|  |       return devToken | ||||||
|  |     } else { | ||||||
|  |       return Notifications.getExpoPushTokenAsync({ | ||||||
|         projectId: '3288313f-3ff0-496a-a5a9-d8985e7cad5f', |         projectId: '3288313f-3ff0-496a-a5a9-d8985e7cad5f', | ||||||
|       applicationId: 'com.xmflsct.app.tooot', |         applicationId: 'com.xmflsct.app.tooot' | ||||||
|       devicePushToken: { type: Platform.OS === 'android' ? 'android' : 'ios', data: 'unknown' } |  | ||||||
|       }).then(({ data }) => { |       }).then(({ data }) => { | ||||||
|       setGlobalStorage('app.expo_token', data) |         setGlobalStorage('app.expo_token', toRawExpoToken(data)) | ||||||
|         return data |         return data | ||||||
|       }) |       }) | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
|   if (expoToken?.length) { |   if (expoToken?.length) { | ||||||
|     getAndSetToken() |     getAndSetToken() | ||||||
|     return Promise.resolve(expoToken) |     return Promise.resolve(expoToken) | ||||||
|   } else { |   } else { | ||||||
|     if (isDevelopment) { |  | ||||||
|       setGlobalStorage('app.expo_token', 'ExponentPushToken[DEVELOPMENT_1]') |  | ||||||
|       return Promise.resolve('ExponentPushToken[DEVELOPMENT_1]') |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     return await getAndSetToken() |     return await getAndSetToken() | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,7 +1,9 @@ | |||||||
| import { displayMessage } from '@components/Message' | import { displayMessage } from '@components/Message' | ||||||
|  | import { getPushPath, getPushendpoint } from '@screens/Tabs/Me/Push' | ||||||
| import * as Sentry from '@sentry/react-native' | import * as Sentry from '@sentry/react-native' | ||||||
| import { useQuery } from '@tanstack/react-query' | import { useQuery } from '@tanstack/react-query' | ||||||
| import apiGeneral from '@utils/api/general' | import apiGeneral from '@utils/api/general' | ||||||
|  | import apiInstance from '@utils/api/instance' | ||||||
| import apiTooot from '@utils/api/tooot' | import apiTooot from '@utils/api/tooot' | ||||||
| import navigationRef from '@utils/navigation/navigationRef' | import navigationRef from '@utils/navigation/navigationRef' | ||||||
| import { | import { | ||||||
| @@ -9,6 +11,7 @@ import { | |||||||
|   getAccountDetails, |   getAccountDetails, | ||||||
|   getGlobalStorage, |   getGlobalStorage, | ||||||
|   setAccountStorage, |   setAccountStorage, | ||||||
|  |   setGlobalStorage, | ||||||
|   useGlobalStorage |   useGlobalStorage | ||||||
| } from '@utils/storage/actions' | } from '@utils/storage/actions' | ||||||
| import { AxiosError } from 'axios' | import { AxiosError } from 'axios' | ||||||
| @@ -16,7 +19,7 @@ import * as Notifications from 'expo-notifications' | |||||||
| import { useEffect, useRef } from 'react' | import { useEffect, useRef } from 'react' | ||||||
| import { useTranslation } from 'react-i18next' | import { useTranslation } from 'react-i18next' | ||||||
| import { AppState } from 'react-native' | import { AppState } from 'react-native' | ||||||
| import { updateExpoToken } from './updateExpoToken' | import { toRawExpoToken, updateExpoToken } from './updateExpoToken' | ||||||
|  |  | ||||||
| const pushUseConnect = () => { | const pushUseConnect = () => { | ||||||
|   const { t } = useTranslation('screens') |   const { t } = useTranslation('screens') | ||||||
| @@ -34,7 +37,9 @@ const pushUseConnect = () => { | |||||||
|             domain: details['auth.domain'], |             domain: details['auth.domain'], | ||||||
|             id: details['auth.account.id'] |             id: details['auth.account.id'] | ||||||
|           }), |           }), | ||||||
|           push: details.push |           push: details.push, | ||||||
|  |           domain: details['auth.domain'], | ||||||
|  |           accountId: details['auth.account.id'] | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     }) |     }) | ||||||
| @@ -120,9 +125,58 @@ const pushUseConnect = () => { | |||||||
|   useEffect(() => { |   useEffect(() => { | ||||||
|     updateExpoToken().then(async token => { |     updateExpoToken().then(async token => { | ||||||
|       const badgeCount = await Notifications.getBadgeCountAsync() |       const badgeCount = await Notifications.getBadgeCountAsync() | ||||||
|       if (token && (pushEnabled?.length || badgeCount)) { |       if (token && !token.startsWith('ExponentPushToken') && (pushEnabled?.length || badgeCount)) { | ||||||
|         connectQuery.refetch() |         connectQuery.refetch() | ||||||
|       } |       } | ||||||
|  |  | ||||||
|  |       if (expoToken?.startsWith('ExponentPushToken')) { | ||||||
|  |         const newToken = toRawExpoToken(expoToken) | ||||||
|  |  | ||||||
|  |         if (pushEnabled) { | ||||||
|  |           for (const account of pushEnabled) { | ||||||
|  |             if (account) { | ||||||
|  |               const oldSub = await apiInstance<Mastodon.PushSubscription>({ | ||||||
|  |                 account: account.accountKey, | ||||||
|  |                 method: 'get', | ||||||
|  |                 url: 'push/subscription' | ||||||
|  |               }) | ||||||
|  |               if (oldSub.body.id) { | ||||||
|  |                 const body: { | ||||||
|  |                   subscription: any | ||||||
|  |                   data: { alerts: Mastodon.PushSubscription['alerts'] } | ||||||
|  |                 } = { | ||||||
|  |                   subscription: { | ||||||
|  |                     endpoint: getPushendpoint( | ||||||
|  |                       getPushPath({ | ||||||
|  |                         expoToken: newToken, | ||||||
|  |                         domain: account.domain, | ||||||
|  |                         accountId: account.accountId | ||||||
|  |                       }) | ||||||
|  |                     ), | ||||||
|  |                     keys: { | ||||||
|  |                       p256dh: | ||||||
|  |                         'BMn2PLpZrMefG981elzG6SB1EY9gU7QZwmtZ/a/J2vUeWG+zXgeskMPwHh4T/bxsD4l7/8QT94F57CbZqYRRfJo=', | ||||||
|  |                       auth: account.push.key | ||||||
|  |                     } | ||||||
|  |                   }, | ||||||
|  |                   data: { alerts: account.push.alerts } | ||||||
|  |                 } | ||||||
|  |                 console.log(body) | ||||||
|  |                 await apiInstance({ | ||||||
|  |                   account: account?.accountKey, | ||||||
|  |                   method: 'post', | ||||||
|  |                   url: 'push/subscription', | ||||||
|  |                   body | ||||||
|  |                 }) | ||||||
|  |               } | ||||||
|  |             } | ||||||
|  |           } | ||||||
|  |         } else { | ||||||
|  |           setGlobalStorage('app.expo_token', newToken) | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         await apiTooot({ method: 'post', url: `push/migrate/${expoToken}` }) | ||||||
|  |       } | ||||||
|     }) |     }) | ||||||
|   }, []) |   }, []) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user