Compare commits
452 Commits
Author | SHA1 | Date | |
---|---|---|---|
4c9f3e799b | |||
e645db1630 | |||
d5cf2478d8 | |||
cf34a285b4 | |||
a75083d916 | |||
919ff5e464 | |||
00863b94e8 | |||
1ad42e6505 | |||
1cec1bf82e | |||
a4ecf30c5b | |||
5da7ccc8ef | |||
b5f42863ce | |||
69d5e95565 | |||
3e3442fc89 | |||
8181010b0b | |||
269caf7555 | |||
ae0809ad35 | |||
4005f03cf8 | |||
4bd8ec54f1 | |||
51a387851f | |||
8ed847d870 | |||
dfe13de220 | |||
b02a54c1e9 | |||
55a7e7d900 | |||
3585941ccb | |||
7c6f2cc4ab | |||
61dbf92909 | |||
b69e4002e0 | |||
49aa24b79d | |||
ceb5c53229 | |||
908f0cb59e | |||
7c2b8de931 | |||
ddd0a4c3d3 | |||
99e07de243 | |||
6bb9c21759 | |||
8f2fc55608 | |||
a1c4e5eca0 | |||
10bf0883e5 | |||
595050f89f | |||
0722c99f21 | |||
12d03836f9 | |||
f78d3f4fd5 | |||
e798a8ba76 | |||
c28a664373 | |||
4589722c3b | |||
38e1c51b45 | |||
610ddec05c | |||
d0276f9ac6 | |||
c1e89a2ee6 | |||
ecc79368a1 | |||
e6d732c86a | |||
dd055fb077 | |||
280840c6d8 | |||
bde62a7b2c | |||
5445c570a2 | |||
b2302f5b3c | |||
d7359cfd0d | |||
9cc577adbe | |||
dd196b7754 | |||
16c07c2133 | |||
6bcb658d44 | |||
9311bfc3b5 | |||
8dd6435a30 | |||
21a1d4a2ad | |||
603875b1af | |||
4209a13c84 | |||
55b79bfd8f | |||
6e6c3f42f6 | |||
dc38b46b2c | |||
b4990308e9 | |||
237abe564d | |||
71b41d470a | |||
7052b5b635 | |||
f356e08f79 | |||
152872db65 | |||
dfe117d04f | |||
caf63f0cbe | |||
b8f5cc82f9 | |||
360bc50f21 | |||
2de93a0486 | |||
02227852f8 | |||
ad16de595b | |||
9f8c8923d9 | |||
060bfa4887 | |||
e68ada2d04 | |||
d6013078bd | |||
5976d61997 | |||
b492db90ca | |||
c9f69fed2c | |||
d2f4e7a969 | |||
aecd04e0b9 | |||
e5212419ae | |||
ec7650a920 | |||
7b96013406 | |||
fc5a79b29b | |||
4146820be5 | |||
9ec0f1ff19 | |||
ac2aec48aa | |||
58421e5d5e | |||
172d0d24fb | |||
71899dd4f2 | |||
02ffe9866d | |||
1b7e668b3f | |||
f03d80ba88 | |||
14ee6845ed | |||
8fe6c2be46 | |||
78e765f69d | |||
ddd6ff7eee | |||
b8f379796f | |||
3a10e9280c | |||
65fe06de22 | |||
e44320e0fe | |||
f2d913ffec | |||
e88dea8858 | |||
813679b161 | |||
9d4ce6ca8c | |||
88396647f3 | |||
335318ae3f | |||
da25fb9c29 | |||
c1aef89b84 | |||
0241c5f804 | |||
f6939d7c23 | |||
d654c162e3 | |||
25550ba197 | |||
3defd3a593 | |||
d62ed4c375 | |||
857f3cc832 | |||
e16bc80eea | |||
a4f6e8af56 | |||
060a97f5ec | |||
92f7e92018 | |||
5c483bd3b8 | |||
1c510d63fe | |||
115cb4adc1 | |||
54c098c274 | |||
29731728cd | |||
9e8882c580 | |||
6042e57e7a | |||
6235e736b9 | |||
e075804782 | |||
d40a6ca1c4 | |||
5ac657e526 | |||
97ddc18b8e | |||
b835c8edea | |||
288c0399f9 | |||
1478933cf1 | |||
93c6fa6e53 | |||
ce6e9c185a | |||
cdaa8cfe58 | |||
76d8cd943d | |||
d6f3ffc655 | |||
5a6b841253 | |||
cb2de52bee | |||
64e2644745 | |||
56711889ab | |||
4f47cd2c0c | |||
2b61c372f5 | |||
73777fe74e | |||
33a4bd7e71 | |||
17e6b81f76 | |||
22fde6b400 | |||
6e03a00280 | |||
72e6a6a1f6 | |||
66aef44281 | |||
7bb73c80b0 | |||
d043ef2410 | |||
1d0e2f7591 | |||
e9ef28d764 | |||
289aa17a7a | |||
93f41bb523 | |||
09ec9d4a0c | |||
1153fbdeee | |||
e933058338 | |||
ae9743c84f | |||
32bf834108 | |||
1b41c847a6 | |||
b1af6c2c97 | |||
8e76ff3f84 | |||
bd26602299 | |||
52ab1d0d10 | |||
f746e06f65 | |||
d11069a2be | |||
d6dc487d9e | |||
a07c7cdede | |||
acbc125dec | |||
ad0ee971c1 | |||
52d6bb083e | |||
2027eab49b | |||
566ebde1dd | |||
9e039cc532 | |||
c4b95d7084 | |||
a66129a9ba | |||
44e1a8bf67 | |||
efcfd3f57d | |||
84759715a4 | |||
fda09382dd | |||
2c5dd0563a | |||
5bdd8e94fa | |||
2a53031c9a | |||
e8bc7261f3 | |||
997934f680 | |||
26e69d6264 | |||
153eabcbf2 | |||
6d0145c335 | |||
81a79f9476 | |||
537f404fe0 | |||
eb29f76b9a | |||
56816dc060 | |||
899d5f3e5e | |||
c8c455bb57 | |||
5468fc0748 | |||
78516abf2e | |||
0424f98eb5 | |||
2188b8b2e2 | |||
0bf614a75c | |||
9f21f744a4 | |||
b94cda6205 | |||
3c0e4046a4 | |||
338c22a606 | |||
25dd895e0d | |||
ea9ef9e82a | |||
edd86eda77 | |||
671b857a79 | |||
408fd0f35e | |||
30184d08b1 | |||
95f257c47a | |||
41297c6712 | |||
a8e0ade0c8 | |||
3338e699c4 | |||
e07da3efa5 | |||
4f7f015250 | |||
2a4c15d0dc | |||
70ef894ec5 | |||
bb9179d5f9 | |||
e2ecb573a2 | |||
8cb5dff498 | |||
a5629975ed | |||
972b304969 | |||
e8ded55055 | |||
04875eb164 | |||
54a59aa470 | |||
365f330629 | |||
a7829d15b2 | |||
a3868a4281 | |||
1d1d61d60c | |||
03c2491587 | |||
2c1adc988c | |||
c0fbee55e4 | |||
6e544c0b6c | |||
7d56c5ef31 | |||
c2df1af16d | |||
a8143c6453 | |||
04065061e0 | |||
226eb452e5 | |||
a6715b0872 | |||
43e3404dbb | |||
c91cf7c813 | |||
9cd1cad695 | |||
dde280833b | |||
42ac12b53e | |||
63567bf708 | |||
5d3cadefef | |||
251fbb2503 | |||
0b31d32217 | |||
5ddd4fed2e | |||
48b6d5f6c1 | |||
b83b0b5efb | |||
cb24bd953d | |||
4937dee182 | |||
d612097bb1 | |||
058d668b6b | |||
8b19462c3a | |||
0a381ef09b | |||
9b84e912b2 | |||
b3254e0f2f | |||
f0a3bbe023 | |||
df81c84438 | |||
8b12395fca | |||
cb2b71d194 | |||
7ed508e2bb | |||
dad869967e | |||
2d5b3b554e | |||
74882116e3 | |||
a97c3bce3a | |||
1aa70827dc | |||
fe028860e9 | |||
a2d2ce4d38 | |||
167c11b9eb | |||
8cb3933fcc | |||
3818328afe | |||
11627e2455 | |||
3f82c06ff8 | |||
2350f59131 | |||
9fe7c9530a | |||
52f1826e91 | |||
28a4c86dbf | |||
85e48ce03b | |||
efef61a8ea | |||
10ead95af9 | |||
838ee4d55d | |||
13e42429a9 | |||
c6ce3fe2b7 | |||
ae9a7eb0fd | |||
5d6fb2442f | |||
5a85985534 | |||
c80499db03 | |||
b8dcdb2315 | |||
b7b921f1f4 | |||
319d5c7d7f | |||
4b5b001739 | |||
db8871a455 | |||
38dcaa6066 | |||
03275b46ca | |||
cf3b482fef | |||
aa4c04d4ef | |||
73b82f65e4 | |||
9471fe40fe | |||
0d1e18735e | |||
8bb62b5992 | |||
1e8a6dea5b | |||
5c2804cc4d | |||
0dbb8f132a | |||
3395f3dbd0 | |||
d258ba776e | |||
0dcfcaad56 | |||
687e720956 | |||
180876949e | |||
9718965809 | |||
5377161fb0 | |||
963e538ae5 | |||
a355e3bf90 | |||
cb4a2598c8 | |||
950612dc07 | |||
cbd1eaf1af | |||
ac41cbd99f | |||
9f9c90abc4 | |||
87029e3538 | |||
127d9adc09 | |||
c82dc7ad85 | |||
36bcff7a7c | |||
38201b547a | |||
ed0334fcda | |||
fbb486b90b | |||
9b34f385d5 | |||
bb7b731602 | |||
19076f8136 | |||
dc77a936ce | |||
7f58710c6f | |||
068ddcdcdc | |||
f4e9252ca0 | |||
3b1e918117 | |||
ed7981fdaf | |||
9698ca53e4 | |||
ddc1dc7daf | |||
1625a957f8 | |||
2dc50d627e | |||
2ffde9a3dd | |||
5967a91ae1 | |||
32c1effcb5 | |||
9d0e19c56f | |||
acf4e634fe | |||
25942c2338 | |||
a4f81f6ba1 | |||
c1b9090e51 | |||
f494f70003 | |||
fb2a55a909 | |||
4edfa7fd50 | |||
d699cac9b1 | |||
c0428e12c1 | |||
55f434ff05 | |||
f2b3bdda2d | |||
1f6bf33b0e | |||
e2027b1a32 | |||
2b3a58b55e | |||
6ac536412a | |||
52f8ffe4e4 | |||
aca81431aa | |||
1fadd850b7 | |||
ed2a9a21b6 | |||
57279eb3e4 | |||
c403a2914a | |||
bcb176344c | |||
ecf362cffc | |||
f4ab7671d8 | |||
a2a3018917 | |||
0bdb664000 | |||
9c3b61ce57 | |||
d06df3d278 | |||
547ba19e61 | |||
cb05ff2e9e | |||
f614da7918 | |||
a3c8dafff9 | |||
fa978a7cd1 | |||
aaa0a562b4 | |||
590a4ce2a6 | |||
f26edce071 | |||
603799ea32 | |||
a32baf7798 | |||
498c9af663 | |||
202dbff6d3 | |||
96fd64d85d | |||
e236b7f98b | |||
5c7929e618 | |||
7ba5260246 | |||
a6d4947a23 | |||
7fbd4e9647 | |||
95d926b29f | |||
f6cf6d0440 | |||
e503c3f02f | |||
d4fbdd397e | |||
03943a7138 | |||
44f2c5fe0e | |||
bb66d5b684 | |||
1fca36293d | |||
2c7dc8c2ea | |||
cf0df91d8c | |||
91c85e8a58 | |||
2851780dda | |||
00fd58fb97 | |||
ee7d0ddd25 | |||
7656c08832 | |||
619c90cdd9 | |||
168d51c9fe | |||
d4b831f98e | |||
4d96a15c31 | |||
06dd3e092a | |||
82fe9e287a | |||
dc1c285de1 | |||
5a3313e94f | |||
61032c84f1 | |||
36a5b8fb39 | |||
3eda464e03 | |||
7a3ab6fd7d | |||
3d15c0b9f9 | |||
67a29b4305 | |||
594f57e0d3 | |||
d1eb51c596 | |||
85d2eff7f8 | |||
2375c46852 | |||
fd2eb5cda6 | |||
1256f440bd | |||
5b05ca67b6 | |||
95af7140cd | |||
77e9994204 | |||
3f6c186c13 | |||
9ac4a940dd | |||
ec050ab712 | |||
77e3ce8bcc | |||
f5dcf71e10 | |||
7fc18b40db | |||
8c8ab24c9e | |||
a319bd7f8c |
87
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
name: Bug report
|
||||
description: Create a report to help us address issues you are facing
|
||||
title: "[Bug] "
|
||||
labels: [Bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to make us better!
|
||||
|
||||
- type: checkboxes
|
||||
id: duplication
|
||||
attributes:
|
||||
label: ⠀
|
||||
options:
|
||||
- label: This issue is not duplicated with any other open or closed issues
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of what the bug is
|
||||
placeholder: |
|
||||
Example:
|
||||
App crashes on startup every time after changing settings.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: A clear and concise description of what you expected to happen
|
||||
placeholder: |
|
||||
Example:
|
||||
App started normally, everything worked fine.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Steps to reproduce the bug
|
||||
placeholder: |
|
||||
Example:
|
||||
1. Change "HyperNet Server" to "127.0.1" in "Network" settings
|
||||
2. Restart the app
|
||||
3. Crash
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: environment
|
||||
attributes:
|
||||
label: Device information
|
||||
description: Provide details about your system environment
|
||||
placeholder: |
|
||||
Example:
|
||||
Device: Google Pixel 8 Pro
|
||||
System: Baklava (BP22.250124.009)
|
||||
Version*: 2.3.2
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: If applicable, add screenshots to help explain your problem
|
||||
placeholder: |
|
||||
Example:
|
||||
setting_items.jpg
|
||||
crash_screen.jpg
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: additional
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Add any other context about the problem here
|
||||
placeholder: |
|
||||
Crash report or other useful informations
|
||||
validations:
|
||||
required: false
|
83
.github/ISSUE_TEMPLATE/bug_report_zh.yaml
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
name: 问题反馈
|
||||
description: 提交 Bug 或其它问题的反馈
|
||||
title: "[Bug] 标题"
|
||||
labels: [Bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
非常感谢,你将要提交的反馈会让我们变得更好!
|
||||
|
||||
- type: checkboxes
|
||||
id: duplication
|
||||
attributes:
|
||||
label: ⠀
|
||||
options:
|
||||
- label: 我已经搜索并确认此 issue 不与其它任何 issue 重复
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: 问题描述
|
||||
description: 清楚且详细地描述你遇到的 Bug 或问题
|
||||
placeholder: |
|
||||
发生了什么?生动地描述你所看到的一切
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: 期望表现
|
||||
description: 清楚且详细地描述你期望发生的事
|
||||
placeholder: |
|
||||
什么功能应该正常运行,运行后会有什么结果
|
||||
什么界面应该正常显示,应该会显示什么内容
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: 复现步骤
|
||||
description: 能够复现问题的每一步
|
||||
placeholder: |
|
||||
1. 尽可能详细地描述每一步
|
||||
2. 更改的设置、添加的好友...
|
||||
3. 这里也可以描述你看到的界面
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: environment
|
||||
attributes:
|
||||
label: 环境/版本
|
||||
description: 提供运行时的环境信息
|
||||
placeholder: |
|
||||
示例:
|
||||
设备型号: Google Pixel 8 Pro
|
||||
系统板本: Baklava (BP22.250124.009)
|
||||
程序版本: 2.3.2
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: 屏幕截图/录制
|
||||
description: 提供截屏或录屏来更好地描述问题
|
||||
placeholder: |
|
||||
错误显示的界面/崩溃时的界面、先前改动的设置
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: additional
|
||||
attributes:
|
||||
label: 更多信息
|
||||
description: 任何与问题有关且有用的信息
|
||||
placeholder: |
|
||||
崩溃报告、日志,或是你的用户名
|
||||
validations:
|
||||
required: false
|
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Solsynth Releases
|
||||
url: https://files.solsynth.dev/production01/solian
|
||||
about: Another place to download released apps
|
59
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
name: Feature request
|
||||
description: Suggest features you want to add or suggest to modify existing features
|
||||
title: "[Feature] "
|
||||
labels: [Feature]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to make us better!
|
||||
|
||||
- type: checkboxes
|
||||
id: duplication
|
||||
attributes:
|
||||
label: ⠀
|
||||
options:
|
||||
- label: This issue is not duplicated with any other open or closed issues
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Describe the feature
|
||||
description: A clear and concise description of what the feature is
|
||||
placeholder: |
|
||||
Example:
|
||||
A Quick Settings tile to start the service, long press to launch the app.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: reasons
|
||||
attributes:
|
||||
label: Reason for adding
|
||||
description: Explain why this feature would be useful to you
|
||||
placeholder: |
|
||||
Example:
|
||||
Start the service quickly from the Quick Settings tile and save lots of time.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: examples
|
||||
attributes:
|
||||
label: Example(s)
|
||||
description: Post screenshots/drawings/links/etc of the feature request, or proof-of-concept images about the feature
|
||||
placeholder: |
|
||||
Example:
|
||||
shazam_toggle.jpg
|
||||
nekobox_switch.jpg
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: additional
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Add any other context about the feature here
|
||||
validations:
|
||||
required: false
|
49
.github/ISSUE_TEMPLATE/feature_request_zh.yaml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: 功能建议
|
||||
description: 提出你想要添加或更改的功能
|
||||
title: "[Feature] 标题"
|
||||
labels: [Feature]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
非常感谢,你将要提交的请求会让我们变得更好!
|
||||
|
||||
- type: checkboxes
|
||||
id: duplication
|
||||
attributes:
|
||||
label: ⠀
|
||||
options:
|
||||
- label: 我已经搜索并确认此 issue 不与其它任何 issue 重复
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: 功能描述
|
||||
description: 清楚且详细地描述要添加/更改后的功能
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: reasons
|
||||
attributes:
|
||||
label: 添加/更改理由
|
||||
description: 解释为什么要这样做,对用户有什么好处
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: examples
|
||||
attributes:
|
||||
label: 功能示例
|
||||
description: 相似/已存在功能的截图,或画出大致的界面
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: additional
|
||||
attributes:
|
||||
label: 更多信息
|
||||
description: 任何与功能有关且有用的信息,或已存在功能的代码/仓库
|
||||
validations:
|
||||
required: false
|
40
.github/workflows/nightly.yml
vendored
@ -39,3 +39,43 @@ jobs:
|
||||
with:
|
||||
name: build-output-windows
|
||||
path: build/windows/x64/runner/Release
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: stable
|
||||
- run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y ninja-build libgtk-3-dev
|
||||
sudo apt-get install -y libmpv-dev mpv
|
||||
sudo apt-get install -y libayatana-appindicator3-dev
|
||||
sudo apt-get install -y keybinder-3.0
|
||||
sudo apt-get install -y libnotify-dev
|
||||
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
||||
sudo apt-get install -y gstreamer-1.0
|
||||
- run: flutter pub get
|
||||
- run: flutter build linux
|
||||
- name: Archive production artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-output-linux
|
||||
path: build/linux/x64/release/bundle
|
||||
- name: Build AppImage
|
||||
run: |
|
||||
rm -r Solian.AppDir | true
|
||||
mkdir Solian.AppDir
|
||||
cp -r build/linux/x64/release/bundle/* Solian.AppDir
|
||||
cp -r buildtools/appimage_config/* Solian.AppDir
|
||||
cp assets/icon/icon-light-radius.png Solian.AppDir
|
||||
sudo chmod +x buildtools/appimagetool-x86_64.AppImage
|
||||
sudo chmod +x Solian.AppDir/AppRun
|
||||
./buildtools/appimagetool-x86_64.AppImage Solian.AppDir
|
||||
- name: Archive production artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-output-linux-appimage
|
||||
path: './*.AppImage*'
|
||||
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"sync": {
|
||||
"region": "solian-next",
|
||||
"region": "solian",
|
||||
"configPath": "roadsign.toml"
|
||||
},
|
||||
"deployments": [
|
||||
{
|
||||
"region": "solian-next",
|
||||
"site": "solian-next-web",
|
||||
"region": "solian",
|
||||
"site": "solian-web",
|
||||
"path": "build/web"
|
||||
}
|
||||
]
|
||||
|
34
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,34 @@
|
||||
# Code of Conduct
|
||||
|
||||
Welcome to the Solar Network / HyperNet project!
|
||||
|
||||
We're welcome for any contribution, from bug reports to feature requests to code contributions.
|
||||
|
||||
To get started, start from fork the repository.
|
||||
|
||||
## Project Structure
|
||||
|
||||
The current repository you're visiting is the front-end project for the Solar Network project. It's built by Flutter and also manages all feature requests and issues reports in this repository.
|
||||
|
||||
The backend of the Solar Network is written in Go and is a microservices app. The code is stored separately in different repositories. They're linked in the README.MD, you can have a look and try to contribute if you want.
|
||||
|
||||
## Commit Messages
|
||||
|
||||
We're using the gitmoji to clarify the reason and changes of the commit. To learn more about gitmoji, visit https://gitmoji.dev
|
||||
|
||||
## Translations & Localization
|
||||
|
||||
We're not accepting translation and localization improvements, or fixes on the GitHub or Solsynth Git Repository. If you want to contribute to those, please head to our Weblate: https://i18n.solsynth.dev. You will able to sign up / in via your Solar Network Account (Solarpass)
|
||||
|
||||
## New Features
|
||||
|
||||
To contribute new features, please create an issue or mention the feature you want in our official development chat channel. You should discuss the feature with us and the community first. You shouldn't just create a Pull Request for the feature you want, it will not be merged.
|
||||
|
||||
## Bug Reports / Ask for help
|
||||
|
||||
Read the error message, check for the update (including pre-releases), and wiki before creating an issue. At the same time, be respectful and don't argue with our developers and contributors in the development chat or GitHub issue. Otherwise your issue may got deleted and your Solar Network Account may got a strike.
|
||||
|
||||
-----------
|
||||
|
||||
We appreciate every single commit you contributed. Let's work together and create a better Solar Network!
|
||||
|
68
README.md
Normal file
@ -0,0 +1,68 @@
|
||||
# Solar Network
|
||||
|
||||

|
||||
|
||||
Hello there! Welcome to the main repository of the HyperNet (also known as the Solar Network). The code here is mainly about the front-end app (also known as Solian). But you can still post issues here to get help and request new features!
|
||||
|
||||
## Sub Projects
|
||||
|
||||
HyperNet, the Solar Network is a microservices project in which the backends are stored in separate repositories. Here is a simple index for it.
|
||||
|
||||
- The Core, Gateway: [Nexus](https://github.com/Solsynth/HyperNet.Nexus)
|
||||
- The Auth Service: [Passport](https://github.com/Solsynth/HyperNet.Passport)
|
||||
- The Posting Service: [Interactive](https://github.com/Solsynth/HyperNet.Interactive)
|
||||
- The Messaging Service: [Messaging](https://github.com/Solsynth/HyperNet.Messaging)
|
||||
- The Wallet Service: [Wallet](https://github.com/Solsynth/HyperNet.Wallet)
|
||||
- The Crawler: [Reader](https://github.com/Solsynth/HyperNet.Reader)
|
||||
- The Attachments Service: [Paperclip](https://github.com/Solsynth/HyperNet.Paperclip)
|
||||
- Some others may not be listed, you can search in the organization with `HyperNet.` It's the prefix of all HyperNet projects.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
For those people who want to know the tech stack of this project, the front-end was built by Flutter, which provides cross-platform ability.
|
||||
|
||||
The backend was built in Go and PostgreSQL with our very own microservice framework included in the nexus.
|
||||
|
||||
If you want to contribute to the project, learn more about the [Code of Conduct](./CODE_OF_CONDUCT.md).
|
||||
|
||||
## Getting Started
|
||||
|
||||
The content below will lead you to the world of Solar Network.
|
||||
|
||||
### For Normal Users
|
||||
|
||||
1. Go to the Github Releases page, and download the latest release / pre-release according to your platform.
|
||||
- **What's the difference between stable and pre-release?** The pre-release is untested by the other users and includes the new cutting-edge features, usually the pre-release is the feature drop. At the same time, due to we're not doing the API versioning, some breaking changes may break the stable release, so use the pre-release one instead.
|
||||
2. Create an account on the Solar Network
|
||||
3. Go to your email inbox to confirm your registration
|
||||
4. Start exploring!
|
||||
|
||||
### For Developers
|
||||
|
||||
To make the Solar Network App run in debug mode on your machine, you need to install the flutter development environment, for more environments, head to https://flutter.dev.
|
||||
|
||||
For the Linux platform, you need to install those extra development libs:
|
||||
|
||||
```bash
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y ninja-build libgtk-3-dev
|
||||
sudo apt-get install -y libmpv-dev mpv
|
||||
sudo apt-get install -y libayatana-appindicator3-dev
|
||||
sudo apt-get install -y keybinder-3.0
|
||||
sudo apt-get install -y libnotify-dev
|
||||
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
||||
sudo apt-get install -y gstreamer-1.0
|
||||
```
|
||||
|
||||
Then, use the flutter run for the app running in debug mode.
|
||||
|
||||
```bash
|
||||
flutter pub get
|
||||
```
|
||||
|
||||
If you want to build the release version, use the flutter build command. Learn more from the flutter docs.
|
||||
|
||||
```bash
|
||||
flutter build <platform>
|
||||
```
|
||||
|
@ -15,6 +15,7 @@ analyzer:
|
||||
- "**/*.freezed.dart"
|
||||
errors:
|
||||
invalid_annotation_target: ignore # Due to freezed + json_serializable issue, ref https://github.com/rrousselGit/freezed/issues/488#issuecomment-894358980
|
||||
deprecated_member_use: ignore
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
|
@ -10,8 +10,9 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "androidx.glance:glance:1.1.1"
|
||||
implementation "androidx.glance:glance-appwidget:1.1.1"
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation 'androidx.glance:glance:1.1.1'
|
||||
implementation 'androidx.glance:glance-appwidget:1.1.1'
|
||||
implementation 'androidx.compose.foundation:foundation-layout-android:1.7.6'
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||
@ -19,6 +20,12 @@ dependencies {
|
||||
implementation 'io.coil-kt.coil3:coil-network-okhttp:3.0.4'
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
android {
|
||||
buildFeatures {
|
||||
compose true
|
||||
@ -49,6 +56,15 @@ android {
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias = keystoreProperties['keyAlias']
|
||||
keyPassword = keystoreProperties['keyPassword']
|
||||
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||
storePassword = keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
debuggable true
|
||||
@ -56,9 +72,7 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.debug
|
||||
signingConfig = signingConfigs.release
|
||||
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
|
@ -18,10 +18,14 @@
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:requestLegacyExternalStorage="true">
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:launchMode="singleInstance"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
|
@ -54,7 +54,7 @@ class CheckInWidget : GlanceAppWidget() {
|
||||
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
|
||||
.registerTypeAdapter(Instant::class.java, InstantAdapter())
|
||||
.create()
|
||||
val resultTierSymbols = listOf("大凶", "凶", "中平", "吉", "大吉")
|
||||
val resultTierSymbols = listOf("Bad", "Poor", "Medium", "Good", "Great")
|
||||
|
||||
val prefs = currentState.preferences
|
||||
val checkInRaw: String? = prefs.getString("pas_check_in_record", null)
|
||||
@ -120,7 +120,7 @@ class CheckInWidget : GlanceAppWidget() {
|
||||
}
|
||||
|
||||
Text(
|
||||
text = "You haven't checked in today",
|
||||
text = "You haven't divined today",
|
||||
style = TextStyle(fontSize = 15.sp, color = GlanceTheme.colors.onSurface)
|
||||
)
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.5 KiB |
@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFFFF</color>
|
||||
<color name="ic_notification_background">#00000000</color>
|
||||
</resources>
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<style name="LaunchTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
@ -16,7 +16,7 @@
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<style name="NormalTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
11
api/Interactive/Trigger Fediverse Scan.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: Trigger Fediverse Scan
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/co/admin/fediverse
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
11
api/Nexus/Check Status.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: Check Status
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{endpoint}}/directory/status
|
||||
body: none
|
||||
auth: none
|
||||
}
|
11
api/Nexus/List Services.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: List Services
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{endpoint}}/directory/services
|
||||
body: none
|
||||
auth: none
|
||||
}
|
26
api/Paperclip/Activate Boost.bru
Normal file
@ -0,0 +1,26 @@
|
||||
meta {
|
||||
name: Activate Boost
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/uc/boosts/1/activate
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"client_id": "{{third_client_id}}",
|
||||
"client_secret":"{{third_client_tk}}",
|
||||
"type": "general",
|
||||
"subject": "Merry Christmas!",
|
||||
"subtitle": "一条来自 Solar Network 团队的信息",
|
||||
"content": "今天是 12 月 25 日 (UTC+8),小羊祝您圣诞快乐 🎄",
|
||||
"metadata": {
|
||||
"image": "6EqsYQwmFRCkbmhR"
|
||||
},
|
||||
"priority": 10
|
||||
}
|
||||
}
|
19
api/Paperclip/Stickers/Create Sticker Pack.bru
Normal file
@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Create Sticker Pack
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/uc/stickers/packs
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"prefix": "cat",
|
||||
"name": "Solar Network full of Cats!",
|
||||
"description": "The sticker packs is full of stickers which related with cats!"
|
||||
}
|
||||
}
|
20
api/Paperclip/Stickers/Create Sticker.bru
Normal file
@ -0,0 +1,20 @@
|
||||
meta {
|
||||
name: Create Sticker
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/uc/stickers
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"alias": "Deadge",
|
||||
"name": "Dead",
|
||||
"attachment_id": "pcbFd0u4zgdM39HM",
|
||||
"pack_id": 4
|
||||
}
|
||||
}
|
11
api/Paperclip/Stickers/Get Sticker Packs.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: Get Sticker Packs
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{endpoint}}/cgi/uc/stickers/packs
|
||||
body: none
|
||||
auth: none
|
||||
}
|
15
api/Paperclip/Stickers/Get Stickers.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Get Stickers
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{endpoint}}/cgi/uc/stickers?take=10
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
params:query {
|
||||
take: 10
|
||||
}
|
18
api/Passport/Deal Abuse Report.bru
Normal file
@ -0,0 +1,18 @@
|
||||
meta {
|
||||
name: Deal Abuse Report
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{endpoint}}/cgi/id/reports/abuse/6/status
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"status": "rejected",
|
||||
"message": "Not a good reason"
|
||||
}
|
||||
}
|
24
api/Passport/Developer Notify All Users.bru
Normal file
@ -0,0 +1,24 @@
|
||||
meta {
|
||||
name: Developer Notify All Users
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/id/dev/notify/all
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"client_id": "{{third_client_id}}",
|
||||
"client_secret":"{{third_client_tk}}",
|
||||
"type": "general",
|
||||
"subject": "关于迁移服务器完成的提示",
|
||||
"subtitle": "一条来自 Solar Network 团队的运营信息",
|
||||
"content": "我们已经将所有用户数据迁移到新版服务器,刚刚发布新的 DNS,因为部分 DNS 缓存的影响。可能更改不会生效,可以使用 nslookup / ping 检查解析地址是否未 8. 开头,您可以主动刷新 DNS。谢谢!",
|
||||
"metadata": {},
|
||||
"priority": 10
|
||||
}
|
||||
}
|
23
api/Passport/Developer Notify One User.bru
Normal file
@ -0,0 +1,23 @@
|
||||
meta {
|
||||
name: Developer Notify One User
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/id/dev/notify/328
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"client_id": "{{third_client_id}}",
|
||||
"client_secret":"{{third_client_tk}}",
|
||||
"type": "general",
|
||||
"subject": "处理该发布者 @vedal987 的决定",
|
||||
"subtitle": "一条来自 Solar Network 客户支持的信息",
|
||||
"content": "您的发布者违反了我们用户协议中的「禁止冒充他人」的相关条例,经管理决定,将相关内容隐藏。冒充他人的判定无论作者是否有主观意志,只要造成了误解我们就有责任处理。希望您能理解,本次决定未作出任何帐号相关的连带处罚。",
|
||||
"priority": 10
|
||||
}
|
||||
}
|
19
api/Passport/Give Punishment.bru
Normal file
@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Give Punishment
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/id/punishments
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"reason": "侮辱 Solar Network 商标,煽动颠覆中华羊国政权,制造不实信息,传播谣言,制造恐慌,寻衅滋事。",
|
||||
"type": 0,
|
||||
"account_id": 5
|
||||
}
|
||||
}
|
11
api/Reader/List News Sources.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: List News Sources
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{endpoint}}/cgi/re/well-known/sources
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
17
api/Reader/List News.bru
Normal file
@ -0,0 +1,17 @@
|
||||
meta {
|
||||
name: List News
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{endpoint}}/cgi/re/news?take=10&offset=0&source=shadiao
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
params:query {
|
||||
take: 10
|
||||
offset: 0
|
||||
source: shadiao
|
||||
}
|
18
api/Reader/Trigger Scan News.bru
Normal file
@ -0,0 +1,18 @@
|
||||
meta {
|
||||
name: Trigger Scan News
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/re/admin/scan
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"sources": ["taiwan-pts"],
|
||||
"eager": true
|
||||
}
|
||||
}
|
20
api/Wallet/Create Order.bru
Normal file
@ -0,0 +1,20 @@
|
||||
meta {
|
||||
name: Create Order
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/wa/orders
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"client_id": "highland-mc",
|
||||
"client_secret": "(3^DLAvo3v",
|
||||
"remark": "我是秦始皇,现在被困香港,现在 SN 转我 500 源点,帮助我回到咸阳,到时候封你为太监一职。",
|
||||
"amount": 500
|
||||
}
|
||||
}
|
21
api/Wallet/Create Transaction.bru
Normal file
@ -0,0 +1,21 @@
|
||||
meta {
|
||||
name: Create Transaction
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/cgi/wa/transactions
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"client_id": "alphabot",
|
||||
"client_secret": "_uR0sVnHTh",
|
||||
"remark": "新年红包",
|
||||
"amount": 150,
|
||||
"payee_id": 18
|
||||
}
|
||||
}
|
20
api/Wallet/Get Order.bru
Normal file
@ -0,0 +1,20 @@
|
||||
meta {
|
||||
name: Get Order
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{endpoint}}/cgi/wa/orders/4
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"client_id": "highland-mc",
|
||||
"client_secret": "(3^DLAvo3v",
|
||||
"remark": "我是秦始皇,现在被困香港,现在 SN 转我 500 源点,帮助我回到咸阳,到时候封你为太监一职。",
|
||||
"amount": 500
|
||||
}
|
||||
}
|
20
api/Wallet/Get Transaction.bru
Normal file
@ -0,0 +1,20 @@
|
||||
meta {
|
||||
name: Get Transaction
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{endpoint}}/cgi/wa/transactions/67
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"client_id": "highland-mc",
|
||||
"client_secret": "(3^DLAvo3v",
|
||||
"remark": "我是秦始皇,现在被困香港,现在 SN 转我 500 源点,帮助我回到咸阳,到时候封你为太监一职。",
|
||||
"amount": 500
|
||||
}
|
||||
}
|
11
api/WatchTower/Run Database Maintenance.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: Run Database Maintenance
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{endpoint}}/wt/maintenance/database
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
9
api/bruno.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": "1",
|
||||
"name": "Solar Network",
|
||||
"type": "collection",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
".git"
|
||||
]
|
||||
}
|
7
api/collection.bru
Normal file
@ -0,0 +1,7 @@
|
||||
auth {
|
||||
mode: bearer
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: {{atk}}
|
||||
}
|
8
api/environments/Prod.bru
Normal file
@ -0,0 +1,8 @@
|
||||
vars {
|
||||
endpoint: https://api.sn.solsynth.dev
|
||||
third_client_id: alphabot
|
||||
}
|
||||
vars:secret [
|
||||
atk,
|
||||
third_client_tk
|
||||
]
|
BIN
assets/audio/notify/metal-pipe.mp3
Normal file
BIN
assets/audio/sfx/launch-done.mp3
Normal file
BIN
assets/audio/sfx/launch-intro.mp3
Normal file
BIN
assets/fonts/Nunito-Bold.ttf
Executable file
BIN
assets/fonts/Nunito-Italic.ttf
Executable file
BIN
assets/fonts/Nunito-Regular.ttf
Executable file
BIN
assets/icon/kanban-1st.jpg
Executable file
After Width: | Height: | Size: 509 KiB |
BIN
assets/icon/tray-icon.ico
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
assets/icon/tray-icon.png
Normal file
After Width: | Height: | Size: 228 KiB |
@ -17,12 +17,17 @@
|
||||
"screenAccountProfileEdit": "Edit Profile",
|
||||
"screenAbuseReport": "Abuse Reports",
|
||||
"screenSettings": "Settings",
|
||||
"screenAccountSettings": "Account Settings",
|
||||
"screenFactorSettings": "Auth Factors",
|
||||
"screenAccountWallet": "Wallet",
|
||||
"screenNews": "News",
|
||||
"screenAlbum": "Album",
|
||||
"screenChat": "Chat",
|
||||
"screenChatManage": "Edit Channel",
|
||||
"screenChatNew": "New Channel",
|
||||
"screenRealm": "Realm",
|
||||
"screenRealmManage": "Edit Realm",
|
||||
"screenRealmDiscovery": "Realm Discovery",
|
||||
"screenRealmNew": "New Realm",
|
||||
"screenNotification": "Notification",
|
||||
"screenPostSearch": "Search Posts",
|
||||
@ -57,7 +62,7 @@
|
||||
"reply": "Reply",
|
||||
"unset": "Unset",
|
||||
"untitled": "Untitled",
|
||||
"postDetail": "Post detail",
|
||||
"postDetail": "Post Detail",
|
||||
"postNoun": "Post",
|
||||
"postReadMore": "Read more",
|
||||
"postReadEstimate": "Est read time {}",
|
||||
@ -103,8 +108,18 @@
|
||||
},
|
||||
"loginEnterPassword": "Enter the code",
|
||||
"loginSuccess": "Logged in as {}",
|
||||
"authFactorDelete": "Delete Auth Factor",
|
||||
"authFactorDeleteDescription": "Are you sure you want delete auth factor {}?",
|
||||
"authFactorPassword": "Password",
|
||||
"authFactorPasswordDescription": "The password you set when you registered.",
|
||||
"authFactorEmail": "Email verification code",
|
||||
"authFactorEmailDescription": "An one-time code sent to the email address you set when you registered.",
|
||||
"authFactorTOTP": "Time-based OTP",
|
||||
"authFactorTOTPDescription": "A one-time code generated by a TOTP authenticator such as Google Authenticator or Authy.",
|
||||
"authFactorInAppNotify": "In-app notification",
|
||||
"authFactorInAppNotifyDescription": "A one-time code sent via in-app notification.",
|
||||
"authFactorAdd": "Add a factor",
|
||||
"authFactorAddSubtitle": "Provide another way to login your account.",
|
||||
"accountIntroTitle": "Hello there!",
|
||||
"accountIntroSubtitle": "Pick an option below to get started.",
|
||||
"accountLogout": "Logout",
|
||||
@ -113,8 +128,14 @@
|
||||
"accountLogoutConfirm": "You will need to re-enter your account password, even if you have already done so. This is required to login again.",
|
||||
"accountPublishers": "Your publishers",
|
||||
"accountPublishersSubtitle": "Manage your publish identities.",
|
||||
"accountProfileEdit": "Edit your profile",
|
||||
"accountSettings": "Account Settings",
|
||||
"accountSettingsSubtitle": "Manage your account and make it yours.",
|
||||
"accountProfileEdit": "Edit Profile",
|
||||
"accountProfileEditSubtitle": "Make your Solarpass account more looks like you.",
|
||||
"accountWallet": "Wallet",
|
||||
"accountWalletSubtitle": "View your balance and transactions.",
|
||||
"factorSettings": "Auth Factors",
|
||||
"factorSettingsSubtitle": "Manage your authentication factors.",
|
||||
"accountProfileEditApplied": "Profile modification applied.",
|
||||
"publishersNew": "New Publisher",
|
||||
"publisherNewSubtitle": "Create a new publisher identity.",
|
||||
@ -132,20 +153,31 @@
|
||||
"publisherRunBy": "Run by {}",
|
||||
"fieldPublisherBelongToRealm": "Belongs to",
|
||||
"fieldPublisherBelongToRealmUnset": "Unset Publisher Belongs to Realm",
|
||||
"writePost": "Compose",
|
||||
"postTypeStory": "Story",
|
||||
"postTypeArticle": "Article",
|
||||
"postTypeQuestion": "Question",
|
||||
"postTypeVideo": "Video",
|
||||
"writePostTypeStory": "Post a story",
|
||||
"writePostTypeArticle": "Write an article",
|
||||
"writePostTypeQuestion": "Ask a question",
|
||||
"writePostTypeVideo": "Post a video",
|
||||
"fieldPostPublisher": "Post publisher",
|
||||
"fieldPostContent": "What happened?!",
|
||||
"fieldPostTitle": "Title",
|
||||
"fieldPostQuestionReward": "Answer Rewards (Source Points)",
|
||||
"fieldPostDescription": "Description",
|
||||
"fieldPostTags": "Tags",
|
||||
"fieldPostCategories": "Categories",
|
||||
"fieldPostAlias": "Alias",
|
||||
"fieldPostAliasHint": "Optional, used to represent the post in URL, should follow URL-Safe.",
|
||||
"postPublish": "Publish",
|
||||
"postPosted": "Post has been posted.",
|
||||
"postPublishedAt": "Published At",
|
||||
"postPublishedUntil": "Published Until",
|
||||
"postEditingNotice": "You're about to editing a post that posted {}.",
|
||||
"postReplyingNotice": "You're about to reply to a post that posted {}.",
|
||||
"postRepostingNotice": "You're about to repost a post that posted {}.",
|
||||
"postEditingNotice": "You're about to editing a post that posted by {}.",
|
||||
"postReplyingNotice": "You're about to reply to a post that posted by {}.",
|
||||
"postRepostingNotice": "You're about to repost a post that posted by {}.",
|
||||
"postReact": "React",
|
||||
"postReactions": "Reactions of Post",
|
||||
"postReactionUpvote": {
|
||||
@ -175,13 +207,37 @@
|
||||
"one": "{} comment",
|
||||
"other": "{} comments"
|
||||
},
|
||||
"postCommentExpand": "Show comments",
|
||||
"settingsAppearance": "Appearance",
|
||||
"settingsCustomFonts": "Custom Fonts",
|
||||
"settingsCustomFontsDescription": "Set custom fonts for the application.",
|
||||
"settingsCustomFontFamily": "Custom Font Family",
|
||||
"settingsCustomFontFamilyHint": "Use comma to separate fonts, higher priority comes first",
|
||||
"settingsCustomFontApplied": "Custom font has been applied.",
|
||||
"settingsDisplayLanguage": "Display Language",
|
||||
"settingsDisplayLanguageDescription": "Set the application language.",
|
||||
"settingsDisplayLanguageSystem": "Follow System",
|
||||
"settingsAppBarTransparent": "Transparent App Bar",
|
||||
"settingsAppBarTransparentDescription": "Enable transparent effect for the app bar.",
|
||||
"settingsDrawerPreferCollapse": "Prefer Drawer Collapse",
|
||||
"settingsDrawerPreferCollapseDescription": "Make the drawer to collapse even when the screen is wide enough.",
|
||||
"settingsBackgroundImage": "Background Image",
|
||||
"settingsBackgroundImageDescription": "Set the background image that will be applied globally.",
|
||||
"settingsBackgroundImageClear": "Clear Existing Background Image",
|
||||
"settingsBackgroundImageClearDescription": "Reset the background image to blank.",
|
||||
"settingsThemeMaterial3": "Use Material You Design",
|
||||
"settingsThemeMaterial3Description": "Set the application theme to Material 3 Design.",
|
||||
"settingsColorScheme": "Color Scheme",
|
||||
"settingsColorSchemeDescription": "Set the application primary color.",
|
||||
"settingsColorSeed": "Color Seed",
|
||||
"settingsColorSeedDescription": "Select one of the present color schemes.",
|
||||
"settingsFeatures": "Features",
|
||||
"settingsNotifyWithHaptic": "Haptic when Notified",
|
||||
"settingsNotifyWithHapticDescription": "Vibrate lightly when a new notification appears in the foreground.",
|
||||
"settingsExpandPostLink": "Expand Post Link",
|
||||
"settingsExpandPostLinkDescription": "Expand the post link in the post list.",
|
||||
"settingsExpandChatLink": "Expand Chat Link",
|
||||
"settingsExpandChatLinkDescription": "Expand the chat link in the chat list.",
|
||||
"settingsNetwork": "Network",
|
||||
"settingsNetworkServer": "HyperNet Server",
|
||||
"settingsNetworkServerDescription": "Set the HyperNet server address, choose ours or build your own.",
|
||||
@ -200,12 +256,15 @@
|
||||
"settingsMisc": "Misc",
|
||||
"settingsMiscAbout": "About",
|
||||
"settingsMiscAboutDescription": "View the version information of Solian.",
|
||||
"settingsAccountLanguage": "Account Language",
|
||||
"settingsAccountLanguageDescription": "Set the language for email, notification, and other account-related content.",
|
||||
"sensitiveContent": "Sensitive Content",
|
||||
"sensitiveContentCollapsed": "Sensitive content has been collapsed.",
|
||||
"sensitiveContentDescription": "This content has been marked as sensitive, and may not be suitable for all viewers.",
|
||||
"sensitiveContentReveal": "Reveal",
|
||||
"serverConnecting": "Connecting to server...",
|
||||
"serverDisconnected": "Lost connection from server",
|
||||
"serverConnecting": "Connecting...",
|
||||
"serverDisconnected": "Connection Lost",
|
||||
"serverConnected": "Connected",
|
||||
"fieldChatAlias": "Channel Alias",
|
||||
"fieldChatAliasHint": "The unique channel alias within the site, used to represent the channel in URL, leave blank to auto generate. Should be URL-Safe.",
|
||||
"fieldChatName": "Name",
|
||||
@ -272,16 +331,52 @@
|
||||
"one": "{} attachment",
|
||||
"other": "{} attachments"
|
||||
},
|
||||
"messageTyping": {
|
||||
"one": "{} is typing...",
|
||||
"other": "{} are typing..."
|
||||
},
|
||||
"fieldAttachmentRandomId": "Random ID",
|
||||
"fieldAttachmentAlt": "Alternative text",
|
||||
"addAttachmentFromAlbum": "Add from album",
|
||||
"addAttachmentFromFiles": "Add from files",
|
||||
"addAttachmentFromClipboard": "Paste file",
|
||||
"addAttachmentFromCameraPhoto": "Take photo",
|
||||
"addAttachmentFromCameraVideo": "Take video",
|
||||
"addAttachmentFromRandomId": "Link via RID",
|
||||
"attachmentDetailInfo": "Attachment details",
|
||||
"attachmentPastedImage": "Pasted Image",
|
||||
"attachmentInsertedImage": "Inserted Image",
|
||||
"attachmentInsertLink": "Insert Link",
|
||||
"attachmentSetAsPostThumbnail": "Set as post thumbnail",
|
||||
"attachmentUnsetAsPostThumbnail": "Unset as post thumbnail",
|
||||
"attachmentCompressVideo": "Re-encode video",
|
||||
"attachmentSetThumbnail": "Set thumbnail",
|
||||
"attachmentSetAlt": "Set alternative text",
|
||||
"attachmentCopyRandomId": "Copy RID",
|
||||
"attachmentUpload": "Upload",
|
||||
"attachmentInputDialog": "Upload attachments",
|
||||
"attachmentInputUseRandomId": "Use Random ID",
|
||||
"attachmentInputNew": "New Upload",
|
||||
"waitingForUpload": "Waiting for upload",
|
||||
"attachmentVideoCompressHint": "Compress a copy of this video",
|
||||
"attachmentVideoCompressHintDescription": "Do you want to upload a compress copy of video {}? It will help your audience to preview this video faster and they still can watch the original video. It will take some while to process the video on your device, so please be patient.",
|
||||
"attachmentCompressQuality": "Compress quality",
|
||||
"attachmentCompressQualityHighest": "Highest",
|
||||
"attachmentCompressQualityDefault": "Default",
|
||||
"attachmentCompressQualityMedium": "Medium",
|
||||
"attachmentCompressQualityLow": "Low",
|
||||
"attachmentCompressQualityHint": "Solar Network doesn't prevent you from uploading large files, high resolution, high bitrate videos. But for your network conditions, we suggest you choose a suitable compression quality.",
|
||||
"attachmentUploaded": "Uploaded",
|
||||
"attachmentPending": "Pending",
|
||||
"attachmentCopyCompressed": "Copy compressed",
|
||||
"attachmentGotBoosted": "Boosted",
|
||||
"attachmentBoost": "Boost",
|
||||
"attachmentCreateBoost": "Create Boost",
|
||||
"attachmentBoostHint": "Boost is a feature that allows you to upload attachments to a server closer to your audience or a faster content network. This feature is currently in beta and is subject to change. It's all free for now, you can feel free to try, you will get notified when the pricing plan changed.",
|
||||
"attachmentDestinationRegion": "Destination Region",
|
||||
"attachmentDestinationRegionAPAC": "Asia Pacific",
|
||||
"attachmentDestinationRegionNGB": "Ning Bo, China, Zhejiang",
|
||||
"attachmentDestinationRegionHKG": "Hong Kong",
|
||||
"notification": "Notification",
|
||||
"notificationUnreadCount": {
|
||||
"zero": "All notifications read",
|
||||
@ -337,7 +432,7 @@
|
||||
"callMessageEnded": "Call lasted {}",
|
||||
"callMessageStarted": "Call started",
|
||||
"dailyCheckIn": "Check In",
|
||||
"dailyCheckInNone": "You haven't checked in today",
|
||||
"dailyCheckInNone": "You haven't divined today",
|
||||
"dailyCheckAction": "Check in right now!",
|
||||
"dailyCheckDetail": "Can't understand the symbol? Master, help me understand it!",
|
||||
"dailyCheckDetailTitle": "{}'s fortune details",
|
||||
@ -369,9 +464,32 @@
|
||||
"dailyCheckNegativeHint5Description": "Lost connection at a crucial moment",
|
||||
"dailyCheckNegativeHint6": "Going out",
|
||||
"dailyCheckNegativeHint6Description": "Forgot your umbrella and got caught in the rain",
|
||||
"happyBirthday": "Happy birthday, {}!",
|
||||
"celebrateBirthday": "Happy birthday, {}!",
|
||||
"celebrateMerryXmas": "Merry christmas, {}!",
|
||||
"celebrateNewYear": "Happy new year, {}!",
|
||||
"celebrateLunarNewYear": "Happy lunar new year, {}!",
|
||||
"celebrateMidAutumn": "Happy mid-autumn festival, {}!",
|
||||
"celebrateDragonBoat": "Happy dragon boat festival, {}!",
|
||||
"celebrateValentineDay": "Today is valentine's day, {}!",
|
||||
"celebrateLaborDay": "Today is labor day, {}.",
|
||||
"celebrateMotherDay": "Today is mother's day, {}.",
|
||||
"celebrateChildrenDay": "Today is children's day, {}!",
|
||||
"celebrateFatherDay": "Today is father's day, {}.",
|
||||
"celebrateHalloween": "Happy halloween, {}!",
|
||||
"celebrateThanksgiving": "Today is thanksgiving day, {}!",
|
||||
"pendingBirthday": "Birthday in {}",
|
||||
"pendingMerryXmas": "Christmas in {}",
|
||||
"pendingLunarNewYear": "Lunar new year in {}",
|
||||
"pendingMidAutumn": "Mid-autumn festival in {}",
|
||||
"pendingDragonBoat": "Dragon boat festival in {}",
|
||||
"pendingNewYear": "New year in {}",
|
||||
"pendingValentineDay": "Valentine's day in {}",
|
||||
"pendingLaborDay": "Labor day in {}",
|
||||
"pendingMotherDay": "Mother's day in {}",
|
||||
"pendingChildrenDay": "Children's day in {}",
|
||||
"pendingFatherDay": "Father's day in {}",
|
||||
"pendingHalloween": "Halloween in {}",
|
||||
"pendingThanksgiving": "Thanksgiving day in {}",
|
||||
"friendNew": "Add Friend",
|
||||
"friendRequests": "Friend Requests",
|
||||
"friendRequestsDescription": {
|
||||
@ -405,14 +523,21 @@
|
||||
"accountJoinedAt": "Joined at {}",
|
||||
"accountBirthday": "Born on {}",
|
||||
"accountBadge": "Badge",
|
||||
"badgeCompanyStaff": "Solsynth Staff",
|
||||
"accountCheckInNoRecords": "No check-in records",
|
||||
"badgeCompanyStaff": "Staff",
|
||||
"badgeSiteMigration": "Solar Network Native",
|
||||
"badgeCommunitySurvey": "Survey Participant",
|
||||
"badgeCommunityVerified": "Verified User",
|
||||
"badgeCommunityContributor": "Great Contributor",
|
||||
"badgeSiteAnniversary": "Anniversary",
|
||||
"badgeUserBirthday": "Birthday",
|
||||
"accountStatus": "Status",
|
||||
"accountStatusOnline": "Online",
|
||||
"accountStatusOffline": "Offline",
|
||||
"accountStatusLastSeen": "Last seen at {}",
|
||||
"postArticle": "Article on the Solar Network",
|
||||
"postStory": "Story on the Solar Network",
|
||||
"postLocalDraftRestored": "Restored from device",
|
||||
"articleWrittenAt": "Written at {}",
|
||||
"articleEditedAt": "Edited at {}",
|
||||
"attachmentSaved": "Saved to album",
|
||||
@ -440,6 +565,7 @@
|
||||
"termAcceptNextWithAgree": "By clicking the \"Next\", it means you agree to our terms and its updates.",
|
||||
"unauthorized": "Unauthorized",
|
||||
"unauthorizedDescription": "Login to explore the entire Solar Network.",
|
||||
"projectDetail": "Project Details",
|
||||
"serviceStatus": "Service Status",
|
||||
"termRelated": "Related Terms",
|
||||
"appDetails": "App Details",
|
||||
@ -448,16 +574,379 @@
|
||||
"publisherBlockHintDescription": "You are going to block this publisher's maintainer, this will also block publishers that run by the same user.",
|
||||
"userUnblocked": "{} has been unblocked.",
|
||||
"userBlocked": "{} has been blocked.",
|
||||
"postSharingViaPicture": "Capturing post as picture, please stand by...",
|
||||
"postSharingViaPicture": "Capturing post as picture, please wait...",
|
||||
"postImageShareReadMore": "Scan the QR code to read full post",
|
||||
"postImageShareAds": "Explore posts on the Solar Network",
|
||||
"postShare": "Share",
|
||||
"postShareImage": "Share via Image",
|
||||
"postGetInsight": "Get Insight",
|
||||
"postGetInsightTitle": "AI Insight",
|
||||
"postGetInsightDescription": "AI may make mistakes, check important information.",
|
||||
"appInitializing": "Initializing",
|
||||
"poweredBy": "Powered by {}",
|
||||
"shareIntent": "Share",
|
||||
"shareIntentDescription": "What do you want to do with the content you are sharing?",
|
||||
"shareIntentPostStory": "Post a Story",
|
||||
"shareIntentSendChannel": "Share to Channel",
|
||||
"updateAvailable": "Update Available",
|
||||
"updateOngoing": "正在更新,请稍后..."
|
||||
"updateOngoing": "Updating, please wait...",
|
||||
"custom": "Custom",
|
||||
"colorSchemeIndigo": "Indigo",
|
||||
"colorSchemeBlue": "Blue",
|
||||
"colorSchemeGreen": "Green",
|
||||
"colorSchemeYellow": "Yellow",
|
||||
"colorSchemeOrange": "Orange",
|
||||
"colorSchemeRed": "Red",
|
||||
"colorSchemeWhite": "White",
|
||||
"colorSchemeBlack": "Black",
|
||||
"colorSchemeApplied": "Color scheme has been applied, may need restart the app to take effect.",
|
||||
"postFeaturedComment": "Featured Comment",
|
||||
"postCategory": "Category",
|
||||
"postCategoryTechnology": "Technology",
|
||||
"postCategoryGaming": "Gaming",
|
||||
"postCategoryLife": "Life",
|
||||
"postCategoryArts": "Arts",
|
||||
"postCategorySports": "Sports",
|
||||
"postCategoryMusic": "Music",
|
||||
"postCategoryNews": "News",
|
||||
"postCategoryKnowledge": "Knowledge",
|
||||
"postCategoryLiterature": "Literature",
|
||||
"postCategoryFunny": "Funny",
|
||||
"postCategoryUncategorized": "Uncategorized",
|
||||
"newsAllSources": "All News",
|
||||
"newsReadingProviderSwap": "Swap",
|
||||
"newsReadingFromReader": "You're reading from HyperNet.Reader",
|
||||
"newsReadingFromOriginal": "You're reading the original article",
|
||||
"newsDisclaimer": "This article is fetched from the Internet, we do not guarantee its authenticity, please judge for yourself. All content in this article belongs to the original author.",
|
||||
"newsToday": "Today's News",
|
||||
"totpPostSetup": "One More Thing",
|
||||
"totpPostSetupDescription": "Scan the QR Code below with Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden or any of kind of authenticator app which supports TOTP.",
|
||||
"totpNeverShare": "Never share this QR Code",
|
||||
"needHelp": "Need Help?",
|
||||
"needHelpLaunch": "Check out our Goatpedia!",
|
||||
"walletCreate": "Create a Wallet",
|
||||
"walletCreateSubtitle": "Create a wallet to start using Source Points",
|
||||
"walletCreatePassword": "Set a payment password for your new wallet below",
|
||||
"walletCurrencyShort": "SRC",
|
||||
"walletCurrency": {
|
||||
"one": "{} Source Point",
|
||||
"other": "{} Source Points"
|
||||
},
|
||||
"aiThinkingProcess": "AI Thinking Process",
|
||||
"accountSettingsApplied": "Account settings have been applied.",
|
||||
"trayMenuExit": "Exit",
|
||||
"postQuestionUnanswered": "Unanswered Question",
|
||||
"postQuestionUnansweredWithReward": "Unanswered Question, reward source points {}",
|
||||
"postQuestionAnswered": "Answered Question",
|
||||
"postQuestionAnswerSelect": "Select as Answer",
|
||||
"postQuestionAnswerTitle": "Selected Question",
|
||||
"postQuestionAnswerSelected": "Answer has been selected, reward has been applied.",
|
||||
"postVideoUpload": "Upload Video",
|
||||
"realmJoin": "Join Realm",
|
||||
"realmCommunityHint": "This realm is a community realm, you can freely join.",
|
||||
"realmCommunityPublicChannelsHint": "The public channels in this realm",
|
||||
"realmCommunityPublishersHint": "The publishers in this realm",
|
||||
"realmJoined": "Joined realm {}.",
|
||||
"join": "Join",
|
||||
"pollEditorNew": "New Poll",
|
||||
"pollEditorEdit": "Edit Poll",
|
||||
"pollEditorDelete": "Delete Poll",
|
||||
"pollEditorDeleteDescription": "Are you sure you want to delete this poll? This operation is irreversible.",
|
||||
"pollEditorUnlink": "Unlink Poll",
|
||||
"pollOptionAdd": "Add Option",
|
||||
"pollOptionName": "Option Name",
|
||||
"pollLinkExisting": "Link existing poll",
|
||||
"pollAnswered": "Answered the poll.",
|
||||
"pollVotes": {
|
||||
"one": "{} vote",
|
||||
"other": "{} votes"
|
||||
},
|
||||
"publisherDelete": "Delete Publisher {}",
|
||||
"publisherDeleteDescription": "Are you sure you want to delete this publisher? This operation is irreversible.",
|
||||
"channelIsPublic": "Public Channel",
|
||||
"channelIsPublicDescription": "The channel is public, anyone can join.",
|
||||
"channelIsCommunity": "Community Channel",
|
||||
"channelIsCommunityDescription": "Currently, community channel has nothing special yet.",
|
||||
"realmIsPublic": "Public Realm",
|
||||
"realmIsPublicDescription": "The realm is public, anyone can join.",
|
||||
"realmIsCommunity": "Community Realm",
|
||||
"realmIsCommunityDescription": "Community realm will be displayed on the discover page.",
|
||||
"realmLeave": "Leave Realm",
|
||||
"realmLeaveDescription": "Leave the current realm and delete the realm's identity.",
|
||||
"checkInResultTier1": "Worst",
|
||||
"checkInResultTier2": "Worse",
|
||||
"checkInResultTier3": "Normal",
|
||||
"checkInResultTier4": "Better",
|
||||
"checkInResultTier5": "Best",
|
||||
"flagPostAction": "Flag the Post",
|
||||
"flagPost": "Flag objectionable content",
|
||||
"flagPostDescription": "If flagged users takes 50% or more of the views, the post will be collapsed. You cannot revoke the action.",
|
||||
"flaggedPost": "Post has been flagged.",
|
||||
"postViews": {
|
||||
"zero": "No views",
|
||||
"one": "{} view",
|
||||
"other": "{} views"
|
||||
},
|
||||
"attachmentBillingUploaded": "Used space",
|
||||
"attachmentBillingDiscount": "Free space",
|
||||
"attachmentBillingRatio": "Usage",
|
||||
"attachmentBillingHint": "Sliding Window Pricing®\nFees will only apply if the size of the file uploaded within 24 hours exceeds the free space.",
|
||||
"postThumbnail": "Post Thumbnail",
|
||||
"accountRealms": "Realms",
|
||||
"postInGlobal": "Global",
|
||||
"postInGlobalDescription": "Do not link this post with any realm.",
|
||||
"postChannelGlobal": "Global",
|
||||
"postChannelFriends": "Friends",
|
||||
"postChannelFollowing": "Following",
|
||||
"postChannelRealm": "Realms",
|
||||
"postFilterReset": "Reset Filter",
|
||||
"postFilterResetDescription": "Clear filter and show all posts.",
|
||||
"postFilterWithCategory": "Viewing posts in {}",
|
||||
"databaseSize": "Database Size",
|
||||
"databaseDelete": "Delete Database",
|
||||
"databaseDeleteDescription": "Remove the database on your local disk, the content will be fetched from server again.",
|
||||
"databaseDeleted": "The local database has been deleted.",
|
||||
"settingsEnablePushNotifications": "Enable Push Notifications",
|
||||
"settingsEnablePushNotificationsDescription": "Re-enable and request permission to receive push notifications. Just in case it didn't run automatically.",
|
||||
"settingsEnabledPushNotifications": "Push notification has been enabled.",
|
||||
"screenStickers": "Stickers",
|
||||
"stickersDiscovery": "Discovery",
|
||||
"stickersOwned": "Owned",
|
||||
"stickersCreated": "Created",
|
||||
"stickersAdd": "Add Sticker Pack",
|
||||
"stickersAdded": "Sticker pack has been added.",
|
||||
"add": "Add",
|
||||
"stickersRemoved": "Sticker pack has been removed, you can add it again anytime.",
|
||||
"stickersReload": "Reload Stickers",
|
||||
"stickersReloadDescription": "Reload stickers from the server, update the sticker picker.",
|
||||
"stickersReloaded": "Sticker packs has been reloaded.",
|
||||
"stickersPackDelete": "Delete Pack {}",
|
||||
"stickersPackDeleteDescription": "Are you sure you want to delete this sticker pack? This operation is irreversible.",
|
||||
"stickersPackDeleted": "Sticker pack has been deleted.",
|
||||
"stickersDelete": "Delete Sticker {}",
|
||||
"stickersDeleteDescription": "Are you sure you want to delete this sticker? This operation is irreversible.",
|
||||
"stickersDeleted": "Sticker has been deleted.",
|
||||
"fieldStickerName": "Sticker Name",
|
||||
"fieldStickerAlias": "Sticker Alias",
|
||||
"fieldStickerAliasHint": "The unique sticker placeholder with the pack prefix.",
|
||||
"fieldStickerPackName": "Name",
|
||||
"fieldStickerPackDescription": "Description",
|
||||
"fieldStickerPackPrefix": "Prefix",
|
||||
"fieldStickerAttachment": "Attachment",
|
||||
"stickersNew": "New Sticker",
|
||||
"stickersNewDescription": "Create a new sticker belongs to this pack.",
|
||||
"stickersPackNew": "New Sticker Pack",
|
||||
"trayMenuShow": "Show",
|
||||
"trayMenuMuteNotification": "Do Not Disturb",
|
||||
"update": "Update",
|
||||
"forceUpdate": "Force Update",
|
||||
"forceUpdateDescription": "Force to show the application update popup, even the new version is not available.",
|
||||
"debugLogging": "Runtime Logs",
|
||||
"runtimeLogsOpen": "Open Logs",
|
||||
"runtimeLogsDescription": "Show the runtime logs to help debugging.",
|
||||
"signinResetPasswordHint": "Please enter the username / email address to help us to find your account and reset your password.",
|
||||
"cacheSize": "Cache Size",
|
||||
"cacheDelete": "Clean Cache",
|
||||
"cacheDeleteDescription": "Remove the cached images and other resources from your disk, the content will be downloaded from server again.",
|
||||
"cacheDeleted": "All cache has been cleaned up.",
|
||||
"userNoDescription": "No description.",
|
||||
"fieldTimeZone": "Time Zone",
|
||||
"fieldGender": "Gender",
|
||||
"fieldPronouns": "Pronouns",
|
||||
"fieldLocation": "Location",
|
||||
"fieldLinks": "Links",
|
||||
"fieldLinkName": "Name",
|
||||
"fieldLinkUrl": "URL",
|
||||
"screenAccountBadges": "Badges",
|
||||
"accountBadges": "Badges",
|
||||
"accountBadgesDescription": "View and manage your badges.",
|
||||
"badgeActivated": "Activated badge {}.",
|
||||
"viewDetailedAttachment": "Details",
|
||||
"screenKeyPairs": "Key Pairs",
|
||||
"accountKeyPairs": "Key Pairs",
|
||||
"accountKeyPairsDescription": "Manage the key pairs which used to encrypt messages.",
|
||||
"enrollNewKeyPair": "Enroll New One",
|
||||
"enrollNewKeyPairDescription": "Generate a new key pair.",
|
||||
"keyPairHasPrivateKey": "With private key",
|
||||
"decrypting": "Decrypting……",
|
||||
"decryptingKeyNotFound": "Key not found or exchange failed, the other party may not be online",
|
||||
"messageUnablePreview": "Unable preview",
|
||||
"messageUnablePreviewEncrypted": "Unable preview encrypted message",
|
||||
"postViewInGlobalDescription": "Do not view the post in the specific realm.",
|
||||
"postDraftSaved": "The draft has been saved.",
|
||||
"postDraftBox": "Draft Box",
|
||||
"postShuffle": "Read Randomly",
|
||||
"checkInStreak": {
|
||||
"zero": "No streak",
|
||||
"one": "{} day streak",
|
||||
"other": "{} days streak"
|
||||
},
|
||||
"accountChangeStatus": "Change Status",
|
||||
"accountStatusSilent": "Do not Disturb",
|
||||
"accountStatusSilentDesc": "The notification will stop popping up",
|
||||
"accountStatusInvisible": "Invisible",
|
||||
"accountStatusInvisibleDesc": "Will show as offline, but all features still remain normal",
|
||||
"accountCustomStatus": "Custom Status",
|
||||
"accountCustomStatusDescription": "Customize your status.",
|
||||
"accountClearStatus": "Clear Status",
|
||||
"accountClearStatusDescription": "Clear your status, and let server decide which status you are for you.",
|
||||
"fieldAccountStatusLabel": "Status Text",
|
||||
"fieldAccountStatusClearAt": "Clear At",
|
||||
"accountStatusNegative": "Negative",
|
||||
"accountStatusNeutral": "Neutral",
|
||||
"accountStatusPositive": "Positive",
|
||||
"mixedFeed": "Mixed Feed",
|
||||
"mixedFeedDescription": "The Explore screen may not only display the user's posts, but may also contain other content. However, this mode does not apply to classification and filtering.",
|
||||
"filterFeed": "Exploring Adjust",
|
||||
"feedUnknownItem": "Unable to display this content, the current version of the client does not support the type of content, please try to update the application afterwards.",
|
||||
"serviceStatusOperational": "All services operational",
|
||||
"serviceStatusDowngraded": "Some services downgraded",
|
||||
"serviceStatusFailed": "All services unavailable",
|
||||
"serviceStatusFailedDescription": "The server is down or the maintenance is just finished.",
|
||||
"serviceNameInsights": "Summarize and Insights",
|
||||
"serviceNameInteractive": "Posts, Reactions and Explore",
|
||||
"serviceNameReader": "News and Link Previews",
|
||||
"serviceNameMessaging": "Chat",
|
||||
"serviceNameMatrix": "Matrix Software and Game Marketplace",
|
||||
"serviceNamePaperclip": "Attachments, Images and Files",
|
||||
"serviceNameWallet": "Source Points Wallet",
|
||||
"serviceNamePassport": "Authorization and Authentication",
|
||||
"accountActionEvent": "Action Events",
|
||||
"accountActionEventDescription": "View your action event logs.",
|
||||
"eventMetadata": "Metadata",
|
||||
"accountAuthTickets": "Auth Sessions",
|
||||
"accountAuthTicketsDescription": "View and manage your auth sessions.",
|
||||
"authTicketCreatedAt": "Issued at {}",
|
||||
"authTicketExpiredAt": "Expired at {}",
|
||||
"authTicketLastGrantAt": "Last granted at {}",
|
||||
"authTicketCurrent": "Current",
|
||||
"accountUnconfirmedTitle": "Unconfirmed Account",
|
||||
"accountUnconfirmedSubtitle": "Your account is unconfirmed, which will make most features unavailable and your account will be destroyed in 24 hours. You should receive an email in your inbox with a confirmation link.",
|
||||
"accountUnconfirmedUnreceived": "Didn't receive the email?",
|
||||
"accountUnconfirmedResend": "Resend one",
|
||||
"accountUnconfirmedResendSuccessful": "Email has been resent, you can resend it again in 60 minutes.",
|
||||
"stickerPickerEmpty": "Sticker list is empty",
|
||||
"stickerPickerEmptyHint": "To start using stickers, you need to add a sticker pack first.",
|
||||
"goto": "Go to {}",
|
||||
"accountContactMethods": "Contact Methods",
|
||||
"accountContactMethodsDescription": "Manage your contact methods.",
|
||||
"accountContactMethodsNameEmail": "Email address",
|
||||
"accountContactMethodsNamePhone": "Phone number",
|
||||
"accountContactMethodsNameAddress": "Address",
|
||||
"accountContactMethodsPrimary": "Primary",
|
||||
"accountContactMethodsVerified": "Verified",
|
||||
"accountContactMethodsPublic": "Public",
|
||||
"accountContactMethodsAdd": "Add Contact Method",
|
||||
"accountContactMethodsEdit": "Edit Contact Method",
|
||||
"accountContactMethodsAddDescription": "Add a new contact method.",
|
||||
"fieldContactContent": "Contact method",
|
||||
"accountContactMethodsPublicHint": "This contact method will be displayed publicly on your profile.",
|
||||
"accountContactMethodsDelete": "Delete Contact Method",
|
||||
"accountContactMethodsDeleteDescription": "Are you sure you want to delete contact method {}? This operation is irreversible.",
|
||||
"postCommentAdd": "Write a comment",
|
||||
"translate": "Translate",
|
||||
"translating": "Translating…",
|
||||
"translated": "Translated",
|
||||
"settingsAutoTranslate": "Auto Translate",
|
||||
"settingsAutoTranslateDescription": "Automatically translate text when viewing posts and messages.",
|
||||
"trayMenuHide": "Hide",
|
||||
"accountSettingsNotify": "Notify Settings",
|
||||
"accountSettingsNotifyDescription": "Adjust the types of notifications you receive.",
|
||||
"accountSettingsSecurity": "Security Settings",
|
||||
"accountSettingsSecurityDescription": "Adjust your account security settings.",
|
||||
"save": "Save",
|
||||
"notificationTopicPostFeedback": "Post Feedback",
|
||||
"notificationTopicPostReply": "Post Replies",
|
||||
"notificationTopicPostSubscription": "Post Subscriptions",
|
||||
"notificationTopicMessaging": "New Messages",
|
||||
"notificationTopicMessagingCall": "Incoming Calls",
|
||||
"notificationTopicGeneral": "General",
|
||||
"authMaximumAuthSteps": "Maximum Authenticate Steps",
|
||||
"authMaximumAuthStepsDescription": {
|
||||
"one": "Maximum ask for {} step authenticate",
|
||||
"other": "Maximum ask for {} steps authenticate"
|
||||
},
|
||||
"authAlwaysRisky": "Always Risky",
|
||||
"authAlwaysRiskyDescription": "Always ask for the highest steps count of authentication when logging in.",
|
||||
"chatUnjoined": "Unjoined Channel",
|
||||
"chatUnjoinedDescription": "You haven't joined this channel, so you can't send messages either view messages in it.",
|
||||
"chatUnjoinedPublicDescription": "Fortunately, this is a public channel, so you can join it as you want.",
|
||||
"chatJoin": "Join the Channel",
|
||||
"appInitStarting": "Starting",
|
||||
"appInitNetwork": "Initializing Network",
|
||||
"appInitUserdata": "Initializing User Data",
|
||||
"appInitWebsocket": "Establishing Solar Link",
|
||||
"appInitNotification": "Initializing Push Notifications",
|
||||
"appInitKeyPair": "Initializing Key Pairs",
|
||||
"appInitStickers": "Initializing Stickers",
|
||||
"appInitUserDirectory": "Initializing User Directory",
|
||||
"appInitRealm": "Initializing Realms",
|
||||
"appInitChat": "Initializing Chat",
|
||||
"appInitDone": "Completed",
|
||||
"community": "Community",
|
||||
"realmCommunity": "{}'s Community",
|
||||
"postTotalCount": {
|
||||
"one": "Total {} post",
|
||||
"other": "Total {} posts"
|
||||
},
|
||||
"settingsHideBottomNav": "Hide Bottom Navigation",
|
||||
"settingsHideBottomNavDescription": "Hide the bottom navigation bar, and show the navigation buttons in the drawer.",
|
||||
"reCaptcha": "reCaptcha",
|
||||
"friends": "Friends",
|
||||
"friendsDescription": "Manage your friendships.",
|
||||
"album": "Album",
|
||||
"albumDescription": "View albums and manage attachments.",
|
||||
"stickers": "Stickers",
|
||||
"stickersDescription": "View sticker packs and manage stickers.",
|
||||
"navBottomUnauthorizedCaption": "Or create an account",
|
||||
"walletCurrencyGoldenShort": "GDP",
|
||||
"walletCurrencyGolden": {
|
||||
"one": "{} Golden Point",
|
||||
"other": "{} Golden Points"
|
||||
},
|
||||
"walletTransactionTypeNormal": "Source Point",
|
||||
"walletTransactionTypeGolden": "Golden Point",
|
||||
"accountProgram": "Programs",
|
||||
"accountProgramDescription": "Explore the available member programs.",
|
||||
"accountProgramJoin": "Join Program",
|
||||
"accountProgramJoinRequirements": "Requirements",
|
||||
"accountProgramJoinPricing": "Pricing",
|
||||
"accountProgramJoinPricingHint": "Billed every (30 days) month.",
|
||||
"accountProgramLeaveHint": "After leaving the program, the source points will not be refunded.",
|
||||
"accountProgramJoined": "Joined Program.",
|
||||
"accountProgramAlreadyJoined": "Joined",
|
||||
"accountProgramLeft": "Left Program.",
|
||||
"leave": "Leave",
|
||||
"attachmentFailedToLoadMedia": "Unable to load media file, please try again later. If this error occurs repeatedly, the source file may not exist or the network connection may be abnormal.",
|
||||
"accountPunishments": "Punishments",
|
||||
"accountPunishmentsDescription": "View your account's reputation status.",
|
||||
"punishmentType0": "Strike",
|
||||
"punishmentType1": "Limited",
|
||||
"punishmentType2": "Banned",
|
||||
"punishmentOverall": "Overall Status",
|
||||
"punishmentStatusNormal": "All abilities normal",
|
||||
"punishmentStatusWarned": "All abilities normal, but at least one strike is in effect",
|
||||
"punishmentStatusLimited": "Some abilities limited, at least one limited punishment is in effect",
|
||||
"punishmentStatusLimitedFully": "All abilities limited, at least one completely limited punishment is in effect",
|
||||
"punishmentStatusBanned": "All services are terminated, banned",
|
||||
"punishmentCreatedAt": "Applied since {}",
|
||||
"punishmentExpiredAt": "Expired at {}",
|
||||
"punishmentExpiredNever": "Never expired",
|
||||
"punishmentModerator": "Moderator who made this punishment",
|
||||
"punishmentMadeBySystem": "Made by auto-mod system",
|
||||
"settingsAprilFoolFeatures": "April Fool Features",
|
||||
"settingsAprilFoolFeaturesDescription": "Enable April Fool features during April Fool, this option will only be visible during April Fool.",
|
||||
"settingsSoundEffects": "Sound Effects",
|
||||
"settingsSoundEffectsDescription": "Enable the sound effects around the app.",
|
||||
"settingsResetMemorizedWindowSize": "Reset Window Size",
|
||||
"settingsResetMemorizedWindowSizeDescription": "Reset the memorized window size, and set it to the default size.",
|
||||
"chatDirect": "Direct Messages",
|
||||
"back": "Back",
|
||||
"badgeProgramDeveloper": "Developer Program Member",
|
||||
"badgeProgramStellar": "A Stellar",
|
||||
"badgeProgramModerator": "Community Moderator",
|
||||
"postEditedHint": "edited",
|
||||
"splashScreenServer": "Server",
|
||||
"splashScreenServerName": "Potato",
|
||||
"splashScreenCaption": "Trying to establishing connection with HyperNet™"
|
||||
}
|
||||
|
@ -15,12 +15,17 @@
|
||||
"screenAccountProfileEdit": "编辑资料",
|
||||
"screenAbuseReport": "滥用检举",
|
||||
"screenSettings": "设置",
|
||||
"screenAccountSettings": "账号设置",
|
||||
"screenFactorSettings": "验证因子",
|
||||
"screenAccountWallet": "钱包",
|
||||
"screenNews": "新闻",
|
||||
"screenAlbum": "相册",
|
||||
"screenChat": "聊天",
|
||||
"screenChatManage": "编辑聊天频道",
|
||||
"screenChatNew": "新建聊天频道",
|
||||
"screenRealm": "领域",
|
||||
"screenRealmManage": "编辑领域",
|
||||
"screenRealmDiscovery": "发现领域",
|
||||
"screenRealmNew": "新建领域",
|
||||
"screenNotification": "通知",
|
||||
"screenPostSearch": "搜索帖子",
|
||||
@ -87,8 +92,18 @@
|
||||
},
|
||||
"loginEnterPassword": "验证代码",
|
||||
"loginSuccess": "登录为 {}",
|
||||
"authFactorDelete": "删除验证因子",
|
||||
"authFactorDeleteDescription": "你确定要删除 {} 验证因子吗?",
|
||||
"authFactorPassword": "密码",
|
||||
"authFactorPasswordDescription": "注册时选择设置的密码。",
|
||||
"authFactorEmail": "电邮一次性验证码",
|
||||
"authFactorEmailDescription": "由我们生成并发送到绑定的的电子邮箱的一次性验证码。",
|
||||
"authFactorTOTP": "时序验证码",
|
||||
"authFactorTOTPDescription": "使用 Google Authenticator 或 Authy 等验证器生成的一次性验证码。",
|
||||
"authFactorInAppNotify": "应用内通知验证码",
|
||||
"authFactorInAppNotifyDescription": "通过站内通知推送的一次性验证码。",
|
||||
"authFactorAdd": "添加新验证因子",
|
||||
"authFactorAddSubtitle": "给你的帐户登陆时提供另一个方案。",
|
||||
"accountIntroTitle": "喜欢您来!",
|
||||
"accountIntroSubtitle": "登陆以探索更广大的世界。",
|
||||
"accountLogout": "退出登录",
|
||||
@ -97,8 +112,14 @@
|
||||
"accountLogoutConfirm": "您需要重新输入账号密码,甚至可能需要多步验证来再次登陆。",
|
||||
"accountPublishers": "你的发布者",
|
||||
"accountPublishersSubtitle": "管理你的公共形象。",
|
||||
"accountSettings": "帐号设置",
|
||||
"accountSettingsSubtitle": "管理你的帐号并让它更好的服务你。",
|
||||
"accountProfileEdit": "编辑资料",
|
||||
"accountProfileEditSubtitle": "使你的 Solarpass 账户更像你。",
|
||||
"accountWallet": "钱包",
|
||||
"accountWalletSubtitle": "查看你的余额和交易记录。",
|
||||
"factorSettings": "验证因子",
|
||||
"factorSettingsSubtitle": "管理你的登陆验证方式。",
|
||||
"accountProfileEditApplied": "个人资料修改已被应用。",
|
||||
"publishersNew": "新发布者",
|
||||
"publisherNewSubtitle": "创建一个新的公共身份。",
|
||||
@ -116,13 +137,24 @@
|
||||
"publisherRunBy": "由 {} 管理",
|
||||
"fieldPublisherBelongToRealm": "所属领域",
|
||||
"fieldPublisherBelongToRealmUnset": "未设置发布者所属领域",
|
||||
"writePost": "撰写",
|
||||
"postTypeStory": "动态",
|
||||
"postTypeArticle": "文章",
|
||||
"postTypeQuestion": "问题",
|
||||
"postTypeVideo": "视频",
|
||||
"writePostTypeStory": "发动态",
|
||||
"writePostTypeArticle": "写文章",
|
||||
"writePostTypeQuestion": "提问题",
|
||||
"writePostTypeVideo": "发视频",
|
||||
"fieldPostPublisher": "帖子发布者",
|
||||
"fieldPostContent": "发生什么事了?!",
|
||||
"fieldPostTitle": "标题",
|
||||
"fieldPostQuestionReward": "回答奖励源点",
|
||||
"fieldPostDescription": "描述",
|
||||
"fieldPostTags": "标签",
|
||||
"fieldPostCategories": "分类",
|
||||
"fieldPostAlias": "别名",
|
||||
"fieldPostAliasHint": "可选项,用于在 URL 中表示该帖子,应遵循 URL-Safe 的原则。",
|
||||
"postPublish": "发布",
|
||||
"postPublishedAt": "发布于",
|
||||
"postPublishedUntil": "取消发布于",
|
||||
@ -173,13 +205,37 @@
|
||||
"one": "{} 条评论",
|
||||
"other": "{} 条评论"
|
||||
},
|
||||
"postCommentExpand": "展开评论",
|
||||
"settingsAppearance": "外观",
|
||||
"settingsCustomFonts": "自定义字体",
|
||||
"settingsCustomFontsDescription": "设置应用程序使用的字体。",
|
||||
"settingsCustomFontFamily": "应用字体",
|
||||
"settingsCustomFontFamilyHint": "使用英文逗号分割每一种字体,越前优先级越高",
|
||||
"settingsCustomFontApplied": "自定义字体已经应用。",
|
||||
"settingsDisplayLanguage": "显示语言",
|
||||
"settingsDisplayLanguageDescription": "设置应用程序使用的语言",
|
||||
"settingsDisplayLanguageSystem": "跟随系统",
|
||||
"settingsBackgroundImage": "背景图片",
|
||||
"settingsBackgroundImageDescription": "设置应用全局生效的的背景图片。",
|
||||
"settingsBackgroundImageClear": "清除现存背景图",
|
||||
"settingsBackgroundImageClearDescription": "将应用背景图重置为空白。",
|
||||
"settingsThemeMaterial3": "使用 Material You 设计范式",
|
||||
"settingsThemeMaterial3Description": "将应用主题设置为 Material 3 设计范式的主题。",
|
||||
"settingsAppBarTransparent": "透明顶栏",
|
||||
"settingsAppBarTransparentDescription": "为顶栏启用透明效果。",
|
||||
"settingsDrawerPreferCollapse": "侧边栏偏好折叠",
|
||||
"settingsDrawerPreferCollapseDescription": "将侧边栏优先折叠,即使屏幕宽度足够大去放下整个侧边栏。",
|
||||
"settingsColorScheme": "主题色",
|
||||
"settingsColorSchemeDescription": "设置应用主题色。",
|
||||
"settingsColorSeed": "预设色彩主题",
|
||||
"settingsColorSeedDescription": "选择一个预设色彩主题。",
|
||||
"settingsFeatures": "功能",
|
||||
"settingsNotifyWithHaptic": "新通知时振动",
|
||||
"settingsNotifyWithHapticDescription": "在应用在前台时收到新通知出现时出发轻量的振动。",
|
||||
"settingsExpandPostLink": "展开帖子链接",
|
||||
"settingsExpandPostLinkDescription": "在帖子列表中展开显示帖子中的链接。",
|
||||
"settingsExpandChatLink": "展开聊天链接",
|
||||
"settingsExpandChatLinkDescription": "在聊天信息中展开显示内容中的链接。",
|
||||
"settingsNetwork": "网络",
|
||||
"settingsNetworkServer": "HyperNet 服务器",
|
||||
"settingsNetworkServerDescription": "设置 HyperNet 服务器地址,选择我们提供的,或者自己搭建。",
|
||||
@ -198,12 +254,15 @@
|
||||
"settingsMisc": "杂项",
|
||||
"settingsMiscAbout": "关于",
|
||||
"settingsMiscAboutDescription": "查看 Solian 的版本信息。",
|
||||
"settingsAccountLanguage": "帐号偏好语言",
|
||||
"settingsAccountLanguageDescription": "设置邮件、通知和其他帐号相关内容的语言。",
|
||||
"sensitiveContent": "敏感内容",
|
||||
"sensitiveContentCollapsed": "敏感内容已折叠。",
|
||||
"sensitiveContentDescription": "此内容已被标记,可能不适合所有人查看。",
|
||||
"sensitiveContentReveal": "显示内容",
|
||||
"serverConnecting": "正在连接服务器…",
|
||||
"serverDisconnected": "已与服务器断开连接",
|
||||
"serverConnecting": "正在连接…",
|
||||
"serverDisconnected": "已断开连接",
|
||||
"serverConnected": "已连接",
|
||||
"fieldChatAlias": "频道别名",
|
||||
"fieldChatAliasHint": "全站范围内唯一的频道别名,用于在 URL 中表示该频道,留空则自动生成。应遵循 URL-Safe 的原则。",
|
||||
"fieldChatName": "名称",
|
||||
@ -270,16 +329,52 @@
|
||||
"one": "{} 个附件",
|
||||
"other": "{} 个附件"
|
||||
},
|
||||
"messageTyping": {
|
||||
"one": "{} 正在输入",
|
||||
"other": "{} 正在输入"
|
||||
},
|
||||
"fieldAttachmentRandomId": "访问 ID",
|
||||
"fieldAttachmentAlt": "概述文字",
|
||||
"addAttachmentFromAlbum": "从相册中添加附件",
|
||||
"addAttachmentFromFiles": "从文件中添加附件",
|
||||
"addAttachmentFromClipboard": "粘贴附件",
|
||||
"addAttachmentFromCameraPhoto": "拍摄照片",
|
||||
"addAttachmentFromCameraVideo": "拍摄视频",
|
||||
"addAttachmentFromRandomId": "通过访问 ID 链接",
|
||||
"attachmentDetailInfo": "附件详细信息",
|
||||
"attachmentPastedImage": "粘贴的图片",
|
||||
"attachmentInsertedImage": "插入的图片",
|
||||
"attachmentInsertLink": "插入连接",
|
||||
"attachmentSetAsPostThumbnail": "设置为帖子缩略图",
|
||||
"attachmentUnsetAsPostThumbnail": "取消设置为帖子缩略图",
|
||||
"attachmentCompressVideo": "重新编码视频",
|
||||
"attachmentSetThumbnail": "设置缩略图",
|
||||
"attachmentSetAlt": "设置概述文字",
|
||||
"attachmentCopyRandomId": "复制访问 ID",
|
||||
"attachmentUpload": "上传",
|
||||
"attachmentInputDialog": "上传附件",
|
||||
"attachmentInputUseRandomId": "使用访问 ID",
|
||||
"attachmentInputNew": "新上传附件",
|
||||
"waitingForUpload": "等待上传",
|
||||
"attachmentVideoCompressHint": "压缩一份视频的副本",
|
||||
"attachmentVideoCompressHintDescription": "你想上传压缩视频 {} 的副本吗?它将帮助你的观众快速预览视频,并且他们仍然可以观看原始视频。这将会在在你的设备上处理视频,所以需要一些时间,所以请耐心等待。",
|
||||
"attachmentCompressQuality": "压缩质量",
|
||||
"attachmentCompressQualityHighest": "最高",
|
||||
"attachmentCompressQualityDefault": "默认",
|
||||
"attachmentCompressQualityMedium": "中等",
|
||||
"attachmentCompressQualityLow": "低",
|
||||
"attachmentCompressQualityHint": "Solar Network 并没有阻止你上传大文件、高分辨率、高码率的视频,但是为了你的网络情况观众考虑,我们建议你选择一个合适的压缩质量。",
|
||||
"attachmentUploaded": "已上传",
|
||||
"attachmentPending": "未上传",
|
||||
"attachmentCopyCompressed": "有压缩副本",
|
||||
"attachmentGotBoosted": "有加速传递",
|
||||
"attachmentBoost": "加速包",
|
||||
"attachmentCreateBoost": "加速传递",
|
||||
"attachmentBoostHint": "加速传递允许您将附件上传到更近的受众或更快的内容网络。该功能目前处于 Beta 阶段。该功能限时免费,当有价格计划更改时,您将会被通知。",
|
||||
"attachmentDestinationRegion": "目标节点",
|
||||
"attachmentDestinationRegionAPAC": "亚太地区",
|
||||
"attachmentDestinationRegionNGB": "中国 · 浙江 · 宁波",
|
||||
"attachmentDestinationRegionHKG": "香港",
|
||||
"notification": "通知",
|
||||
"notificationUnreadCount": {
|
||||
"zero": "无未读通知",
|
||||
@ -367,9 +462,32 @@
|
||||
"dailyCheckNegativeHint5Description": "关键时刻断网",
|
||||
"dailyCheckNegativeHint6": "出门",
|
||||
"dailyCheckNegativeHint6Description": "忘带伞遇上大雨",
|
||||
"happyBirthday": "生日快乐,{}!",
|
||||
"celebrateBirthday": "生日快乐,{}!",
|
||||
"celebrateLunarNewYear": "春节快乐,{}!",
|
||||
"celebrateMidAutumn": "中秋节快乐,{}!",
|
||||
"celebrateDragonBoat": "端午节快乐,{}!",
|
||||
"celebrateMerryXmas": "圣诞快乐,{}!",
|
||||
"celebrateNewYear": "新年快乐,{}!",
|
||||
"celebrateValentineDay": "今天是情人节,{}!",
|
||||
"celebrateLaborDay": "今天是劳动节,{}。",
|
||||
"celebrateMotherDay": "今天是母亲节,{}。",
|
||||
"celebrateChildrenDay": "今天是儿童节,{}!",
|
||||
"celebrateFatherDay": "今天是父亲节,{}。",
|
||||
"celebrateHalloween": "快乐在圣诞节,{}!",
|
||||
"celebrateThanksgiving": "今天是感恩节,{}!",
|
||||
"pendingLunarNewYear": "{} 过春节",
|
||||
"pendingMidAutumn": "{} 过中秋节",
|
||||
"pendingDragonBoat": "{} 过端午节",
|
||||
"pendingBirthday": "{} 过生日",
|
||||
"pendingMerryXmas": "{} 过圣诞节",
|
||||
"pendingNewYear": "{} 跨年",
|
||||
"pendingValentineDay": "{} 过情人节",
|
||||
"pendingLaborDay": "{} 过劳动节",
|
||||
"pendingMotherDay": "{} 过母亲节",
|
||||
"pendingChildrenDay": "{} 过儿童节",
|
||||
"pendingFatherDay": "{} 过父亲节",
|
||||
"pendingHalloween": "{} 过圣诞节",
|
||||
"pendingThanksgiving": "{} 过感恩节",
|
||||
"friendNew": "添加好友",
|
||||
"friendRequests": "好友请求",
|
||||
"friendRequestsDescription": {
|
||||
@ -403,14 +521,21 @@
|
||||
"accountJoinedAt": "加入于 {}",
|
||||
"accountBirthday": "出生于 {}",
|
||||
"accountBadge": "徽章",
|
||||
"badgeCompanyStaff": "索尔辛茨士大夫 · 员工",
|
||||
"accountCheckInNoRecords": "暂无运势记录",
|
||||
"badgeCompanyStaff": "工作人员",
|
||||
"badgeSiteMigration": "Solar Network 原住民",
|
||||
"badgeCommunitySurvey": "调研参与者",
|
||||
"badgeCommunityVerified": "认证用户",
|
||||
"badgeCommunityContributor": "优秀社区贡献者",
|
||||
"badgeSiteAnniversary": "周年纪念",
|
||||
"badgeUserBirthday": "生日纪念",
|
||||
"accountStatus": "状态",
|
||||
"accountStatusOnline": "在线",
|
||||
"accountStatusOffline": "离线",
|
||||
"accountStatusLastSeen": "最后一次在 {} 上线",
|
||||
"accountStatusLastSeen": "最后一次上线于 {}",
|
||||
"postArticle": "Solar Network 上的文章",
|
||||
"postStory": "Solar Network 上的故事",
|
||||
"postLocalDraftRestored": "从本地恢复草稿",
|
||||
"articleWrittenAt": "发表于 {}",
|
||||
"articleEditedAt": "编辑于 {}",
|
||||
"attachmentSaved": "已保存到相册",
|
||||
@ -438,6 +563,7 @@
|
||||
"termAcceptNextWithAgree": "点击 “下一步”,即表示你同意我们的各项条款,包括其之后的更新。",
|
||||
"unauthorized": "未登陆",
|
||||
"unauthorizedDescription": "登陆以探索整个 Solar Network。",
|
||||
"projectDetail": "项目详情",
|
||||
"serviceStatus": "服务状态",
|
||||
"termRelated": "相关条款",
|
||||
"appDetails": "应用程序详情",
|
||||
@ -451,11 +577,373 @@
|
||||
"postImageShareAds": "来 Solar Network 探索更多有趣帖子",
|
||||
"postShare": "分享",
|
||||
"postShareImage": "分享帖图",
|
||||
"postGetInsight": "获取见解",
|
||||
"postGetInsightTitle": "AI 见解",
|
||||
"postGetInsightDescription": "AI 可能会出错,检查信息真实性。",
|
||||
"appInitializing": "正在初始化",
|
||||
"poweredBy": "由 {} 提供支持",
|
||||
"shareIntent": "分享",
|
||||
"shareIntentDescription": "您想对您分享的内容做些什么?",
|
||||
"shareIntentPostStory": "发布动态",
|
||||
"shareIntentSendChannel": "分享到聊天频道",
|
||||
"updateAvailable": "检测到更新可用",
|
||||
"updateOngoing": "正在更新,请稍后……"
|
||||
"updateOngoing": "正在更新,请稍后……",
|
||||
"custom": "自定义",
|
||||
"colorSchemeIndigo": "靛蓝",
|
||||
"colorSchemeBlue": "蓝色",
|
||||
"colorSchemeGreen": "绿色",
|
||||
"colorSchemeYellow": "黄色",
|
||||
"colorSchemeOrange": "橙色",
|
||||
"colorSchemeRed": "红色",
|
||||
"colorSchemeWhite": "白色",
|
||||
"colorSchemeBlack": "黑色",
|
||||
"colorSchemeApplied": "主题色已应用,可能需要重启来生效。",
|
||||
"postFeaturedComment": "精选评论",
|
||||
"postCategory": "分类",
|
||||
"postCategoryTechnology": "技术",
|
||||
"postCategoryGaming": "游戏",
|
||||
"postCategoryLife": "生活",
|
||||
"postCategoryArts": "艺术",
|
||||
"postCategorySports": "体育",
|
||||
"postCategoryMusic": "音乐",
|
||||
"postCategoryNews": "新闻",
|
||||
"postCategoryKnowledge": "知识",
|
||||
"postCategoryLiterature": "文学",
|
||||
"postCategoryFunny": "搞笑",
|
||||
"postCategoryUncategorized": "未分类",
|
||||
"newsAllSources": "所有新闻",
|
||||
"newsReadingProviderSwap": "切换",
|
||||
"newsReadingFromReader": "你正在从 HyperNet.Reader 阅读文章",
|
||||
"newsReadingFromOriginal": "你正在阅读原始文章",
|
||||
"newsDisclaimer": "本文由 HyperNet.Reader 从互联网上获取,我们不担保其内容的真实性,请自行判断。本文章的所有内容版权归原作者所有。",
|
||||
"newsToday": "快讯",
|
||||
"totpPostSetup": "还有一件事",
|
||||
"totpPostSetupDescription": "使用 Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden 或其他支持 TOTP 的验证器扫描本 QR Code 来添加。",
|
||||
"totpNeverShare": "永远不要分享这个 QR Code",
|
||||
"needHelp": "需要帮助?",
|
||||
"needHelpLaunch": "查看我们的山羊维基!",
|
||||
"walletCreate": "创建钱包",
|
||||
"walletCreateSubtitle": "创建于一个钱包来开始使用源点。",
|
||||
"walletCreatePassword": "在下方设置你的付款密码",
|
||||
"walletCurrencyShort": "源点",
|
||||
"walletCurrency": {
|
||||
"one": "{} 源点",
|
||||
"other": "{} 源点"
|
||||
},
|
||||
"aiThinkingProcess": "AI 思考过程",
|
||||
"accountSettingsApplied": "帐号设置已应用。",
|
||||
"trayMenuExit": "退出",
|
||||
"postQuestionUnanswered": "未解答的问题",
|
||||
"postQuestionUnansweredWithReward": "未解答的问题,悬赏源点 {}",
|
||||
"postQuestionAnswered": "已解答的问题",
|
||||
"postQuestionAnswerTitle": "精选解答",
|
||||
"postQuestionAnswerSelect": "选择解答",
|
||||
"postQuestionAnswerSelected": "解答已选择,奖励已发放。",
|
||||
"postVideoUpload": "上传视频",
|
||||
"realmJoin": "加入领域",
|
||||
"realmCommunityHint": "该领域是一个社区领域,你可以自由加入。",
|
||||
"realmCommunityPublicChannelsHint": "该领域包含的公共频道",
|
||||
"realmCommunityPublishersHint": "该领域的发布者",
|
||||
"realmJoined": "已加入领域 {}。",
|
||||
"join": "加入",
|
||||
"pollEditorNew": "新投票",
|
||||
"pollEditorEdit": "编辑投票",
|
||||
"pollEditorDelete": "删除投票",
|
||||
"pollEditorDeleteDescription": "你确定要删除这个投票吗?该操作不可撤销。",
|
||||
"pollEditorUnlink": "解除链接",
|
||||
"pollOptionAdd": "添加选项",
|
||||
"pollOptionName": "选项名称",
|
||||
"pollLinkExisting": "链接现有投票",
|
||||
"pollAnswered": "答案已经反馈。",
|
||||
"pollVotes": {
|
||||
"one": "{} 票",
|
||||
"other": "{} 票"
|
||||
},
|
||||
"publisherDelete": "删除发布者 {}",
|
||||
"publisherDeleteDescription": "你确定要删除这个发布者吗?该操作不可撤销。",
|
||||
"channelIsPublic": "公开频道",
|
||||
"channelIsPublicDescription": "该频道是公开的,任何人都可以加入。",
|
||||
"channelIsCommunity": "社区频道",
|
||||
"channelIsCommunityDescription": "目前来说,社区频道还没有什么特别之处。",
|
||||
"realmIsPublic": "公开领域",
|
||||
"realmIsPublicDescription": "该领域是公开的,任何人都可以加入。",
|
||||
"realmIsCommunity": "社区领域",
|
||||
"realmIsCommunityDescription": "社区领域会显示在发现页面上。",
|
||||
"realmLeave": "离开领域",
|
||||
"realmLeaveDescription": "离开当前领域,并且删除领域中的身份。",
|
||||
"checkInResultTier1": "大凶",
|
||||
"checkInResultTier2": "凶",
|
||||
"checkInResultTier3": "中平",
|
||||
"checkInResultTier4": "吉",
|
||||
"checkInResultTier5": "大吉",
|
||||
"flagPostAction": "吹哨",
|
||||
"flagPost": "吹哨不良内容",
|
||||
"flagPostDescription": "吹哨不良内容,如果吹哨用户占浏览量的 50% 或以上,则帖子会被折叠。吹哨后不可撤销。",
|
||||
"flaggedPost": "哨子已经吹响。",
|
||||
"postViews": {
|
||||
"zero": "{} 次浏览",
|
||||
"one": "{} 次浏览",
|
||||
"other": "{} 次浏览"
|
||||
},
|
||||
"attachmentBillingUploaded": "已占用的字节数",
|
||||
"attachmentBillingDiscount": "免费的字节数",
|
||||
"attachmentBillingHint": "滑动窗口计价®\n在24小时内上传的文件大小超出免费空间才会适用扣费。",
|
||||
"postThumbnail": "帖子缩略图",
|
||||
"accountRealms": "领域",
|
||||
"postInGlobal": "全站",
|
||||
"postInGlobalDescription": "不关联此帖子与任何领域。",
|
||||
"postChannelGlobal": "全站",
|
||||
"postChannelFriends": "好友",
|
||||
"postChannelFollowing": "关注",
|
||||
"postChannelRealm": "领域",
|
||||
"postFilterReset": "重置过滤器",
|
||||
"postFilterResetDescription": "清除过滤器并显示所有帖子。",
|
||||
"postFilterWithCategory": "查看{}区中的帖子",
|
||||
"databaseSize": "数据库大小",
|
||||
"databaseDelete": "删除数据库",
|
||||
"databaseDeleteDescription": "删除本地数据库,内容将从服务器重新获取。",
|
||||
"databaseDeleted": "本地数据库已被删除。",
|
||||
"settingsEnablePushNotifications": "启用推送数据",
|
||||
"settingsEnablePushNotificationsDescription": "重新启用并请求推送权限,以防自动激活失败。",
|
||||
"settingsEnabledPushNotifications": "推送通知已经注册。",
|
||||
"screenStickers": "贴图",
|
||||
"stickersDiscovery": "发现",
|
||||
"stickersOwned": "由我拥有",
|
||||
"stickersCreated": "由我发布",
|
||||
"stickersAdd": "添加贴图包",
|
||||
"stickersAdded": "贴图包已添加。",
|
||||
"add": "添加",
|
||||
"stickersRemoved": "贴图包已被移除,你可以随时再次添加回来。",
|
||||
"stickersReload": "重载贴图包",
|
||||
"stickersReloadDescription": "从服务器重新加载添加过的贴图,更新贴图选择器。",
|
||||
"stickersReloaded": "贴图包已重载。",
|
||||
"stickersPackDelete": "删除贴图包 {}",
|
||||
"stickersPackDeleteDescription": "你确定要删除这个贴图包吗?这个操作不可撤销。",
|
||||
"stickersPackDeleted": "贴图包已被删除。",
|
||||
"stickersDelete": "删除贴图 {}",
|
||||
"stickersDeleteDescription": "你确定要删除这个贴图吗?这个操作不可撤销。",
|
||||
"stickersDeleted": "贴图已被删除。",
|
||||
"fieldStickerName": "贴图名称",
|
||||
"fieldStickerAlias": "贴图别名",
|
||||
"fieldStickerAliasHint": "和贴图包前缀组合成为本贴图的唯一占位符。",
|
||||
"fieldStickerPackName": "名称",
|
||||
"fieldStickerPackDescription": "描述",
|
||||
"fieldStickerPackPrefix": "贴图包前缀",
|
||||
"fieldStickerAttachment": "附件",
|
||||
"stickersNew": "新建贴图",
|
||||
"stickersNewDescription": "创建一个新的贴图。",
|
||||
"stickersPackNew": "新建贴图包",
|
||||
"trayMenuShow": "显示",
|
||||
"trayMenuMuteNotification": "静音通知",
|
||||
"update": "更新",
|
||||
"forceUpdate": "强制更新",
|
||||
"forceUpdateDescription": "强制更新应用程序,即使有更新的版本可能不可用。",
|
||||
"runtimeLogs": "运行时日志",
|
||||
"runtimeLogsOpen": "打开日志文件",
|
||||
"runtimeLogsDescription": "显示运行时的日志记录。",
|
||||
"signinResetPasswordHint": "请输入用户名/电子邮箱地址以帮助我们找到您的帐户并重置密码。",
|
||||
"cacheSize": "缓存资源大小",
|
||||
"cacheDelete": "清除缓存",
|
||||
"cacheDeleteDescription": "从磁盘中移除缓存的图片和其他资源,内容将从服务器重新下载。",
|
||||
"cacheDeleted": "所有缓存已被清除。",
|
||||
"userNoDescription": "这个人很懒,没有留下什么……",
|
||||
"fieldTimeZone": "时区",
|
||||
"fieldGender": "性别",
|
||||
"fieldPronouns": "人称代词",
|
||||
"fieldLocation": "位置",
|
||||
"fieldLinks": "链接",
|
||||
"fieldLinkName": "名称",
|
||||
"fieldLinkUrl": "链接",
|
||||
"screenAccountBadges": "徽章",
|
||||
"accountBadges": "徽章",
|
||||
"accountBadgesDescription": "查看并管理你的徽章。",
|
||||
"badgeActivated": "已佩戴徽章 {}。",
|
||||
"viewDetailedAttachment": "查看附件详情",
|
||||
"screenKeyPairs": "密钥对",
|
||||
"accountKeyPairs": "密钥对",
|
||||
"accountKeyPairsDescription": "管理用于加密信息的密钥对。",
|
||||
"enrollNewKeyPair": "新建密钥对",
|
||||
"enrollNewKeyPairDescription": "生成一对新密钥对。",
|
||||
"keyPairHasPrivateKey": "有私钥",
|
||||
"decrypting": "解密中……",
|
||||
"decryptingKeyNotFound": "未找到密钥对或交换失败,对方可能不在线",
|
||||
"messageUnablePreview": "无法预览消息",
|
||||
"messageUnablePreviewEncrypted": "无法预览加密消息",
|
||||
"postViewInGlobalDescription": "不查看特定领域的帖子。",
|
||||
"postDraftSaved": "已保存为草稿。",
|
||||
"postDraftBox": "草稿箱",
|
||||
"postShuffle": "随便看看",
|
||||
"checkInStreak": {
|
||||
"zero": "无连击",
|
||||
"one": "连续签到 {} 天",
|
||||
"other": "连续签到 {} 天"
|
||||
},
|
||||
"accountChangeStatus": "修改状态",
|
||||
"accountStatusSilent": "请勿打扰",
|
||||
"accountStatusSilentDesc": "将会暂停所有通知推送",
|
||||
"accountStatusInvisible": "隐身",
|
||||
"accountStatusInvisibleDesc": "将会在他人界面显示离线,但不影响功能使用",
|
||||
"accountCustomStatus": "自定义状态",
|
||||
"accountCustomStatusDescription": "客制化你的状态。",
|
||||
"accountClearStatus": "清除状态",
|
||||
"accountClearStatusDescription": "清除你的状态,并让服务器决定你的状态。",
|
||||
"fieldAccountStatusLabel": "状态文字",
|
||||
"fieldAccountStatusClearAt": "清除时间",
|
||||
"accountStatusNegative": "负面",
|
||||
"accountStatusNeutral": "中性",
|
||||
"accountStatusPositive": "正面",
|
||||
"mixedFeed": "混合推荐流",
|
||||
"mixedFeedDescription": "探索页面可能不只会展示用户的帖子,更可能包含其他的内容。但该模式不适用分类和过滤。",
|
||||
"filterFeed": "探索队列调整",
|
||||
"feedUnknownItem": "无法显示该内容,当前版本客户端不支持该类型的内容,请尝试更新应用程序后再试。",
|
||||
"serviceStatusOperational": "所有服务正常",
|
||||
"serviceStatusDowngraded": "部分服务异常",
|
||||
"serviceStatusFailed": "服务状态异常",
|
||||
"serviceStatusFailedDescription": "服务器炸了或者刚刚执行完维护程序。",
|
||||
"serviceNameInsights": "总结、见解与洞察",
|
||||
"serviceNameInteractive": "帖子与互动",
|
||||
"serviceNameReader": "新闻与链接展开",
|
||||
"serviceNameMessaging": "即使聊天",
|
||||
"serviceNameMatrix": "矩阵市场",
|
||||
"serviceNamePaperclip": "附件",
|
||||
"serviceNameWallet": "源点钱包",
|
||||
"serviceNamePassport": "身份验证与授权",
|
||||
"accountActionEvent": "操作日志",
|
||||
"accountActionEventDescription": "查看你的操作日志。",
|
||||
"eventMetadata": "元数据",
|
||||
"accountAuthTickets": "授权会话",
|
||||
"accountAuthTicketsDescription": "查看和管理你的授权会话。",
|
||||
"authTicketCreatedAt": "签发于 {}",
|
||||
"authTicketExpiredAt": "到期于 {}",
|
||||
"authTicketLastGrantAt": "上次刷新于 {}",
|
||||
"authTicketCurrent": "当前会话",
|
||||
"accountUnconfirmedTitle": "尚未未确认账户",
|
||||
"accountUnconfirmedSubtitle": "您的账户尚未确认,这会导致大部分功能不可用,并且您的帐户将在 24 小时后自毁。您绑定的邮箱的收件箱应该会有一封邮件指引您确认您的帐户。",
|
||||
"accountUnconfirmedUnreceived": "未收到邮件?",
|
||||
"accountUnconfirmedResend": "重新发送一封",
|
||||
"accountUnconfirmedResendSuccessful": "邮件已重新发送,你可以在 60 分钟后再重发一封。",
|
||||
"stickerPickerEmpty": "贴图列表为空",
|
||||
"stickerPickerEmptyHint": "想要开始使用贴图,请先添加贴图包。",
|
||||
"goto": "跳转到 {}",
|
||||
"accountContactMethods": "联系方式",
|
||||
"accountContactMethodsDescription": "管理你的联系方式。",
|
||||
"accountContactMethodsNameEmail": "电子邮箱",
|
||||
"accountContactMethodsNamePhone": "电话",
|
||||
"accountContactMethodsNameAddress": "地址",
|
||||
"accountContactMethodsPrimary": "主要的",
|
||||
"accountContactMethodsVerified": "已验证",
|
||||
"accountContactMethodsPublic": "公开的",
|
||||
"accountContactMethodsAdd": "添加联系方式",
|
||||
"accountContactMethodsEdit": "编辑联系方式",
|
||||
"accountContactMethodsAddDescription": "添加新的联系方式。",
|
||||
"fieldContactContent": "联系方式",
|
||||
"accountContactMethodsPublicHint": "这个联系方式公开地显示在个人资料中。",
|
||||
"accountContactMethodsDelete": "删除联系方式",
|
||||
"accountContactMethodsDeleteDescription": "你确定要删除联系方式 {} 吗?这个操作不可撤销。",
|
||||
"postCommentAdd": "撰写一条评论",
|
||||
"translate": "翻译",
|
||||
"translating": "正在翻译……",
|
||||
"translated": "已翻译",
|
||||
"settingsAutoTranslate": "自动翻译",
|
||||
"settingsAutoTranslateDescription": "在查看帖子、消息时自动翻译文本。",
|
||||
"trayMenuHide": "隐藏",
|
||||
"accountSettingsNotify": "通知设置",
|
||||
"accountSettingsNotifyDescription": "调整你所收到的通知种类。",
|
||||
"accountSettingsSecurity": "安全设置",
|
||||
"accountSettingsSecurityDescription": "调整你的帐户安全设置。",
|
||||
"save": "保存",
|
||||
"notificationTopicPostFeedback": "帖子数据反馈",
|
||||
"notificationTopicPostReply": "帖子回复",
|
||||
"notificationTopicPostSubscription": "帖子订阅",
|
||||
"notificationTopicMessaging": "消息",
|
||||
"notificationTopicMessagingCall": "通话",
|
||||
"notificationTopicGeneral": "杂项",
|
||||
"authMaximumAuthSteps": "最大验证步骤",
|
||||
"authMaximumAuthStepsDescription": {
|
||||
"one": "登入时最多要求 {} 步验证",
|
||||
"other": "登入时最多要求 {} 步验证"
|
||||
},
|
||||
"authAlwaysRisky": "总是风险",
|
||||
"authAlwaysRiskyDescription": "在登入时始终按最高标准要求验证。",
|
||||
"chatUnjoined": "未加入频道",
|
||||
"chatUnjoinedDescription": "你没有加入这个频道,所以你也无法发送消息或者查看这个频道中的消息。",
|
||||
"chatUnjoinedPublicDescription": "但幸运的是,这是一个公开频道,所以你可以主动加入。",
|
||||
"chatJoin": "加入频道",
|
||||
"appInitStarting": "启动中",
|
||||
"appInitNetwork": "正在初始化网络",
|
||||
"appInitUserdata": "正在初始化用户数据",
|
||||
"appInitWebsocket": "正在建立 Solar Link",
|
||||
"appInitNotification": "正在初始化推送通知",
|
||||
"appInitKeyPair": "正在初始化密钥对",
|
||||
"appInitStickers": "正在初始化贴图包",
|
||||
"appInitUserDirectory": "正在初始化用户目录",
|
||||
"appInitRealm": "正在初始化领域信息",
|
||||
"appInitChat": "正在初始化聊天",
|
||||
"appInitDone": "完成",
|
||||
"community": "社区",
|
||||
"realmCommunity": "{}的社区",
|
||||
"postTotalCount": {
|
||||
"zero": "没有帖子",
|
||||
"one": "共 {} 条帖子"
|
||||
},
|
||||
"settingsHideBottomNav": "隐藏底部导航栏",
|
||||
"settingsHideBottomNavDescription": "隐藏底部导航栏,在侧边栏抽屉显示导航按钮。",
|
||||
"reCaptcha": "人机验证",
|
||||
"friends": "好友",
|
||||
"friendsDescription": "管理好友关系。",
|
||||
"album": "相册",
|
||||
"albumDescription": "查看相册与管理上传附件。",
|
||||
"stickers": "贴图",
|
||||
"stickersDescription": "查看贴图包与管理贴图。",
|
||||
"navBottomUnauthorizedCaption": "或者注册一个账号",
|
||||
"walletCurrencyGoldenShort": "金点",
|
||||
"walletCurrencyGolden": {
|
||||
"one": "{} 金点",
|
||||
"other": "{} 金点"
|
||||
},
|
||||
"walletTransactionTypeNormal": "源点",
|
||||
"walletTransactionTypeGolden": "金点",
|
||||
"accountProgram": "计划",
|
||||
"accountProgramDescription": "了解可用的成员计划。",
|
||||
"accountProgramJoin": "加入计划",
|
||||
"accountProgramJoinRequirements": "要求",
|
||||
"accountProgramJoinPricing": "价格",
|
||||
"accountProgramJoinPricingHint": "按月(30 天)收费",
|
||||
"accountProgramLeaveHint": "离开计划后,之前花费的源点不会退款。",
|
||||
"accountProgramJoined": "已加入计划。",
|
||||
"accountProgramLeft": "已离开计划。",
|
||||
"accountProgramAlreadyJoined": "已加入",
|
||||
"leave": "离开",
|
||||
"attachmentFailedToLoadMedia": "无法加载媒体文件,请稍后重试。若此错误重复出现,可能源文件不存在或者网络连接异常。",
|
||||
"accountPunishments": "处分",
|
||||
"accountPunishmentsDescription": "查看你帐号的信誉状态。",
|
||||
"punishmentType0": "警告",
|
||||
"punishmentType1": "停权",
|
||||
"punishmentType2": "封禁",
|
||||
"punishmentOverall": "总体状态",
|
||||
"punishmentStatusNormal": "所有功能正常",
|
||||
"punishmentStatusWarned": "所有功能正常,但有警告生效",
|
||||
"punishmentStatusLimited": "部份功能暂时受限,有至少一个停权生效",
|
||||
"punishmentStatusLimitedFully": "所有功能暂时受限,有至少一个完全停权生效",
|
||||
"punishmentStatusBanned": "所有服务终止,已被封禁",
|
||||
"punishmentCreatedAt": "宣布于 {}",
|
||||
"punishmentExpiredAt": "到期于 {}",
|
||||
"punishmentExpiredNever": "永久生效",
|
||||
"punishmentModerator": "责任管理员",
|
||||
"punishmentMadeBySystem": "由系统自动裁决",
|
||||
"settingsAprilFoolFeatures": "愚人节特性",
|
||||
"settingsAprilFoolFeaturesDescription": "在愚人节期间启用愚人节特性,该选项只会在愚人节期间显示。",
|
||||
"settingsSoundEffects": "声音效果",
|
||||
"settingsSoundEffectsDescription": "在一些场合下启用声音特效。",
|
||||
"settingsResetMemorizedWindowSize": "重置窗口大小",
|
||||
"settingsResetMemorizedWindowSizeDescription": "重置记忆的窗口大小,以重新设置为默认大小。",
|
||||
"chatDirect": "私信",
|
||||
"back": "返回",
|
||||
"badgeProgramDeveloper": "开发者计划成员",
|
||||
"badgeProgramStellar": "一颗恒星",
|
||||
"badgeProgramModerator": "社区管理员",
|
||||
"postEditedHint": "已编辑",
|
||||
"splashScreenServer": "服务器",
|
||||
"splashScreenServerName": "土豆",
|
||||
"splashScreenCaption": "正在尝试与 HyperNet™ 取得太阳链连接"
|
||||
}
|
||||
|
@ -15,12 +15,17 @@
|
||||
"screenAccountProfileEdit": "編輯資料",
|
||||
"screenAbuseReport": "濫用檢舉",
|
||||
"screenSettings": "設置",
|
||||
"screenAccountSettings": "賬號設置",
|
||||
"screenFactorSettings": "驗證因子",
|
||||
"screenAccountWallet": "錢包",
|
||||
"screenNews": "新聞",
|
||||
"screenAlbum": "相冊",
|
||||
"screenChat": "聊天",
|
||||
"screenChatManage": "編輯聊天頻道",
|
||||
"screenChatNew": "新建聊天頻道",
|
||||
"screenRealm": "領域",
|
||||
"screenRealmManage": "編輯領域",
|
||||
"screenRealmDiscovery": "發現領域",
|
||||
"screenRealmNew": "新建領域",
|
||||
"screenNotification": "通知",
|
||||
"screenPostSearch": "搜索帖子",
|
||||
@ -87,8 +92,18 @@
|
||||
},
|
||||
"loginEnterPassword": "驗證代碼",
|
||||
"loginSuccess": "登錄為 {}",
|
||||
"authFactorDelete": "刪除驗證因子",
|
||||
"authFactorDeleteDescription": "你確定要刪除 {} 驗證因子嗎?",
|
||||
"authFactorPassword": "密碼",
|
||||
"authFactorPasswordDescription": "註冊時選擇設置的密碼。",
|
||||
"authFactorEmail": "電郵一次性驗證碼",
|
||||
"authFactorEmailDescription": "由我們生成併發送到綁定的的電子郵箱的一次性驗證碼。",
|
||||
"authFactorTOTP": "時序驗證碼",
|
||||
"authFactorTOTPDescription": "使用 Google Authenticator 或 Authy 等驗證器生成的一次性驗證碼。",
|
||||
"authFactorInAppNotify": "應用內通知驗證碼",
|
||||
"authFactorInAppNotifyDescription": "通過站內通知推送的一次性驗證碼。",
|
||||
"authFactorAdd": "添加新驗證因子",
|
||||
"authFactorAddSubtitle": "給你的帳户登陸時提供另一個方案。",
|
||||
"accountIntroTitle": "喜歡您來!",
|
||||
"accountIntroSubtitle": "登陸以探索更廣大的世界。",
|
||||
"accountLogout": "退出登錄",
|
||||
@ -97,8 +112,14 @@
|
||||
"accountLogoutConfirm": "您需要重新輸入賬號密碼,甚至可能需要多步驗證來再次登陸。",
|
||||
"accountPublishers": "你的發佈者",
|
||||
"accountPublishersSubtitle": "管理你的公共形象。",
|
||||
"accountSettings": "帳號設置",
|
||||
"accountSettingsSubtitle": "管理你的帳號並讓它更好的服務你。",
|
||||
"accountProfileEdit": "編輯資料",
|
||||
"accountProfileEditSubtitle": "使你的 Solarpass 賬户更像你。",
|
||||
"accountWallet": "錢包",
|
||||
"accountWalletSubtitle": "查看你的餘額和交易記錄。",
|
||||
"factorSettings": "驗證因子",
|
||||
"factorSettingsSubtitle": "管理你的登陸驗證方式。",
|
||||
"accountProfileEditApplied": "個人資料修改已被應用。",
|
||||
"publishersNew": "新發布者",
|
||||
"publisherNewSubtitle": "創建一個新的公共身份。",
|
||||
@ -116,13 +137,24 @@
|
||||
"publisherRunBy": "由 {} 管理",
|
||||
"fieldPublisherBelongToRealm": "所屬領域",
|
||||
"fieldPublisherBelongToRealmUnset": "未設置發佈者所屬領域",
|
||||
"writePost": "撰寫",
|
||||
"postTypeStory": "動態",
|
||||
"postTypeArticle": "文章",
|
||||
"postTypeQuestion": "問題",
|
||||
"postTypeVideo": "視頻",
|
||||
"writePostTypeStory": "發動態",
|
||||
"writePostTypeArticle": "寫文章",
|
||||
"writePostTypeQuestion": "提問題",
|
||||
"writePostTypeVideo": "發視頻",
|
||||
"fieldPostPublisher": "帖子發佈者",
|
||||
"fieldPostContent": "發生什麼事了?!",
|
||||
"fieldPostTitle": "標題",
|
||||
"fieldPostQuestionReward": "回答獎勵源點",
|
||||
"fieldPostDescription": "描述",
|
||||
"fieldPostTags": "標籤",
|
||||
"fieldPostCategories": "分類",
|
||||
"fieldPostAlias": "別名",
|
||||
"fieldPostAliasHint": "可選項,用於在 URL 中表示該帖子,應遵循 URL-Safe 的原則。",
|
||||
"postPublish": "發佈",
|
||||
"postPublishedAt": "發佈於",
|
||||
"postPublishedUntil": "取消發佈於",
|
||||
@ -173,13 +205,37 @@
|
||||
"one": "{} 條評論",
|
||||
"other": "{} 條評論"
|
||||
},
|
||||
"postCommentExpand": "展開評論",
|
||||
"settingsAppearance": "外觀",
|
||||
"settingsCustomFonts": "自定義字體",
|
||||
"settingsCustomFontsDescription": "設置應用程序使用的字體。",
|
||||
"settingsCustomFontFamily": "應用字體",
|
||||
"settingsCustomFontFamilyHint": "使用英文逗號分割每一種字體,越前優先級越高",
|
||||
"settingsCustomFontApplied": "自定義字體已經應用。",
|
||||
"settingsDisplayLanguage": "顯示語言",
|
||||
"settingsDisplayLanguageDescription": "設置應用程序使用的語言",
|
||||
"settingsDisplayLanguageSystem": "跟隨系統",
|
||||
"settingsBackgroundImage": "背景圖片",
|
||||
"settingsBackgroundImageDescription": "設置應用全局生效的的背景圖片。",
|
||||
"settingsBackgroundImageClear": "清除現存背景圖",
|
||||
"settingsBackgroundImageClearDescription": "將應用背景圖重置為空白。",
|
||||
"settingsThemeMaterial3": "使用 Material You 設計範式",
|
||||
"settingsThemeMaterial3Description": "將應用主題設置為 Material 3 設計範式的主題。",
|
||||
"settingsAppBarTransparent": "透明頂欄",
|
||||
"settingsAppBarTransparentDescription": "為頂欄啓用透明效果。",
|
||||
"settingsDrawerPreferCollapse": "側邊欄偏好摺疊",
|
||||
"settingsDrawerPreferCollapseDescription": "將側邊欄優先摺疊,即使屏幕寬度足夠大去放下整個側邊欄。",
|
||||
"settingsColorScheme": "主題色",
|
||||
"settingsColorSchemeDescription": "設置應用主題色。",
|
||||
"settingsColorSeed": "預設色彩主題",
|
||||
"settingsColorSeedDescription": "選擇一個預設色彩主題。",
|
||||
"settingsFeatures": "功能",
|
||||
"settingsNotifyWithHaptic": "新通知時振動",
|
||||
"settingsNotifyWithHapticDescription": "在應用在前台時收到新通知出現時出發輕量的振動。",
|
||||
"settingsExpandPostLink": "展開帖子鏈接",
|
||||
"settingsExpandPostLinkDescription": "在帖子列表中展開顯示帖子中的鏈接。",
|
||||
"settingsExpandChatLink": "展開聊天鏈接",
|
||||
"settingsExpandChatLinkDescription": "在聊天信息中展開顯示內容中的鏈接。",
|
||||
"settingsNetwork": "網絡",
|
||||
"settingsNetworkServer": "HyperNet 服務器",
|
||||
"settingsNetworkServerDescription": "設置 HyperNet 服務器地址,選擇我們提供的,或者自己搭建。",
|
||||
@ -198,12 +254,15 @@
|
||||
"settingsMisc": "雜項",
|
||||
"settingsMiscAbout": "關於",
|
||||
"settingsMiscAboutDescription": "查看 Solian 的版本信息。",
|
||||
"settingsAccountLanguage": "帳號偏好語言",
|
||||
"settingsAccountLanguageDescription": "設置郵件、通知和其他帳號相關內容的語言。",
|
||||
"sensitiveContent": "敏感內容",
|
||||
"sensitiveContentCollapsed": "敏感內容已摺疊。",
|
||||
"sensitiveContentDescription": "此內容已被標記,可能不適合所有人查看。",
|
||||
"sensitiveContentReveal": "顯示內容",
|
||||
"serverConnecting": "正在連接服務器…",
|
||||
"serverDisconnected": "已與服務器斷開連接",
|
||||
"serverConnecting": "正在連接…",
|
||||
"serverDisconnected": "已斷開連接",
|
||||
"serverConnected": "已連接",
|
||||
"fieldChatAlias": "頻道別名",
|
||||
"fieldChatAliasHint": "全站範圍內唯一的頻道別名,用於在 URL 中表示該頻道,留空則自動生成。應遵循 URL-Safe 的原則。",
|
||||
"fieldChatName": "名稱",
|
||||
@ -270,16 +329,52 @@
|
||||
"one": "{} 個附件",
|
||||
"other": "{} 個附件"
|
||||
},
|
||||
"messageTyping": {
|
||||
"one": "{} 正在輸入",
|
||||
"other": "{} 正在輸入"
|
||||
},
|
||||
"fieldAttachmentRandomId": "訪問 ID",
|
||||
"fieldAttachmentAlt": "概述文字",
|
||||
"addAttachmentFromAlbum": "從相冊中添加附件",
|
||||
"addAttachmentFromFiles": "從文件中添加附件",
|
||||
"addAttachmentFromClipboard": "粘貼附件",
|
||||
"addAttachmentFromCameraPhoto": "拍攝照片",
|
||||
"addAttachmentFromCameraVideo": "拍攝視頻",
|
||||
"addAttachmentFromRandomId": "通過訪問 ID 鏈接",
|
||||
"attachmentDetailInfo": "附件詳細信息",
|
||||
"attachmentPastedImage": "粘貼的圖片",
|
||||
"attachmentInsertedImage": "插入的圖片",
|
||||
"attachmentInsertLink": "插入連接",
|
||||
"attachmentSetAsPostThumbnail": "設置為帖子縮略圖",
|
||||
"attachmentUnsetAsPostThumbnail": "取消設置為帖子縮略圖",
|
||||
"attachmentCompressVideo": "重新編碼視頻",
|
||||
"attachmentSetThumbnail": "設置縮略圖",
|
||||
"attachmentSetAlt": "設置概述文字",
|
||||
"attachmentCopyRandomId": "複製訪問 ID",
|
||||
"attachmentUpload": "上傳",
|
||||
"attachmentInputDialog": "上傳附件",
|
||||
"attachmentInputUseRandomId": "使用訪問 ID",
|
||||
"attachmentInputNew": "新上傳附件",
|
||||
"waitingForUpload": "等待上傳",
|
||||
"attachmentVideoCompressHint": "壓縮一份視頻的副本",
|
||||
"attachmentVideoCompressHintDescription": "你想上傳壓縮視頻 {} 的副本嗎?它將幫助你的觀眾快速預覽視頻,並且他們仍然可以觀看原始視頻。這將會在在你的設備上處理視頻,所以需要一些時間,所以請耐心等待。",
|
||||
"attachmentCompressQuality": "壓縮質量",
|
||||
"attachmentCompressQualityHighest": "最高",
|
||||
"attachmentCompressQualityDefault": "默認",
|
||||
"attachmentCompressQualityMedium": "中等",
|
||||
"attachmentCompressQualityLow": "低",
|
||||
"attachmentCompressQualityHint": "Solar Network 並沒有阻止你上傳大文件、高分辨率、高碼率的視頻,但是為了你的網絡情況觀眾考慮,我們建議你選擇一個合適的壓縮質量。",
|
||||
"attachmentUploaded": "已上傳",
|
||||
"attachmentPending": "未上傳",
|
||||
"attachmentCopyCompressed": "有壓縮副本",
|
||||
"attachmentGotBoosted": "有加速傳遞",
|
||||
"attachmentBoost": "加速包",
|
||||
"attachmentCreateBoost": "加速傳遞",
|
||||
"attachmentBoostHint": "加速傳遞允許您將附件上傳到更近的受眾或更快的內容網絡。該功能目前處於 Beta 階段。該功能限時免費,當有價格計劃更改時,您將會被通知。",
|
||||
"attachmentDestinationRegion": "目標節點",
|
||||
"attachmentDestinationRegionAPAC": "亞太地區",
|
||||
"attachmentDestinationRegionNGB": "中國 · 浙江 · 寧波",
|
||||
"attachmentDestinationRegionHKG": "香港",
|
||||
"notification": "通知",
|
||||
"notificationUnreadCount": {
|
||||
"zero": "無未讀通知",
|
||||
@ -367,7 +462,32 @@
|
||||
"dailyCheckNegativeHint5Description": "關鍵時刻斷網",
|
||||
"dailyCheckNegativeHint6": "出門",
|
||||
"dailyCheckNegativeHint6Description": "忘帶傘遇上大雨",
|
||||
"happyBirthday": "生日快樂,{}!",
|
||||
"celebrateBirthday": "生日快樂,{}!",
|
||||
"celebrateLunarNewYear": "春節快樂,{}!",
|
||||
"celebrateMidAutumn": "中秋節快樂,{}!",
|
||||
"celebrateDragonBoat": "端午節快樂,{}!",
|
||||
"celebrateMerryXmas": "聖誕快樂,{}!",
|
||||
"celebrateNewYear": "新年快樂,{}!",
|
||||
"celebrateValentineDay": "今天是情人節,{}!",
|
||||
"celebrateLaborDay": "今天是勞動節,{}。",
|
||||
"celebrateMotherDay": "今天是母親節,{}。",
|
||||
"celebrateChildrenDay": "今天是兒童節,{}!",
|
||||
"celebrateFatherDay": "今天是父親節,{}。",
|
||||
"celebrateHalloween": "快樂在聖誕節,{}!",
|
||||
"celebrateThanksgiving": "今天是感恩節,{}!",
|
||||
"pendingLunarNewYear": "{} 過春節",
|
||||
"pendingMidAutumn": "{} 過中秋節",
|
||||
"pendingDragonBoat": "{} 過端午節",
|
||||
"pendingBirthday": "{} 過生日",
|
||||
"pendingMerryXmas": "{} 過聖誕節",
|
||||
"pendingNewYear": "{} 跨年",
|
||||
"pendingValentineDay": "{} 過情人節",
|
||||
"pendingLaborDay": "{} 過勞動節",
|
||||
"pendingMotherDay": "{} 過母親節",
|
||||
"pendingChildrenDay": "{} 過兒童節",
|
||||
"pendingFatherDay": "{} 過父親節",
|
||||
"pendingHalloween": "{} 過聖誕節",
|
||||
"pendingThanksgiving": "{} 過感恩節",
|
||||
"friendNew": "添加好友",
|
||||
"friendRequests": "好友請求",
|
||||
"friendRequestsDescription": {
|
||||
@ -401,14 +521,21 @@
|
||||
"accountJoinedAt": "加入於 {}",
|
||||
"accountBirthday": "出生於 {}",
|
||||
"accountBadge": "徽章",
|
||||
"badgeCompanyStaff": "索爾辛茨士大夫 · 員工",
|
||||
"accountCheckInNoRecords": "暫無運勢記錄",
|
||||
"badgeCompanyStaff": "工作人員",
|
||||
"badgeSiteMigration": "Solar Network 原住民",
|
||||
"badgeCommunitySurvey": "調研參與者",
|
||||
"badgeCommunityVerified": "認證用户",
|
||||
"badgeCommunityContributor": "優秀社區貢獻者",
|
||||
"badgeSiteAnniversary": "週年紀念",
|
||||
"badgeUserBirthday": "生日紀念",
|
||||
"accountStatus": "狀態",
|
||||
"accountStatusOnline": "在線",
|
||||
"accountStatusOffline": "離線",
|
||||
"accountStatusLastSeen": "最後一次在 {} 上線",
|
||||
"accountStatusLastSeen": "最後一次上線於 {}",
|
||||
"postArticle": "Solar Network 上的文章",
|
||||
"postStory": "Solar Network 上的故事",
|
||||
"postLocalDraftRestored": "從本地恢復草稿",
|
||||
"articleWrittenAt": "發表於 {}",
|
||||
"articleEditedAt": "編輯於 {}",
|
||||
"attachmentSaved": "已保存到相冊",
|
||||
@ -436,6 +563,7 @@
|
||||
"termAcceptNextWithAgree": "點擊 “下一步”,即表示你同意我們的各項條款,包括其之後的更新。",
|
||||
"unauthorized": "未登陸",
|
||||
"unauthorizedDescription": "登陸以探索整個 Solar Network。",
|
||||
"projectDetail": "項目詳情",
|
||||
"serviceStatus": "服務狀態",
|
||||
"termRelated": "相關條款",
|
||||
"appDetails": "應用程序詳情",
|
||||
@ -449,9 +577,323 @@
|
||||
"postImageShareAds": "來 Solar Network 探索更多有趣帖子",
|
||||
"postShare": "分享",
|
||||
"postShareImage": "分享帖圖",
|
||||
"postGetInsight": "獲取見解",
|
||||
"postGetInsightTitle": "AI 見解",
|
||||
"postGetInsightDescription": "AI 可能會出錯,檢查信息真實性。",
|
||||
"appInitializing": "正在初始化",
|
||||
"poweredBy": "由 {} 提供支持",
|
||||
"shareIntent": "分享",
|
||||
"shareIntentDescription": "您想對您分享的內容做些什麼?",
|
||||
"shareIntentPostStory": "發佈動態"
|
||||
"shareIntentPostStory": "發佈動態",
|
||||
"shareIntentSendChannel": "分享到聊天頻道",
|
||||
"updateAvailable": "檢測到更新可用",
|
||||
"updateOngoing": "正在更新,請稍後……",
|
||||
"custom": "自定義",
|
||||
"colorSchemeIndigo": "靛藍",
|
||||
"colorSchemeBlue": "藍色",
|
||||
"colorSchemeGreen": "綠色",
|
||||
"colorSchemeYellow": "黃色",
|
||||
"colorSchemeOrange": "橙色",
|
||||
"colorSchemeRed": "紅色",
|
||||
"colorSchemeWhite": "白色",
|
||||
"colorSchemeBlack": "黑色",
|
||||
"colorSchemeApplied": "主題色已應用,可能需要重啓來生效。",
|
||||
"postFeaturedComment": "精選評論",
|
||||
"postCategory": "分類",
|
||||
"postCategoryTechnology": "技術",
|
||||
"postCategoryGaming": "遊戲",
|
||||
"postCategoryLife": "生活",
|
||||
"postCategoryArts": "藝術",
|
||||
"postCategorySports": "體育",
|
||||
"postCategoryMusic": "音樂",
|
||||
"postCategoryNews": "新聞",
|
||||
"postCategoryKnowledge": "知識",
|
||||
"postCategoryLiterature": "文學",
|
||||
"postCategoryFunny": "搞笑",
|
||||
"postCategoryUncategorized": "未分類",
|
||||
"newsAllSources": "所有新聞",
|
||||
"newsReadingProviderSwap": "切換",
|
||||
"newsReadingFromReader": "你正在從 HyperNet.Reader 閲讀文章",
|
||||
"newsReadingFromOriginal": "你正在閲讀原始文章",
|
||||
"newsDisclaimer": "本文由 HyperNet.Reader 從互聯網上獲取,我們不擔保其內容的真實性,請自行判斷。本文章的所有內容版權歸原作者所有。",
|
||||
"newsToday": "快訊",
|
||||
"totpPostSetup": "還有一件事",
|
||||
"totpPostSetupDescription": "使用 Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden 或其他支持 TOTP 的驗證器掃描本 QR Code 來添加。",
|
||||
"totpNeverShare": "永遠不要分享這個 QR Code",
|
||||
"needHelp": "需要幫助?",
|
||||
"needHelpLaunch": "查看我們的山羊維基!",
|
||||
"walletCreate": "創建錢包",
|
||||
"walletCreateSubtitle": "創建於一個錢包來開始使用源點。",
|
||||
"walletCreatePassword": "在下方設置你的付款密碼",
|
||||
"walletCurrencyShort": "源點",
|
||||
"walletCurrency": {
|
||||
"one": "{} 源點",
|
||||
"other": "{} 源點"
|
||||
},
|
||||
"aiThinkingProcess": "AI 思考過程",
|
||||
"accountSettingsApplied": "帳號設置已應用。",
|
||||
"trayMenuExit": "退出",
|
||||
"postQuestionUnanswered": "未解答的問題",
|
||||
"postQuestionUnansweredWithReward": "未解答的問題,懸賞源點 {}",
|
||||
"postQuestionAnswered": "已解答的問題",
|
||||
"postQuestionAnswerTitle": "精選解答",
|
||||
"postQuestionAnswerSelect": "選擇解答",
|
||||
"postQuestionAnswerSelected": "解答已選擇,獎勵已發放。",
|
||||
"postVideoUpload": "上傳視頻",
|
||||
"realmJoin": "加入領域",
|
||||
"realmCommunityHint": "該領域是一個社區領域,你可以自由加入。",
|
||||
"realmCommunityPublicChannelsHint": "該領域包含的公共頻道",
|
||||
"realmCommunityPublishersHint": "該領域的發佈者",
|
||||
"realmJoined": "已加入領域 {}。",
|
||||
"join": "加入",
|
||||
"pollEditorNew": "新投票",
|
||||
"pollEditorEdit": "編輯投票",
|
||||
"pollEditorDelete": "刪除投票",
|
||||
"pollEditorDeleteDescription": "你確定要刪除這個投票嗎?該操作不可撤銷。",
|
||||
"pollEditorUnlink": "解除鏈接",
|
||||
"pollOptionAdd": "添加選項",
|
||||
"pollOptionName": "選項名稱",
|
||||
"pollLinkExisting": "鏈接現有投票",
|
||||
"pollAnswered": "答案已經反饋。",
|
||||
"pollVotes": {
|
||||
"one": "{} 票",
|
||||
"other": "{} 票"
|
||||
},
|
||||
"publisherDelete": "刪除發佈者 {}",
|
||||
"publisherDeleteDescription": "你確定要刪除這個發佈者嗎?該操作不可撤銷。",
|
||||
"channelIsPublic": "公開頻道",
|
||||
"channelIsPublicDescription": "該頻道是公開的,任何人都可以加入。",
|
||||
"channelIsCommunity": "社區頻道",
|
||||
"channelIsCommunityDescription": "目前來説,社區頻道還沒有什麼特別之處。",
|
||||
"realmIsPublic": "公開領域",
|
||||
"realmIsPublicDescription": "該領域是公開的,任何人都可以加入。",
|
||||
"realmIsCommunity": "社區領域",
|
||||
"realmIsCommunityDescription": "社區領域會顯示在發現頁面上。",
|
||||
"realmLeave": "離開領域",
|
||||
"realmLeaveDescription": "離開當前領域,並且刪除領域中的身份。",
|
||||
"checkInResultTier1": "大凶",
|
||||
"checkInResultTier2": "兇",
|
||||
"checkInResultTier3": "中平",
|
||||
"checkInResultTier4": "吉",
|
||||
"checkInResultTier5": "大吉",
|
||||
"flagPostAction": "吹哨",
|
||||
"flagPost": "吹哨不良內容",
|
||||
"flagPostDescription": "吹哨不良內容,如果吹哨用户佔瀏覽量的 50% 或以上,則帖子會被摺疊。吹哨後不可撤銷。",
|
||||
"flaggedPost": "哨子已經吹響。",
|
||||
"postViews": {
|
||||
"zero": "{} 次瀏覽",
|
||||
"one": "{} 次瀏覽",
|
||||
"other": "{} 次瀏覽"
|
||||
},
|
||||
"attachmentBillingUploaded": "已佔用的字節數",
|
||||
"attachmentBillingDiscount": "免費的字節數",
|
||||
"attachmentBillingHint": "滑動窗口計價®\n在24小時內上傳的文件大小超出免費空間才會適用扣費。",
|
||||
"postThumbnail": "帖子縮略圖",
|
||||
"accountRealms": "領域",
|
||||
"postInGlobal": "全站",
|
||||
"postInGlobalDescription": "不關聯此帖子與任何領域。",
|
||||
"postChannelGlobal": "全站",
|
||||
"postChannelFriends": "好友",
|
||||
"postChannelFollowing": "關注",
|
||||
"postChannelRealm": "領域",
|
||||
"postFilterReset": "重置過濾器",
|
||||
"postFilterResetDescription": "清除過濾器並顯示所有帖子。",
|
||||
"postFilterWithCategory": "查看{}區中的帖子",
|
||||
"databaseSize": "數據庫大小",
|
||||
"databaseDelete": "刪除數據庫",
|
||||
"databaseDeleteDescription": "刪除本地數據庫,內容將從服務器重新獲取。",
|
||||
"databaseDeleted": "本地數據庫已被刪除。",
|
||||
"settingsEnablePushNotifications": "啓用推送數據",
|
||||
"settingsEnablePushNotificationsDescription": "重新啓用並請求推送權限,以防自動激活失敗。",
|
||||
"settingsEnabledPushNotifications": "推送通知已經註冊。",
|
||||
"screenStickers": "貼圖",
|
||||
"stickersDiscovery": "發現",
|
||||
"stickersOwned": "由我擁有",
|
||||
"stickersCreated": "由我發佈",
|
||||
"stickersAdd": "添加貼圖包",
|
||||
"stickersAdded": "貼圖包已添加。",
|
||||
"add": "添加",
|
||||
"stickersRemoved": "貼圖包已被移除,你可以隨時再次添加回來。",
|
||||
"stickersReload": "重載貼圖包",
|
||||
"stickersReloadDescription": "從服務器重新加載添加過的貼圖,更新貼圖選擇器。",
|
||||
"stickersReloaded": "貼圖包已重載。",
|
||||
"stickersPackDelete": "刪除貼圖包 {}",
|
||||
"stickersPackDeleteDescription": "你確定要刪除這個貼圖包嗎?這個操作不可撤銷。",
|
||||
"stickersPackDeleted": "貼圖包已被刪除。",
|
||||
"stickersDelete": "刪除貼圖 {}",
|
||||
"stickersDeleteDescription": "你確定要刪除這個貼圖嗎?這個操作不可撤銷。",
|
||||
"stickersDeleted": "貼圖已被刪除。",
|
||||
"fieldStickerName": "貼圖名稱",
|
||||
"fieldStickerAlias": "貼圖別名",
|
||||
"fieldStickerAliasHint": "和貼圖包前綴組合成為本貼圖的唯一佔位符。",
|
||||
"fieldStickerPackName": "名稱",
|
||||
"fieldStickerPackDescription": "描述",
|
||||
"fieldStickerPackPrefix": "貼圖包前綴",
|
||||
"fieldStickerAttachment": "附件",
|
||||
"stickersNew": "新建貼圖",
|
||||
"stickersNewDescription": "創建一個新的貼圖。",
|
||||
"stickersPackNew": "新建貼圖包",
|
||||
"trayMenuShow": "顯示",
|
||||
"trayMenuMuteNotification": "靜音通知",
|
||||
"update": "更新",
|
||||
"forceUpdate": "強制更新",
|
||||
"forceUpdateDescription": "強制更新應用程序,即使有更新的版本可能不可用。",
|
||||
"runtimeLogs": "運行時日誌",
|
||||
"runtimeLogsOpen": "打開日誌文件",
|
||||
"runtimeLogsDescription": "顯示運行時的日誌記錄。",
|
||||
"signinResetPasswordHint": "請輸入用户名/電子郵箱地址以幫助我們找到您的帳户並重置密碼。",
|
||||
"cacheSize": "緩存資源大小",
|
||||
"cacheDelete": "清除緩存",
|
||||
"cacheDeleteDescription": "從磁盤中移除緩存的圖片和其他資源,內容將從服務器重新下載。",
|
||||
"cacheDeleted": "所有緩存已被清除。",
|
||||
"userNoDescription": "這個人很懶,沒有留下什麼……",
|
||||
"fieldTimeZone": "時區",
|
||||
"fieldGender": "性別",
|
||||
"fieldPronouns": "人稱代詞",
|
||||
"fieldLocation": "位置",
|
||||
"fieldLinks": "鏈接",
|
||||
"fieldLinkName": "名稱",
|
||||
"fieldLinkUrl": "鏈接",
|
||||
"screenAccountBadges": "徽章",
|
||||
"accountBadges": "徽章",
|
||||
"accountBadgesDescription": "查看並管理你的徽章。",
|
||||
"badgeActivated": "已佩戴徽章 {}。",
|
||||
"viewDetailedAttachment": "查看附件詳情",
|
||||
"screenKeyPairs": "密鑰對",
|
||||
"accountKeyPairs": "密鑰對",
|
||||
"accountKeyPairsDescription": "管理用於加密信息的密鑰對。",
|
||||
"enrollNewKeyPair": "新建密鑰對",
|
||||
"enrollNewKeyPairDescription": "生成一對新密鑰對。",
|
||||
"keyPairHasPrivateKey": "有私鑰",
|
||||
"decrypting": "解密中……",
|
||||
"decryptingKeyNotFound": "未找到密鑰對或交換失敗,對方可能不在線",
|
||||
"messageUnablePreview": "無法預覽消息",
|
||||
"messageUnablePreviewEncrypted": "無法預覽加密消息",
|
||||
"postViewInGlobalDescription": "不查看特定領域的帖子。",
|
||||
"postDraftSaved": "已保存為草稿。",
|
||||
"postDraftBox": "草稿箱",
|
||||
"postShuffle": "隨便看看",
|
||||
"checkInStreak": {
|
||||
"zero": "無連擊",
|
||||
"one": "連續簽到 {} 天",
|
||||
"other": "連續簽到 {} 天"
|
||||
},
|
||||
"accountChangeStatus": "修改狀態",
|
||||
"accountStatusSilent": "請勿打擾",
|
||||
"accountStatusSilentDesc": "將會暫停所有通知推送",
|
||||
"accountStatusInvisible": "隱身",
|
||||
"accountStatusInvisibleDesc": "將會在他人界面顯示離線,但不影響功能使用",
|
||||
"accountCustomStatus": "自定義狀態",
|
||||
"accountCustomStatusDescription": "客製化你的狀態。",
|
||||
"accountClearStatus": "清除狀態",
|
||||
"accountClearStatusDescription": "清除你的狀態,並讓服務器決定你的狀態。",
|
||||
"fieldAccountStatusLabel": "狀態文字",
|
||||
"fieldAccountStatusClearAt": "清除時間",
|
||||
"accountStatusNegative": "負面",
|
||||
"accountStatusNeutral": "中性",
|
||||
"accountStatusPositive": "正面",
|
||||
"mixedFeed": "混合推薦流",
|
||||
"mixedFeedDescription": "探索頁面可能不只會展示用户的帖子,更可能包含其他的內容。但該模式不適用分類和過濾。",
|
||||
"filterFeed": "探索隊列調整",
|
||||
"feedUnknownItem": "無法顯示該內容,當前版本客户端不支持該類型的內容,請嘗試更新應用程序後再試。",
|
||||
"serviceStatusOperational": "所有服務正常",
|
||||
"serviceStatusDowngraded": "部分服務異常",
|
||||
"serviceStatusFailed": "服務狀態異常",
|
||||
"serviceStatusFailedDescription": "服務器炸了或者剛剛執行完維護程序。",
|
||||
"serviceNameInsights": "總結、見解與洞察",
|
||||
"serviceNameInteractive": "帖子與互動",
|
||||
"serviceNameReader": "新聞與鏈接展開",
|
||||
"serviceNameMessaging": "即使聊天",
|
||||
"serviceNameMatrix": "矩陣市場",
|
||||
"serviceNamePaperclip": "附件",
|
||||
"serviceNameWallet": "源點錢包",
|
||||
"serviceNamePassport": "身份驗證與授權",
|
||||
"accountActionEvent": "操作日誌",
|
||||
"accountActionEventDescription": "查看你的操作日誌。",
|
||||
"eventMetadata": "元數據",
|
||||
"accountAuthTickets": "授權會話",
|
||||
"accountAuthTicketsDescription": "查看和管理你的授權會話。",
|
||||
"authTicketCreatedAt": "簽發於 {}",
|
||||
"authTicketExpiredAt": "到期於 {}",
|
||||
"authTicketLastGrantAt": "上次刷新於 {}",
|
||||
"authTicketCurrent": "當前會話",
|
||||
"accountUnconfirmedTitle": "尚未未確認賬户",
|
||||
"accountUnconfirmedSubtitle": "您的賬户尚未確認,這會導致大部分功能不可用,並且您的帳户將在 24 小時後自毀。您綁定的郵箱的收件箱應該會有一封郵件指引您確認您的帳户。",
|
||||
"accountUnconfirmedUnreceived": "未收到郵件?",
|
||||
"accountUnconfirmedResend": "重新發送一封",
|
||||
"accountUnconfirmedResendSuccessful": "郵件已重新發送,你可以在 60 分鐘後再重發一封。",
|
||||
"stickerPickerEmpty": "貼圖列表為空",
|
||||
"stickerPickerEmptyHint": "想要開始使用貼圖,請先添加貼圖包。",
|
||||
"goto": "跳轉到 {}",
|
||||
"accountContactMethods": "聯繫方式",
|
||||
"accountContactMethodsDescription": "管理你的聯繫方式。",
|
||||
"accountContactMethodsNameEmail": "電子郵箱",
|
||||
"accountContactMethodsNamePhone": "電話",
|
||||
"accountContactMethodsNameAddress": "地址",
|
||||
"accountContactMethodsPrimary": "主要的",
|
||||
"accountContactMethodsVerified": "已驗證",
|
||||
"accountContactMethodsPublic": "公開的",
|
||||
"accountContactMethodsAdd": "添加聯繫方式",
|
||||
"accountContactMethodsEdit": "編輯聯繫方式",
|
||||
"accountContactMethodsAddDescription": "添加新的聯繫方式。",
|
||||
"fieldContactContent": "聯繫方式",
|
||||
"accountContactMethodsPublicHint": "這個聯繫方式公開地顯示在個人資料中。",
|
||||
"accountContactMethodsDelete": "刪除聯繫方式",
|
||||
"accountContactMethodsDeleteDescription": "你確定要刪除聯繫方式 {} 嗎?這個操作不可撤銷。",
|
||||
"postCommentAdd": "撰寫一條評論",
|
||||
"translate": "翻譯",
|
||||
"translating": "正在翻譯……",
|
||||
"translated": "已翻譯",
|
||||
"settingsAutoTranslate": "自動翻譯",
|
||||
"settingsAutoTranslateDescription": "在查看帖子、消息時自動翻譯文本。",
|
||||
"trayMenuHide": "隱藏",
|
||||
"accountSettingsNotify": "通知設置",
|
||||
"accountSettingsNotifyDescription": "調整你所收到的通知種類。",
|
||||
"accountSettingsSecurity": "安全設置",
|
||||
"accountSettingsSecurityDescription": "調整你的帳户安全設置。",
|
||||
"save": "保存",
|
||||
"notificationTopicPostFeedback": "帖子數據反饋",
|
||||
"notificationTopicPostReply": "帖子回覆",
|
||||
"notificationTopicPostSubscription": "帖子訂閲",
|
||||
"notificationTopicMessaging": "消息",
|
||||
"notificationTopicMessagingCall": "通話",
|
||||
"notificationTopicGeneral": "雜項",
|
||||
"authMaximumAuthSteps": "最大驗證步驟",
|
||||
"authMaximumAuthStepsDescription": {
|
||||
"one": "登入時最多要求 {} 步驗證",
|
||||
"other": "登入時最多要求 {} 步驗證"
|
||||
},
|
||||
"authAlwaysRisky": "總是風險",
|
||||
"authAlwaysRiskyDescription": "在登入時始終按最高標準要求驗證。",
|
||||
"chatUnjoined": "未加入頻道",
|
||||
"chatUnjoinedDescription": "你沒有加入這個頻道,所以你也無法發送消息或者查看這個頻道中的消息。",
|
||||
"chatUnjoinedPublicDescription": "但幸運的是,這是一個公開頻道,所以你可以主動加入。",
|
||||
"chatJoin": "加入頻道",
|
||||
"appInitStarting": "啓動中",
|
||||
"appInitNetwork": "正在初始化網絡",
|
||||
"appInitUserdata": "正在初始化用户數據",
|
||||
"appInitWebsocket": "正在建立 Solar Link",
|
||||
"appInitNotification": "正在初始化推送通知",
|
||||
"appInitKeyPair": "正在初始化密鑰對",
|
||||
"appInitStickers": "正在初始化貼圖包",
|
||||
"appInitUserDirectory": "正在初始化用户目錄",
|
||||
"appInitRealm": "正在初始化領域信息",
|
||||
"appInitChat": "正在初始化聊天",
|
||||
"appInitDone": "完成",
|
||||
"community": "社區",
|
||||
"realmCommunity": "{}的社區",
|
||||
"postTotalCount": {
|
||||
"zero": "沒有帖子",
|
||||
"one": "共 {} 條帖子"
|
||||
},
|
||||
"settingsHideBottomNav": "隱藏底部導航欄",
|
||||
"settingsHideBottomNavDescription": "隱藏底部導航欄,在側邊欄抽屜顯示導航按鈕。",
|
||||
"reCaptcha": "人機驗證",
|
||||
"friends": "好友",
|
||||
"friendsDescription": "管理好友關係。",
|
||||
"album": "相冊",
|
||||
"albumDescription": "查看相冊與管理上傳附件。",
|
||||
"stickers": "貼圖",
|
||||
"stickersDescription": "查看貼圖包與管理貼圖。",
|
||||
"navBottomUnauthorizedCaption": "或者註冊一個賬號"
|
||||
}
|
||||
|
@ -7,53 +7,58 @@
|
||||
"screenAuthLogin": "登陸",
|
||||
"screenAuthLoginSubtitle": "使用 Solarpass 登陸 Solar Network",
|
||||
"screenAuthLoginGreeting": "歡迎回來",
|
||||
"screenAuthRegister": "建立賬號",
|
||||
"screenAuthRegisterSubtitle": "建立一個 Solarpass 賬號",
|
||||
"screenAccountPublishers": "釋出者",
|
||||
"screenAccountPublisherNew": "新建釋出者",
|
||||
"screenAccountPublisherEdit": "編輯釋出者",
|
||||
"screenAuthRegister": "創建賬號",
|
||||
"screenAuthRegisterSubtitle": "創建一個 Solarpass 賬號",
|
||||
"screenAccountPublishers": "發佈者",
|
||||
"screenAccountPublisherNew": "新建發佈者",
|
||||
"screenAccountPublisherEdit": "編輯發佈者",
|
||||
"screenAccountProfileEdit": "編輯資料",
|
||||
"screenAbuseReport": "濫用檢舉",
|
||||
"screenSettings": "設定",
|
||||
"screenAlbum": "相簿",
|
||||
"screenSettings": "設置",
|
||||
"screenAccountSettings": "賬號設置",
|
||||
"screenFactorSettings": "驗證因子",
|
||||
"screenAccountWallet": "錢包",
|
||||
"screenNews": "新聞",
|
||||
"screenAlbum": "相冊",
|
||||
"screenChat": "聊天",
|
||||
"screenChatManage": "編輯聊天頻道",
|
||||
"screenChatNew": "新建聊天頻道",
|
||||
"screenRealm": "領域",
|
||||
"screenRealmManage": "編輯領域",
|
||||
"screenRealmDiscovery": "發現領域",
|
||||
"screenRealmNew": "新建領域",
|
||||
"screenNotification": "通知",
|
||||
"screenPostSearch": "搜尋帖子",
|
||||
"screenPostSearch": "搜索帖子",
|
||||
"screenFriend": "好友",
|
||||
"dialogOkay": "好的",
|
||||
"dialogCancel": "取消",
|
||||
"dialogConfirm": "確認",
|
||||
"dialogDismiss": "忽略",
|
||||
"dialogError": "出了點問題",
|
||||
"errorRequestBad": "伺服器拒絕了您的請求,請檢查您的輸入。",
|
||||
"errorRequestUnauthorized": "未授權的請求,請登入或者嘗試重新登陸。",
|
||||
"errorRequestForbidden": "被禁止的請求,您沒有足夠的許可權去做那件事。",
|
||||
"errorRequestNotFound": "您正查詢的資源無法被找到。",
|
||||
"errorRequestConnection": "網路連線錯誤,請檢查您的網路狀態或者檢查我們的服務狀態。",
|
||||
"errorRequestUnknown": "未知請求錯誤,您可能想將此對話方塊截圖併發送給我們。",
|
||||
"errorRequestBad": "服務器拒絕了您的請求,請檢查您的輸入。",
|
||||
"errorRequestUnauthorized": "未授權的請求,請登錄或者嘗試重新登陸。",
|
||||
"errorRequestForbidden": "被禁止的請求,您沒有足夠的權限去做那件事。",
|
||||
"errorRequestNotFound": "您正查找的資源無法被找到。",
|
||||
"errorRequestConnection": "網絡連接錯誤,請檢查您的網絡狀態或者檢查我們的服務狀態。",
|
||||
"errorRequestUnknown": "未知請求錯誤,您可能想將此對話框截圖併發送給我們。",
|
||||
"unknown": "未知",
|
||||
"loading": "載入中…",
|
||||
"loading": "加載中…",
|
||||
"prev": "上一步",
|
||||
"next": "下一步",
|
||||
"edit": "編輯",
|
||||
"apply": "應用",
|
||||
"cancel": "取消",
|
||||
"create": "建立",
|
||||
"create": "創建",
|
||||
"preview": "預覽",
|
||||
"delete": "刪除",
|
||||
"unlink": "解除連結",
|
||||
"unlink": "解除鏈接",
|
||||
"crop": "裁剪",
|
||||
"compress": "壓縮",
|
||||
"report": "檢舉",
|
||||
"repost": "轉帖",
|
||||
"replyPost": "回貼",
|
||||
"reply": "回覆",
|
||||
"unset": "未設定",
|
||||
"unset": "未設置",
|
||||
"untitled": "無題",
|
||||
"postDetail": "帖子詳情",
|
||||
"postNoun": "帖子",
|
||||
@ -64,20 +69,20 @@
|
||||
"one": "總計 {} 字",
|
||||
"other": "總計 {} 字"
|
||||
},
|
||||
"fieldUsername": "使用者名稱",
|
||||
"fieldUsername": "用戶名",
|
||||
"fieldNickname": "顯示名",
|
||||
"fieldEmail": "電子郵箱地址",
|
||||
"fieldPassword": "密碼",
|
||||
"fieldUsernameAlphanumOnly": "使用者名稱只能包含英文大小寫字母和數字。",
|
||||
"fieldUsernameLengthLimit": "使用者名稱必須在 {} 和 {} 之間。",
|
||||
"fieldUsernameCannotEditHint": "使用者名稱在建立後無法修改",
|
||||
"fieldUsernameLookupHint": "支援使用者名稱、電話號碼或郵箱地址",
|
||||
"fieldUsernameAlphanumOnly": "用戶名只能包含英文大小寫字母和數字。",
|
||||
"fieldUsernameLengthLimit": "用戶名必須在 {} 和 {} 之間。",
|
||||
"fieldUsernameCannotEditHint": "用戶名在創建後無法修改",
|
||||
"fieldUsernameLookupHint": "支持用戶名、電話號碼或郵箱地址",
|
||||
"fieldNicknameLengthLimit": "暱稱必須在 {} 和 {} 之間。",
|
||||
"fieldEmailAddressMustBeValid": "電子郵箱地址必須是一個電子郵箱地址。",
|
||||
"fieldFirstName": "名",
|
||||
"fieldLastName": "姓",
|
||||
"fieldBirthday": "生日",
|
||||
"fieldImageHint": "你可以點選這些個人頭像來編輯它們。",
|
||||
"fieldImageHint": "你可以點擊這些個人頭像來編輯它們。",
|
||||
"fieldDescription": "簡介",
|
||||
"forgotPassword": "忘記密碼",
|
||||
"loginPickFactor": "選擇方式驗證",
|
||||
@ -85,24 +90,40 @@
|
||||
"one": "{} 步驗證",
|
||||
"other": "{} 步驗證"
|
||||
},
|
||||
"loginEnterPassword": "驗證程式碼",
|
||||
"loginSuccess": "登入為 {}",
|
||||
"loginEnterPassword": "驗證代碼",
|
||||
"loginSuccess": "登錄為 {}",
|
||||
"authFactorDelete": "刪除驗證因子",
|
||||
"authFactorDeleteDescription": "你確定要刪除 {} 驗證因子嗎?",
|
||||
"authFactorPassword": "密碼",
|
||||
"authFactorPasswordDescription": "註冊時選擇設置的密碼。",
|
||||
"authFactorEmail": "電郵一次性驗證碼",
|
||||
"authFactorEmailDescription": "由我們生成併發送到綁定的的電子郵箱的一次性驗證碼。",
|
||||
"authFactorTOTP": "時序驗證碼",
|
||||
"authFactorTOTPDescription": "使用 Google Authenticator 或 Authy 等驗證器生成的一次性驗證碼。",
|
||||
"authFactorInAppNotify": "應用內通知驗證碼",
|
||||
"authFactorInAppNotifyDescription": "通過站內通知推送的一次性驗證碼。",
|
||||
"authFactorAdd": "添加新驗證因子",
|
||||
"authFactorAddSubtitle": "給你的帳戶登陸時提供另一個方案。",
|
||||
"accountIntroTitle": "喜歡您來!",
|
||||
"accountIntroSubtitle": "登陸以探索更廣大的世界。",
|
||||
"accountLogout": "退出登入",
|
||||
"accountLogoutSubtitle": "登出當前賬戶的登陸狀態。",
|
||||
"accountLogoutConfirmTitle": "您確定要退出登入嗎?",
|
||||
"accountLogout": "退出登錄",
|
||||
"accountLogoutSubtitle": "註銷當前賬戶的登陸狀態。",
|
||||
"accountLogoutConfirmTitle": "您確定要退出登錄嗎?",
|
||||
"accountLogoutConfirm": "您需要重新輸入賬號密碼,甚至可能需要多步驗證來再次登陸。",
|
||||
"accountPublishers": "你的釋出者",
|
||||
"accountPublishers": "你的發佈者",
|
||||
"accountPublishersSubtitle": "管理你的公共形象。",
|
||||
"accountSettings": "帳號設置",
|
||||
"accountSettingsSubtitle": "管理你的帳號並讓它更好的服務你。",
|
||||
"accountProfileEdit": "編輯資料",
|
||||
"accountProfileEditSubtitle": "使你的 Solarpass 賬戶更像你。",
|
||||
"accountWallet": "錢包",
|
||||
"accountWalletSubtitle": "查看你的餘額和交易記錄。",
|
||||
"factorSettings": "驗證因子",
|
||||
"factorSettingsSubtitle": "管理你的登陸驗證方式。",
|
||||
"accountProfileEditApplied": "個人資料修改已被應用。",
|
||||
"publishersNew": "新發布者",
|
||||
"publisherNewSubtitle": "建立一個新的公共身份。",
|
||||
"publisherSyncWithAccount": "同步賬戶資訊",
|
||||
"publisherNewSubtitle": "創建一個新的公共身份。",
|
||||
"publisherSyncWithAccount": "同步賬戶信息",
|
||||
"publisherTotalUpvote": "總頂數",
|
||||
"publisherTotalDownvote": "總踩數",
|
||||
"publisherSocialPoint": "社會信用點",
|
||||
@ -115,34 +136,45 @@
|
||||
"publisherAffiliatedBy": "隸屬於 {}",
|
||||
"publisherRunBy": "由 {} 管理",
|
||||
"fieldPublisherBelongToRealm": "所屬領域",
|
||||
"fieldPublisherBelongToRealmUnset": "未設定釋出者所屬領域",
|
||||
"fieldPublisherBelongToRealmUnset": "未設置發佈者所屬領域",
|
||||
"writePost": "撰寫",
|
||||
"postTypeStory": "動態",
|
||||
"postTypeArticle": "文章",
|
||||
"postTypeQuestion": "問題",
|
||||
"postTypeVideo": "視頻",
|
||||
"writePostTypeStory": "發動態",
|
||||
"writePostTypeArticle": "寫文章",
|
||||
"fieldPostPublisher": "帖子釋出者",
|
||||
"writePostTypeQuestion": "提問題",
|
||||
"writePostTypeVideo": "發視頻",
|
||||
"fieldPostPublisher": "帖子發佈者",
|
||||
"fieldPostContent": "發生什麼事了?!",
|
||||
"fieldPostTitle": "標題",
|
||||
"fieldPostQuestionReward": "回答獎勵源點",
|
||||
"fieldPostDescription": "描述",
|
||||
"fieldPostTags": "標籤",
|
||||
"postPublish": "釋出",
|
||||
"postPublishedAt": "釋出於",
|
||||
"postPublishedUntil": "取消釋出於",
|
||||
"fieldPostCategories": "分類",
|
||||
"fieldPostAlias": "別名",
|
||||
"fieldPostAliasHint": "可選項,用於在 URL 中表示該帖子,應遵循 URL-Safe 的原則。",
|
||||
"postPublish": "發佈",
|
||||
"postPublishedAt": "發佈於",
|
||||
"postPublishedUntil": "取消發佈於",
|
||||
"postVisibility": "可見性",
|
||||
"postVisibilityDescription": "帖子可見性決定了誰能檢視該篇帖子。",
|
||||
"postVisibilityDescription": "帖子可見性決定了誰能查看該篇帖子。",
|
||||
"postVisibilityAll": "所有人可見",
|
||||
"postVisibilityFriends": "僅限好友可見",
|
||||
"postVisibilitySelected": "選定的使用者可見",
|
||||
"postVisibilityFiltered": "選定使用者不可見",
|
||||
"postVisibilitySelected": "選定的用戶可見",
|
||||
"postVisibilityFiltered": "選定用戶不可見",
|
||||
"postVisibilityNone": "僅自己可見",
|
||||
"postVisibleUsers": "可見的使用者",
|
||||
"postInvisibleUsers": "不可見的使用者",
|
||||
"postVisibleUsers": "可見的用戶",
|
||||
"postInvisibleUsers": "不可見的用戶",
|
||||
"postSelectedUsers": {
|
||||
"zero": "未選擇使用者",
|
||||
"one": "選擇了 {} 個使用者",
|
||||
"other": "選擇了 {} 個使用者"
|
||||
"zero": "未選擇用戶",
|
||||
"one": "選擇了 {} 個用戶",
|
||||
"other": "選擇了 {} 個用戶"
|
||||
},
|
||||
"postEditingNotice": "你正在修改由 {} 釋出的帖子。",
|
||||
"postReplyingNotice": "你正在回覆由 {} 釋出的帖子。",
|
||||
"postRepostingNotice": "你正在轉發由 {} 釋出的帖子。",
|
||||
"postEditingNotice": "你正在修改由 {} 發佈的帖子。",
|
||||
"postReplyingNotice": "你正在回覆由 {} 發佈的帖子。",
|
||||
"postRepostingNotice": "你正在轉發由 {} 發佈的帖子。",
|
||||
"postReact": "反應",
|
||||
"postPosted": "帖子已經發表。",
|
||||
"postReactions": "帖子的反應",
|
||||
@ -161,7 +193,7 @@
|
||||
"one": "{} 點社會信用點變更",
|
||||
"other": "{} 點社會信用點變更"
|
||||
},
|
||||
"postReactCompleted": "反應已被新增。",
|
||||
"postReactCompleted": "反應已被添加。",
|
||||
"postReactUncompleted": "反應已被移除。",
|
||||
"postComments": {
|
||||
"zero": "評論",
|
||||
@ -173,72 +205,99 @@
|
||||
"one": "{} 條評論",
|
||||
"other": "{} 條評論"
|
||||
},
|
||||
"postCommentExpand": "展開評論",
|
||||
"settingsAppearance": "外觀",
|
||||
"settingsCustomFonts": "自定義字體",
|
||||
"settingsCustomFontsDescription": "設置應用程序使用的字體。",
|
||||
"settingsCustomFontFamily": "應用字體",
|
||||
"settingsCustomFontFamilyHint": "使用英文逗號分割每一種字體,越前優先級越高",
|
||||
"settingsCustomFontApplied": "自定義字體已經應用。",
|
||||
"settingsDisplayLanguage": "顯示語言",
|
||||
"settingsDisplayLanguageDescription": "設置應用程序使用的語言",
|
||||
"settingsDisplayLanguageSystem": "跟隨系統",
|
||||
"settingsBackgroundImage": "背景圖片",
|
||||
"settingsBackgroundImageDescription": "設定應用全域性生效的的背景圖片。",
|
||||
"settingsBackgroundImageDescription": "設置應用全局生效的的背景圖片。",
|
||||
"settingsBackgroundImageClear": "清除現存背景圖",
|
||||
"settingsBackgroundImageClearDescription": "將應用背景圖重置為空白。",
|
||||
"settingsThemeMaterial3": "使用 Material You 設計正規化",
|
||||
"settingsThemeMaterial3Description": "將應用主題設定為 Material 3 設計正規化的主題。",
|
||||
"settingsNetwork": "網路",
|
||||
"settingsNetworkServer": "HyperNet 伺服器",
|
||||
"settingsNetworkServerDescription": "設定 HyperNet 伺服器地址,選擇我們提供的,或者自己搭建。",
|
||||
"settingsNetworkServerReset": "重設為官方伺服器",
|
||||
"settingsNetworkServerResetDescription": "重設為 Solar Network 的伺服器地址。",
|
||||
"settingsNetworkServerPreset": "預設的 HyperNet 伺服器",
|
||||
"settingsNetworkServerPresetDescription": "你可以在旁邊的列表中選擇我們提供的預設 HyperNet 伺服器地址。",
|
||||
"settingsNetworkServerSaved": "伺服器地址已儲存。",
|
||||
"settingsPerformance": "效能",
|
||||
"settingsThemeMaterial3": "使用 Material You 設計範式",
|
||||
"settingsThemeMaterial3Description": "將應用主題設置為 Material 3 設計範式的主題。",
|
||||
"settingsAppBarTransparent": "透明頂欄",
|
||||
"settingsAppBarTransparentDescription": "為頂欄啟用透明效果。",
|
||||
"settingsDrawerPreferCollapse": "側邊欄偏好摺疊",
|
||||
"settingsDrawerPreferCollapseDescription": "將側邊欄優先摺疊,即使屏幕寬度足夠大去放下整個側邊欄。",
|
||||
"settingsColorScheme": "主題色",
|
||||
"settingsColorSchemeDescription": "設置應用主題色。",
|
||||
"settingsColorSeed": "預設色彩主題",
|
||||
"settingsColorSeedDescription": "選擇一個預設色彩主題。",
|
||||
"settingsFeatures": "功能",
|
||||
"settingsNotifyWithHaptic": "新通知時振動",
|
||||
"settingsNotifyWithHapticDescription": "在應用在前臺時收到新通知出現時出發輕量的振動。",
|
||||
"settingsExpandPostLink": "展開帖子鏈接",
|
||||
"settingsExpandPostLinkDescription": "在帖子列表中展開顯示帖子中的鏈接。",
|
||||
"settingsExpandChatLink": "展開聊天鏈接",
|
||||
"settingsExpandChatLinkDescription": "在聊天信息中展開顯示內容中的鏈接。",
|
||||
"settingsNetwork": "網絡",
|
||||
"settingsNetworkServer": "HyperNet 服務器",
|
||||
"settingsNetworkServerDescription": "設置 HyperNet 服務器地址,選擇我們提供的,或者自己搭建。",
|
||||
"settingsNetworkServerReset": "重設為官方服務器",
|
||||
"settingsNetworkServerResetDescription": "重設為 Solar Network 的服務器地址。",
|
||||
"settingsNetworkServerPreset": "預設的 HyperNet 服務器",
|
||||
"settingsNetworkServerPresetDescription": "你可以在旁邊的列表中選擇我們提供的預設 HyperNet 服務器地址。",
|
||||
"settingsNetworkServerSaved": "服務器地址已保存。",
|
||||
"settingsPerformance": "性能",
|
||||
"settingsImageQuality": "圖片預覽質量",
|
||||
"settingsImageQualityDescription": "設定圖片預覽質量,會影響圖片解碼速度。",
|
||||
"settingsImageQualityDescription": "設置圖片預覽質量,會影響圖片解碼速度。",
|
||||
"settingsImageQualityLowest": "極低",
|
||||
"settingsImageQualityLow": "低",
|
||||
"settingsImageQualityMedium": "中",
|
||||
"settingsImageQualityHigh": "高",
|
||||
"settingsMisc": "雜項",
|
||||
"settingsMiscAbout": "關於",
|
||||
"settingsMiscAboutDescription": "檢視 Solian 的版本資訊。",
|
||||
"settingsMiscAboutDescription": "查看 Solian 的版本信息。",
|
||||
"settingsAccountLanguage": "帳號偏好語言",
|
||||
"settingsAccountLanguageDescription": "設置郵件、通知和其他帳號相關內容的語言。",
|
||||
"sensitiveContent": "敏感內容",
|
||||
"sensitiveContentCollapsed": "敏感內容已摺疊。",
|
||||
"sensitiveContentDescription": "此內容已被標記,可能不適合所有人檢視。",
|
||||
"sensitiveContentDescription": "此內容已被標記,可能不適合所有人查看。",
|
||||
"sensitiveContentReveal": "顯示內容",
|
||||
"serverConnecting": "正在連線伺服器…",
|
||||
"serverDisconnected": "已與伺服器斷開連線",
|
||||
"serverConnecting": "正在連接…",
|
||||
"serverDisconnected": "已斷開連接",
|
||||
"serverConnected": "已連接",
|
||||
"fieldChatAlias": "頻道別名",
|
||||
"fieldChatAliasHint": "全站範圍內唯一的頻道別名,用於在 URL 中表示該頻道,留空則自動生成。應遵循 URL-Safe 的原則。",
|
||||
"fieldChatName": "名稱",
|
||||
"fieldChatDescription": "描述",
|
||||
"fieldChatBelongToRealm": "所屬領域",
|
||||
"fieldChatBelongToRealmUnset": "未設定頻道所屬領域",
|
||||
"fieldChatBelongToRealmUnset": "未設置頻道所屬領域",
|
||||
"channelEditingNotice": "您正在編輯頻道 {}",
|
||||
"channelDeleted": "聊天頻道 {} 已被刪除",
|
||||
"channelDelete": "刪除聊天頻道 {}",
|
||||
"channelDeleteDescription": "你確定要刪除這個聊天頻道嗎?該操作不可撤銷,其頻道內的所有訊息將被永久刪除。",
|
||||
"channelDeleteDescription": "你確定要刪除這個聊天頻道嗎?該操作不可撤銷,其頻道內的所有消息將被永久刪除。",
|
||||
"channelDetailPersonalRegion": "個人區域",
|
||||
"channelDetailMemberRegion": "成員管理",
|
||||
"channelMemberManage": "管理成員",
|
||||
"channelMemberManageDescription": "管理頻道內現有成員。",
|
||||
"channelMemberAdd": "新增成員",
|
||||
"channelMemberAddDescription": "給當前頻道新增新成員。",
|
||||
"channelMemberAdded": "頻道成員已新增。",
|
||||
"channelMemberAdd": "添加成員",
|
||||
"channelMemberAddDescription": "給當前頻道添加新成員。",
|
||||
"channelMemberAdded": "頻道成員已添加。",
|
||||
"fieldMemberRelatedName": "成員名 / 賬戶 ID",
|
||||
"channelDetailAdminRegion": "管理區域",
|
||||
"channelEditProfile": "更改頻道身份",
|
||||
"channelEdit": "編輯頻道",
|
||||
"channelEditDescription": "更改頻道基本資訊,元資料等。",
|
||||
"channelEditDescription": "更改頻道基本信息,元數據等。",
|
||||
"channelProfileEdit": "編輯頻道身份",
|
||||
"channelActionDelete": "刪除頻道",
|
||||
"channelActionDeleteDescription": "刪除整個頻道,並且刪除頻道里的所有資訊。",
|
||||
"channelActionDeleteDescription": "刪除整個頻道,並且刪除頻道里的所有信息。",
|
||||
"channelLeave": "退出頻道 {}",
|
||||
"channelLeaveDescription": "退出該頻道,但是你頻道內的資訊不會被移除。",
|
||||
"channelLeaveDescription": "退出該頻道,但是你頻道內的信息不會被移除。",
|
||||
"channelActionLeave": "退出頻道",
|
||||
"channelActionLeaveDescription": "刪除你在這個頻道的身份。",
|
||||
"channelNotifyLevel": "通知級別",
|
||||
"channelNotifyLevelDescription": "有您決定要接受多少來自這個頻道的訊息。",
|
||||
"channelNotifyLevelDescription": "有您決定要接受多少來自這個頻道的消息。",
|
||||
"channelNotifyLevelAll": "全部通知",
|
||||
"channelNotifyLevelMentioned": "僅提及",
|
||||
"channelNotifyLevelNone": "全部靜音",
|
||||
"channelNotifyLevelApplied": "已經儲存並應用頻道通知級別配置。",
|
||||
"channelNotifyLevelApplied": "已經保存並應用頻道通知級別配置。",
|
||||
"fieldChannelProfileNick": "頻道內顯示名",
|
||||
"fieldChannelProfileNickHint": "在頻道內顯示的暱稱,留空則使用賬號顯示名。",
|
||||
"fieldRealmAlias": "領域別名",
|
||||
@ -248,38 +307,74 @@
|
||||
"realmEditingNotice": "您正在編輯領域 {}",
|
||||
"realmDeleted": "領域 {} 已被刪除",
|
||||
"realmDelete": "刪除領域 {}",
|
||||
"realmDeleteDescription": "你確定要刪除這個領域嗎?該操作不可撤銷,其隸屬於該領域的所有資源(帖子、聊天頻道、釋出者、製品等)都將被永久刪除。三思而後行!",
|
||||
"realmDeleteDescription": "你確定要刪除這個領域嗎?該操作不可撤銷,其隸屬於該領域的所有資源(帖子、聊天頻道、發佈者、製品等)都將被永久刪除。三思而後行!",
|
||||
"realmActionDelete": "刪除領域",
|
||||
"realmActionDeleteDescription": "刪除整個領域及其附屬的資源。",
|
||||
"realmEdit": "編輯領域",
|
||||
"realmEditDescription": "更改領域基本資訊,元資料等。",
|
||||
"realmMemberAdd": "新增成員",
|
||||
"realmMemberAddDescription": "給當前領域新增新成員。",
|
||||
"realmMemberAdded": "領域成員已新增。",
|
||||
"fieldChatMessage": "在 {} 中發訊息",
|
||||
"fieldChatMessageDirect": "給 {} 發訊息",
|
||||
"eventResourceTag": "訊息 {}",
|
||||
"messageDelete": "刪除訊息 {}",
|
||||
"messageDeleteDescription": "你確定要刪除這個訊息嗎?該操作不可撤銷。同時您將留下一條刪除訊息的記錄。",
|
||||
"messageDeleted": "訊息 {} 已被刪除",
|
||||
"messageEdited": "訊息 {} 已被編輯",
|
||||
"realmEditDescription": "更改領域基本信息,元數據等。",
|
||||
"realmMemberAdd": "添加成員",
|
||||
"realmMemberAddDescription": "給當前領域添加新成員。",
|
||||
"realmMemberAdded": "領域成員已添加。",
|
||||
"fieldChatMessage": "在 {} 中發消息",
|
||||
"fieldChatMessageDirect": "給 {} 發消息",
|
||||
"eventResourceTag": "消息 {}",
|
||||
"messageDelete": "刪除消息 {}",
|
||||
"messageDeleteDescription": "你確定要刪除這個消息嗎?該操作不可撤銷。同時您將留下一條刪除消息的記錄。",
|
||||
"messageDeleted": "消息 {} 已被刪除",
|
||||
"messageEdited": "消息 {} 已被編輯",
|
||||
"messageEditedHint": "已編輯",
|
||||
"messageUnsupported": "不支援的訊息 {}",
|
||||
"messageUnsupported": "不支持的消息 {}",
|
||||
"messageFileHint": {
|
||||
"zero": "沒有附件",
|
||||
"one": "{} 個附件",
|
||||
"other": "{} 個附件"
|
||||
},
|
||||
"addAttachmentFromAlbum": "從相簿中新增附件",
|
||||
"addAttachmentFromClipboard": "貼上附件",
|
||||
"messageTyping": {
|
||||
"one": "{} 正在輸入",
|
||||
"other": "{} 正在輸入"
|
||||
},
|
||||
"fieldAttachmentRandomId": "訪問 ID",
|
||||
"fieldAttachmentAlt": "概述文字",
|
||||
"addAttachmentFromAlbum": "從相冊中添加附件",
|
||||
"addAttachmentFromFiles": "從文件中添加附件",
|
||||
"addAttachmentFromClipboard": "粘貼附件",
|
||||
"addAttachmentFromCameraPhoto": "拍攝照片",
|
||||
"addAttachmentFromCameraVideo": "拍攝影片",
|
||||
"attachmentPastedImage": "貼上的圖片",
|
||||
"attachmentInsertLink": "插入連線",
|
||||
"attachmentSetAsPostThumbnail": "設定為帖子縮圖",
|
||||
"attachmentUnsetAsPostThumbnail": "取消設定為帖子縮圖",
|
||||
"attachmentSetThumbnail": "設定縮圖",
|
||||
"addAttachmentFromCameraVideo": "拍攝視頻",
|
||||
"addAttachmentFromRandomId": "通過訪問 ID 鏈接",
|
||||
"attachmentDetailInfo": "附件詳細信息",
|
||||
"attachmentPastedImage": "粘貼的圖片",
|
||||
"attachmentInsertedImage": "插入的圖片",
|
||||
"attachmentInsertLink": "插入連接",
|
||||
"attachmentSetAsPostThumbnail": "設置為帖子縮略圖",
|
||||
"attachmentUnsetAsPostThumbnail": "取消設置為帖子縮略圖",
|
||||
"attachmentCompressVideo": "重新編碼視頻",
|
||||
"attachmentSetThumbnail": "設置縮略圖",
|
||||
"attachmentSetAlt": "設置概述文字",
|
||||
"attachmentCopyRandomId": "複製訪問 ID",
|
||||
"attachmentUpload": "上傳",
|
||||
"attachmentInputDialog": "上傳附件",
|
||||
"attachmentInputUseRandomId": "使用訪問 ID",
|
||||
"attachmentInputNew": "新上傳附件",
|
||||
"waitingForUpload": "等待上傳",
|
||||
"attachmentVideoCompressHint": "壓縮一份視頻的副本",
|
||||
"attachmentVideoCompressHintDescription": "你想上傳壓縮視頻 {} 的副本嗎?它將幫助你的觀眾快速預覽視頻,並且他們仍然可以觀看原始視頻。這將會在在你的設備上處理視頻,所以需要一些時間,所以請耐心等待。",
|
||||
"attachmentCompressQuality": "壓縮質量",
|
||||
"attachmentCompressQualityHighest": "最高",
|
||||
"attachmentCompressQualityDefault": "默認",
|
||||
"attachmentCompressQualityMedium": "中等",
|
||||
"attachmentCompressQualityLow": "低",
|
||||
"attachmentCompressQualityHint": "Solar Network 並沒有阻止你上傳大文件、高分辨率、高碼率的視頻,但是為了你的網絡情況觀眾考慮,我們建議你選擇一個合適的壓縮質量。",
|
||||
"attachmentUploaded": "已上傳",
|
||||
"attachmentPending": "未上傳",
|
||||
"attachmentCopyCompressed": "有壓縮副本",
|
||||
"attachmentGotBoosted": "有加速傳遞",
|
||||
"attachmentBoost": "加速包",
|
||||
"attachmentCreateBoost": "加速傳遞",
|
||||
"attachmentBoostHint": "加速傳遞允許您將附件上傳到更近的受眾或更快的內容網絡。該功能目前處於 Beta 階段。該功能限時免費,當有價格計劃更改時,您將會被通知。",
|
||||
"attachmentDestinationRegion": "目標節點",
|
||||
"attachmentDestinationRegionAPAC": "亞太地區",
|
||||
"attachmentDestinationRegionNGB": "中國 · 浙江 · 寧波",
|
||||
"attachmentDestinationRegionHKG": "香港",
|
||||
"notification": "通知",
|
||||
"notificationUnreadCount": {
|
||||
"zero": "無未讀通知",
|
||||
@ -289,18 +384,18 @@
|
||||
"notificationUnread": "未讀",
|
||||
"notificationRead": "已讀",
|
||||
"notificationMarkAllRead": "已讀所有通知",
|
||||
"notificationMarkAllReadDescription": "您確定要將所有通知設定為已讀嗎?該操作不可撤銷。",
|
||||
"notificationMarkAllReadDescription": "您確定要將所有通知設置為已讀嗎?該操作不可撤銷。",
|
||||
"notificationMarkAllReadPrompt": {
|
||||
"zero": "已將 0 個通知標記為已讀。",
|
||||
"one": "已將 {} 個通知標記為已讀。",
|
||||
"other": "已將 {} 個通知標記為已讀。"
|
||||
},
|
||||
"notificationMarkOneReadPrompt": "已將通知 {} 標記為已讀。",
|
||||
"search": "搜尋",
|
||||
"search": "搜索",
|
||||
"postSearchResult": {
|
||||
"zero": "沒有搜尋到結果",
|
||||
"one": "搜尋到 {} 個結果",
|
||||
"other": "搜尋到 {} 個結果"
|
||||
"zero": "沒有搜索到結果",
|
||||
"one": "搜索到 {} 個結果",
|
||||
"other": "搜索到 {} 個結果"
|
||||
},
|
||||
"postSearchTook": "耗時 {}",
|
||||
"postDelete": "刪除帖子 {}",
|
||||
@ -312,26 +407,26 @@
|
||||
"callResume": "恢復",
|
||||
"callMicrophone": "麥克風",
|
||||
"callCamera": "攝像頭",
|
||||
"callMicrophoneDisabled": "麥克風已停用",
|
||||
"callMicrophoneDisabled": "麥克風已禁用",
|
||||
"callMicrophoneSelect": "選擇麥克風",
|
||||
"callCameraDisabled": "攝像頭已停用",
|
||||
"callCameraDisabled": "攝像頭已禁用",
|
||||
"callCameraSelect": "選擇攝像頭",
|
||||
"callDisconnected": "通話已斷開",
|
||||
"callEnded": "通話已結束",
|
||||
"callStatusConnected": "已連線",
|
||||
"callStatusDisconnected": "未連線",
|
||||
"callStatusConnecting": "正在連線",
|
||||
"callStatusConnected": "已連接",
|
||||
"callStatusDisconnected": "未連接",
|
||||
"callStatusConnecting": "正在連接",
|
||||
"callStatusReconnecting": "正在重連",
|
||||
"callDisconnect": "斷開連線",
|
||||
"callDisconnectDescription": "您確定要與通話斷開連線嗎?",
|
||||
"callDisconnect": "斷開連接",
|
||||
"callDisconnectDescription": "您確定要與通話斷開連接嗎?",
|
||||
"callMicrophoneOff": "關閉麥克風",
|
||||
"callMicrophoneOn": "開啟麥克風",
|
||||
"callMicrophoneOn": "打開麥克風",
|
||||
"callCameraOff": "關閉攝像頭",
|
||||
"callCameraOn": "開啟攝像頭",
|
||||
"callVideoFlip": "映象畫面",
|
||||
"callCameraOn": "打開攝像頭",
|
||||
"callVideoFlip": "鏡像畫面",
|
||||
"callSpeakerphoneToggle": "切換揚聲器",
|
||||
"callScreenOff": "關閉螢幕共享",
|
||||
"callScreenOn": "開啟螢幕共享",
|
||||
"callScreenOff": "關閉屏幕共享",
|
||||
"callScreenOn": "開啟屏幕共享",
|
||||
"callMessageEnded": "通話持續了 {}",
|
||||
"callMessageStarted": "通話開始了",
|
||||
"dailyCheckIn": "每日簽到",
|
||||
@ -367,28 +462,53 @@
|
||||
"dailyCheckNegativeHint5Description": "關鍵時刻斷網",
|
||||
"dailyCheckNegativeHint6": "出門",
|
||||
"dailyCheckNegativeHint6Description": "忘帶傘遇上大雨",
|
||||
"happyBirthday": "生日快樂,{}!",
|
||||
"friendNew": "新增好友",
|
||||
"celebrateBirthday": "生日快樂,{}!",
|
||||
"celebrateLunarNewYear": "春節快樂,{}!",
|
||||
"celebrateMidAutumn": "中秋節快樂,{}!",
|
||||
"celebrateDragonBoat": "端午節快樂,{}!",
|
||||
"celebrateMerryXmas": "聖誕快樂,{}!",
|
||||
"celebrateNewYear": "新年快樂,{}!",
|
||||
"celebrateValentineDay": "今天是情人節,{}!",
|
||||
"celebrateLaborDay": "今天是勞動節,{}。",
|
||||
"celebrateMotherDay": "今天是母親節,{}。",
|
||||
"celebrateChildrenDay": "今天是兒童節,{}!",
|
||||
"celebrateFatherDay": "今天是父親節,{}。",
|
||||
"celebrateHalloween": "快樂在聖誕節,{}!",
|
||||
"celebrateThanksgiving": "今天是感恩節,{}!",
|
||||
"pendingLunarNewYear": "{} 過春節",
|
||||
"pendingMidAutumn": "{} 過中秋節",
|
||||
"pendingDragonBoat": "{} 過端午節",
|
||||
"pendingBirthday": "{} 過生日",
|
||||
"pendingMerryXmas": "{} 過聖誕節",
|
||||
"pendingNewYear": "{} 跨年",
|
||||
"pendingValentineDay": "{} 過情人節",
|
||||
"pendingLaborDay": "{} 過勞動節",
|
||||
"pendingMotherDay": "{} 過母親節",
|
||||
"pendingChildrenDay": "{} 過兒童節",
|
||||
"pendingFatherDay": "{} 過父親節",
|
||||
"pendingHalloween": "{} 過聖誕節",
|
||||
"pendingThanksgiving": "{} 過感恩節",
|
||||
"friendNew": "添加好友",
|
||||
"friendRequests": "好友請求",
|
||||
"friendRequestsDescription": {
|
||||
"zero": "你沒有好友請求",
|
||||
"one": "你有 {} 個好友請求",
|
||||
"other": "你有 {} 個好友請求"
|
||||
},
|
||||
"friendBlocklist": "遮蔽列表",
|
||||
"friendBlocklist": "屏蔽列表",
|
||||
"friendBlocklistDescription": {
|
||||
"zero": "你沒有遮蔽任何人",
|
||||
"one": "你遮蔽了 {} 個使用者",
|
||||
"other": "你遮蔽了 {} 個使用者"
|
||||
"zero": "你沒有屏蔽任何人",
|
||||
"one": "你屏蔽了 {} 個用戶",
|
||||
"other": "你屏蔽了 {} 個用戶"
|
||||
},
|
||||
"friendStatusPending": "待處理",
|
||||
"friendStatusWaiting": "等待中",
|
||||
"friendStatusActive": "正活躍",
|
||||
"friendStatusBlocked": "已遮蔽",
|
||||
"friendRequestSent": "好友請求已傳送。",
|
||||
"friendStatusBlocked": "已屏蔽",
|
||||
"friendRequestSent": "好友請求已發送。",
|
||||
"fieldFriendRelatedName": "好友名 / 賬戶 ID",
|
||||
"friendBlock": "遮蔽",
|
||||
"friendUnblock": "解除遮蔽",
|
||||
"friendBlock": "屏蔽",
|
||||
"friendUnblock": "解除屏蔽",
|
||||
"friendDeleteAction": "遺忘",
|
||||
"friendDelete": "遺忘跟 {} 的關係",
|
||||
"friendDeleteDescription": "你確定要遺忘跟 {} 的關係嗎?這個操作無法撤銷。",
|
||||
@ -401,23 +521,30 @@
|
||||
"accountJoinedAt": "加入於 {}",
|
||||
"accountBirthday": "出生於 {}",
|
||||
"accountBadge": "徽章",
|
||||
"badgeCompanyStaff": "索爾辛茨士大夫 · 員工",
|
||||
"accountCheckInNoRecords": "暫無運勢記錄",
|
||||
"badgeCompanyStaff": "工作人員",
|
||||
"badgeSiteMigration": "Solar Network 原住民",
|
||||
"badgeCommunitySurvey": "調研參與者",
|
||||
"badgeCommunityVerified": "認證用戶",
|
||||
"badgeCommunityContributor": "優秀社區貢獻者",
|
||||
"badgeSiteAnniversary": "週年紀念",
|
||||
"badgeUserBirthday": "生日紀念",
|
||||
"accountStatus": "狀態",
|
||||
"accountStatusOnline": "線上",
|
||||
"accountStatusOnline": "在線",
|
||||
"accountStatusOffline": "離線",
|
||||
"accountStatusLastSeen": "最後一次在 {} 上線",
|
||||
"accountStatusLastSeen": "最後一次上線於 {}",
|
||||
"postArticle": "Solar Network 上的文章",
|
||||
"postStory": "Solar Network 上的故事",
|
||||
"postLocalDraftRestored": "從本地恢復草稿",
|
||||
"articleWrittenAt": "發表於 {}",
|
||||
"articleEditedAt": "編輯於 {}",
|
||||
"attachmentSaved": "已儲存到相簿",
|
||||
"attachmentSavedDesktop": "已儲存到下載目錄",
|
||||
"openInAlbum": "在相簿中開啟",
|
||||
"attachmentSaved": "已保存到相冊",
|
||||
"attachmentSavedDesktop": "已保存到下載目錄",
|
||||
"openInAlbum": "在相冊中打開",
|
||||
"postAbuseReport": "檢舉帖子",
|
||||
"postAbuseReportDescription": "檢舉不符合我們使用者協議以及社群準則的帖子,來幫助我們更好的維護 Solar Network 上的內容。請在下面描述該帖子如何違反我麼的相關規定。請勿填寫任何敏感資訊。我們將會在 24 小時內處理您的檢舉。",
|
||||
"postAbuseReportDescription": "檢舉不符合我們用戶協議以及社區準則的帖子,來幫助我們更好的維護 Solar Network 上的內容。請在下面描述該帖子如何違反我麼的相關規定。請勿填寫任何敏感信息。我們將會在 24 小時內處理您的檢舉。",
|
||||
"abuseReport": "檢舉",
|
||||
"abuseReportDescription": "檢舉不符合我們使用者協議以及社群準則的任何資源,來幫助我們更好的維護 Solar Network 上的內容。請在下面描述資源的位置(提供資源 ID 為佳)以及如何違反我麼的相關規定。請勿填寫任何敏感資訊。我們將會在 24 小時內處理您的檢舉。",
|
||||
"abuseReportDescription": "檢舉不符合我們用戶協議以及社區準則的任何資源,來幫助我們更好的維護 Solar Network 上的內容。請在下面描述資源的位置(提供資源 ID 為佳)以及如何違反我麼的相關規定。請勿填寫任何敏感信息。我們將會在 24 小時內處理您的檢舉。",
|
||||
"abuseReportAction": "提交檢舉",
|
||||
"abuseReportActionDescription": "檢舉不合規行為。",
|
||||
"abuseReportResource": "資源位置 / ID",
|
||||
@ -425,33 +552,348 @@
|
||||
"abuseReportSubmitted": "檢舉已提交,感謝你的貢獻。",
|
||||
"submit": "提交",
|
||||
"accountDeletion": "刪除帳戶",
|
||||
"accountDeletionDescription": "你確定要刪除這個帳戶嗎?該操作不可撤銷,其隸屬於該帳戶的所有資源(帖子、聊天頻道、釋出者、製品等)都將被永久刪除。三思而後行!",
|
||||
"accountDeletionDescription": "你確定要刪除這個帳戶嗎?該操作不可撤銷,其隸屬於該帳戶的所有資源(帖子、聊天頻道、發佈者、製品等)都將被永久刪除。三思而後行!",
|
||||
"accountDeletionActionDescription": "刪除你的 Solarpass 帳戶。",
|
||||
"accountDeletionSubmitted": "帳戶刪除申請已發出,你可以檢查你的收件箱並根據郵件內的指示完成刪除操作。",
|
||||
"channelNewChannel": "新建頻道",
|
||||
"channelNewDirectMessage": "發起私信",
|
||||
"channelDirectMessageDescription": "與 {} 的私聊",
|
||||
"fieldCannotBeEmpty": "此欄位不能為空。",
|
||||
"fieldCannotBeEmpty": "此字段不能為空。",
|
||||
"termAcceptLink": "瀏覽條款",
|
||||
"termAcceptNextWithAgree": "點選 “下一步”,即表示你同意我們的各項條款,包括其之後的更新。",
|
||||
"termAcceptNextWithAgree": "點擊 “下一步”,即表示你同意我們的各項條款,包括其之後的更新。",
|
||||
"unauthorized": "未登陸",
|
||||
"unauthorizedDescription": "登陸以探索整個 Solar Network。",
|
||||
"projectDetail": "項目詳情",
|
||||
"serviceStatus": "服務狀態",
|
||||
"termRelated": "相關條款",
|
||||
"appDetails": "應用程式詳情",
|
||||
"appDetails": "應用程序詳情",
|
||||
"postRecommendation": "推薦帖子",
|
||||
"publisherBlockHint": "遮蔽 {}",
|
||||
"publisherBlockHintDescription": "你正要遮蔽此釋出者的運營者,該操作也將遮蔽由同一使用者運營的釋出者。",
|
||||
"userUnblocked": "已解除遮蔽使用者 {}",
|
||||
"userBlocked": "已遮蔽使用者 {}",
|
||||
"publisherBlockHint": "屏蔽 {}",
|
||||
"publisherBlockHintDescription": "你正要屏蔽此發佈者的運營者,該操作也將屏蔽由同一用戶運營的發佈者。",
|
||||
"userUnblocked": "已解除屏蔽用戶 {}",
|
||||
"userBlocked": "已屏蔽用戶 {}",
|
||||
"postSharingViaPicture": "正在生成帖子截圖,請稍等片刻……",
|
||||
"postImageShareReadMore": "掃描右側 QRCode 檢視全文",
|
||||
"postImageShareReadMore": "掃描右側 QRCode 查看全文",
|
||||
"postImageShareAds": "來 Solar Network 探索更多有趣帖子",
|
||||
"postShare": "分享",
|
||||
"postShareImage": "分享帖圖",
|
||||
"postGetInsight": "獲取見解",
|
||||
"postGetInsightTitle": "AI 見解",
|
||||
"postGetInsightDescription": "AI 可能會出錯,檢查信息真實性。",
|
||||
"appInitializing": "正在初始化",
|
||||
"poweredBy": "由 {} 提供支援",
|
||||
"poweredBy": "由 {} 提供支持",
|
||||
"shareIntent": "分享",
|
||||
"shareIntentDescription": "您想對您分享的內容做些什麼?",
|
||||
"shareIntentPostStory": "釋出動態"
|
||||
"shareIntentPostStory": "發佈動態",
|
||||
"shareIntentSendChannel": "分享到聊天頻道",
|
||||
"updateAvailable": "檢測到更新可用",
|
||||
"updateOngoing": "正在更新,請稍後……",
|
||||
"custom": "自定義",
|
||||
"colorSchemeIndigo": "靛藍",
|
||||
"colorSchemeBlue": "藍色",
|
||||
"colorSchemeGreen": "綠色",
|
||||
"colorSchemeYellow": "黃色",
|
||||
"colorSchemeOrange": "橙色",
|
||||
"colorSchemeRed": "紅色",
|
||||
"colorSchemeWhite": "白色",
|
||||
"colorSchemeBlack": "黑色",
|
||||
"colorSchemeApplied": "主題色已應用,可能需要重啟來生效。",
|
||||
"postFeaturedComment": "精選評論",
|
||||
"postCategory": "分類",
|
||||
"postCategoryTechnology": "技術",
|
||||
"postCategoryGaming": "遊戲",
|
||||
"postCategoryLife": "生活",
|
||||
"postCategoryArts": "藝術",
|
||||
"postCategorySports": "體育",
|
||||
"postCategoryMusic": "音樂",
|
||||
"postCategoryNews": "新聞",
|
||||
"postCategoryKnowledge": "知識",
|
||||
"postCategoryLiterature": "文學",
|
||||
"postCategoryFunny": "搞笑",
|
||||
"postCategoryUncategorized": "未分類",
|
||||
"newsAllSources": "所有新聞",
|
||||
"newsReadingProviderSwap": "切換",
|
||||
"newsReadingFromReader": "你正在從 HyperNet.Reader 閱讀文章",
|
||||
"newsReadingFromOriginal": "你正在閱讀原始文章",
|
||||
"newsDisclaimer": "本文由 HyperNet.Reader 從互聯網上獲取,我們不擔保其內容的真實性,請自行判斷。本文章的所有內容版權歸原作者所有。",
|
||||
"newsToday": "快訊",
|
||||
"totpPostSetup": "還有一件事",
|
||||
"totpPostSetupDescription": "使用 Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden 或其他支持 TOTP 的驗證器掃描本 QR Code 來添加。",
|
||||
"totpNeverShare": "永遠不要分享這個 QR Code",
|
||||
"needHelp": "需要幫助?",
|
||||
"needHelpLaunch": "查看我們的山羊維基!",
|
||||
"walletCreate": "創建錢包",
|
||||
"walletCreateSubtitle": "創建於一個錢包來開始使用源點。",
|
||||
"walletCreatePassword": "在下方設置你的付款密碼",
|
||||
"walletCurrencyShort": "源點",
|
||||
"walletCurrency": {
|
||||
"one": "{} 源點",
|
||||
"other": "{} 源點"
|
||||
},
|
||||
"aiThinkingProcess": "AI 思考過程",
|
||||
"accountSettingsApplied": "帳號設置已應用。",
|
||||
"trayMenuExit": "退出",
|
||||
"postQuestionUnanswered": "未解答的問題",
|
||||
"postQuestionUnansweredWithReward": "未解答的問題,懸賞源點 {}",
|
||||
"postQuestionAnswered": "已解答的問題",
|
||||
"postQuestionAnswerTitle": "精選解答",
|
||||
"postQuestionAnswerSelect": "選擇解答",
|
||||
"postQuestionAnswerSelected": "解答已選擇,獎勵已發放。",
|
||||
"postVideoUpload": "上傳視頻",
|
||||
"realmJoin": "加入領域",
|
||||
"realmCommunityHint": "該領域是一個社區領域,你可以自由加入。",
|
||||
"realmCommunityPublicChannelsHint": "該領域包含的公共頻道",
|
||||
"realmCommunityPublishersHint": "該領域的發佈者",
|
||||
"realmJoined": "已加入領域 {}。",
|
||||
"join": "加入",
|
||||
"pollEditorNew": "新投票",
|
||||
"pollEditorEdit": "編輯投票",
|
||||
"pollEditorDelete": "刪除投票",
|
||||
"pollEditorDeleteDescription": "你確定要刪除這個投票嗎?該操作不可撤銷。",
|
||||
"pollEditorUnlink": "解除鏈接",
|
||||
"pollOptionAdd": "添加選項",
|
||||
"pollOptionName": "選項名稱",
|
||||
"pollLinkExisting": "鏈接現有投票",
|
||||
"pollAnswered": "答案已經反饋。",
|
||||
"pollVotes": {
|
||||
"one": "{} 票",
|
||||
"other": "{} 票"
|
||||
},
|
||||
"publisherDelete": "刪除發佈者 {}",
|
||||
"publisherDeleteDescription": "你確定要刪除這個發佈者嗎?該操作不可撤銷。",
|
||||
"channelIsPublic": "公開頻道",
|
||||
"channelIsPublicDescription": "該頻道是公開的,任何人都可以加入。",
|
||||
"channelIsCommunity": "社區頻道",
|
||||
"channelIsCommunityDescription": "目前來說,社區頻道還沒有什麼特別之處。",
|
||||
"realmIsPublic": "公開領域",
|
||||
"realmIsPublicDescription": "該領域是公開的,任何人都可以加入。",
|
||||
"realmIsCommunity": "社區領域",
|
||||
"realmIsCommunityDescription": "社區領域會顯示在發現頁面上。",
|
||||
"realmLeave": "離開領域",
|
||||
"realmLeaveDescription": "離開當前領域,並且刪除領域中的身份。",
|
||||
"checkInResultTier1": "大凶",
|
||||
"checkInResultTier2": "兇",
|
||||
"checkInResultTier3": "中平",
|
||||
"checkInResultTier4": "吉",
|
||||
"checkInResultTier5": "大吉",
|
||||
"flagPostAction": "吹哨",
|
||||
"flagPost": "吹哨不良內容",
|
||||
"flagPostDescription": "吹哨不良內容,如果吹哨用戶佔瀏覽量的 50% 或以上,則帖子會被摺疊。吹哨後不可撤銷。",
|
||||
"flaggedPost": "哨子已經吹響。",
|
||||
"postViews": {
|
||||
"zero": "{} 次瀏覽",
|
||||
"one": "{} 次瀏覽",
|
||||
"other": "{} 次瀏覽"
|
||||
},
|
||||
"attachmentBillingUploaded": "已佔用的字節數",
|
||||
"attachmentBillingDiscount": "免費的字節數",
|
||||
"attachmentBillingHint": "滑動窗口計價®\n在24小時內上傳的文件大小超出免費空間才會適用扣費。",
|
||||
"postThumbnail": "帖子縮略圖",
|
||||
"accountRealms": "領域",
|
||||
"postInGlobal": "全站",
|
||||
"postInGlobalDescription": "不關聯此帖子與任何領域。",
|
||||
"postChannelGlobal": "全站",
|
||||
"postChannelFriends": "好友",
|
||||
"postChannelFollowing": "關注",
|
||||
"postChannelRealm": "領域",
|
||||
"postFilterReset": "重置過濾器",
|
||||
"postFilterResetDescription": "清除過濾器並顯示所有帖子。",
|
||||
"postFilterWithCategory": "查看{}區中的帖子",
|
||||
"databaseSize": "數據庫大小",
|
||||
"databaseDelete": "刪除數據庫",
|
||||
"databaseDeleteDescription": "刪除本地數據庫,內容將從服務器重新獲取。",
|
||||
"databaseDeleted": "本地數據庫已被刪除。",
|
||||
"settingsEnablePushNotifications": "啟用推送數據",
|
||||
"settingsEnablePushNotificationsDescription": "重新啟用並請求推送權限,以防自動激活失敗。",
|
||||
"settingsEnabledPushNotifications": "推送通知已經註冊。",
|
||||
"screenStickers": "貼圖",
|
||||
"stickersDiscovery": "發現",
|
||||
"stickersOwned": "由我擁有",
|
||||
"stickersCreated": "由我發佈",
|
||||
"stickersAdd": "添加貼圖包",
|
||||
"stickersAdded": "貼圖包已添加。",
|
||||
"add": "添加",
|
||||
"stickersRemoved": "貼圖包已被移除,你可以隨時再次添加回來。",
|
||||
"stickersReload": "重載貼圖包",
|
||||
"stickersReloadDescription": "從服務器重新加載添加過的貼圖,更新貼圖選擇器。",
|
||||
"stickersReloaded": "貼圖包已重載。",
|
||||
"stickersPackDelete": "刪除貼圖包 {}",
|
||||
"stickersPackDeleteDescription": "你確定要刪除這個貼圖包嗎?這個操作不可撤銷。",
|
||||
"stickersPackDeleted": "貼圖包已被刪除。",
|
||||
"stickersDelete": "刪除貼圖 {}",
|
||||
"stickersDeleteDescription": "你確定要刪除這個貼圖嗎?這個操作不可撤銷。",
|
||||
"stickersDeleted": "貼圖已被刪除。",
|
||||
"fieldStickerName": "貼圖名稱",
|
||||
"fieldStickerAlias": "貼圖別名",
|
||||
"fieldStickerAliasHint": "和貼圖包前綴組合成為本貼圖的唯一佔位符。",
|
||||
"fieldStickerPackName": "名稱",
|
||||
"fieldStickerPackDescription": "描述",
|
||||
"fieldStickerPackPrefix": "貼圖包前綴",
|
||||
"fieldStickerAttachment": "附件",
|
||||
"stickersNew": "新建貼圖",
|
||||
"stickersNewDescription": "創建一個新的貼圖。",
|
||||
"stickersPackNew": "新建貼圖包",
|
||||
"trayMenuShow": "顯示",
|
||||
"trayMenuMuteNotification": "靜音通知",
|
||||
"update": "更新",
|
||||
"forceUpdate": "強制更新",
|
||||
"forceUpdateDescription": "強制更新應用程序,即使有更新的版本可能不可用。",
|
||||
"runtimeLogs": "運行時日誌",
|
||||
"runtimeLogsOpen": "打開日誌文件",
|
||||
"runtimeLogsDescription": "顯示運行時的日誌記錄。",
|
||||
"signinResetPasswordHint": "請輸入用戶名/電子郵箱地址以幫助我們找到您的帳戶並重置密碼。",
|
||||
"cacheSize": "緩存資源大小",
|
||||
"cacheDelete": "清除緩存",
|
||||
"cacheDeleteDescription": "從磁盤中移除緩存的圖片和其他資源,內容將從服務器重新下載。",
|
||||
"cacheDeleted": "所有緩存已被清除。",
|
||||
"userNoDescription": "這個人很懶,沒有留下什麼……",
|
||||
"fieldTimeZone": "時區",
|
||||
"fieldGender": "性別",
|
||||
"fieldPronouns": "人稱代詞",
|
||||
"fieldLocation": "位置",
|
||||
"fieldLinks": "鏈接",
|
||||
"fieldLinkName": "名稱",
|
||||
"fieldLinkUrl": "鏈接",
|
||||
"screenAccountBadges": "徽章",
|
||||
"accountBadges": "徽章",
|
||||
"accountBadgesDescription": "查看並管理你的徽章。",
|
||||
"badgeActivated": "已佩戴徽章 {}。",
|
||||
"viewDetailedAttachment": "查看附件詳情",
|
||||
"screenKeyPairs": "密鑰對",
|
||||
"accountKeyPairs": "密鑰對",
|
||||
"accountKeyPairsDescription": "管理用於加密信息的密鑰對。",
|
||||
"enrollNewKeyPair": "新建密鑰對",
|
||||
"enrollNewKeyPairDescription": "生成一對新密鑰對。",
|
||||
"keyPairHasPrivateKey": "有私鑰",
|
||||
"decrypting": "解密中……",
|
||||
"decryptingKeyNotFound": "未找到密鑰對或交換失敗,對方可能不在線",
|
||||
"messageUnablePreview": "無法預覽消息",
|
||||
"messageUnablePreviewEncrypted": "無法預覽加密消息",
|
||||
"postViewInGlobalDescription": "不查看特定領域的帖子。",
|
||||
"postDraftSaved": "已保存為草稿。",
|
||||
"postDraftBox": "草稿箱",
|
||||
"postShuffle": "隨便看看",
|
||||
"checkInStreak": {
|
||||
"zero": "無連擊",
|
||||
"one": "連續簽到 {} 天",
|
||||
"other": "連續簽到 {} 天"
|
||||
},
|
||||
"accountChangeStatus": "修改狀態",
|
||||
"accountStatusSilent": "請勿打擾",
|
||||
"accountStatusSilentDesc": "將會暫停所有通知推送",
|
||||
"accountStatusInvisible": "隱身",
|
||||
"accountStatusInvisibleDesc": "將會在他人界面顯示離線,但不影響功能使用",
|
||||
"accountCustomStatus": "自定義狀態",
|
||||
"accountCustomStatusDescription": "客製化你的狀態。",
|
||||
"accountClearStatus": "清除狀態",
|
||||
"accountClearStatusDescription": "清除你的狀態,並讓服務器決定你的狀態。",
|
||||
"fieldAccountStatusLabel": "狀態文字",
|
||||
"fieldAccountStatusClearAt": "清除時間",
|
||||
"accountStatusNegative": "負面",
|
||||
"accountStatusNeutral": "中性",
|
||||
"accountStatusPositive": "正面",
|
||||
"mixedFeed": "混合推薦流",
|
||||
"mixedFeedDescription": "探索頁面可能不只會展示用戶的帖子,更可能包含其他的內容。但該模式不適用分類和過濾。",
|
||||
"filterFeed": "探索隊列調整",
|
||||
"feedUnknownItem": "無法顯示該內容,當前版本客戶端不支持該類型的內容,請嘗試更新應用程序後再試。",
|
||||
"serviceStatusOperational": "所有服務正常",
|
||||
"serviceStatusDowngraded": "部分服務異常",
|
||||
"serviceStatusFailed": "服務狀態異常",
|
||||
"serviceStatusFailedDescription": "服務器炸了或者剛剛執行完維護程序。",
|
||||
"serviceNameInsights": "總結、見解與洞察",
|
||||
"serviceNameInteractive": "帖子與互動",
|
||||
"serviceNameReader": "新聞與鏈接展開",
|
||||
"serviceNameMessaging": "即使聊天",
|
||||
"serviceNameMatrix": "矩陣市場",
|
||||
"serviceNamePaperclip": "附件",
|
||||
"serviceNameWallet": "源點錢包",
|
||||
"serviceNamePassport": "身份驗證與授權",
|
||||
"accountActionEvent": "操作日誌",
|
||||
"accountActionEventDescription": "查看你的操作日誌。",
|
||||
"eventMetadata": "元數據",
|
||||
"accountAuthTickets": "授權會話",
|
||||
"accountAuthTicketsDescription": "查看和管理你的授權會話。",
|
||||
"authTicketCreatedAt": "簽發於 {}",
|
||||
"authTicketExpiredAt": "到期於 {}",
|
||||
"authTicketLastGrantAt": "上次刷新於 {}",
|
||||
"authTicketCurrent": "當前會話",
|
||||
"accountUnconfirmedTitle": "尚未未確認賬戶",
|
||||
"accountUnconfirmedSubtitle": "您的賬戶尚未確認,這會導致大部分功能不可用,並且您的帳戶將在 24 小時後自毀。您綁定的郵箱的收件箱應該會有一封郵件指引您確認您的帳戶。",
|
||||
"accountUnconfirmedUnreceived": "未收到郵件?",
|
||||
"accountUnconfirmedResend": "重新發送一封",
|
||||
"accountUnconfirmedResendSuccessful": "郵件已重新發送,你可以在 60 分鐘後再重發一封。",
|
||||
"stickerPickerEmpty": "貼圖列表為空",
|
||||
"stickerPickerEmptyHint": "想要開始使用貼圖,請先添加貼圖包。",
|
||||
"goto": "跳轉到 {}",
|
||||
"accountContactMethods": "聯繫方式",
|
||||
"accountContactMethodsDescription": "管理你的聯繫方式。",
|
||||
"accountContactMethodsNameEmail": "電子郵箱",
|
||||
"accountContactMethodsNamePhone": "電話",
|
||||
"accountContactMethodsNameAddress": "地址",
|
||||
"accountContactMethodsPrimary": "主要的",
|
||||
"accountContactMethodsVerified": "已驗證",
|
||||
"accountContactMethodsPublic": "公開的",
|
||||
"accountContactMethodsAdd": "添加聯繫方式",
|
||||
"accountContactMethodsEdit": "編輯聯繫方式",
|
||||
"accountContactMethodsAddDescription": "添加新的聯繫方式。",
|
||||
"fieldContactContent": "聯繫方式",
|
||||
"accountContactMethodsPublicHint": "這個聯繫方式公開地顯示在個人資料中。",
|
||||
"accountContactMethodsDelete": "刪除聯繫方式",
|
||||
"accountContactMethodsDeleteDescription": "你確定要刪除聯繫方式 {} 嗎?這個操作不可撤銷。",
|
||||
"postCommentAdd": "撰寫一條評論",
|
||||
"translate": "翻譯",
|
||||
"translating": "正在翻譯……",
|
||||
"translated": "已翻譯",
|
||||
"settingsAutoTranslate": "自動翻譯",
|
||||
"settingsAutoTranslateDescription": "在查看帖子、消息時自動翻譯文本。",
|
||||
"trayMenuHide": "隱藏",
|
||||
"accountSettingsNotify": "通知設置",
|
||||
"accountSettingsNotifyDescription": "調整你所收到的通知種類。",
|
||||
"accountSettingsSecurity": "安全設置",
|
||||
"accountSettingsSecurityDescription": "調整你的帳戶安全設置。",
|
||||
"save": "保存",
|
||||
"notificationTopicPostFeedback": "帖子數據反饋",
|
||||
"notificationTopicPostReply": "帖子回覆",
|
||||
"notificationTopicPostSubscription": "帖子訂閱",
|
||||
"notificationTopicMessaging": "消息",
|
||||
"notificationTopicMessagingCall": "通話",
|
||||
"notificationTopicGeneral": "雜項",
|
||||
"authMaximumAuthSteps": "最大驗證步驟",
|
||||
"authMaximumAuthStepsDescription": {
|
||||
"one": "登入時最多要求 {} 步驗證",
|
||||
"other": "登入時最多要求 {} 步驗證"
|
||||
},
|
||||
"authAlwaysRisky": "總是風險",
|
||||
"authAlwaysRiskyDescription": "在登入時始終按最高標準要求驗證。",
|
||||
"chatUnjoined": "未加入頻道",
|
||||
"chatUnjoinedDescription": "你沒有加入這個頻道,所以你也無法發送消息或者查看這個頻道中的消息。",
|
||||
"chatUnjoinedPublicDescription": "但幸運的是,這是一個公開頻道,所以你可以主動加入。",
|
||||
"chatJoin": "加入頻道",
|
||||
"appInitStarting": "啟動中",
|
||||
"appInitNetwork": "正在初始化網絡",
|
||||
"appInitUserdata": "正在初始化用戶數據",
|
||||
"appInitWebsocket": "正在建立 Solar Link",
|
||||
"appInitNotification": "正在初始化推送通知",
|
||||
"appInitKeyPair": "正在初始化密鑰對",
|
||||
"appInitStickers": "正在初始化貼圖包",
|
||||
"appInitUserDirectory": "正在初始化用戶目錄",
|
||||
"appInitRealm": "正在初始化領域信息",
|
||||
"appInitChat": "正在初始化聊天",
|
||||
"appInitDone": "完成",
|
||||
"community": "社區",
|
||||
"realmCommunity": "{}的社區",
|
||||
"postTotalCount": {
|
||||
"zero": "沒有帖子",
|
||||
"one": "共 {} 條帖子"
|
||||
},
|
||||
"settingsHideBottomNav": "隱藏底部導航欄",
|
||||
"settingsHideBottomNavDescription": "隱藏底部導航欄,在側邊欄抽屜顯示導航按鈕。",
|
||||
"reCaptcha": "人機驗證",
|
||||
"friends": "好友",
|
||||
"friendsDescription": "管理好友關係。",
|
||||
"album": "相冊",
|
||||
"albumDescription": "查看相冊與管理上傳附件。",
|
||||
"stickers": "貼圖",
|
||||
"stickersDescription": "查看貼圖包與管理貼圖。",
|
||||
"navBottomUnauthorizedCaption": "或者註冊一個賬號"
|
||||
}
|
||||
|
@ -5,3 +5,7 @@ targets:
|
||||
options:
|
||||
explicit_to_json: true
|
||||
field_rename: snake
|
||||
drift_dev:
|
||||
options:
|
||||
databases:
|
||||
my_database: lib/database/database.dart
|
4
buildtools/appimage_config/AppRun
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
exec ./surface
|
8
buildtools/appimage_config/Solian.desktop
Normal file
@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Name=Solian
|
||||
Exec=surface %u
|
||||
Icon=icon-light-radius
|
||||
Categories=Network;
|
BIN
buildtools/appimagetool-x86_64.AppImage
Executable file
14
debian/debian.yml
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
flutter_app:
|
||||
command: surface
|
||||
arch: x64
|
||||
parent: /usr/local/lib
|
||||
nonInteractive: false
|
||||
|
||||
control:
|
||||
Package: solian
|
||||
Version: 2.3.2
|
||||
Architecture: amd64
|
||||
Priority: optional
|
||||
Depends: mpv keybinder-3.0
|
||||
Maintainer: Solsynth LLC
|
||||
Description: The Solar Network Desktop Application
|
9
debian/gui/surface.desktop
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Version=2.3.2
|
||||
Name=Solian
|
||||
GenericName=Solian
|
||||
Comment=The Solar Network Desktop Application
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Social Networking
|
||||
Keywords=social;social network;chat;solar network
|
23
debian/gui/surface.svg
vendored
Normal file
After Width: | Height: | Size: 232 KiB |
1
drift_schemas/my_database/drift_schema_v1.json
Normal file
@ -0,0 +1 @@
|
||||
{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sn_local_chat_channel","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"alias","getter_name":"alias","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"content","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const SnChannelConverter()","dart_type_name":"SnChannel"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CAST(strftime(\\'%s\\', CURRENT_TIMESTAMP) AS INTEGER)')","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"sn_local_chat_message","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"channel_id","getter_name":"channelId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"content","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const SnMessageConverter()","dart_type_name":"SnChatMessage"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CAST(strftime(\\'%s\\', CURRENT_TIMESTAMP) AS INTEGER)')","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]}
|
1
drift_schemas/my_database/drift_schema_v2.json
Normal file
@ -0,0 +1 @@
|
||||
{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"sn_local_chat_channel","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"alias","getter_name":"alias","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"content","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const SnChannelConverter()","dart_type_name":"SnChannel"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CAST(strftime(\\'%s\\', CURRENT_TIMESTAMP) AS INTEGER)')","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"sn_local_chat_message","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"channel_id","getter_name":"channelId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"content","getter_name":"content","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const SnMessageConverter()","dart_type_name":"SnChatMessage"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CAST(strftime(\\'%s\\', CURRENT_TIMESTAMP) AS INTEGER)')","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[],"type":"table","data":{"name":"sn_local_key_pair","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"account_id","getter_name":"accountId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"public_key","getter_name":"publicKey","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"private_key","getter_name":"privateKey","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_active","getter_name":"isActive","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_active\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_active\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}}]}
|
1
drift_schemas/my_database/drift_schema_v3.json
Normal file
1
drift_schemas/my_database/drift_schema_v4.json
Normal file
248
ios/Podfile.lock
@ -1,8 +1,9 @@
|
||||
PODS:
|
||||
- Alamofire (5.10.2)
|
||||
- audioplayers_darwin (0.0.1):
|
||||
- Flutter
|
||||
- connectivity_plus (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- croppy (0.0.1):
|
||||
- Flutter
|
||||
- device_info_plus (0.0.1):
|
||||
@ -38,63 +39,65 @@ PODS:
|
||||
- DKPhotoGallery/Resource (0.0.19):
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- fast_rsa (0.6.0):
|
||||
- Flutter
|
||||
- file_picker (0.0.1):
|
||||
- DKImagePickerController/PhotoGallery
|
||||
- Flutter
|
||||
- file_saver (0.0.1):
|
||||
- Flutter
|
||||
- Firebase/Analytics (11.4.0):
|
||||
- Firebase/Analytics (11.10.0):
|
||||
- Firebase/Core
|
||||
- Firebase/Core (11.4.0):
|
||||
- Firebase/Core (11.10.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseAnalytics (~> 11.4.0)
|
||||
- Firebase/CoreOnly (11.4.0):
|
||||
- FirebaseCore (= 11.4.0)
|
||||
- Firebase/Messaging (11.4.0):
|
||||
- FirebaseAnalytics (~> 11.10.0)
|
||||
- Firebase/CoreOnly (11.10.0):
|
||||
- FirebaseCore (~> 11.10.0)
|
||||
- Firebase/Messaging (11.10.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseMessaging (~> 11.4.0)
|
||||
- firebase_analytics (11.3.6):
|
||||
- Firebase/Analytics (= 11.4.0)
|
||||
- FirebaseMessaging (~> 11.10.0)
|
||||
- firebase_analytics (11.4.5):
|
||||
- Firebase/Analytics (= 11.10.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- firebase_core (3.9.0):
|
||||
- Firebase/CoreOnly (= 11.4.0)
|
||||
- firebase_core (3.13.0):
|
||||
- Firebase/CoreOnly (= 11.10.0)
|
||||
- Flutter
|
||||
- firebase_messaging (15.1.6):
|
||||
- Firebase/Messaging (= 11.4.0)
|
||||
- firebase_messaging (15.2.5):
|
||||
- Firebase/Messaging (= 11.10.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- FirebaseAnalytics (11.4.0):
|
||||
- FirebaseAnalytics/AdIdSupport (= 11.4.0)
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseAnalytics (11.10.0):
|
||||
- FirebaseAnalytics/AdIdSupport (= 11.10.0)
|
||||
- FirebaseCore (~> 11.10.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- FirebaseAnalytics/AdIdSupport (11.4.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseAnalytics/AdIdSupport (11.10.0):
|
||||
- FirebaseCore (~> 11.10.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- GoogleAppMeasurement (= 11.4.0)
|
||||
- GoogleAppMeasurement (= 11.10.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- FirebaseCore (11.4.0):
|
||||
- FirebaseCoreInternal (~> 11.0)
|
||||
- FirebaseCore (11.10.0):
|
||||
- FirebaseCoreInternal (~> 11.10.0)
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- GoogleUtilities/Logger (~> 8.0)
|
||||
- FirebaseCoreInternal (11.6.0):
|
||||
- FirebaseCoreInternal (11.10.0):
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- FirebaseInstallations (11.4.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseInstallations (11.10.0):
|
||||
- FirebaseCore (~> 11.10.0)
|
||||
- GoogleUtilities/Environment (~> 8.0)
|
||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- FirebaseMessaging (11.4.0):
|
||||
- FirebaseCore (~> 11.0)
|
||||
- FirebaseMessaging (11.10.0):
|
||||
- FirebaseCore (~> 11.10.0)
|
||||
- FirebaseInstallations (~> 11.0)
|
||||
- GoogleDataTransport (~> 10.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
@ -105,32 +108,41 @@ PODS:
|
||||
- Flutter (1.0.0)
|
||||
- flutter_app_update (0.0.1):
|
||||
- Flutter
|
||||
- flutter_inappwebview_ios (0.0.1):
|
||||
- Flutter
|
||||
- flutter_inappwebview_ios/Core (= 0.0.1)
|
||||
- OrderedSet (~> 6.0.3)
|
||||
- flutter_inappwebview_ios/Core (0.0.1):
|
||||
- Flutter
|
||||
- OrderedSet (~> 6.0.3)
|
||||
- flutter_native_splash (2.4.3):
|
||||
- Flutter
|
||||
- flutter_timezone (0.0.1):
|
||||
- Flutter
|
||||
- flutter_udid (0.0.1):
|
||||
- Flutter
|
||||
- SAMKeychain
|
||||
- flutter_webrtc (0.12.2):
|
||||
- flutter_webrtc (0.12.6):
|
||||
- Flutter
|
||||
- WebRTC-SDK (= 125.6422.06)
|
||||
- gal (1.0.0):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- GoogleAppMeasurement (11.4.0):
|
||||
- GoogleAppMeasurement/AdIdSupport (= 11.4.0)
|
||||
- GoogleAppMeasurement (11.10.0):
|
||||
- GoogleAppMeasurement/AdIdSupport (= 11.10.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- GoogleAppMeasurement/AdIdSupport (11.4.0):
|
||||
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.4.0)
|
||||
- GoogleAppMeasurement/AdIdSupport (11.10.0):
|
||||
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.10.0)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||
- nanopb (~> 3.30910.0)
|
||||
- GoogleAppMeasurement/WithoutAdIdSupport (11.4.0):
|
||||
- GoogleAppMeasurement/WithoutAdIdSupport (11.10.0):
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||
- GoogleUtilities/Network (~> 8.0)
|
||||
@ -172,14 +184,17 @@ PODS:
|
||||
- Flutter
|
||||
- in_app_review (2.0.0):
|
||||
- Flutter
|
||||
- Kingfisher (8.1.3)
|
||||
- livekit_client (2.3.2):
|
||||
- Kingfisher (8.3.1)
|
||||
- livekit_client (2.4.1):
|
||||
- Flutter
|
||||
- flutter_webrtc
|
||||
- WebRTC-SDK (= 125.6422.06)
|
||||
- media_kit_libs_ios_video (1.0.4):
|
||||
- livekit_noise_filter (0.0.1):
|
||||
- Flutter
|
||||
- media_kit_native_event_loop (1.0.0):
|
||||
- flutter_webrtc
|
||||
- LiveKitKrispNoiseFilter (= 0.0.7)
|
||||
- LiveKitKrispNoiseFilter (0.0.7)
|
||||
- media_kit_libs_ios_video (1.0.4):
|
||||
- Flutter
|
||||
- media_kit_video (0.0.1):
|
||||
- Flutter
|
||||
@ -188,6 +203,7 @@ PODS:
|
||||
- nanopb/encode (= 3.30910.0)
|
||||
- nanopb/decode (3.30910.0)
|
||||
- nanopb/encode (3.30910.0)
|
||||
- OrderedSet (6.0.3)
|
||||
- package_info_plus (0.4.5):
|
||||
- Flutter
|
||||
- pasteboard (0.0.1):
|
||||
@ -201,11 +217,9 @@ PODS:
|
||||
- receive_sharing_intent (1.8.1):
|
||||
- Flutter
|
||||
- SAMKeychain (1.5.3)
|
||||
- screen_brightness_ios (0.1.0):
|
||||
- Flutter
|
||||
- SDWebImage (5.20.0):
|
||||
- SDWebImage/Core (= 5.20.0)
|
||||
- SDWebImage/Core (5.20.0)
|
||||
- SDWebImage (5.21.0):
|
||||
- SDWebImage/Core (= 5.21.0)
|
||||
- SDWebImage/Core (5.21.0)
|
||||
- share_plus (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
@ -214,9 +228,33 @@ PODS:
|
||||
- sqflite_darwin (0.0.4):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqlite3 (3.49.1):
|
||||
- sqlite3/common (= 3.49.1)
|
||||
- sqlite3/common (3.49.1)
|
||||
- sqlite3/dbstatvtab (3.49.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/fts5 (3.49.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/math (3.49.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/perf-threadsafe (3.49.1):
|
||||
- sqlite3/common
|
||||
- sqlite3/rtree (3.49.1):
|
||||
- sqlite3/common
|
||||
- sqlite3_flutter_libs (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqlite3 (~> 3.49.1)
|
||||
- sqlite3/dbstatvtab
|
||||
- sqlite3/fts5
|
||||
- sqlite3/math
|
||||
- sqlite3/perf-threadsafe
|
||||
- sqlite3/rtree
|
||||
- SwiftyGif (5.4.5)
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
- video_compress (0.3.0):
|
||||
- Flutter
|
||||
- volume_controller (0.0.1):
|
||||
- Flutter
|
||||
- wakelock_plus (0.0.1):
|
||||
@ -227,9 +265,11 @@ PODS:
|
||||
|
||||
DEPENDENCIES:
|
||||
- Alamofire
|
||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
|
||||
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
|
||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
|
||||
- croppy (from `.symlinks/plugins/croppy/ios`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- fast_rsa (from `.symlinks/plugins/fast_rsa/ios`)
|
||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||
- file_saver (from `.symlinks/plugins/file_saver/ios`)
|
||||
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
|
||||
@ -237,7 +277,9 @@ DEPENDENCIES:
|
||||
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_app_update (from `.symlinks/plugins/flutter_app_update/ios`)
|
||||
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
|
||||
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
|
||||
- flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`)
|
||||
- flutter_udid (from `.symlinks/plugins/flutter_udid/ios`)
|
||||
- flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)
|
||||
- gal (from `.symlinks/plugins/gal/darwin`)
|
||||
@ -246,19 +288,20 @@ DEPENDENCIES:
|
||||
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
|
||||
- Kingfisher (~> 8.0)
|
||||
- livekit_client (from `.symlinks/plugins/livekit_client/ios`)
|
||||
- livekit_noise_filter (from `.symlinks/plugins/livekit_noise_filter/ios`)
|
||||
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
|
||||
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
|
||||
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- pasteboard (from `.symlinks/plugins/pasteboard/ios`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||
- receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`)
|
||||
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
|
||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
|
||||
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/darwin`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
- video_compress (from `.symlinks/plugins/video_compress/ios`)
|
||||
- volume_controller (from `.symlinks/plugins/volume_controller/ios`)
|
||||
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
|
||||
- workmanager (from `.symlinks/plugins/workmanager/ios`)
|
||||
@ -278,20 +321,27 @@ SPEC REPOS:
|
||||
- GoogleDataTransport
|
||||
- GoogleUtilities
|
||||
- Kingfisher
|
||||
- LiveKitKrispNoiseFilter
|
||||
- nanopb
|
||||
- OrderedSet
|
||||
- PromisesObjC
|
||||
- SAMKeychain
|
||||
- SDWebImage
|
||||
- sqlite3
|
||||
- SwiftyGif
|
||||
- WebRTC-SDK
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
audioplayers_darwin:
|
||||
:path: ".symlinks/plugins/audioplayers_darwin/ios"
|
||||
connectivity_plus:
|
||||
:path: ".symlinks/plugins/connectivity_plus/darwin"
|
||||
:path: ".symlinks/plugins/connectivity_plus/ios"
|
||||
croppy:
|
||||
:path: ".symlinks/plugins/croppy/ios"
|
||||
device_info_plus:
|
||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||
fast_rsa:
|
||||
:path: ".symlinks/plugins/fast_rsa/ios"
|
||||
file_picker:
|
||||
:path: ".symlinks/plugins/file_picker/ios"
|
||||
file_saver:
|
||||
@ -306,8 +356,12 @@ EXTERNAL SOURCES:
|
||||
:path: Flutter
|
||||
flutter_app_update:
|
||||
:path: ".symlinks/plugins/flutter_app_update/ios"
|
||||
flutter_inappwebview_ios:
|
||||
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
|
||||
flutter_native_splash:
|
||||
:path: ".symlinks/plugins/flutter_native_splash/ios"
|
||||
flutter_timezone:
|
||||
:path: ".symlinks/plugins/flutter_timezone/ios"
|
||||
flutter_udid:
|
||||
:path: ".symlinks/plugins/flutter_udid/ios"
|
||||
flutter_webrtc:
|
||||
@ -322,10 +376,10 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/in_app_review/ios"
|
||||
livekit_client:
|
||||
:path: ".symlinks/plugins/livekit_client/ios"
|
||||
livekit_noise_filter:
|
||||
:path: ".symlinks/plugins/livekit_noise_filter/ios"
|
||||
media_kit_libs_ios_video:
|
||||
:path: ".symlinks/plugins/media_kit_libs_ios_video/ios"
|
||||
media_kit_native_event_loop:
|
||||
:path: ".symlinks/plugins/media_kit_native_event_loop/ios"
|
||||
media_kit_video:
|
||||
:path: ".symlinks/plugins/media_kit_video/ios"
|
||||
package_info_plus:
|
||||
@ -338,16 +392,18 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
receive_sharing_intent:
|
||||
:path: ".symlinks/plugins/receive_sharing_intent/ios"
|
||||
screen_brightness_ios:
|
||||
:path: ".symlinks/plugins/screen_brightness_ios/ios"
|
||||
share_plus:
|
||||
:path: ".symlinks/plugins/share_plus/ios"
|
||||
shared_preferences_foundation:
|
||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||
sqflite_darwin:
|
||||
:path: ".symlinks/plugins/sqflite_darwin/darwin"
|
||||
sqlite3_flutter_libs:
|
||||
:path: ".symlinks/plugins/sqlite3_flutter_libs/darwin"
|
||||
url_launcher_ios:
|
||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||
video_compress:
|
||||
:path: ".symlinks/plugins/video_compress/ios"
|
||||
volume_controller:
|
||||
:path: ".symlinks/plugins/volume_controller/ios"
|
||||
wakelock_plus:
|
||||
@ -357,58 +413,66 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Alamofire: 7193b3b92c74a07f85569e1a6c4f4237291e7496
|
||||
connectivity_plus: 18382e7311ba19efcaee94442b23b32507b20695
|
||||
croppy: b6199bc8d56bd2e03cc11609d1c47ad9875c1321
|
||||
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
|
||||
audioplayers_darwin: ccf9c770ee768abb07e26d90af093f7bab1c12ab
|
||||
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
|
||||
croppy: 979e8ddc254f4642bffe7d52dc7193354b27ba30
|
||||
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
|
||||
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
||||
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
||||
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
|
||||
file_saver: 503e386464dbe118f630e17b4c2e1190fa0cf808
|
||||
Firebase: cf1b19f21410b029b6786a54e9764a0cacad3c99
|
||||
firebase_analytics: 2815af29d49c1a994652abd37a5b001a88bc7b75
|
||||
firebase_core: b62a5080210edad3f2934314a8b2c6f5124e8e10
|
||||
firebase_messaging: 98619a0572d82cfb3668e78859ba9f1110e268c9
|
||||
FirebaseAnalytics: 3feef9ae8733c567866342a1000691baaa7cad49
|
||||
FirebaseCore: e0510f1523bc0eb21653cac00792e1e2bd6f1771
|
||||
FirebaseCoreInternal: d98ab91e2d80a56d7b246856a8885443b302c0c2
|
||||
FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414
|
||||
FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2
|
||||
fast_rsa: d99f8e1809a4a312fa9216d830186869b2e9eb65
|
||||
file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
|
||||
file_saver: 6cdbcddd690cb02b0c1a0c225b37cd805c2bf8b6
|
||||
Firebase: 1fe1c0a7d9aaea32efe01fbea5f0ebd8d70e53a2
|
||||
firebase_analytics: 1998960b8fa16fd0cd9e77a6f9fd35a2009ad65e
|
||||
firebase_core: 2d4534e7b489907dcede540c835b48981d890943
|
||||
firebase_messaging: 75bc93a4df25faccad67f6662ae872ac9ae69b64
|
||||
FirebaseAnalytics: 4e42333f02cf78ed93703a5c36f36dd518aebdef
|
||||
FirebaseCore: 8344daef5e2661eb004b177488d6f9f0f24251b7
|
||||
FirebaseCoreInternal: ef4505d2afb1d0ebbc33162cb3795382904b5679
|
||||
FirebaseInstallations: 9980995bdd06ec8081dfb6ab364162bdd64245c3
|
||||
FirebaseMessaging: 2b9f56aa4ed286e1f0ce2ee1d413aabb8f9f5cb9
|
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
flutter_app_update: 65f61da626cb111d1b24674abc4b01728d7723bc
|
||||
flutter_native_splash: e8a1e01082d97a8099d973f919f57904c925008a
|
||||
flutter_udid: b2417673f287ee62817a1de3d1643f47b9f508ab
|
||||
flutter_webrtc: 1a53bd24f97bcfeff512f13699e721897f261563
|
||||
gal: 6a522c75909f1244732d4596d11d6a2f86ff37a5
|
||||
GoogleAppMeasurement: 987769c4ca6b968f2479fbcc9fe3ce34af454b8e
|
||||
flutter_app_update: 816fdb2e30e4832a7c45e3f108d391c42ef040a9
|
||||
flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99
|
||||
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
|
||||
flutter_timezone: 7c838e17ffd4645d261e87037e5bebf6d38fe544
|
||||
flutter_udid: f7c3884e6ec2951efe4f9de082257fc77c4d15e9
|
||||
flutter_webrtc: 57f32415b8744e806f9c2a96ccdb60c6a627ba33
|
||||
gal: baecd024ebfd13c441269ca7404792a7152fde89
|
||||
GoogleAppMeasurement: 36684bfb3ee034e2b42b4321eb19da3a1b81e65d
|
||||
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
||||
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
|
||||
home_widget: 0434835a4c9a75704264feff6be17ea40e0f0d57
|
||||
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
|
||||
in_app_review: a31b5257259646ea78e0e35fc914979b0031d011
|
||||
Kingfisher: f2af9028b16baf9dc6c07c570072bc41cbf009ef
|
||||
livekit_client: 6108dad8b77db3142bafd4c630f471d0a54335cd
|
||||
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
|
||||
media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a
|
||||
media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e
|
||||
home_widget: f169fc41fd807b4d46ab6615dc44d62adbf9f64f
|
||||
image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a
|
||||
in_app_review: 5596fe56fab799e8edb3561c03d053363ab13457
|
||||
Kingfisher: 3204d23de16b5ea53541c44ca5a8efb55741dec3
|
||||
livekit_client: 08755cabfa4da4ed455642f460cfbb39bc518070
|
||||
livekit_noise_filter: a26aeb1c1eae6db0a023fd2f6ea3ff108c3ecbb0
|
||||
LiveKitKrispNoiseFilter: efe418ceca28163ace0ff222bd2cc02384645d84
|
||||
media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854
|
||||
media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474
|
||||
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
||||
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
|
||||
pasteboard: 982969ebaa7c78af3e6cc7761e8f5e77565d9ce0
|
||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
||||
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
||||
pasteboard: 49088aeb6119d51f976a421db60d8e1ab079b63c
|
||||
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
|
||||
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
|
||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||
receive_sharing_intent: 79c848f5b045674ad60b9fea3bafea59962ad2c1
|
||||
receive_sharing_intent: 222384f00ffe7e952bbfabaa9e3967cb87e5fe00
|
||||
SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c
|
||||
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
|
||||
SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8
|
||||
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
|
||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
|
||||
SDWebImage: f84b0feeb08d2d11e6a9b843cb06d75ebf5b8868
|
||||
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
|
||||
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
|
||||
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
|
||||
sqlite3: fc1400008a9b3525f5914ed715a5d1af0b8f4983
|
||||
sqlite3_flutter_libs: f6acaa2172e6bb3e2e70c771661905080e8ebcf2
|
||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
||||
volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9
|
||||
wakelock_plus: 373cfe59b235a6dd5837d0fb88791d2f13a90d56
|
||||
url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
|
||||
video_compress: f2133a07762889d67f0711ac831faa26f956980e
|
||||
volume_controller: 3657a1f65bedb98fa41ff7dc5793537919f31b12
|
||||
wakelock_plus: 04623e3f525556020ebd4034310f20fe7fda8b49
|
||||
WebRTC-SDK: 79942c006ea64f6fb48d7da8a4786dfc820bc1db
|
||||
workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6
|
||||
workmanager: 01be2de7f184bd15de93a1812936a2b7f42ef07e
|
||||
|
||||
PODFILE CHECKSUM: 9b244e02f87527430136c8d21cbdcf1cd586b6bc
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
enableGPUValidationMode = "1"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
|
@ -79,6 +79,8 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>LSSupportsOpeningDocumentsInPlace</key>
|
||||
<true/>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
|
@ -80,7 +80,11 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
|
||||
let metadataCopy = metadata as? [String: String] ?? [:]
|
||||
let avatarUrl = getAttachmentUrl(for: avatarIdentifier)
|
||||
KingfisherManager.shared.retrieveImage(with: URL(string: avatarUrl)!, completionHandler: { result in
|
||||
|
||||
let targetSize = 640
|
||||
let scaleProcessor = ResizingImageProcessor(referenceSize: CGSize(width: targetSize, height: targetSize), mode: .aspectFit)
|
||||
|
||||
KingfisherManager.shared.retrieveImage(with: URL(string: avatarUrl)!, options: [.processor(scaleProcessor)], completionHandler: { result in
|
||||
var image: Data?
|
||||
switch result {
|
||||
case .success(let value):
|
||||
@ -119,25 +123,35 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
}
|
||||
|
||||
if let imageIdentifier = metadata["image"] as? String {
|
||||
attachMedia(to: content, withIdentifier: imageIdentifier, fileType: UTType.jpeg, doScaleDown: true)
|
||||
attachMedia(to: content, withIdentifier: [imageIdentifier], fileType: UTType.jpeg, doScaleDown: true)
|
||||
} else if let avatarIdentifier = metadata["avatar"] as? String {
|
||||
attachMedia(to: content, withIdentifier: avatarIdentifier, fileType: UTType.jpeg, doScaleDown: true)
|
||||
attachMedia(to: content, withIdentifier: [avatarIdentifier], fileType: UTType.jpeg, doScaleDown: true)
|
||||
} else if let imagesIdentifier = metadata["images"] as? Array<String> {
|
||||
attachMedia(to: content, withIdentifier: imagesIdentifier, fileType: UTType.jpeg, doScaleDown: true)
|
||||
} else {
|
||||
contentHandler?(content)
|
||||
}
|
||||
}
|
||||
|
||||
private func attachMedia(to content: UNMutableNotificationContent, withIdentifier identifier: String, fileType type: UTType?, doScaleDown scaleDown: Bool = false) {
|
||||
let attachmentUrl = getAttachmentUrl(for: identifier)
|
||||
private func attachMedia(to content: UNMutableNotificationContent, withIdentifier identifier: Array<String>, fileType type: UTType?, doScaleDown scaleDown: Bool = false) {
|
||||
let attachmentUrls = identifier.compactMap { element in
|
||||
return getAttachmentUrl(for: element)
|
||||
}
|
||||
|
||||
guard let remoteUrl = URL(string: attachmentUrl) else {
|
||||
print("Invalid URL for attachment: \(attachmentUrl)")
|
||||
guard !attachmentUrls.isEmpty else {
|
||||
print("Invalid URLs for attachments: \(attachmentUrls)")
|
||||
return
|
||||
}
|
||||
|
||||
let targetSize = 800
|
||||
let scaleProcessor = ResizingImageProcessor(referenceSize: CGSize(width: targetSize, height: targetSize), mode: .aspectFit)
|
||||
|
||||
for attachmentUrl in attachmentUrls {
|
||||
guard let remoteUrl = URL(string: attachmentUrl) else {
|
||||
print("Invalid URL for attachment: \(attachmentUrl)")
|
||||
continue // Skip this URL and move to the next one
|
||||
}
|
||||
|
||||
KingfisherManager.shared.retrieveImage(with: remoteUrl, options: scaleDown ? [
|
||||
.processor(scaleProcessor)
|
||||
] : nil) { [weak self] result in
|
||||
@ -147,12 +161,12 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
case .success(let retrievalResult):
|
||||
// The image is either retrieved from cache or downloaded
|
||||
let tempDirectory = FileManager.default.temporaryDirectory
|
||||
let cachedFileUrl = tempDirectory.appendingPathComponent(identifier)
|
||||
let cachedFileUrl = tempDirectory.appendingPathComponent(UUID().uuidString) // Unique identifier for each file
|
||||
|
||||
do {
|
||||
// Write the image data to a temporary file for UNNotificationAttachment
|
||||
try retrievalResult.image.pngData()?.write(to: cachedFileUrl)
|
||||
self.attachLocalMedia(to: content, fileType: type?.identifier, from: cachedFileUrl, withIdentifier: identifier)
|
||||
self.attachLocalMedia(to: content, fileType: type?.identifier, from: cachedFileUrl, withIdentifier: attachmentUrl)
|
||||
} catch {
|
||||
print("Failed to write media to temporary file: \(error.localizedDescription)")
|
||||
self.contentHandler?(content)
|
||||
@ -164,6 +178,7 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func attachLocalMedia(to content: UNMutableNotificationContent, fileType type: String?, from localUrl: URL, withIdentifier identifier: String) {
|
||||
do {
|
||||
|
@ -55,7 +55,7 @@ struct CheckInEntry: TimelineEntry {
|
||||
struct CheckInWidgetEntryView : View {
|
||||
var entry: CheckInProvider.Entry
|
||||
|
||||
private let resultTierSymbols: [String] = ["大凶", "凶", "中平", "吉", "大吉"]
|
||||
private let resultTierSymbols: [String] = ["Bad", "Poor", "Medium", "Good", "Great"]
|
||||
|
||||
func checkIn() -> Void {}
|
||||
|
||||
@ -91,7 +91,7 @@ struct CheckInWidgetEntryView : View {
|
||||
} else {
|
||||
VStack(alignment: .leading) {
|
||||
Text("Check In").font(.system(size: 19, weight: .bold))
|
||||
Text("You haven't check in today").font(.system(size: 15))
|
||||
Text("You haven't divined today").font(.system(size: 15))
|
||||
}.padding(.horizontal, 4)
|
||||
|
||||
Spacer()
|
||||
|
@ -1,26 +1,34 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/database/database.dart';
|
||||
import 'package:surface/logger.dart';
|
||||
import 'package:surface/providers/channel.dart';
|
||||
import 'package:surface/providers/database.dart';
|
||||
import 'package:surface/providers/keypair.dart';
|
||||
import 'package:surface/providers/sn_attachment.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/providers/user_directory.dart';
|
||||
import 'package:surface/providers/websocket.dart';
|
||||
import 'package:surface/types/chat.dart';
|
||||
import 'package:surface/types/websocket.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class ChatMessageController extends ChangeNotifier {
|
||||
static const kChatMessageBoxPrefix = 'nex_chat_messages_';
|
||||
static const kSingleBatchLoadLimit = 100;
|
||||
|
||||
late final SnNetworkProvider _sn;
|
||||
late final UserDirectoryProvider _ud;
|
||||
late final WebSocketProvider _ws;
|
||||
late final SnAttachmentProvider _attach;
|
||||
late final DatabaseProvider _dt;
|
||||
late final ChatChannelProvider _ct;
|
||||
late final KeyPairProvider _kp;
|
||||
|
||||
StreamSubscription? _wsSubscription;
|
||||
|
||||
@ -29,17 +37,20 @@ class ChatMessageController extends ChangeNotifier {
|
||||
_ud = context.read<UserDirectoryProvider>();
|
||||
_ws = context.read<WebSocketProvider>();
|
||||
_attach = context.read<SnAttachmentProvider>();
|
||||
_ct = context.read<ChatChannelProvider>();
|
||||
_dt = context.read<DatabaseProvider>();
|
||||
_kp = context.read<KeyPairProvider>();
|
||||
}
|
||||
|
||||
bool isPending = true;
|
||||
bool isLoading = false;
|
||||
bool isAggressiveLoading = false;
|
||||
|
||||
int? messageTotal;
|
||||
|
||||
bool get isAllLoaded =>
|
||||
messageTotal != null && messages.length >= messageTotal!;
|
||||
|
||||
String? _boxKey;
|
||||
SnChannel? channel;
|
||||
SnChannelMember? profile;
|
||||
|
||||
@ -50,27 +61,19 @@ class ChatMessageController extends ChangeNotifier {
|
||||
/// Stored as a list of nonce to provide the loading state
|
||||
final List<String> unconfirmedMessages = List.empty(growable: true);
|
||||
|
||||
Box<SnChatMessage>? get _box =>
|
||||
(_boxKey == null || isPending) ? null : Hive.box<SnChatMessage>(_boxKey!);
|
||||
final List<SnChannelMember> typingMembers = List.empty(growable: true);
|
||||
final Map<int, Timer> typingInactiveTimer = {};
|
||||
|
||||
Future<void> initialize(SnChannel chan) async {
|
||||
channel = chan;
|
||||
|
||||
// Initialize local data
|
||||
_boxKey = '$kChatMessageBoxPrefix${chan.id}';
|
||||
await Hive.openBox<SnChatMessage>(_boxKey!);
|
||||
|
||||
// Fetch channel profile
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/im/channels/${chan.keyPath}/me',
|
||||
);
|
||||
profile = SnChannelMember.fromJson(
|
||||
resp.data as Map<String, dynamic>,
|
||||
);
|
||||
profile = await _ct.getChannelProfile(channel!);
|
||||
|
||||
_wsSubscription = _ws.stream.stream.listen((event) {
|
||||
_wsSubscription = _ws.pk.stream.listen((event) {
|
||||
switch (event.method) {
|
||||
case 'events.new':
|
||||
if (event.payload?['channel_id'] != channel?.id) break;
|
||||
final payload = SnChatMessage.fromJson(event.payload!);
|
||||
_addMessage(payload);
|
||||
break;
|
||||
@ -78,22 +81,17 @@ class ChatMessageController extends ChangeNotifier {
|
||||
if (event.payload?['channel_id'] != channel?.id) break;
|
||||
final member = SnChannelMember.fromJson(event.payload!['member']);
|
||||
if (member.id == profile?.id) break;
|
||||
// TODO impl typing users
|
||||
// if (!_typingUsers.any((x) => x.id == member.id)) {
|
||||
// setState(() {
|
||||
// _typingUsers.add(member);
|
||||
// });
|
||||
// }
|
||||
// _typingInactiveTimer[member.id]?.cancel();
|
||||
// _typingInactiveTimer[member.id] = Timer(
|
||||
// const Duration(seconds: 3),
|
||||
// () {
|
||||
// setState(() {
|
||||
// _typingUsers.removeWhere((x) => x.id == member.id);
|
||||
// _typingInactiveTimer.remove(member.id);
|
||||
// });
|
||||
// },
|
||||
// );
|
||||
if (!typingMembers.any((x) => x.id == member.id)) {
|
||||
typingMembers.add(member);
|
||||
notifyListeners();
|
||||
}
|
||||
typingInactiveTimer[member.id]?.cancel();
|
||||
typingInactiveTimer[member.id] =
|
||||
Timer(const Duration(seconds: 3), () {
|
||||
typingMembers.removeWhere((x) => x.id == member.id);
|
||||
typingInactiveTimer.remove(member.id);
|
||||
notifyListeners();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -101,12 +99,47 @@ class ChatMessageController extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> _saveMessageToLocal(Iterable<SnChatMessage> messages) async {
|
||||
if (_box == null) return;
|
||||
await _box!.putAll({
|
||||
for (final message in messages) message.id: message,
|
||||
Timer? _typingNotifyTimer;
|
||||
bool _typingStatus = false;
|
||||
|
||||
Future<void> _sendTypingStatusPackage() async {
|
||||
_ws.conn?.sink.add(jsonEncode(
|
||||
WebSocketPackage(
|
||||
method: 'status.typing',
|
||||
endpoint: 'im',
|
||||
payload: {
|
||||
'channel_id': channel!.id,
|
||||
},
|
||||
).toJson(),
|
||||
));
|
||||
}
|
||||
|
||||
void pingTypingStatus() {
|
||||
if (!_typingStatus) {
|
||||
_sendTypingStatusPackage();
|
||||
_typingStatus = true;
|
||||
}
|
||||
|
||||
if (_typingNotifyTimer == null || !_typingNotifyTimer!.isActive) {
|
||||
_typingNotifyTimer?.cancel();
|
||||
_typingNotifyTimer = Timer(const Duration(milliseconds: 1850), () {
|
||||
_typingStatus = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _saveMessageToLocal(Iterable<SnChatMessage> messages) async {
|
||||
await _dt.db.snLocalChatMessage.insertAll(
|
||||
messages.map(
|
||||
(ele) => SnLocalChatMessageCompanion.insert(
|
||||
id: Value(ele.id),
|
||||
content: ele,
|
||||
channelId: channel!.id,
|
||||
createdAt: Value(ele.createdAt),
|
||||
),
|
||||
),
|
||||
onConflict: DoNothing());
|
||||
}
|
||||
|
||||
Future<void> _addUnconfirmedMessage(SnChatMessage message) async {
|
||||
SnChatMessage? quoteEvent;
|
||||
@ -154,11 +187,27 @@ class ChatMessageController extends ChangeNotifier {
|
||||
} else {
|
||||
messages.insert(0, message);
|
||||
}
|
||||
notifyListeners();
|
||||
await _applyMessage(message);
|
||||
notifyListeners();
|
||||
|
||||
if (_box == null) return;
|
||||
await _box!.put(message.id, message);
|
||||
if (isCheckedUpdate) {
|
||||
await _dt.db.snLocalChatMessage.insertOne(
|
||||
SnLocalChatMessageCompanion.insert(
|
||||
id: Value(message.id),
|
||||
content: message,
|
||||
channelId: channel!.id,
|
||||
createdAt: Value(message.createdAt),
|
||||
),
|
||||
onConflict: DoUpdate(
|
||||
(_) => SnLocalChatMessageCompanion.custom(
|
||||
content: Constant(jsonEncode(message.toJson())),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
incomeStrandedQueue.add(message);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _applyMessage(SnChatMessage message) async {
|
||||
@ -170,27 +219,53 @@ class ChatMessageController extends ChangeNotifier {
|
||||
final idx =
|
||||
messages.indexWhere((x) => x.id == message.relatedEventId);
|
||||
if (idx != -1) {
|
||||
final newBody = message.body;
|
||||
final newBody = Map<String, dynamic>.from(message.body);
|
||||
newBody.remove('related_event');
|
||||
messages[idx] = messages[idx].copyWith(
|
||||
body: newBody,
|
||||
updatedAt: message.updatedAt,
|
||||
);
|
||||
if (_box!.containsKey(message.relatedEventId)) {
|
||||
await _box!.put(message.relatedEventId, messages[idx]);
|
||||
}
|
||||
if (message.relatedEventId != null) {
|
||||
await (_dt.db.snLocalChatMessage.update()
|
||||
..where((e) => e.id.equals(message.relatedEventId!)))
|
||||
.write(
|
||||
SnLocalChatMessageCompanion.custom(
|
||||
content: Constant(jsonEncode(messages[idx].toJson())),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
case 'messages.delete':
|
||||
if (message.relatedEventId != null) {
|
||||
messages.removeWhere((x) => x.id == message.relatedEventId);
|
||||
if (_box!.containsKey(message.relatedEventId)) {
|
||||
await _box!.delete(message.relatedEventId);
|
||||
if (message.relatedEventId != null) {
|
||||
await (_dt.db.snLocalChatMessage.delete()
|
||||
..where((e) => e.id.equals(message.relatedEventId!)))
|
||||
.go();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> _encodeMessageBody(
|
||||
String text,
|
||||
bool isEncrypted,
|
||||
) async {
|
||||
if (!isEncrypted || _kp.activeKp == null) {
|
||||
return {
|
||||
'text': text,
|
||||
'algorithm': 'plain',
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'text': await _kp.encryptText(text),
|
||||
'algorithm': 'rsa',
|
||||
'keypair_id': _kp.activeKp!.id,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> sendMessage(
|
||||
String type,
|
||||
String content, {
|
||||
@ -198,13 +273,13 @@ class ChatMessageController extends ChangeNotifier {
|
||||
int? relatedId,
|
||||
List<String>? attachments,
|
||||
SnChatMessage? editingMessage,
|
||||
bool isEncrypted = false,
|
||||
}) async {
|
||||
if (channel == null) return;
|
||||
const uuid = Uuid();
|
||||
final nonce = uuid.v4();
|
||||
final body = {
|
||||
'text': content,
|
||||
'algorithm': 'plain',
|
||||
...(await _encodeMessageBody(content, isEncrypted)),
|
||||
if (quoteId != null) 'quote_event': quoteId,
|
||||
if (relatedId != null) 'related_event': relatedId,
|
||||
if (attachments != null && attachments.isNotEmpty)
|
||||
@ -212,6 +287,8 @@ class ChatMessageController extends ChangeNotifier {
|
||||
};
|
||||
|
||||
// Mock the message locally
|
||||
// Do not mock the editing message
|
||||
if (editingMessage == null) {
|
||||
final createdAt = DateTime.now();
|
||||
final message = SnChatMessage(
|
||||
id: 0,
|
||||
@ -229,6 +306,7 @@ class ChatMessageController extends ChangeNotifier {
|
||||
relatedEventId: relatedId,
|
||||
);
|
||||
_addUnconfirmedMessage(message);
|
||||
}
|
||||
|
||||
// Send to server
|
||||
try {
|
||||
@ -262,20 +340,36 @@ class ChatMessageController extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
bool isCheckedUpdate = false;
|
||||
List<SnChatMessage> incomeStrandedQueue = List.empty(growable: true);
|
||||
|
||||
/// Check the local storage is up to date with the server.
|
||||
/// If the local storage is not up to date, it will be updated.
|
||||
Future<void> checkUpdate() async {
|
||||
if (_box == null) return;
|
||||
if (_box!.isEmpty) return;
|
||||
|
||||
isLoading = true;
|
||||
isAggressiveLoading = true;
|
||||
notifyListeners();
|
||||
|
||||
final mostRecentMessage = await (_dt.db.snLocalChatMessage.select()
|
||||
..where((e) => e.channelId.equals(channel!.id))
|
||||
..limit(1)
|
||||
..orderBy([
|
||||
(e) =>
|
||||
OrderingTerm(expression: e.createdAt, mode: OrderingMode.desc)
|
||||
]))
|
||||
.getSingleOrNull();
|
||||
if (mostRecentMessage == null) {
|
||||
// Initial load
|
||||
await loadMessages(take: 20);
|
||||
isAggressiveLoading = false;
|
||||
isCheckedUpdate = true;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/im/channels/${channel!.keyPath}/events/update',
|
||||
queryParameters: {
|
||||
'pivot': _box!.values.last.id,
|
||||
'pivot': mostRecentMessage.content.id,
|
||||
},
|
||||
);
|
||||
if (resp.data['up_to_date'] == true) return;
|
||||
@ -284,13 +378,25 @@ class ChatMessageController extends ChangeNotifier {
|
||||
final countToFetch = math.min(resp.data['count'] as int, 100);
|
||||
|
||||
for (int idx = 0; idx < countToFetch; idx += kSingleBatchLoadLimit) {
|
||||
await getMessages(kSingleBatchLoadLimit, idx, forceRemote: true);
|
||||
final out = await getMessages(
|
||||
kSingleBatchLoadLimit,
|
||||
idx,
|
||||
forceRemote: true,
|
||||
);
|
||||
messages.insertAll(0, out);
|
||||
notifyListeners();
|
||||
}
|
||||
} catch (err) {
|
||||
rethrow;
|
||||
} finally {
|
||||
await loadMessages();
|
||||
isLoading = false;
|
||||
isAggressiveLoading = false;
|
||||
|
||||
isCheckedUpdate = true;
|
||||
_saveMessageToLocal(incomeStrandedQueue).then((_) {
|
||||
incomeStrandedQueue.clear();
|
||||
});
|
||||
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@ -299,8 +405,12 @@ class ChatMessageController extends ChangeNotifier {
|
||||
/// If it was not found in local storage we will look it up in remote
|
||||
Future<SnChatMessage?> getMessage(int id) async {
|
||||
SnChatMessage? out;
|
||||
if (_box != null && _box!.containsKey(id)) {
|
||||
out = _box!.get(id);
|
||||
final local = await (_dt.db.snLocalChatMessage.select()
|
||||
..limit(1)
|
||||
..where((e) => e.id.equals(id)))
|
||||
.getSingleOrNull();
|
||||
if (local != null) {
|
||||
out = local.content;
|
||||
}
|
||||
|
||||
if (out == null) {
|
||||
@ -340,18 +450,21 @@ class ChatMessageController extends ChangeNotifier {
|
||||
bool forceLocal = false,
|
||||
bool forceRemote = false,
|
||||
}) async {
|
||||
final localTotal = await _dt.db.snLocalChatMessage
|
||||
.count(where: (e) => e.channelId.equals(channel!.id))
|
||||
.getSingle();
|
||||
|
||||
late List<SnChatMessage> out;
|
||||
if (_box != null &&
|
||||
(_box!.length >= take + offset || forceLocal) &&
|
||||
!forceRemote) {
|
||||
out = _box!.keys
|
||||
.toList()
|
||||
.cast<int>()
|
||||
.sorted((a, b) => b.compareTo(a))
|
||||
.skip(offset)
|
||||
.take(take)
|
||||
.map((key) => _box!.get(key)!)
|
||||
.toList();
|
||||
if ((localTotal >= take + offset || forceLocal) && !forceRemote) {
|
||||
final result = await (_dt.db.snLocalChatMessage.select()
|
||||
..where((e) => e.channelId.equals(channel!.id))
|
||||
..orderBy([
|
||||
(e) =>
|
||||
OrderingTerm(expression: e.createdAt, mode: OrderingMode.desc)
|
||||
])
|
||||
..limit(take, offset: offset))
|
||||
.get();
|
||||
out = result.map((e) => e.content).toList();
|
||||
} else {
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/im/channels/${channel!.keyPath}/events',
|
||||
@ -423,10 +536,45 @@ class ChatMessageController extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Timer? _readEventDebounce;
|
||||
int? _readEventAnchor;
|
||||
|
||||
void readEvent(int id) {
|
||||
if (_readEventAnchor != null) {
|
||||
_readEventAnchor = math.max(_readEventAnchor!, id);
|
||||
} else {
|
||||
_readEventAnchor = id;
|
||||
}
|
||||
if (_readEventDebounce?.isActive ?? false) {
|
||||
_readEventDebounce?.cancel();
|
||||
}
|
||||
|
||||
_readEventDebounce = Timer(const Duration(milliseconds: 500), () {
|
||||
_sendReadEvent();
|
||||
});
|
||||
}
|
||||
|
||||
void _sendReadEvent() {
|
||||
_ws.conn?.sink.add(jsonEncode(
|
||||
WebSocketPackage(
|
||||
method: 'events.read',
|
||||
endpoint: 'im',
|
||||
payload: {
|
||||
'channel_member_id': profile!.id,
|
||||
'event_id': _readEventAnchor,
|
||||
},
|
||||
).toJson(),
|
||||
));
|
||||
logging.debug('[Messaging] Send read event request: $_readEventAnchor');
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_box?.close();
|
||||
_wsSubscription?.cancel();
|
||||
if (_readEventDebounce?.isActive ?? false) {
|
||||
_sendReadEvent();
|
||||
}
|
||||
_readEventDebounce?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
@ -1,29 +1,31 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:mime/mime.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:surface/providers/post.dart';
|
||||
import 'package:surface/providers/sn_attachment.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/types/attachment.dart';
|
||||
import 'package:surface/types/poll.dart';
|
||||
import 'package:surface/types/post.dart';
|
||||
import 'package:surface/types/realm.dart';
|
||||
import 'package:surface/widgets/dialog.dart';
|
||||
import 'package:surface/widgets/universal_image.dart';
|
||||
|
||||
enum PostWriteMediaType {
|
||||
image,
|
||||
video,
|
||||
audio,
|
||||
file,
|
||||
}
|
||||
import 'package:video_compress/video_compress.dart';
|
||||
|
||||
class PostWriteMedia {
|
||||
late String name;
|
||||
late PostWriteMediaType type;
|
||||
late SnMediaType type;
|
||||
final SnAttachment? attachment;
|
||||
final XFile? file;
|
||||
final Uint8List? raw;
|
||||
@ -35,16 +37,16 @@ class PostWriteMedia {
|
||||
|
||||
switch (attachment?.mimetype.split('/').firstOrNull) {
|
||||
case 'image':
|
||||
type = PostWriteMediaType.image;
|
||||
type = SnMediaType.image;
|
||||
break;
|
||||
case 'video':
|
||||
type = PostWriteMediaType.video;
|
||||
type = SnMediaType.video;
|
||||
break;
|
||||
case 'audio':
|
||||
type = PostWriteMediaType.audio;
|
||||
type = SnMediaType.audio;
|
||||
break;
|
||||
default:
|
||||
type = PostWriteMediaType.file;
|
||||
type = SnMediaType.file;
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,20 +58,21 @@ class PostWriteMedia {
|
||||
|
||||
switch (mimetype?.split('/').firstOrNull) {
|
||||
case 'image':
|
||||
type = PostWriteMediaType.image;
|
||||
type = SnMediaType.image;
|
||||
break;
|
||||
case 'video':
|
||||
type = PostWriteMediaType.video;
|
||||
type = SnMediaType.video;
|
||||
break;
|
||||
case 'audio':
|
||||
type = PostWriteMediaType.audio;
|
||||
type = SnMediaType.audio;
|
||||
break;
|
||||
default:
|
||||
type = PostWriteMediaType.file;
|
||||
type = SnMediaType.file;
|
||||
}
|
||||
}
|
||||
|
||||
PostWriteMedia.fromBytes(this.raw, this.name, this.type, {this.attachment, this.file});
|
||||
PostWriteMedia.fromBytes(this.raw, this.name, this.type,
|
||||
{this.attachment, this.file});
|
||||
|
||||
bool get isEmpty => attachment == null && file == null && raw == null;
|
||||
|
||||
@ -103,8 +106,9 @@ class PostWriteMedia {
|
||||
}) {
|
||||
if (attachment != null) {
|
||||
final sn = context.read<SnNetworkProvider>();
|
||||
final ImageProvider provider = UniversalImage.provider(sn.getAttachmentUrl(attachment!.rid));
|
||||
if (width != null && height != null) {
|
||||
final ImageProvider provider =
|
||||
UniversalImage.provider(sn.getAttachmentUrl(attachment!.rid));
|
||||
if (width != null && height != null && !kIsWeb) {
|
||||
return ResizeImage(
|
||||
provider,
|
||||
width: width,
|
||||
@ -114,7 +118,8 @@ class PostWriteMedia {
|
||||
}
|
||||
return provider;
|
||||
} else if (file != null) {
|
||||
final ImageProvider provider = kIsWeb ? NetworkImage(file!.path) : FileImage(File(file!.path));
|
||||
final ImageProvider provider =
|
||||
kIsWeb ? NetworkImage(file!.path) : FileImage(File(file!.path));
|
||||
if (width != null && height != null) {
|
||||
return ResizeImage(
|
||||
provider,
|
||||
@ -144,6 +149,8 @@ class PostWriteController extends ChangeNotifier {
|
||||
static const Map<String, String> kTitleMap = {
|
||||
'stories': 'writePostTypeStory',
|
||||
'articles': 'writePostTypeArticle',
|
||||
'questions': 'writePostTypeQuestion',
|
||||
'videos': 'writePostTypeVideo',
|
||||
};
|
||||
|
||||
static const kAttachmentProgressWeight = 0.9;
|
||||
@ -152,10 +159,38 @@ class PostWriteController extends ChangeNotifier {
|
||||
final TextEditingController contentController = TextEditingController();
|
||||
final TextEditingController titleController = TextEditingController();
|
||||
final TextEditingController descriptionController = TextEditingController();
|
||||
final TextEditingController aliasController = TextEditingController();
|
||||
final TextEditingController rewardController = TextEditingController();
|
||||
|
||||
PostWriteController() {
|
||||
titleController.addListener(() => notifyListeners());
|
||||
descriptionController.addListener(() => notifyListeners());
|
||||
ContentInsertionConfiguration get contentInsertionConfiguration =>
|
||||
ContentInsertionConfiguration(
|
||||
onContentInserted: (KeyboardInsertedContent content) {
|
||||
if (content.hasData) {
|
||||
addAttachments([
|
||||
PostWriteMedia.fromBytes(content.data!,
|
||||
'attachmentInsertedImage'.tr(), SnMediaType.image)
|
||||
]);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
bool _temporarySaveActive = false;
|
||||
|
||||
PostWriteController({bool doLoadFromTemporary = true}) {
|
||||
_temporarySaveActive = doLoadFromTemporary;
|
||||
titleController.addListener(() {
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
});
|
||||
descriptionController.addListener(() {
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
});
|
||||
contentController.addListener(() {
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
});
|
||||
if (doLoadFromTemporary) _temporaryLoad();
|
||||
}
|
||||
|
||||
String mode = kTitleMap.keys.first;
|
||||
@ -164,21 +199,27 @@ class PostWriteController extends ChangeNotifier {
|
||||
|
||||
String get description => descriptionController.text;
|
||||
|
||||
bool get isRelatedNull => ![editingPost, repostingPost, replyingPost].any((ele) => ele != null);
|
||||
bool get isRelatedNull =>
|
||||
![editingPost, repostingPost, replyingPost].any((ele) => ele != null);
|
||||
|
||||
bool isLoading = false, isBusy = false;
|
||||
double? progress;
|
||||
|
||||
SnRealm? realm;
|
||||
SnPublisher? publisher;
|
||||
SnPost? editingPost, repostingPost, replyingPost;
|
||||
bool editingDraft = false;
|
||||
|
||||
int visibility = 0;
|
||||
List<int> visibleUsers = List.empty();
|
||||
List<int> invisibleUsers = List.empty();
|
||||
List<String> tags = List.empty();
|
||||
List<String> categories = List.empty();
|
||||
PostWriteMedia? thumbnail;
|
||||
List<PostWriteMedia> attachments = List.empty(growable: true);
|
||||
DateTime? publishedAt, publishedUntil;
|
||||
SnAttachment? videoAttachment;
|
||||
SnPoll? poll;
|
||||
|
||||
Future<void> fetchRelatedPost(
|
||||
BuildContext context, {
|
||||
@ -198,16 +239,37 @@ class PostWriteController extends ChangeNotifier {
|
||||
titleController.text = post.body['title'] ?? '';
|
||||
descriptionController.text = post.body['description'] ?? '';
|
||||
contentController.text = post.body['content'] ?? '';
|
||||
aliasController.text = post.alias ?? '';
|
||||
rewardController.text = post.body['reward']?.toString() ?? '';
|
||||
videoAttachment = post.body['video'] != null
|
||||
? SnAttachment.fromJson(post.body['video'])
|
||||
: null;
|
||||
publishedAt = post.publishedAt;
|
||||
publishedUntil = post.publishedUntil;
|
||||
visibleUsers = List.from(post.visibleUsersList ?? []);
|
||||
invisibleUsers = List.from(post.invisibleUsersList ?? []);
|
||||
visibleUsers = List.from(post.visibleUsersList ?? [], growable: true);
|
||||
invisibleUsers =
|
||||
List.from(post.invisibleUsersList ?? [], growable: true);
|
||||
visibility = post.visibility;
|
||||
tags = List.from(post.tags.map((ele) => ele.alias));
|
||||
attachments.addAll(post.preload?.attachments?.map((ele) => PostWriteMedia(ele)) ?? []);
|
||||
tags = List.from(post.tags.map((ele) => ele.alias), growable: true);
|
||||
categories =
|
||||
List.from(post.categories.map((ele) => ele.alias), growable: true);
|
||||
attachments.addAll(
|
||||
post.body['attachments']
|
||||
?.map((ele) => SnAttachment.fromJson(ele))
|
||||
?.map((ele) => PostWriteMedia(ele))
|
||||
?.cast<PostWriteMedia>() ??
|
||||
[],
|
||||
);
|
||||
poll = post.poll;
|
||||
|
||||
if (post.preload?.thumbnail != null && (post.preload?.thumbnail?.rid.isNotEmpty ?? false)) {
|
||||
thumbnail = PostWriteMedia(post.preload!.thumbnail);
|
||||
editingDraft = post.isDraft;
|
||||
|
||||
if (post.body['thumbnail'] != null) {
|
||||
thumbnail =
|
||||
PostWriteMedia(SnAttachment.fromJson(post.body['thumbnail']));
|
||||
}
|
||||
if (post.realm != null) {
|
||||
realm = post.realm!;
|
||||
}
|
||||
|
||||
editingPost = post;
|
||||
@ -231,7 +293,9 @@ class PostWriteController extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Future<SnAttachment> _uploadAttachment(BuildContext context, PostWriteMedia media) async {
|
||||
Future<SnAttachment> _uploadAttachment(
|
||||
BuildContext context, PostWriteMedia media,
|
||||
{bool isCompressed = false}) async {
|
||||
final attach = context.read<SnAttachmentProvider>();
|
||||
|
||||
final place = await attach.chunkedUploadInitialize(
|
||||
@ -239,22 +303,173 @@ class PostWriteController extends ChangeNotifier {
|
||||
media.name,
|
||||
'interactive',
|
||||
null,
|
||||
mimetype: media.raw != null && media.type == PostWriteMediaType.image ? 'image/png' : null,
|
||||
mimetype: media.raw != null && media.type == SnMediaType.image
|
||||
? 'image/png'
|
||||
: null,
|
||||
);
|
||||
|
||||
final item = await attach.chunkedUploadParts(
|
||||
var item = await attach.chunkedUploadParts(
|
||||
media.toFile()!,
|
||||
place.$1,
|
||||
place.$2,
|
||||
onProgress: (progress) {
|
||||
progress = progress;
|
||||
analyzeNow: media.type == SnMediaType.image,
|
||||
onProgress: (value) {
|
||||
progress = value;
|
||||
notifyListeners();
|
||||
},
|
||||
);
|
||||
|
||||
if (media.type == SnMediaType.video && !isCompressed && context.mounted) {
|
||||
try {
|
||||
final compressedAttachment =
|
||||
await _tryCompressVideoCopy(context, media);
|
||||
if (compressedAttachment != null) {
|
||||
item = await attach.updateOne(item,
|
||||
compressedId: compressedAttachment.id);
|
||||
}
|
||||
} catch (err) {
|
||||
if (context.mounted) context.showErrorDialog(err);
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
Future<SnAttachment?> _tryCompressVideoCopy(
|
||||
BuildContext context, PostWriteMedia media) async {
|
||||
if (kIsWeb || !(Platform.isAndroid || Platform.isIOS || Platform.isMacOS))
|
||||
return null;
|
||||
if (media.type != SnMediaType.video) return null;
|
||||
if (media.file == null) return null;
|
||||
if (VideoCompress.isCompressing) return null;
|
||||
|
||||
final confirm = await context.showConfirmDialog(
|
||||
'attachmentVideoCompressHint'.tr(),
|
||||
'attachmentVideoCompressHintDescription'.tr(args: [media.file!.name]),
|
||||
);
|
||||
if (!confirm) return null;
|
||||
|
||||
progress = null;
|
||||
notifyListeners();
|
||||
|
||||
final mediaInfo = await VideoCompress.compressVideo(
|
||||
media.file!.path,
|
||||
quality: VideoQuality.LowQuality,
|
||||
frameRate: 30,
|
||||
deleteOrigin: false,
|
||||
);
|
||||
if (mediaInfo == null) return null;
|
||||
if (!context.mounted) return null;
|
||||
|
||||
final compressedMedia = PostWriteMedia.fromFile(XFile(mediaInfo.path!));
|
||||
final compressedAttachment =
|
||||
await _uploadAttachment(context, compressedMedia, isCompressed: true);
|
||||
|
||||
return compressedAttachment;
|
||||
}
|
||||
|
||||
static const kTemporaryStorageKey = 'int_draft_post';
|
||||
|
||||
Timer? _temporarySaveTimer;
|
||||
|
||||
void _temporaryPlanSave() {
|
||||
if (!_temporarySaveActive) return;
|
||||
_temporarySaveTimer?.cancel();
|
||||
_temporarySaveTimer = Timer(const Duration(seconds: 1), () {
|
||||
_temporarySave();
|
||||
log("[PostWriter] Temporary save saved.");
|
||||
});
|
||||
}
|
||||
|
||||
void _temporarySave() {
|
||||
SharedPreferences.getInstance().then((prefs) {
|
||||
if (titleController.text.isEmpty &&
|
||||
descriptionController.text.isEmpty &&
|
||||
contentController.text.isEmpty &&
|
||||
thumbnail == null &&
|
||||
attachments.isEmpty) {
|
||||
prefs.remove(kTemporaryStorageKey);
|
||||
return;
|
||||
}
|
||||
|
||||
prefs.setString(
|
||||
kTemporaryStorageKey,
|
||||
jsonEncode({
|
||||
'publisher': publisher,
|
||||
'content': contentController.text,
|
||||
if (aliasController.text.isNotEmpty) 'alias': aliasController.text,
|
||||
if (titleController.text.isNotEmpty) 'title': titleController.text,
|
||||
if (descriptionController.text.isNotEmpty)
|
||||
'description': descriptionController.text,
|
||||
if (rewardController.text.isNotEmpty) 'reward': rewardController.text,
|
||||
if (thumbnail != null && thumbnail!.attachment != null)
|
||||
'thumbnail': thumbnail!.attachment!.toJson(),
|
||||
'attachments': attachments
|
||||
.where((e) => e.attachment != null)
|
||||
.map((e) => e.attachment!.toJson())
|
||||
.toList(growable: true),
|
||||
'tags': tags.map((ele) => {'alias': ele}).toList(growable: true),
|
||||
'categories':
|
||||
categories.map((ele) => {'alias': ele}).toList(growable: true),
|
||||
'visibility': visibility,
|
||||
'visible_users_list': visibleUsers,
|
||||
'invisible_users_list': invisibleUsers,
|
||||
if (publishedAt != null)
|
||||
'published_at': publishedAt!.toUtc().toIso8601String(),
|
||||
if (publishedUntil != null)
|
||||
'published_until': publishedAt!.toUtc().toIso8601String(),
|
||||
if (replyingPost != null) 'reply_to': replyingPost!.toJson(),
|
||||
if (repostingPost != null) 'repost_to': repostingPost!.toJson(),
|
||||
if (poll != null) 'poll': poll!.toJson(),
|
||||
if (realm != null) 'realm': realm!.toJson(),
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
bool get isNotEmpty =>
|
||||
title.isNotEmpty ||
|
||||
description.isNotEmpty ||
|
||||
contentController.text.isNotEmpty ||
|
||||
attachments.isNotEmpty;
|
||||
|
||||
bool temporaryRestored = false;
|
||||
|
||||
void _temporaryLoad() {
|
||||
SharedPreferences.getInstance().then((prefs) {
|
||||
final raw = prefs.getString(kTemporaryStorageKey);
|
||||
if (raw == null) return;
|
||||
final data = jsonDecode(raw);
|
||||
contentController.text = data['content'];
|
||||
aliasController.text = data['alias'] ?? '';
|
||||
titleController.text = data['title'] ?? '';
|
||||
descriptionController.text = data['description'] ?? '';
|
||||
rewardController.text = data['reward']?.toString() ?? '';
|
||||
if (data['thumbnail'] != null)
|
||||
thumbnail = PostWriteMedia(SnAttachment.fromJson(data['thumbnail']));
|
||||
attachments.addAll(data['attachments']
|
||||
.map((ele) => PostWriteMedia(SnAttachment.fromJson(ele)))
|
||||
.cast<PostWriteMedia>());
|
||||
tags = List.from(data['tags'].map((ele) => ele['alias']));
|
||||
categories = List.from(data['categories'].map((ele) => ele['alias']));
|
||||
visibility = data['visibility'];
|
||||
visibleUsers = List.from(data['visible_users_list'] ?? []);
|
||||
invisibleUsers = List.from(data['invisible_users_list'] ?? []);
|
||||
if (data['published_at'] != null)
|
||||
publishedAt = DateTime.tryParse(data['published_at'])?.toLocal();
|
||||
if (data['published_until'] != null)
|
||||
publishedUntil = DateTime.tryParse(data['published_until'])?.toLocal();
|
||||
replyingPost =
|
||||
data['reply_to'] != null ? SnPost.fromJson(data['reply_to']) : null;
|
||||
repostingPost =
|
||||
data['repost_to'] != null ? SnPost.fromJson(data['repost_to']) : null;
|
||||
poll = data['poll'] != null ? SnPoll.fromJson(data['poll']) : null;
|
||||
realm = data['realm'] != null ? SnRealm.fromJson(data['realm']) : null;
|
||||
temporaryRestored = true;
|
||||
notifyListeners();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> uploadSingleAttachment(BuildContext context, int idx) async {
|
||||
if (isBusy) return;
|
||||
|
||||
@ -269,7 +484,10 @@ class PostWriteController extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> post(BuildContext context) async {
|
||||
Future<void> sendPost(
|
||||
BuildContext context, {
|
||||
bool saveAsDraft = false,
|
||||
}) async {
|
||||
if (isBusy || publisher == null) return;
|
||||
|
||||
final sn = context.read<SnNetworkProvider>();
|
||||
@ -296,21 +514,40 @@ class PostWriteController extends ChangeNotifier {
|
||||
media.name,
|
||||
'interactive',
|
||||
null,
|
||||
mimetype: media.raw != null && media.type == PostWriteMediaType.image ? 'image/png' : null,
|
||||
mimetype: media.raw != null && media.type == SnMediaType.image
|
||||
? 'image/png'
|
||||
: null,
|
||||
);
|
||||
|
||||
final item = await attach.chunkedUploadParts(
|
||||
var item = await attach.chunkedUploadParts(
|
||||
media.toFile()!,
|
||||
place.$1,
|
||||
place.$2,
|
||||
onProgress: (progress) {
|
||||
onProgress: (value) {
|
||||
// Calculate overall progress for attachments
|
||||
progress = ((i + progress) / attachments.length) * kAttachmentProgressWeight;
|
||||
progress = math.max(
|
||||
((i + value) / attachments.length) * kAttachmentProgressWeight,
|
||||
value);
|
||||
notifyListeners();
|
||||
},
|
||||
);
|
||||
|
||||
try {
|
||||
if (context.mounted) {
|
||||
final compressedAttachment =
|
||||
await _tryCompressVideoCopy(context, media);
|
||||
if (compressedAttachment != null) {
|
||||
item = await attach.updateOne(item,
|
||||
compressedId: compressedAttachment.id);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
if (context.mounted) context.showErrorDialog(err);
|
||||
}
|
||||
|
||||
progress = (i + 1) / attachments.length * kAttachmentProgressWeight;
|
||||
attachments[i] = PostWriteMedia(item);
|
||||
notifyListeners();
|
||||
}
|
||||
} catch (err) {
|
||||
isBusy = false;
|
||||
@ -323,10 +560,12 @@ class PostWriteController extends ChangeNotifier {
|
||||
progress = kAttachmentProgressWeight;
|
||||
notifyListeners();
|
||||
|
||||
final reward = double.tryParse(rewardController.text);
|
||||
|
||||
// Posting the content
|
||||
try {
|
||||
final baseProgressVal = progress!;
|
||||
await sn.client.request(
|
||||
final resp = await sn.client.request(
|
||||
[
|
||||
'/cgi/co/$mode',
|
||||
if (editingPost != null) '${editingPost!.id}',
|
||||
@ -334,31 +573,58 @@ class PostWriteController extends ChangeNotifier {
|
||||
data: {
|
||||
'publisher': publisher!.id,
|
||||
'content': contentController.text,
|
||||
if (aliasController.text.isNotEmpty) 'alias': aliasController.text,
|
||||
if (titleController.text.isNotEmpty) 'title': titleController.text,
|
||||
if (descriptionController.text.isNotEmpty) 'description': descriptionController.text,
|
||||
if (thumbnail != null && thumbnail!.attachment != null) 'thumbnail': thumbnail!.attachment!.rid,
|
||||
'attachments': attachments.where((e) => e.attachment != null).map((e) => e.attachment!.rid).toList(),
|
||||
if (descriptionController.text.isNotEmpty)
|
||||
'description': descriptionController.text,
|
||||
if (thumbnail != null && thumbnail!.attachment != null)
|
||||
'thumbnail': thumbnail!.attachment!.rid,
|
||||
'attachments': attachments
|
||||
.where((e) => e.attachment != null)
|
||||
.map((e) => e.attachment!.rid)
|
||||
.toList(),
|
||||
'tags': tags.map((ele) => {'alias': ele}).toList(),
|
||||
'categories': categories.map((ele) => {'alias': ele}).toList(),
|
||||
'visibility': visibility,
|
||||
'visible_users_list': visibleUsers,
|
||||
'invisible_users_list': invisibleUsers,
|
||||
if (publishedAt != null) 'published_at': publishedAt!.toUtc().toIso8601String(),
|
||||
if (publishedUntil != null) 'published_until': publishedAt!.toUtc().toIso8601String(),
|
||||
if (publishedAt != null)
|
||||
'published_at': publishedAt!.toUtc().toIso8601String(),
|
||||
if (publishedUntil != null)
|
||||
'published_until': publishedAt!.toUtc().toIso8601String(),
|
||||
if (replyingPost != null) 'reply_to': replyingPost!.id,
|
||||
if (repostingPost != null) 'repost_to': repostingPost!.id,
|
||||
if (reward != null) 'reward': reward,
|
||||
if (videoAttachment != null) 'video': videoAttachment!.rid,
|
||||
if (poll != null) 'poll': poll!.id,
|
||||
if (realm != null) 'realm': realm!.id,
|
||||
'is_draft': saveAsDraft,
|
||||
},
|
||||
onSendProgress: (count, total) {
|
||||
progress = baseProgressVal + (count / total) * (kPostingProgressWeight / 2);
|
||||
progress =
|
||||
baseProgressVal + (count / total) * (kPostingProgressWeight / 2);
|
||||
notifyListeners();
|
||||
},
|
||||
onReceiveProgress: (count, total) {
|
||||
progress = baseProgressVal + (kPostingProgressWeight / 2) + (count / total) * (kPostingProgressWeight / 2);
|
||||
progress = baseProgressVal +
|
||||
(kPostingProgressWeight / 2) +
|
||||
(count / total) * (kPostingProgressWeight / 2);
|
||||
notifyListeners();
|
||||
},
|
||||
options: Options(
|
||||
method: editingPost != null ? 'PUT' : 'POST',
|
||||
),
|
||||
);
|
||||
if (saveAsDraft) {
|
||||
if (!context.mounted) return;
|
||||
editingDraft = true;
|
||||
final out = SnPost.fromJson(resp.data);
|
||||
final pt = context.read<SnPostContentProvider>();
|
||||
editingPost = await pt.completePostData(out);
|
||||
notifyListeners();
|
||||
} else {
|
||||
reset();
|
||||
}
|
||||
} catch (err) {
|
||||
if (!context.mounted) return;
|
||||
context.showErrorDialog(err);
|
||||
@ -391,81 +657,111 @@ class PostWriteController extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setThumbnail(int? idx) {
|
||||
if (idx == null) {
|
||||
attachments.add(thumbnail!);
|
||||
thumbnail = null;
|
||||
} else {
|
||||
if (thumbnail != null) {
|
||||
attachments.add(thumbnail!);
|
||||
}
|
||||
thumbnail = attachments[idx];
|
||||
attachments.removeAt(idx);
|
||||
}
|
||||
void setThumbnail(SnAttachment? value) {
|
||||
thumbnail = value == null ? null : PostWriteMedia(value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPublisher(SnPublisher? item) {
|
||||
publisher = item;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPublishedAt(DateTime? value) {
|
||||
publishedAt = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPublishedUntil(DateTime? value) {
|
||||
publishedUntil = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setTags(List<String> value) {
|
||||
tags = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setCategories(List<String> value) {
|
||||
categories = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setVisibility(int value) {
|
||||
visibility = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setVisibleUsers(List<int> value) {
|
||||
visibleUsers = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setInvisibleUsers(List<int> value) {
|
||||
invisibleUsers = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setRealm(SnRealm? value) {
|
||||
realm = value;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setProgress(double? value) {
|
||||
progress = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setIsBusy(bool value) {
|
||||
isBusy = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setMode(String value) {
|
||||
mode = value;
|
||||
_temporaryPlanSave();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setVideoAttachment(SnAttachment? value) {
|
||||
videoAttachment = value;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPoll(SnPoll? value) {
|
||||
poll = value;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
publishedAt = null;
|
||||
publishedUntil = null;
|
||||
thumbnail = null;
|
||||
visibility = 0;
|
||||
titleController.clear();
|
||||
descriptionController.clear();
|
||||
contentController.clear();
|
||||
attachments.clear();
|
||||
aliasController.clear();
|
||||
tags = List.empty(growable: true);
|
||||
categories = List.empty(growable: true);
|
||||
attachments = List.empty(growable: true);
|
||||
editingPost = null;
|
||||
replyingPost = null;
|
||||
repostingPost = null;
|
||||
mode = kTitleMap.keys.first;
|
||||
temporaryRestored = false;
|
||||
SharedPreferences.getInstance()
|
||||
.then((prefs) => prefs.remove(kTemporaryStorageKey));
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@ -474,6 +770,7 @@ class PostWriteController extends ChangeNotifier {
|
||||
contentController.dispose();
|
||||
titleController.dispose();
|
||||
descriptionController.dispose();
|
||||
aliasController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
42
lib/database/account.dart
Normal file
@ -0,0 +1,42 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:surface/types/account.dart';
|
||||
|
||||
class SnAccountConverter extends TypeConverter<SnAccount, String>
|
||||
with JsonTypeConverter2<SnAccount, String, Map<String, Object?>> {
|
||||
const SnAccountConverter();
|
||||
|
||||
@override
|
||||
SnAccount fromSql(String fromDb) {
|
||||
return fromJson(jsonDecode(fromDb) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(SnAccount value) {
|
||||
return jsonEncode(toJson(value));
|
||||
}
|
||||
|
||||
@override
|
||||
SnAccount fromJson(Map<String, Object?> json) {
|
||||
return SnAccount.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Object?> toJson(SnAccount value) {
|
||||
return value.toJson();
|
||||
}
|
||||
}
|
||||
|
||||
@TableIndex(name: 'idx_account_name', columns: {#name})
|
||||
class SnLocalAccount extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
TextColumn get name => text()();
|
||||
|
||||
TextColumn get content => text().map(const SnAccountConverter())();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
||||
|
||||
DateTimeColumn get cacheExpiredAt => dateTime()();
|
||||
}
|
47
lib/database/attachment.dart
Normal file
@ -0,0 +1,47 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:surface/types/attachment.dart';
|
||||
|
||||
class SnAttachmentConverter extends TypeConverter<SnAttachment, String>
|
||||
with JsonTypeConverter2<SnAttachment, String, Map<String, Object?>> {
|
||||
const SnAttachmentConverter();
|
||||
|
||||
@override
|
||||
SnAttachment fromSql(String fromDb) {
|
||||
return fromJson(jsonDecode(fromDb) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(SnAttachment value) {
|
||||
return jsonEncode(toJson(value));
|
||||
}
|
||||
|
||||
@override
|
||||
SnAttachment fromJson(Map<String, Object?> json) {
|
||||
return SnAttachment.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Object?> toJson(SnAttachment value) {
|
||||
return value.toJson();
|
||||
}
|
||||
}
|
||||
|
||||
@TableIndex(name: 'idx_attachment_rid', columns: {#rid})
|
||||
@TableIndex(name: 'idx_attachment_account', columns: {#accountId})
|
||||
class SnLocalAttachment extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
TextColumn get rid => text().unique()();
|
||||
|
||||
TextColumn get uuid => text().unique()();
|
||||
|
||||
TextColumn get content => text().map(const SnAttachmentConverter())();
|
||||
|
||||
IntColumn get accountId => integer()();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
||||
|
||||
DateTimeColumn get cacheExpiredAt => dateTime()();
|
||||
}
|
117
lib/database/chat.dart
Normal file
@ -0,0 +1,117 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:surface/types/chat.dart';
|
||||
|
||||
class SnChannelConverter extends TypeConverter<SnChannel, String>
|
||||
with JsonTypeConverter2<SnChannel, String, Map<String, Object?>> {
|
||||
const SnChannelConverter();
|
||||
|
||||
@override
|
||||
SnChannel fromSql(String fromDb) {
|
||||
return fromJson(jsonDecode(fromDb) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(SnChannel value) {
|
||||
return jsonEncode(toJson(value));
|
||||
}
|
||||
|
||||
@override
|
||||
SnChannel fromJson(Map<String, Object?> json) {
|
||||
return SnChannel.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Object?> toJson(SnChannel value) {
|
||||
return value.toJson();
|
||||
}
|
||||
}
|
||||
|
||||
@TableIndex(name: 'idx_channel_alias', columns: {#alias})
|
||||
class SnLocalChatChannel extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
TextColumn get alias => text()();
|
||||
|
||||
TextColumn get content => text().map(const SnChannelConverter())();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
||||
}
|
||||
|
||||
class SnMessageConverter extends TypeConverter<SnChatMessage, String>
|
||||
with JsonTypeConverter2<SnChatMessage, String, Map<String, Object?>> {
|
||||
const SnMessageConverter();
|
||||
|
||||
@override
|
||||
SnChatMessage fromSql(String fromDb) {
|
||||
return fromJson(jsonDecode(fromDb) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(SnChatMessage value) {
|
||||
return jsonEncode(toJson(value));
|
||||
}
|
||||
|
||||
@override
|
||||
SnChatMessage fromJson(Map<String, Object?> json) {
|
||||
return SnChatMessage.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Object?> toJson(SnChatMessage value) {
|
||||
return value.toJson();
|
||||
}
|
||||
}
|
||||
|
||||
@TableIndex(name: 'idx_chat_channel', columns: {#channelId})
|
||||
class SnLocalChatMessage extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
IntColumn get channelId => integer()();
|
||||
|
||||
IntColumn get senderId => integer().nullable()();
|
||||
|
||||
TextColumn get content => text().map(const SnMessageConverter())();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
||||
}
|
||||
|
||||
class SnChannelMemberConverter extends TypeConverter<SnChannelMember, String>
|
||||
with JsonTypeConverter2<SnChannelMember, String, Map<String, Object?>> {
|
||||
const SnChannelMemberConverter();
|
||||
|
||||
@override
|
||||
SnChannelMember fromSql(String fromDb) {
|
||||
return fromJson(jsonDecode(fromDb) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(SnChannelMember value) {
|
||||
return jsonEncode(toJson(value));
|
||||
}
|
||||
|
||||
@override
|
||||
SnChannelMember fromJson(Map<String, Object?> json) {
|
||||
return SnChannelMember.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Object?> toJson(SnChannelMember value) {
|
||||
return value.toJson();
|
||||
}
|
||||
}
|
||||
|
||||
class SnLocalChannelMember extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
IntColumn get channelId => integer()();
|
||||
|
||||
IntColumn get accountId => integer()();
|
||||
|
||||
TextColumn get content => text().map(SnChannelMemberConverter())();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
||||
|
||||
DateTimeColumn get cacheExpiredAt => dateTime()();
|
||||
}
|
62
lib/database/database.dart
Normal file
@ -0,0 +1,62 @@
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:drift_flutter/drift_flutter.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:surface/database/account.dart';
|
||||
import 'package:surface/database/attachment.dart';
|
||||
import 'package:surface/database/chat.dart';
|
||||
import 'package:surface/database/database.steps.dart';
|
||||
import 'package:surface/database/keypair.dart';
|
||||
import 'package:surface/database/realm.dart';
|
||||
import 'package:surface/database/sticker.dart';
|
||||
import 'package:surface/types/chat.dart';
|
||||
import 'package:surface/types/attachment.dart';
|
||||
import 'package:surface/types/account.dart';
|
||||
import 'package:surface/types/realm.dart';
|
||||
|
||||
part 'database.g.dart';
|
||||
|
||||
@DriftDatabase(tables: [
|
||||
SnLocalChatChannel,
|
||||
SnLocalChatMessage,
|
||||
SnLocalChannelMember,
|
||||
SnLocalKeyPair,
|
||||
SnLocalAccount,
|
||||
SnLocalAttachment,
|
||||
SnLocalSticker,
|
||||
SnLocalStickerPack,
|
||||
SnLocalRealm,
|
||||
])
|
||||
class AppDatabase extends _$AppDatabase {
|
||||
AppDatabase([QueryExecutor? e]) : super(e ?? _openConnection());
|
||||
|
||||
@override
|
||||
int get schemaVersion => 4;
|
||||
|
||||
static QueryExecutor _openConnection() {
|
||||
return driftDatabase(
|
||||
name: 'solar_network_data',
|
||||
native: const DriftNativeOptions(
|
||||
databaseDirectory: getApplicationSupportDirectory,
|
||||
),
|
||||
web: DriftWebOptions(
|
||||
sqlite3Wasm: Uri.parse('sqlite3.wasm'),
|
||||
driftWorker: Uri.parse('drift_worker.dart.js'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration {
|
||||
return MigrationStrategy(
|
||||
onUpgrade: stepByStep(from1To2: (m, schema) async {
|
||||
// Nothing else to do here
|
||||
}, from2To3: (m, schema) async {
|
||||
// Nothing else to do here, too
|
||||
}, from3To4: (m, schema) async {
|
||||
m.createTable(schema.snLocalRealm);
|
||||
m.createIndex(schema.idxRealmAccount);
|
||||
m.createIndex(schema.idxRealmAlias);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
4452
lib/database/database.g.dart
Normal file
657
lib/database/database.steps.dart
Normal file
@ -0,0 +1,657 @@
|
||||
// dart format width=80
|
||||
import 'package:drift/internal/versioned_schema.dart' as i0;
|
||||
import 'package:drift/drift.dart' as i1;
|
||||
import 'package:drift/drift.dart'; // ignore_for_file: type=lint,unused_import
|
||||
|
||||
// GENERATED BY drift_dev, DO NOT MODIFY.
|
||||
final class Schema2 extends i0.VersionedSchema {
|
||||
Schema2({required super.database}) : super(version: 2);
|
||||
@override
|
||||
late final List<i1.DatabaseSchemaEntity> entities = [
|
||||
snLocalChatChannel,
|
||||
snLocalChatMessage,
|
||||
snLocalKeyPair,
|
||||
];
|
||||
late final Shape0 snLocalChatChannel = Shape0(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_chat_channel',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_1,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape1 snLocalChatMessage = Shape1(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_chat_message',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_4,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape2 snLocalKeyPair = Shape2(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_key_pair',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [
|
||||
'PRIMARY KEY(id)',
|
||||
],
|
||||
columns: [
|
||||
_column_5,
|
||||
_column_6,
|
||||
_column_7,
|
||||
_column_8,
|
||||
_column_9,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
}
|
||||
|
||||
class Shape0 extends i0.VersionedTable {
|
||||
Shape0({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get alias =>
|
||||
columnsByName['alias']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<int> _column_0(String aliasedName) =>
|
||||
i1.GeneratedColumn<int>('id', aliasedName, false,
|
||||
hasAutoIncrement: true,
|
||||
type: i1.DriftSqlType.int,
|
||||
defaultConstraints:
|
||||
i1.GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
|
||||
i1.GeneratedColumn<String> _column_1(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('alias', aliasedName, false,
|
||||
type: i1.DriftSqlType.string);
|
||||
i1.GeneratedColumn<String> _column_2(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('content', aliasedName, false,
|
||||
type: i1.DriftSqlType.string);
|
||||
i1.GeneratedColumn<DateTime> _column_3(String aliasedName) =>
|
||||
i1.GeneratedColumn<DateTime>('created_at', aliasedName, false,
|
||||
type: i1.DriftSqlType.dateTime,
|
||||
defaultValue: const CustomExpression(
|
||||
'CAST(strftime(\'%s\', CURRENT_TIMESTAMP) AS INTEGER)'));
|
||||
|
||||
class Shape1 extends i0.VersionedTable {
|
||||
Shape1({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get channelId =>
|
||||
columnsByName['channel_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<int> _column_4(String aliasedName) =>
|
||||
i1.GeneratedColumn<int>('channel_id', aliasedName, false,
|
||||
type: i1.DriftSqlType.int);
|
||||
|
||||
class Shape2 extends i0.VersionedTable {
|
||||
Shape2({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<String> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<int> get accountId =>
|
||||
columnsByName['account_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get publicKey =>
|
||||
columnsByName['public_key']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get privateKey =>
|
||||
columnsByName['private_key']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<bool> get isActive =>
|
||||
columnsByName['is_active']! as i1.GeneratedColumn<bool>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<String> _column_5(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('id', aliasedName, false,
|
||||
type: i1.DriftSqlType.string);
|
||||
i1.GeneratedColumn<int> _column_6(String aliasedName) =>
|
||||
i1.GeneratedColumn<int>('account_id', aliasedName, false,
|
||||
type: i1.DriftSqlType.int);
|
||||
i1.GeneratedColumn<String> _column_7(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('public_key', aliasedName, false,
|
||||
type: i1.DriftSqlType.string);
|
||||
i1.GeneratedColumn<String> _column_8(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('private_key', aliasedName, true,
|
||||
type: i1.DriftSqlType.string);
|
||||
i1.GeneratedColumn<bool> _column_9(String aliasedName) =>
|
||||
i1.GeneratedColumn<bool>('is_active', aliasedName, false,
|
||||
type: i1.DriftSqlType.bool,
|
||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
||||
'CHECK ("is_active" IN (0, 1))'),
|
||||
defaultValue: const CustomExpression('0'));
|
||||
|
||||
final class Schema3 extends i0.VersionedSchema {
|
||||
Schema3({required super.database}) : super(version: 3);
|
||||
@override
|
||||
late final List<i1.DatabaseSchemaEntity> entities = [
|
||||
snLocalChatChannel,
|
||||
snLocalChatMessage,
|
||||
snLocalChannelMember,
|
||||
snLocalKeyPair,
|
||||
snLocalAccount,
|
||||
snLocalAttachment,
|
||||
snLocalSticker,
|
||||
snLocalStickerPack,
|
||||
idxChannelAlias,
|
||||
idxChatChannel,
|
||||
idxAccountName,
|
||||
idxAttachmentRid,
|
||||
idxAttachmentAccount,
|
||||
];
|
||||
late final Shape0 snLocalChatChannel = Shape0(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_chat_channel',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_1,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape3 snLocalChatMessage = Shape3(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_chat_message',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_4,
|
||||
_column_10,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape4 snLocalChannelMember = Shape4(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_channel_member',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_4,
|
||||
_column_6,
|
||||
_column_2,
|
||||
_column_3,
|
||||
_column_11,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape2 snLocalKeyPair = Shape2(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_key_pair',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [
|
||||
'PRIMARY KEY(id)',
|
||||
],
|
||||
columns: [
|
||||
_column_5,
|
||||
_column_6,
|
||||
_column_7,
|
||||
_column_8,
|
||||
_column_9,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape5 snLocalAccount = Shape5(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_account',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_12,
|
||||
_column_2,
|
||||
_column_3,
|
||||
_column_11,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape6 snLocalAttachment = Shape6(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_attachment',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_13,
|
||||
_column_14,
|
||||
_column_2,
|
||||
_column_6,
|
||||
_column_3,
|
||||
_column_11,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape7 snLocalSticker = Shape7(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_sticker',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_1,
|
||||
_column_15,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape8 snLocalStickerPack = Shape8(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_sticker_pack',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
final i1.Index idxChannelAlias = i1.Index('idx_channel_alias',
|
||||
'CREATE INDEX idx_channel_alias ON sn_local_chat_channel (alias)');
|
||||
final i1.Index idxChatChannel = i1.Index('idx_chat_channel',
|
||||
'CREATE INDEX idx_chat_channel ON sn_local_chat_message (channel_id)');
|
||||
final i1.Index idxAccountName = i1.Index('idx_account_name',
|
||||
'CREATE INDEX idx_account_name ON sn_local_account (name)');
|
||||
final i1.Index idxAttachmentRid = i1.Index('idx_attachment_rid',
|
||||
'CREATE INDEX idx_attachment_rid ON sn_local_attachment (rid)');
|
||||
final i1.Index idxAttachmentAccount = i1.Index('idx_attachment_account',
|
||||
'CREATE INDEX idx_attachment_account ON sn_local_attachment (account_id)');
|
||||
}
|
||||
|
||||
class Shape3 extends i0.VersionedTable {
|
||||
Shape3({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get channelId =>
|
||||
columnsByName['channel_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get senderId =>
|
||||
columnsByName['sender_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<int> _column_10(String aliasedName) =>
|
||||
i1.GeneratedColumn<int>('sender_id', aliasedName, true,
|
||||
type: i1.DriftSqlType.int);
|
||||
|
||||
class Shape4 extends i0.VersionedTable {
|
||||
Shape4({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get channelId =>
|
||||
columnsByName['channel_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get accountId =>
|
||||
columnsByName['account_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
i1.GeneratedColumn<DateTime> get cacheExpiredAt =>
|
||||
columnsByName['cache_expired_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<DateTime> _column_11(String aliasedName) =>
|
||||
i1.GeneratedColumn<DateTime>('cache_expired_at', aliasedName, false,
|
||||
type: i1.DriftSqlType.dateTime);
|
||||
|
||||
class Shape5 extends i0.VersionedTable {
|
||||
Shape5({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get name =>
|
||||
columnsByName['name']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
i1.GeneratedColumn<DateTime> get cacheExpiredAt =>
|
||||
columnsByName['cache_expired_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<String> _column_12(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('name', aliasedName, false,
|
||||
type: i1.DriftSqlType.string);
|
||||
|
||||
class Shape6 extends i0.VersionedTable {
|
||||
Shape6({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get rid =>
|
||||
columnsByName['rid']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get uuid =>
|
||||
columnsByName['uuid']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<int> get accountId =>
|
||||
columnsByName['account_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
i1.GeneratedColumn<DateTime> get cacheExpiredAt =>
|
||||
columnsByName['cache_expired_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<String> _column_13(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('rid', aliasedName, false,
|
||||
type: i1.DriftSqlType.string,
|
||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('UNIQUE'));
|
||||
i1.GeneratedColumn<String> _column_14(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('uuid', aliasedName, false,
|
||||
type: i1.DriftSqlType.string,
|
||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('UNIQUE'));
|
||||
|
||||
class Shape7 extends i0.VersionedTable {
|
||||
Shape7({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get alias =>
|
||||
columnsByName['alias']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get fullAlias =>
|
||||
columnsByName['full_alias']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<String> _column_15(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('full_alias', aliasedName, false,
|
||||
type: i1.DriftSqlType.string);
|
||||
|
||||
class Shape8 extends i0.VersionedTable {
|
||||
Shape8({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
final class Schema4 extends i0.VersionedSchema {
|
||||
Schema4({required super.database}) : super(version: 4);
|
||||
@override
|
||||
late final List<i1.DatabaseSchemaEntity> entities = [
|
||||
snLocalChatChannel,
|
||||
snLocalChatMessage,
|
||||
snLocalChannelMember,
|
||||
snLocalKeyPair,
|
||||
snLocalAccount,
|
||||
snLocalAttachment,
|
||||
snLocalSticker,
|
||||
snLocalStickerPack,
|
||||
snLocalRealm,
|
||||
idxChannelAlias,
|
||||
idxChatChannel,
|
||||
idxAccountName,
|
||||
idxAttachmentRid,
|
||||
idxAttachmentAccount,
|
||||
idxRealmAlias,
|
||||
idxRealmAccount,
|
||||
];
|
||||
late final Shape0 snLocalChatChannel = Shape0(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_chat_channel',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_1,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape3 snLocalChatMessage = Shape3(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_chat_message',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_4,
|
||||
_column_10,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape4 snLocalChannelMember = Shape4(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_channel_member',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_4,
|
||||
_column_6,
|
||||
_column_2,
|
||||
_column_3,
|
||||
_column_11,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape2 snLocalKeyPair = Shape2(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_key_pair',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [
|
||||
'PRIMARY KEY(id)',
|
||||
],
|
||||
columns: [
|
||||
_column_5,
|
||||
_column_6,
|
||||
_column_7,
|
||||
_column_8,
|
||||
_column_9,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape5 snLocalAccount = Shape5(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_account',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_12,
|
||||
_column_2,
|
||||
_column_3,
|
||||
_column_11,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape6 snLocalAttachment = Shape6(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_attachment',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_13,
|
||||
_column_14,
|
||||
_column_2,
|
||||
_column_6,
|
||||
_column_3,
|
||||
_column_11,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape7 snLocalSticker = Shape7(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_sticker',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_1,
|
||||
_column_15,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape8 snLocalStickerPack = Shape8(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_sticker_pack',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_2,
|
||||
_column_3,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
late final Shape9 snLocalRealm = Shape9(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'sn_local_realm',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_16,
|
||||
_column_2,
|
||||
_column_6,
|
||||
_column_3,
|
||||
_column_11,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null);
|
||||
final i1.Index idxChannelAlias = i1.Index('idx_channel_alias',
|
||||
'CREATE INDEX idx_channel_alias ON sn_local_chat_channel (alias)');
|
||||
final i1.Index idxChatChannel = i1.Index('idx_chat_channel',
|
||||
'CREATE INDEX idx_chat_channel ON sn_local_chat_message (channel_id)');
|
||||
final i1.Index idxAccountName = i1.Index('idx_account_name',
|
||||
'CREATE INDEX idx_account_name ON sn_local_account (name)');
|
||||
final i1.Index idxAttachmentRid = i1.Index('idx_attachment_rid',
|
||||
'CREATE INDEX idx_attachment_rid ON sn_local_attachment (rid)');
|
||||
final i1.Index idxAttachmentAccount = i1.Index('idx_attachment_account',
|
||||
'CREATE INDEX idx_attachment_account ON sn_local_attachment (account_id)');
|
||||
final i1.Index idxRealmAlias = i1.Index('idx_realm_alias',
|
||||
'CREATE INDEX idx_realm_alias ON sn_local_realm (alias)');
|
||||
final i1.Index idxRealmAccount = i1.Index('idx_realm_account',
|
||||
'CREATE INDEX idx_realm_account ON sn_local_realm (account_id)');
|
||||
}
|
||||
|
||||
class Shape9 extends i0.VersionedTable {
|
||||
Shape9({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<int> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get alias =>
|
||||
columnsByName['alias']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get content =>
|
||||
columnsByName['content']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<int> get accountId =>
|
||||
columnsByName['account_id']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||
i1.GeneratedColumn<DateTime> get cacheExpiredAt =>
|
||||
columnsByName['cache_expired_at']! as i1.GeneratedColumn<DateTime>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<String> _column_16(String aliasedName) =>
|
||||
i1.GeneratedColumn<String>('alias', aliasedName, false,
|
||||
type: i1.DriftSqlType.string,
|
||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('UNIQUE'));
|
||||
i0.MigrationStepWithVersion migrationSteps({
|
||||
required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
|
||||
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
|
||||
required Future<void> Function(i1.Migrator m, Schema4 schema) from3To4,
|
||||
}) {
|
||||
return (currentVersion, database) async {
|
||||
switch (currentVersion) {
|
||||
case 1:
|
||||
final schema = Schema2(database: database);
|
||||
final migrator = i1.Migrator(database, schema);
|
||||
await from1To2(migrator, schema);
|
||||
return 2;
|
||||
case 2:
|
||||
final schema = Schema3(database: database);
|
||||
final migrator = i1.Migrator(database, schema);
|
||||
await from2To3(migrator, schema);
|
||||
return 3;
|
||||
case 3:
|
||||
final schema = Schema4(database: database);
|
||||
final migrator = i1.Migrator(database, schema);
|
||||
await from3To4(migrator, schema);
|
||||
return 4;
|
||||
default:
|
||||
throw ArgumentError.value('Unknown migration from $currentVersion');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
i1.OnUpgrade stepByStep({
|
||||
required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
|
||||
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
|
||||
required Future<void> Function(i1.Migrator m, Schema4 schema) from3To4,
|
||||
}) =>
|
||||
i0.VersionedSchema.stepByStepHelper(
|
||||
step: migrationSteps(
|
||||
from1To2: from1To2,
|
||||
from2To3: from2To3,
|
||||
from3To4: from3To4,
|
||||
));
|
8
lib/database/drift_worker.dart
Normal file
@ -0,0 +1,8 @@
|
||||
import 'package:drift/wasm.dart';
|
||||
|
||||
// Use `dart compile js -O4 ./drift_worker.dart` to compile this file.
|
||||
// And place it in the web/ directory.
|
||||
|
||||
// When compiled with dart2js, this file defines a dedicated or shared web
|
||||
// worker used by drift.
|
||||
void main() => WasmDatabase.workerMainForOpen();
|
16
lib/database/keypair.dart
Normal file
@ -0,0 +1,16 @@
|
||||
import 'package:drift/drift.dart';
|
||||
|
||||
class SnLocalKeyPair extends Table {
|
||||
TextColumn get id => text()();
|
||||
|
||||
IntColumn get accountId => integer()();
|
||||
|
||||
TextColumn get publicKey => text()();
|
||||
|
||||
TextColumn get privateKey => text().nullable()();
|
||||
|
||||
BoolColumn get isActive => boolean().withDefault(Constant(false))();
|
||||
|
||||
@override
|
||||
Set<Column<Object>> get primaryKey => {id};
|
||||
}
|
45
lib/database/realm.dart
Normal file
@ -0,0 +1,45 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:surface/types/realm.dart';
|
||||
|
||||
class SnRealmConverter extends TypeConverter<SnRealm, String>
|
||||
with JsonTypeConverter2<SnRealm, String, Map<String, Object?>> {
|
||||
const SnRealmConverter();
|
||||
|
||||
@override
|
||||
SnRealm fromSql(String fromDb) {
|
||||
return fromJson(jsonDecode(fromDb) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(SnRealm value) {
|
||||
return jsonEncode(toJson(value));
|
||||
}
|
||||
|
||||
@override
|
||||
SnRealm fromJson(Map<String, Object?> json) {
|
||||
return SnRealm.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Object?> toJson(SnRealm value) {
|
||||
return value.toJson();
|
||||
}
|
||||
}
|
||||
|
||||
@TableIndex(name: 'idx_realm_alias', columns: {#alias})
|
||||
@TableIndex(name: 'idx_realm_account', columns: {#accountId})
|
||||
class SnLocalRealm extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
TextColumn get alias => text().unique()();
|
||||
|
||||
TextColumn get content => text().map(const SnRealmConverter())();
|
||||
|
||||
IntColumn get accountId => integer()();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
||||
|
||||
DateTimeColumn get cacheExpiredAt => dateTime()();
|
||||
}
|
74
lib/database/sticker.dart
Normal file
@ -0,0 +1,74 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:surface/types/attachment.dart';
|
||||
|
||||
class SnStickerConverter extends TypeConverter<SnSticker, String>
|
||||
with JsonTypeConverter2<SnSticker, String, Map<String, Object?>> {
|
||||
const SnStickerConverter();
|
||||
|
||||
@override
|
||||
SnSticker fromSql(String fromDb) {
|
||||
return fromJson(jsonDecode(fromDb) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(SnSticker value) {
|
||||
return jsonEncode(toJson(value));
|
||||
}
|
||||
|
||||
@override
|
||||
SnSticker fromJson(Map<String, Object?> json) {
|
||||
return SnSticker.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Object?> toJson(SnSticker value) {
|
||||
return value.toJson();
|
||||
}
|
||||
}
|
||||
|
||||
class SnLocalSticker extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
TextColumn get alias => text()();
|
||||
|
||||
TextColumn get fullAlias => text()();
|
||||
|
||||
TextColumn get content => text().map(const SnStickerConverter())();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
||||
}
|
||||
|
||||
class SnStickerPackConverter extends TypeConverter<SnStickerPack, String>
|
||||
with JsonTypeConverter2<SnStickerPack, String, Map<String, Object?>> {
|
||||
const SnStickerPackConverter();
|
||||
|
||||
@override
|
||||
SnStickerPack fromSql(String fromDb) {
|
||||
return fromJson(jsonDecode(fromDb) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(SnStickerPack value) {
|
||||
return jsonEncode(toJson(value));
|
||||
}
|
||||
|
||||
@override
|
||||
SnStickerPack fromJson(Map<String, Object?> json) {
|
||||
return SnStickerPack.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Object?> toJson(SnStickerPack value) {
|
||||
return value.toJson();
|
||||
}
|
||||
}
|
||||
|
||||
class SnLocalStickerPack extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
TextColumn get content => text().map(const SnStickerPackConverter())();
|
||||
|
||||
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
||||
}
|
10
lib/logger.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'package:talker/talker.dart';
|
||||
|
||||
final logging = Talker(
|
||||
settings: TalkerSettings(
|
||||
enabled: true,
|
||||
useHistory: true,
|
||||
maxHistoryItems: 1000,
|
||||
useConsoleLogs: true,
|
||||
),
|
||||
);
|
630
lib/main.dart
@ -1,7 +1,9 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
import 'package:bitsdojo_window/bitsdojo_window.dart';
|
||||
import 'package:croppy/croppy.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
@ -10,9 +12,11 @@ import 'package:easy_localization_loader/easy_localization_loader.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hotkey_manager/hotkey_manager.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:relative_time/relative_time.dart';
|
||||
@ -20,9 +24,12 @@ import 'package:responsive_framework/responsive_framework.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:surface/firebase_options.dart';
|
||||
import 'package:surface/logger.dart';
|
||||
import 'package:surface/providers/channel.dart';
|
||||
import 'package:surface/providers/chat_call.dart';
|
||||
import 'package:surface/providers/config.dart';
|
||||
import 'package:surface/providers/database.dart';
|
||||
import 'package:surface/providers/keypair.dart';
|
||||
import 'package:surface/providers/link_preview.dart';
|
||||
import 'package:surface/providers/navigation.dart';
|
||||
import 'package:surface/providers/notification.dart';
|
||||
@ -30,20 +37,29 @@ import 'package:surface/providers/post.dart';
|
||||
import 'package:surface/providers/relationship.dart';
|
||||
import 'package:surface/providers/sn_attachment.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/providers/sn_realm.dart';
|
||||
import 'package:surface/providers/sn_sticker.dart';
|
||||
import 'package:surface/providers/special_day.dart';
|
||||
import 'package:surface/providers/theme.dart';
|
||||
import 'package:surface/providers/translation.dart';
|
||||
import 'package:surface/providers/user_directory.dart';
|
||||
import 'package:surface/providers/userinfo.dart';
|
||||
import 'package:surface/providers/websocket.dart';
|
||||
import 'package:surface/providers/widget.dart';
|
||||
import 'package:surface/router.dart';
|
||||
import 'package:surface/types/chat.dart';
|
||||
import 'package:surface/types/realm.dart';
|
||||
import 'package:flutter_web_plugins/url_strategy.dart' show usePathUrlStrategy;
|
||||
import 'package:surface/widgets/dialog.dart';
|
||||
import 'package:surface/widgets/menu_bar.dart';
|
||||
import 'package:surface/widgets/navigation/app_scaffold.dart';
|
||||
import 'package:surface/widgets/version_label.dart';
|
||||
import 'package:tray_manager/tray_manager.dart';
|
||||
import 'package:version/version.dart';
|
||||
import 'package:workmanager/workmanager.dart';
|
||||
import 'package:in_app_review/in_app_review.dart';
|
||||
import 'package:image_picker_android/image_picker_android.dart';
|
||||
import 'package:image_picker_platform_interface/image_picker_platform_interface.dart';
|
||||
import 'package:local_notifier/local_notifier.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
|
||||
@pragma('vm:entry-point')
|
||||
void appBackgroundDispatcher() {
|
||||
@ -62,37 +78,58 @@ void appBackgroundDispatcher() {
|
||||
});
|
||||
}
|
||||
|
||||
// Desktop size tools
|
||||
|
||||
Future<Size> _getSavedWindowSize() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
String? sizeString = prefs.getString(kAppWindowSize);
|
||||
|
||||
if (sizeString != null) {
|
||||
List<String> parts = sizeString.split('x');
|
||||
if (parts.length == 2) {
|
||||
double? width = double.tryParse(parts[0]);
|
||||
double? height = double.tryParse(parts[1]);
|
||||
if (width != null && height != null) {
|
||||
return Size(width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return const Size(1280, 720); // Default size
|
||||
}
|
||||
|
||||
Future<void> _saveWindowSize() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final size = appWindow.size;
|
||||
await prefs.setString(kAppWindowSize, '${size.width}x${size.height}');
|
||||
}
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await EasyLocalization.ensureInitialized();
|
||||
|
||||
await Hive.initFlutter();
|
||||
Hive.registerAdapter(SnChannelImplAdapter());
|
||||
Hive.registerAdapter(SnRealmImplAdapter());
|
||||
Hive.registerAdapter(SnChannelMemberImplAdapter());
|
||||
Hive.registerAdapter(SnChatMessageImplAdapter());
|
||||
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
|
||||
GoRouter.optionURLReflectsImperativeAPIs = true;
|
||||
usePathUrlStrategy();
|
||||
|
||||
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
||||
final Size savedSize = await _getSavedWindowSize();
|
||||
doWhenWindowReady(() {
|
||||
appWindow.minSize = Size(480, 640);
|
||||
appWindow.size = Size(1280, 720);
|
||||
appWindow.size = savedSize;
|
||||
appWindow.alignment = Alignment.center;
|
||||
appWindow.show();
|
||||
});
|
||||
}
|
||||
|
||||
await EasyLocalization.ensureInitialized();
|
||||
|
||||
if (!kIsWeb && !Platform.isLinux) {
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform);
|
||||
}
|
||||
|
||||
GoRouter.optionURLReflectsImperativeAPIs = true;
|
||||
usePathUrlStrategy();
|
||||
|
||||
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
|
||||
Workmanager().initialize(
|
||||
appBackgroundDispatcher,
|
||||
isInDebugMode: kDebugMode,
|
||||
);
|
||||
Workmanager()
|
||||
.initialize(appBackgroundDispatcher, isInDebugMode: kDebugMode);
|
||||
if (Platform.isAndroid) {
|
||||
Workmanager().registerPeriodicTask(
|
||||
"widget-update-random-post",
|
||||
@ -104,6 +141,14 @@ void main() async {
|
||||
}
|
||||
}
|
||||
|
||||
if (!kIsWeb && Platform.isAndroid) {
|
||||
final ImagePickerPlatform imagePickerImplementation =
|
||||
ImagePickerPlatform.instance;
|
||||
if (imagePickerImplementation is ImagePickerAndroid) {
|
||||
imagePickerImplementation.useAndroidPhotoPicker = true;
|
||||
}
|
||||
}
|
||||
|
||||
runApp(const SolianApp());
|
||||
}
|
||||
|
||||
@ -119,13 +164,16 @@ class SolianApp extends StatelessWidget {
|
||||
Locale('en', 'US'),
|
||||
Locale('zh', 'CN'),
|
||||
Locale('zh', 'TW'),
|
||||
Locale('zh', 'HK'),
|
||||
Locale('zh', 'HK')
|
||||
],
|
||||
fallbackLocale: Locale('en', 'US'),
|
||||
useFallbackTranslations: true,
|
||||
assetLoader: JsonAssetLoader(),
|
||||
child: MultiProvider(
|
||||
providers: [
|
||||
// Infrastructure layer
|
||||
Provider(create: (ctx) => DatabaseProvider(ctx)),
|
||||
|
||||
// System extensions layer
|
||||
Provider(create: (ctx) => HomeWidgetProvider(ctx)),
|
||||
|
||||
@ -140,21 +188,28 @@ class SolianApp extends StatelessWidget {
|
||||
Provider(create: (ctx) => SnNetworkProvider(ctx)),
|
||||
Provider(create: (ctx) => UserDirectoryProvider(ctx)),
|
||||
Provider(create: (ctx) => SnAttachmentProvider(ctx)),
|
||||
ChangeNotifierProvider(create: (ctx) => SnRealmProvider(ctx)),
|
||||
Provider(create: (ctx) => SnPostContentProvider(ctx)),
|
||||
Provider(create: (ctx) => SnRelationshipProvider(ctx)),
|
||||
Provider(create: (ctx) => SnLinkPreviewProvider(ctx)),
|
||||
Provider(create: (ctx) => SnStickerProvider(ctx)),
|
||||
ChangeNotifierProvider(create: (ctx) => UserProvider(ctx)),
|
||||
ChangeNotifierProvider(create: (ctx) => WebSocketProvider(ctx)),
|
||||
Provider(create: (ctx) => KeyPairProvider(ctx)),
|
||||
ChangeNotifierProvider(create: (ctx) => NotificationProvider(ctx)),
|
||||
ChangeNotifierProvider(create: (ctx) => ChatChannelProvider(ctx)),
|
||||
ChangeNotifierProvider(create: (ctx) => ChatCallProvider(ctx)),
|
||||
Provider(create: (ctx) => SnTranslator()),
|
||||
|
||||
// Additional helper layer
|
||||
Provider(create: (ctx) => SpecialDayProvider(ctx)),
|
||||
],
|
||||
child: _AppDelegate(),
|
||||
),
|
||||
),
|
||||
breakpoints: [
|
||||
const Breakpoint(start: 0, end: 450, name: MOBILE),
|
||||
const Breakpoint(start: 451, end: 800, name: TABLET),
|
||||
const Breakpoint(start: 0, end: 600, name: MOBILE),
|
||||
const Breakpoint(start: 601, end: 800, name: TABLET),
|
||||
const Breakpoint(start: 801, end: 1920, name: DESKTOP),
|
||||
],
|
||||
);
|
||||
@ -203,22 +258,25 @@ class _AppSplashScreen extends StatefulWidget {
|
||||
State<_AppSplashScreen> createState() => _AppSplashScreenState();
|
||||
}
|
||||
|
||||
class _AppSplashScreenState extends State<_AppSplashScreen> {
|
||||
bool _isReady = false;
|
||||
class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
|
||||
bool _isBusy = false;
|
||||
double _initPercentage = 0;
|
||||
String _phaseText = 'appInitStarting';
|
||||
|
||||
void _tryRequestRating() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
if (prefs.containsKey('first_boot_time')) {
|
||||
final rawTime = prefs.getString('first_boot_time');
|
||||
final time = DateTime.tryParse(rawTime ?? '');
|
||||
if (time != null && time.isBefore(DateTime.now().subtract(const Duration(days: 3)))) {
|
||||
if (time != null &&
|
||||
time.isBefore(DateTime.now().subtract(const Duration(days: 3)))) {
|
||||
final inAppReview = InAppReview.instance;
|
||||
if (prefs.getBool('rating_requested') == true) return;
|
||||
if (await inAppReview.isAvailable()) {
|
||||
await inAppReview.requestReview();
|
||||
prefs.setBool('rating_requested', true);
|
||||
} else {
|
||||
log('Unable request app review, unavailable');
|
||||
logging.error('Unable request app review, unavailable');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -234,51 +292,103 @@ class _AppSplashScreenState extends State<_AppSplashScreen> {
|
||||
final resp = await Dio(
|
||||
BaseOptions(
|
||||
sendTimeout: const Duration(seconds: 60),
|
||||
receiveTimeout: const Duration(seconds: 60),
|
||||
),
|
||||
receiveTimeout: const Duration(seconds: 60)),
|
||||
).get(
|
||||
'https://git.solsynth.dev/api/v1/repos/HyperNet/Surface/tags?page=1&limit=1',
|
||||
);
|
||||
final remoteVersionString = (resp.data as List).firstOrNull?['name'] ?? '0.0.0+0';
|
||||
'https://api.github.com/repos/Solsynth/HyperNet.Surface/releases/latest');
|
||||
final remoteVersionString = resp.data?['tag_name'] ?? '0.0.0+0';
|
||||
final remoteVersion = Version.parse(remoteVersionString.split('+').first);
|
||||
final localVersion = Version.parse(localVersionString.split('+').first);
|
||||
final remoteBuildNumber = int.tryParse(remoteVersionString.split('+').last) ?? 0;
|
||||
final localBuildNumber = int.tryParse(localVersionString.split('+').last) ?? 0;
|
||||
log("[Update] Local: $localVersionString, Remote: $remoteVersionString");
|
||||
if ((remoteVersion > localVersion || remoteBuildNumber > localBuildNumber) && mounted) {
|
||||
final remoteBuildNumber =
|
||||
int.tryParse(remoteVersionString.split('+').last) ?? 0;
|
||||
final localBuildNumber =
|
||||
int.tryParse(localVersionString.split('+').last) ?? 0;
|
||||
logging.info(
|
||||
"[Update] Local: $localVersionString, Remote: $remoteVersionString");
|
||||
if ((remoteVersion > localVersion ||
|
||||
remoteBuildNumber > localBuildNumber) &&
|
||||
mounted) {
|
||||
final config = context.read<ConfigProvider>();
|
||||
config.setUpdate(remoteVersionString);
|
||||
log("[Update] Update available: $remoteVersionString");
|
||||
config.setUpdate(
|
||||
remoteVersionString, resp.data?['body'] ?? 'No changelog');
|
||||
logging.info("[Update] Update available: $remoteVersionString");
|
||||
}
|
||||
} catch (e) {
|
||||
logging.error('[Error] Unable to check update...', e);
|
||||
if (mounted) context.showErrorDialog('Unable to check update: $e');
|
||||
}
|
||||
}
|
||||
|
||||
void _setPhaseText(String text) {
|
||||
_phaseText = 'appInit${text.capitalize()}'.tr();
|
||||
if (mounted) setState(() {});
|
||||
}
|
||||
|
||||
Future<void> _initialize() async {
|
||||
try {
|
||||
final cfg = context.read<ConfigProvider>();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
cfg.calcDrawerSize(context);
|
||||
});
|
||||
final home = context.read<HomeWidgetProvider>();
|
||||
await home.initialize();
|
||||
if (!mounted) return;
|
||||
// The Network initialization must be done after the HomeWidget initialization
|
||||
// The Network initialization will save the server url to the HomeWidget
|
||||
// The Network initialization will also save initialize the Config, so it not need to be initialized again
|
||||
_initPercentage = 0.1;
|
||||
_setPhaseText('network');
|
||||
final sn = context.read<SnNetworkProvider>();
|
||||
await sn.initializeUserAgent();
|
||||
await sn.setConfigWithNative();
|
||||
if (!mounted) return;
|
||||
_initPercentage = 0.2;
|
||||
_setPhaseText('userdata');
|
||||
final ua = context.read<UserProvider>();
|
||||
await ua.initialize();
|
||||
if (!mounted) return;
|
||||
_initPercentage = 0.3;
|
||||
_setPhaseText('websocket');
|
||||
final ws = context.read<WebSocketProvider>();
|
||||
await ws.tryConnect();
|
||||
try {
|
||||
if (!mounted) return;
|
||||
_initPercentage = 0.9;
|
||||
_setPhaseText('keyPair');
|
||||
final kp = context.read<KeyPairProvider>();
|
||||
kp.reloadActive();
|
||||
kp.listen();
|
||||
} catch (_) {}
|
||||
if (ua.isAuthorized) {
|
||||
if (!mounted) return;
|
||||
_setPhaseText('notification');
|
||||
final notify = context.read<NotificationProvider>();
|
||||
await notify.registerPushNotifications();
|
||||
notify.listen();
|
||||
try {
|
||||
notify.registerPushNotifications();
|
||||
if (!mounted) return;
|
||||
_setPhaseText('stickers');
|
||||
final sticker = context.read<SnStickerProvider>();
|
||||
await sticker.listSticker();
|
||||
if (!mounted) return;
|
||||
_setPhaseText('userDirectory');
|
||||
final ud = context.read<UserDirectoryProvider>();
|
||||
await ud.loadAccountCache();
|
||||
if (!mounted) return;
|
||||
_setPhaseText('realm');
|
||||
final rm = context.read<SnRealmProvider>();
|
||||
await rm.refreshAvailableRealms();
|
||||
if (!mounted) return;
|
||||
_setPhaseText('chat');
|
||||
final ct = context.read<ChatChannelProvider>();
|
||||
await ct.refreshAvailableChannels();
|
||||
_initPercentage = 1;
|
||||
_setPhaseText('done');
|
||||
} catch (_) {}
|
||||
_playIntro();
|
||||
}
|
||||
} catch (err) {
|
||||
if (!mounted) return;
|
||||
await context.showErrorDialog(err);
|
||||
} finally {
|
||||
setState(() => _isReady = true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,44 +396,436 @@ class _AppSplashScreenState extends State<_AppSplashScreen> {
|
||||
await widgetUpdateRandomPost();
|
||||
}
|
||||
|
||||
Future<void> _hotkeyInitialization() async {
|
||||
if (kIsWeb) return;
|
||||
// The quit key has been removed, and the logic of the quit key is moved to system menu bar activator.
|
||||
}
|
||||
|
||||
void _playIntro() async {
|
||||
final cfg = context.read<ConfigProvider>();
|
||||
if (!cfg.soundEffects) return;
|
||||
|
||||
final date = DateTime.now();
|
||||
final player = AudioPlayer(playerId: 'launch-done-player');
|
||||
await player.play(
|
||||
(cfg.aprilFoolFeatures && date.month == 4 && date.day == 1)
|
||||
? AssetSource('audio/sfx/launch-intro.mp3')
|
||||
: AssetSource('audio/sfx/launch-done.mp3'),
|
||||
volume: 0.8,
|
||||
ctx: AudioContext(
|
||||
android: AudioContextAndroid(
|
||||
contentType: AndroidContentType.sonification,
|
||||
usageType: AndroidUsageType.notificationEvent,
|
||||
),
|
||||
iOS: AudioContextIOS(category: AVAudioSessionCategory.ambient),
|
||||
),
|
||||
mode: PlayerMode.lowLatency,
|
||||
);
|
||||
player.onPlayerComplete.listen((_) {
|
||||
player.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
final Menu _appTrayMenu = Menu(
|
||||
items: [
|
||||
MenuItem(key: 'version_label', label: 'Solian', disabled: true),
|
||||
MenuItem.separator(),
|
||||
MenuItem.checkbox(
|
||||
checked: false,
|
||||
key: 'mute_notification',
|
||||
label: 'trayMenuMuteNotification'.tr()),
|
||||
MenuItem.separator(),
|
||||
MenuItem(key: 'window_show', label: 'trayMenuShow'.tr()),
|
||||
MenuItem(key: 'exit', label: 'trayMenuExit'.tr()),
|
||||
],
|
||||
);
|
||||
|
||||
Future<void> _trayInitialization() async {
|
||||
if (kIsWeb || Platform.isAndroid || Platform.isIOS) return;
|
||||
|
||||
final icon = Platform.isWindows
|
||||
? 'assets/icon/tray-icon.ico'
|
||||
: 'assets/icon/tray-icon.png';
|
||||
final appVersion = await PackageInfo.fromPlatform();
|
||||
|
||||
trayManager.addListener(this);
|
||||
await trayManager.setIcon(icon);
|
||||
|
||||
_appTrayMenu.items![0] = MenuItem(
|
||||
key: 'version_label',
|
||||
label: 'Solian ${appVersion.version}+${appVersion.buildNumber}',
|
||||
disabled: true,
|
||||
);
|
||||
|
||||
await trayManager.setContextMenu(_appTrayMenu);
|
||||
}
|
||||
|
||||
Future<void> _notifyInitialization() async {
|
||||
if (kIsWeb || Platform.isAndroid || Platform.isIOS) return;
|
||||
|
||||
await localNotifier.setup(
|
||||
appName: 'Solian', shortcutPolicy: ShortcutPolicy.requireCreate);
|
||||
}
|
||||
|
||||
AppLifecycleListener? _appLifecycleListener;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_isBusy = true;
|
||||
if (!kIsWeb && !(Platform.isIOS || Platform.isAndroid)) {
|
||||
_appLifecycleListener =
|
||||
AppLifecycleListener(onExitRequested: _onExitRequested);
|
||||
}
|
||||
|
||||
try {
|
||||
_trayInitialization();
|
||||
_hotkeyInitialization();
|
||||
_notifyInitialization();
|
||||
_initialize().then((_) {
|
||||
_postInitialization();
|
||||
_tryRequestRating();
|
||||
_checkForUpdate();
|
||||
setState(() => _isBusy = false);
|
||||
}).catchError((err) {
|
||||
logging.error('[Bootstrap] Unable to initialize app', err);
|
||||
setState(() => _isBusy = false);
|
||||
});
|
||||
} catch (err) {
|
||||
logging.error('[Bootstrap] Unable to initialize (pre-stage) app', err);
|
||||
}
|
||||
}
|
||||
|
||||
Future<AppExitResponse> _onExitRequested() async {
|
||||
appWindow.hide();
|
||||
return AppExitResponse.cancel;
|
||||
}
|
||||
|
||||
void _quitApp() {
|
||||
_saveWindowSize();
|
||||
_appLifecycleListener?.dispose();
|
||||
if (Platform.isWindows) {
|
||||
appWindow.close();
|
||||
} else {
|
||||
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onTrayIconMouseDown() {
|
||||
if (Platform.isWindows) {
|
||||
context.read<NotificationProvider>().clearTray();
|
||||
appWindow.show();
|
||||
} else {
|
||||
trayManager.popUpContextMenu();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onTrayIconRightMouseDown() {
|
||||
if (Platform.isWindows) {
|
||||
trayManager.popUpContextMenu();
|
||||
} else {
|
||||
context.read<NotificationProvider>().clearTray();
|
||||
appWindow.show();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onTrayMenuItemClick(MenuItem menuItem) {
|
||||
switch (menuItem.key) {
|
||||
case 'mute_notification':
|
||||
final nty = context.read<NotificationProvider>();
|
||||
nty.isMuted = !nty.isMuted;
|
||||
_appTrayMenu.items![2].checked = nty.isMuted;
|
||||
trayManager.setContextMenu(_appTrayMenu);
|
||||
break;
|
||||
case 'window_show':
|
||||
// To prevent the window from being hide after just show on macOS
|
||||
Timer(const Duration(milliseconds: 100), () => appWindow.show());
|
||||
break;
|
||||
case 'exit':
|
||||
_quitApp();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (!kIsWeb && !(Platform.isAndroid || Platform.isIOS)) {
|
||||
trayManager.removeListener(this);
|
||||
hotKeyManager.unregisterAll();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!_isReady) {
|
||||
return Scaffold(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Container(
|
||||
constraints: const BoxConstraints(maxWidth: 180),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (MediaQuery.of(context).platformBrightness == Brightness.dark)
|
||||
Image.asset("assets/icon/icon-dark.png", width: 64, height: 64)
|
||||
else
|
||||
Image.asset("assets/icon/icon.png", width: 64, height: 64),
|
||||
const Gap(6),
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
|
||||
final cfg = context.read<ConfigProvider>();
|
||||
return AppSystemMenuBar(
|
||||
onQuit: _quitApp,
|
||||
child: NotificationListener<SizeChangedLayoutNotification>(
|
||||
onNotification: (notification) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
cfg.calcDrawerSize(context);
|
||||
});
|
||||
return false;
|
||||
},
|
||||
child: OrientationBuilder(
|
||||
builder: (context, orientation) {
|
||||
final cfg = context.read<ConfigProvider>();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
cfg.calcDrawerSize(context);
|
||||
});
|
||||
Future.delayed(const Duration(milliseconds: 300), () {
|
||||
if (context.mounted) {
|
||||
cfg.calcDrawerSize(context);
|
||||
}
|
||||
});
|
||||
return SizeChangedLayoutNotifier(
|
||||
child: _isBusy
|
||||
? _AppLoadingScreen(
|
||||
isBusy: _isBusy,
|
||||
initPercentage: _initPercentage,
|
||||
phaseText: _phaseText,
|
||||
)
|
||||
: widget.child,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _AppLoadingScreen extends StatelessWidget {
|
||||
const _AppLoadingScreen({
|
||||
required this.isBusy,
|
||||
required this.initPercentage,
|
||||
required this.phaseText,
|
||||
});
|
||||
|
||||
final bool isBusy;
|
||||
final double initPercentage;
|
||||
final String phaseText;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (ResponsiveScaffold.getIsExpand(context)) {
|
||||
return Material(
|
||||
key: Key('app-splash-screen-$isBusy'),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/icon/kanban-1st.jpg'),
|
||||
fit: BoxFit.cover,
|
||||
opacity: 0.1,
|
||||
),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
backgroundBlendMode: BlendMode.darken,
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TweenAnimationBuilder<double>(
|
||||
tween: Tween(begin: 0, end: initPercentage),
|
||||
duration: Duration(milliseconds: 300),
|
||||
builder: (context, value, _) => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('${(value * 100).toStringAsFixed(0)}%')
|
||||
.padding(left: 32, bottom: 4),
|
||||
LinearProgressIndicator(
|
||||
value: value,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(0),
|
||||
),
|
||||
stopIndicatorColor: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
const Gap(24),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: TweenAnimationBuilder<double>(
|
||||
tween: Tween(begin: 0, end: initPercentage),
|
||||
duration: Duration(milliseconds: 300),
|
||||
builder: (context, value, _) => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text('${(value * 100).toStringAsFixed(0)}%')
|
||||
.padding(right: 32, bottom: 4),
|
||||
Transform.flip(
|
||||
flipX: true,
|
||||
child: LinearProgressIndicator(
|
||||
value: value,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(0),
|
||||
),
|
||||
stopIndicatorColor: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
),
|
||||
const Gap(24),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(maxWidth: 240, minWidth: 160),
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
Theme.of(context).colorScheme.surface.withOpacity(0.85),
|
||||
border: Border.all(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 3,
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'splashScreenServer',
|
||||
style: GoogleFonts.notoSerifHk(height: 1, fontSize: 11),
|
||||
textAlign: TextAlign.center,
|
||||
).tr().opacity(0.85),
|
||||
Text(
|
||||
'splashScreenServerName',
|
||||
style: GoogleFonts.notoSerifHk(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
).tr().opacity(0.85),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
text: '#',
|
||||
style: GoogleFonts.notoSerifHk(),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '0',
|
||||
style: GoogleFonts.notoSerifHk(
|
||||
fontSize: 80,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
).padding(vertical: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: MediaQuery.of(context).size.height * 0.2,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
phaseText,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
AnimateWidgetExtensions(Text(
|
||||
'splashScreenCaption',
|
||||
textAlign: TextAlign.center,
|
||||
).tr())
|
||||
.animate(onPlay: (e) => e.repeat())
|
||||
.fadeIn(duration: 500.ms, curve: Curves.easeOut)
|
||||
.then()
|
||||
.fadeOut(
|
||||
duration: 500.ms,
|
||||
delay: 1000.ms,
|
||||
curve: Curves.easeIn,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 8,
|
||||
left: 16,
|
||||
right: 16,
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/icon/icon.png',
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
).padding(all: 4),
|
||||
const Gap(4),
|
||||
Text('Solar Network').bold(),
|
||||
Expanded(child: const SizedBox()),
|
||||
AppVersionLabel(),
|
||||
const Gap(12),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
Text('appInitializing'.tr(), textAlign: TextAlign.center),
|
||||
AppVersionLabel(),
|
||||
],
|
||||
),
|
||||
).center(),
|
||||
);
|
||||
}
|
||||
|
||||
return widget.child;
|
||||
return Material(
|
||||
key: Key('app-splash-screen-$isBusy'),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/icon/kanban-1st.jpg'),
|
||||
fit: BoxFit.cover,
|
||||
opacity: 0.1,
|
||||
),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
backgroundBlendMode: BlendMode.darken,
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(maxWidth: 240),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/icon/icon.png',
|
||||
width: 64,
|
||||
height: 64,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
Text('Solar Network').bold(),
|
||||
AppVersionLabel(),
|
||||
Gap(8),
|
||||
Text(phaseText, textAlign: TextAlign.center),
|
||||
Gap(16),
|
||||
TweenAnimationBuilder<double>(
|
||||
tween: Tween(begin: 0, end: initPercentage),
|
||||
duration: Duration(milliseconds: 300),
|
||||
builder: (context, value, _) =>
|
||||
LinearProgressIndicator(value: value),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,48 +1,75 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/controllers/chat_message_controller.dart';
|
||||
import 'package:surface/database/database.dart';
|
||||
import 'package:surface/providers/database.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/providers/sn_realm.dart';
|
||||
import 'package:surface/providers/user_directory.dart';
|
||||
import 'package:surface/providers/userinfo.dart';
|
||||
import 'package:surface/types/chat.dart';
|
||||
import 'package:surface/types/realm.dart';
|
||||
|
||||
class ChatChannelProvider extends ChangeNotifier {
|
||||
static const kChatChannelBoxName = 'nex_chat_channels';
|
||||
|
||||
late final SnNetworkProvider _sn;
|
||||
late final UserDirectoryProvider _ud;
|
||||
|
||||
Box<SnChannel>? get _channelBox => Hive.box<SnChannel>(kChatChannelBoxName);
|
||||
late final UserProvider _ua;
|
||||
late final DatabaseProvider _dt;
|
||||
late final SnRealmProvider _rels;
|
||||
|
||||
ChatChannelProvider(BuildContext context) {
|
||||
_sn = context.read<SnNetworkProvider>();
|
||||
_ud = context.read<UserDirectoryProvider>();
|
||||
_initializeLocalData();
|
||||
_ua = context.read<UserProvider>();
|
||||
_dt = context.read<DatabaseProvider>();
|
||||
_rels = context.read<SnRealmProvider>();
|
||||
}
|
||||
|
||||
Future<void> _initializeLocalData() async {
|
||||
await Hive.openBox<SnChannel>(kChatChannelBoxName);
|
||||
}
|
||||
final List<SnChannel> _availableChannels = List.empty(growable: true);
|
||||
|
||||
Future<void> _saveChannelToLocal(Iterable<SnChannel> channels) async {
|
||||
if (_channelBox == null) return;
|
||||
await _channelBox!.putAll({
|
||||
for (final channel in channels) channel.key: channel,
|
||||
List<SnChannel> get availableChannels => _availableChannels;
|
||||
|
||||
Future<void> refreshAvailableChannels() async {
|
||||
final stream = fetchChannels();
|
||||
stream.listen((ele) {
|
||||
_availableChannels.clear();
|
||||
_availableChannels.addAll(ele);
|
||||
notifyListeners();
|
||||
});
|
||||
}
|
||||
|
||||
void addAvailableChannel(SnChannel channel) {
|
||||
_availableChannels.add(channel);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> _saveChannelToLocal(Iterable<SnChannel> channels) async {
|
||||
await Future.wait(
|
||||
channels.map(
|
||||
(ele) => _dt.db.snLocalChatChannel.insertOne(
|
||||
SnLocalChatChannelCompanion.insert(
|
||||
id: Value(ele.id),
|
||||
alias: ele.key,
|
||||
content: ele,
|
||||
createdAt: Value(ele.createdAt),
|
||||
),
|
||||
onConflict: DoUpdate(
|
||||
(_) => SnLocalChatChannelCompanion.custom(
|
||||
content: Constant(jsonEncode(ele.toJson())),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<SnChannel>> _fetchChannelsFromServer({
|
||||
String scope = 'global',
|
||||
bool direct = false,
|
||||
bool doNotSave = false,
|
||||
}) async {
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/im/channels/$scope/me/available',
|
||||
queryParameters: {
|
||||
'direct': direct,
|
||||
},
|
||||
);
|
||||
final resp = await _sn.client.get('/cgi/im/channels/me/available');
|
||||
final out = List<SnChannel>.from(
|
||||
resp.data?.map((e) => SnChannel.fromJson(e)) ?? [],
|
||||
);
|
||||
@ -54,18 +81,25 @@ class ChatChannelProvider extends ChangeNotifier {
|
||||
/// It will use the local storage as much as possible.
|
||||
/// The alias should include the scope, formatted as `scope:alias`.
|
||||
Future<SnChannel> getChannel(String key) async {
|
||||
if (_channelBox != null) {
|
||||
final local = _channelBox!.get(key);
|
||||
if (local != null) return local;
|
||||
final local = await (_dt.db.snLocalChatChannel.select()
|
||||
..where((e) => e.alias.equals(key)))
|
||||
.getSingleOrNull();
|
||||
if (local != null) {
|
||||
final out = local.content;
|
||||
if (out.realmId != null) {
|
||||
return out.copyWith(realm: await _rels.getRealm(out.realmId!));
|
||||
} else {
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
var resp = await _sn.client.get('/cgi/im/channels/$key');
|
||||
var resp =
|
||||
await _sn.client.get('/cgi/im/channels/${key.replaceAll(':', '/')}');
|
||||
var out = SnChannel.fromJson(resp.data);
|
||||
|
||||
// Preload realm of the channel
|
||||
if (out.realmId != null) {
|
||||
resp = await _sn.client.get('/cgi/id/realms/${out.realmId}');
|
||||
out = out.copyWith(realm: SnRealm.fromJson(resp.data));
|
||||
out = out.copyWith(realm: await _rels.getRealm(out.realmId!));
|
||||
}
|
||||
|
||||
_saveChannelToLocal([out]);
|
||||
@ -77,42 +111,39 @@ class ChatChannelProvider extends ChangeNotifier {
|
||||
/// And the second time is when the data was fetched from the server.
|
||||
/// But there is some exception that will only cause one of them to be emitted.
|
||||
/// Like the local storage is broken or the server is down.
|
||||
Stream<List<SnChannel>> fetchChannels() async* {
|
||||
if (_channelBox != null) yield _channelBox!.values.toList();
|
||||
|
||||
var resp = await _sn.client.get('/cgi/id/realms/me/available');
|
||||
final realms = List<SnRealm>.from(
|
||||
resp.data?.map((e) => SnRealm.fromJson(e)) ?? [],
|
||||
Stream<List<SnChannel>> fetchChannels(
|
||||
{bool noRemote = false, bool noLocal = false}) async* {
|
||||
if (!noLocal) {
|
||||
final local = await (_dt.db.snLocalChatChannel.select()
|
||||
..orderBy([
|
||||
(e) =>
|
||||
OrderingTerm(expression: e.createdAt, mode: OrderingMode.desc)
|
||||
]))
|
||||
.get();
|
||||
final out = local.map((e) => e.content).toList();
|
||||
for (var idx = 0; idx < out.length; idx++) {
|
||||
final channel = out[idx];
|
||||
if (channel.realmId != null) {
|
||||
out[idx] = out[idx].copyWith(
|
||||
realm: await _rels.getRealm(channel.realmId!),
|
||||
);
|
||||
final realmMap = {
|
||||
for (final realm in realms) realm.alias: realm,
|
||||
};
|
||||
|
||||
final scopeToFetch = {'global', ...realms.map((e) => e.alias)};
|
||||
|
||||
final List<SnChannel> result = List.empty(growable: true);
|
||||
final directMessages = await _fetchChannelsFromServer(
|
||||
scope: scopeToFetch.first,
|
||||
direct: true,
|
||||
);
|
||||
result.addAll(directMessages);
|
||||
|
||||
final nonBelongsChannels = await _fetchChannelsFromServer(
|
||||
scope: scopeToFetch.first,
|
||||
direct: false,
|
||||
);
|
||||
result.addAll(nonBelongsChannels);
|
||||
|
||||
for (final scope in scopeToFetch.skip(1)) {
|
||||
final channel = await _fetchChannelsFromServer(
|
||||
scope: scope,
|
||||
direct: false,
|
||||
doNotSave: true,
|
||||
);
|
||||
final out = channel.map((ele) => ele.copyWith(realm: realmMap[scope]));
|
||||
_saveChannelToLocal(out);
|
||||
result.addAll(out);
|
||||
}
|
||||
}
|
||||
yield out;
|
||||
}
|
||||
|
||||
if (noRemote) return;
|
||||
final List<SnChannel> result = List.empty(growable: true);
|
||||
final channels = await _fetchChannelsFromServer();
|
||||
for (var idx = 0; idx < channels.length; idx++) {
|
||||
final channel = channels[idx];
|
||||
if (channel.realmId != null) {
|
||||
channels[idx] = channels[idx].copyWith(
|
||||
realm: await _rels.getRealm(channel.realmId!),
|
||||
);
|
||||
}
|
||||
}
|
||||
result.addAll(channels);
|
||||
|
||||
yield result;
|
||||
}
|
||||
@ -120,23 +151,79 @@ class ChatChannelProvider extends ChangeNotifier {
|
||||
Future<List<SnChatMessage>> getLastMessages(
|
||||
Iterable<SnChannel> channels,
|
||||
) async {
|
||||
final result = List<SnChatMessage>.empty(growable: true);
|
||||
final result = List<Future<SnLocalChatMessageData?>>.empty(growable: true);
|
||||
for (final channel in channels) {
|
||||
final channelBox = await Hive.openBox<SnChatMessage>(
|
||||
'${ChatMessageController.kChatMessageBoxPrefix}${channel.id}',
|
||||
);
|
||||
final lastMessage =
|
||||
channelBox.isNotEmpty ? channelBox.values.reduce((a, b) => a.createdAt.isAfter(b.createdAt) ? a : b) : null;
|
||||
if (lastMessage != null) result.add(lastMessage);
|
||||
channelBox.close();
|
||||
final out = (_dt.db.snLocalChatMessage.select()
|
||||
..where((e) => e.channelId.equals(channel.id))
|
||||
..orderBy([
|
||||
(e) =>
|
||||
OrderingTerm(expression: e.createdAt, mode: OrderingMode.desc)
|
||||
])
|
||||
..limit(1))
|
||||
.getSingleOrNull();
|
||||
result.add(out);
|
||||
}
|
||||
await _ud.listAccount(result.map((ele) => ele.sender.accountId).toSet());
|
||||
return result;
|
||||
final out = (await Future.wait(result))
|
||||
.where((e) => e != null)
|
||||
.map((e) => e!.content)
|
||||
.toList();
|
||||
await _ud.listAccount(out.map((ele) => ele.sender.accountId).toSet());
|
||||
return out;
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_channelBox?.close();
|
||||
super.dispose();
|
||||
Future<void> _saveMemberToLocal(Iterable<SnChannelMember> members) async {
|
||||
final queries = members.map((ele) {
|
||||
return _dt.db.snLocalChannelMember.insertOne(
|
||||
SnLocalChannelMemberCompanion.insert(
|
||||
id: Value(ele.id),
|
||||
channelId: ele.channelId,
|
||||
accountId: ele.accountId,
|
||||
content: ele,
|
||||
cacheExpiredAt: DateTime.now().add(const Duration(days: 7)),
|
||||
),
|
||||
onConflict: DoUpdate(
|
||||
(_) => SnLocalChannelMemberCompanion.custom(
|
||||
content: Constant(jsonEncode(ele.toJson())),
|
||||
cacheExpiredAt:
|
||||
Constant(DateTime.now().add(const Duration(days: 7))),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
await Future.wait(queries);
|
||||
}
|
||||
|
||||
Future<void> removeLocalChannel(SnChannel channel) async {
|
||||
await _dt.db.transaction(() async {
|
||||
await (_dt.db.snLocalChannelMember.delete()
|
||||
..where((e) => e.channelId.equals(channel.id)))
|
||||
.go();
|
||||
await (_dt.db.snLocalChatChannel.delete()
|
||||
..where((e) => e.id.equals(channel.id)))
|
||||
.go();
|
||||
await (_dt.db.snLocalChatMessage.delete()
|
||||
..where((e) => e.channelId.equals(channel.id)))
|
||||
.go();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> updateChannelProfile(SnChannelMember member) {
|
||||
return _saveMemberToLocal([member]);
|
||||
}
|
||||
|
||||
Future<SnChannelMember> getChannelProfile(SnChannel channel) async {
|
||||
if (_ua.user == null) throw Exception('User not logged in');
|
||||
final local = await (_dt.db.snLocalChannelMember.select()
|
||||
..where((e) => e.channelId.equals(channel.id))
|
||||
..where((e) => e.accountId.equals(_ua.user!.id)))
|
||||
.getSingleOrNull();
|
||||
if (local != null) {
|
||||
return local.content;
|
||||
}
|
||||
|
||||
final resp = await _sn.client.get('/cgi/im/channels/${channel.keyPath}/me');
|
||||
final out = SnChannelMember.fromJson(resp.data);
|
||||
_saveMemberToLocal([out]);
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:livekit_client/livekit_client.dart';
|
||||
import 'package:livekit_noise_filter/livekit_noise_filter.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
@ -131,10 +132,14 @@ class ChatCallProvider extends ChangeNotifier {
|
||||
|
||||
void initRoom() {
|
||||
initHardware();
|
||||
final timeout = const Duration(seconds: 60);
|
||||
_room = Room(
|
||||
roomOptions: const RoomOptions(
|
||||
roomOptions: RoomOptions(
|
||||
dynacast: true,
|
||||
adaptiveStream: true,
|
||||
defaultAudioCaptureOptions: AudioCaptureOptions(
|
||||
processor: LiveKitNoiseFilter(),
|
||||
),
|
||||
defaultAudioPublishOptions: AudioPublishOptions(
|
||||
name: 'call_voice',
|
||||
stream: 'call_stream',
|
||||
@ -154,6 +159,16 @@ class ChatCallProvider extends ChangeNotifier {
|
||||
params: VideoParametersPresets.h1080_169,
|
||||
),
|
||||
),
|
||||
connectOptions: ConnectOptions(
|
||||
autoSubscribe: true,
|
||||
timeouts: Timeouts(
|
||||
connection: timeout,
|
||||
debounce: timeout,
|
||||
publish: timeout,
|
||||
peerConnection: timeout,
|
||||
iceRestart: timeout,
|
||||
),
|
||||
),
|
||||
);
|
||||
_listener = _room.createListener();
|
||||
WakelockPlus.enable();
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:surface/providers/widget.dart';
|
||||
|
||||
@ -9,6 +10,21 @@ const kRtkStoreKey = 'nex_user_rtk';
|
||||
const kNetworkServerDefault = 'https://api.sn.solsynth.dev';
|
||||
const kNetworkServerStoreKey = 'app_server_url';
|
||||
|
||||
const kAppbarTransparentStoreKey = 'app_bar_transparent';
|
||||
const kAppBackgroundStoreKey = 'app_has_background';
|
||||
const kAppColorSchemeStoreKey = 'app_color_scheme';
|
||||
const kAppNotifyWithHaptic = 'app_notify_with_haptic';
|
||||
const kAppExpandPostLink = 'app_expand_post_link';
|
||||
const kAppExpandChatLink = 'app_expand_chat_link';
|
||||
const kAppRealmCompactView = 'app_realm_compact_view';
|
||||
const kAppCustomFonts = 'app_custom_fonts';
|
||||
const kAppMixedFeed = 'app_mixed_feed';
|
||||
const kAppAutoTranslate = 'app_auto_translate';
|
||||
const kAppHideBottomNav = 'app_hide_bottom_nav';
|
||||
const kAppSoundEffects = 'app_sound_effects';
|
||||
const kAppAprilFoolFeatures = 'app_april_fool_features';
|
||||
const kAppWindowSize = 'app_window_size';
|
||||
|
||||
const Map<String, FilterQuality> kImageQualityLevel = {
|
||||
'settingsImageQualityLowest': FilterQuality.none,
|
||||
'settingsImageQualityLow': FilterQuality.low,
|
||||
@ -29,23 +45,98 @@ class ConfigProvider extends ChangeNotifier {
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
}
|
||||
|
||||
bool drawerIsCollapsed = false;
|
||||
|
||||
void calcDrawerSize(BuildContext context, {bool withMediaQuery = false}) {
|
||||
bool newDrawerIsCollapsed = false;
|
||||
if (withMediaQuery) {
|
||||
newDrawerIsCollapsed = MediaQuery.of(context).size.width < 600;
|
||||
} else {
|
||||
final rpb = ResponsiveBreakpoints.of(context);
|
||||
newDrawerIsCollapsed = rpb.smallerOrEqualTo(MOBILE);
|
||||
}
|
||||
|
||||
if (newDrawerIsCollapsed != drawerIsCollapsed) {
|
||||
drawerIsCollapsed = newDrawerIsCollapsed;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
FilterQuality get imageQuality {
|
||||
return kImageQualityLevel.values.elementAtOrNull(prefs.getInt('app_image_quality') ?? 3) ?? FilterQuality.high;
|
||||
return kImageQualityLevel.values
|
||||
.elementAtOrNull(prefs.getInt('app_image_quality') ?? 3) ??
|
||||
FilterQuality.high;
|
||||
}
|
||||
|
||||
String get serverUrl {
|
||||
return prefs.getString(kNetworkServerStoreKey) ?? kNetworkServerDefault;
|
||||
}
|
||||
|
||||
bool get realmCompactView {
|
||||
return prefs.getBool(kAppRealmCompactView) ?? false;
|
||||
}
|
||||
|
||||
bool get mixedFeed {
|
||||
return prefs.getBool(kAppMixedFeed) ?? true;
|
||||
}
|
||||
|
||||
bool get autoTranslate {
|
||||
return prefs.getBool(kAppAutoTranslate) ?? false;
|
||||
}
|
||||
|
||||
bool get hideBottomNav {
|
||||
return prefs.getBool(kAppHideBottomNav) ?? false;
|
||||
}
|
||||
|
||||
bool get aprilFoolFeatures {
|
||||
return prefs.getBool(kAppAprilFoolFeatures) ?? true;
|
||||
}
|
||||
|
||||
bool get soundEffects {
|
||||
return prefs.getBool(kAppSoundEffects) ?? true;
|
||||
}
|
||||
|
||||
set soundEffects(bool value) {
|
||||
prefs.setBool(kAppSoundEffects, value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
set aprilFoolFeatures(bool value) {
|
||||
prefs.setBool(kAppAprilFoolFeatures, value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
set hideBottomNav(bool value) {
|
||||
prefs.setBool(kAppHideBottomNav, value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
set autoTranslate(bool value) {
|
||||
prefs.setBool(kAppAutoTranslate, value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
set mixedFeed(bool value) {
|
||||
prefs.setBool(kAppMixedFeed, value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
set realmCompactView(bool value) {
|
||||
prefs.setBool(kAppRealmCompactView, value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
set serverUrl(String url) {
|
||||
prefs.setString(kNetworkServerStoreKey, url);
|
||||
_home.saveWidgetData("nex_server_url", url);
|
||||
}
|
||||
|
||||
String? updatableVersion;
|
||||
String? updatableChangelog;
|
||||
|
||||
void setUpdate(String newVersion) {
|
||||
void setUpdate(String newVersion, String newChangelog) {
|
||||
updatableVersion = newVersion;
|
||||
updatableChangelog = newChangelog;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
31
lib/providers/database.dart
Normal file
@ -0,0 +1,31 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:path/path.dart' show join;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:surface/database/database.dart';
|
||||
|
||||
class DatabaseProvider {
|
||||
late AppDatabase db;
|
||||
|
||||
DatabaseProvider(BuildContext context) {
|
||||
db = AppDatabase();
|
||||
}
|
||||
|
||||
Future<int> getDatabaseSize() async {
|
||||
if (kIsWeb) return 0;
|
||||
final basepath = await getApplicationSupportDirectory();
|
||||
return await File(join(basepath.path, 'solar_network_data.sqlite'))
|
||||
.length();
|
||||
}
|
||||
|
||||
Future<void> removeDatabase() async {
|
||||
if (kIsWeb) return;
|
||||
final basepath = await getApplicationSupportDirectory();
|
||||
final file = File(join(basepath.path, 'solar_network_data.sqlite'));
|
||||
db.close();
|
||||
await file.delete();
|
||||
db = AppDatabase();
|
||||
}
|
||||
}
|
41
lib/providers/experience.dart
Normal file
@ -0,0 +1,41 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
const List<int> kExperienceToLevelRequirements = [
|
||||
0, // Level 0
|
||||
1000, // Level 1
|
||||
4000, // Level 2
|
||||
9000, // Level 3
|
||||
16000, // Level 4
|
||||
25000, // Level 5
|
||||
36000, // Level 6
|
||||
49000, // Level 7
|
||||
64000, // Level 8
|
||||
81000, // Level 9
|
||||
100000, // Level 10
|
||||
121000, // Level 11
|
||||
144000, // Level 12
|
||||
368000 // Level 13
|
||||
];
|
||||
|
||||
int getLevelFromExp(int experience) {
|
||||
final exp = kExperienceToLevelRequirements.reversed.firstWhere((x) => x <= experience);
|
||||
final idx = kExperienceToLevelRequirements.indexOf(exp);
|
||||
return idx;
|
||||
}
|
||||
|
||||
double calcLevelUpProgress(int experience) {
|
||||
final exp = kExperienceToLevelRequirements.reversed.firstWhere((x) => x <= experience);
|
||||
final idx = kExperienceToLevelRequirements.indexOf(exp);
|
||||
if (idx + 1 >= kExperienceToLevelRequirements.length) return 1;
|
||||
final nextExp = kExperienceToLevelRequirements[idx + 1];
|
||||
return (experience - exp).abs() / (exp - nextExp).abs();
|
||||
}
|
||||
|
||||
String calcLevelUpProgressLevel(int experience) {
|
||||
final exp = kExperienceToLevelRequirements.reversed.firstWhere((x) => x <= experience);
|
||||
final idx = kExperienceToLevelRequirements.indexOf(exp);
|
||||
if (idx + 1 >= kExperienceToLevelRequirements.length) return 'Infinity';
|
||||
final nextExp = exp - kExperienceToLevelRequirements[idx + 1];
|
||||
final formatter = NumberFormat.compactCurrency(symbol: '', decimalDigits: 1);
|
||||
return '${formatter.format((exp - experience).abs())}/${formatter.format(nextExp.abs())}';
|
||||
}
|
245
lib/providers/keypair.dart
Normal file
@ -0,0 +1,245 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/database/database.dart';
|
||||
import 'package:surface/logger.dart';
|
||||
import 'package:surface/providers/database.dart';
|
||||
import 'package:surface/providers/userinfo.dart';
|
||||
import 'package:surface/providers/websocket.dart';
|
||||
import 'package:surface/types/keypair.dart';
|
||||
import 'package:fast_rsa/fast_rsa.dart';
|
||||
import 'package:surface/types/websocket.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
// Currently the keypair only provide RSA encryption
|
||||
// Supported by the `fast_rsa` package
|
||||
class KeyPairProvider {
|
||||
late final DatabaseProvider _dt;
|
||||
late final UserProvider _ua;
|
||||
late final WebSocketProvider _ws;
|
||||
|
||||
SnKeyPair? activeKp;
|
||||
|
||||
KeyPairProvider(BuildContext context) {
|
||||
_dt = context.read<DatabaseProvider>();
|
||||
_ua = context.read<UserProvider>();
|
||||
_ws = context.read<WebSocketProvider>();
|
||||
}
|
||||
|
||||
void listen() {
|
||||
_ws.pk.stream.listen((event) {
|
||||
switch (event.method) {
|
||||
case 'kex.ack':
|
||||
ackKeyExchange(event);
|
||||
break;
|
||||
case 'kex.ask':
|
||||
replyAskKeyExchange(event);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<String> decryptText(String text, String kpId, {int? kpOwner}) async {
|
||||
String? publicKey;
|
||||
final kp = await (_dt.db.snLocalKeyPair.select()
|
||||
..where((e) => e.id.equals(kpId)))
|
||||
.getSingleOrNull();
|
||||
if (kp == null) {
|
||||
if (kpOwner != null) {
|
||||
final out = await askKeyExchange(kpOwner, kpId);
|
||||
publicKey = out.publicKey;
|
||||
}
|
||||
} else {
|
||||
publicKey = kp.publicKey;
|
||||
}
|
||||
if (publicKey == null) {
|
||||
throw Exception('Key pair not found');
|
||||
}
|
||||
return await RSA.decryptPKCS1v15(text, publicKey);
|
||||
}
|
||||
|
||||
Future<String> encryptText(String text) async {
|
||||
if (activeKp == null) throw Exception('No active key pair');
|
||||
return await RSA.encryptPKCS1v15(text, activeKp!.privateKey!);
|
||||
}
|
||||
|
||||
final Map<String, Completer<SnKeyPair>> _requests = {};
|
||||
|
||||
Future<SnKeyPair> askKeyExchange(int kpOwner, String kpId) async {
|
||||
if (_requests.containsKey(kpId)) return await _requests[kpId]!.future;
|
||||
|
||||
final completer = Completer<SnKeyPair>();
|
||||
_requests[kpId] = completer;
|
||||
|
||||
_ws.conn?.sink.add(
|
||||
jsonEncode(WebSocketPackage(
|
||||
method: 'kex.ask',
|
||||
endpoint: 'id',
|
||||
payload: {
|
||||
'keypair_id': kpId,
|
||||
'user_id': kpOwner,
|
||||
},
|
||||
)),
|
||||
);
|
||||
|
||||
return Future.any([
|
||||
_requests[kpId]!.future,
|
||||
Future.delayed(const Duration(seconds: 60), () {
|
||||
_requests.remove(kpId);
|
||||
throw TimeoutException("Key exchange timed out");
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
Future<void> ackKeyExchange(WebSocketPackage pkt) async {
|
||||
if (pkt.payload == null) return;
|
||||
final kpMeta = SnKeyPair(
|
||||
id: pkt.payload!['keypair_id'] as String,
|
||||
accountId: pkt.payload!['user_id'] as int,
|
||||
publicKey: pkt.payload!['public_key'] as String,
|
||||
privateKey: pkt.payload?['private_key'] as String?,
|
||||
);
|
||||
|
||||
if (_requests.containsKey(kpMeta.id)) {
|
||||
_requests[kpMeta.id]!.complete(kpMeta);
|
||||
_requests.remove(kpMeta.id);
|
||||
}
|
||||
|
||||
// Save the keypair to the local database
|
||||
await _dt.db.snLocalKeyPair.insertOne(
|
||||
SnLocalKeyPairCompanion.insert(
|
||||
id: kpMeta.id,
|
||||
accountId: kpMeta.accountId,
|
||||
publicKey: kpMeta.publicKey,
|
||||
privateKey: Value(kpMeta.privateKey),
|
||||
),
|
||||
onConflict: DoNothing(),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> replyAskKeyExchange(WebSocketPackage pkt) async {
|
||||
final kpId = pkt.payload!['keypair_id'] as String;
|
||||
final userId = pkt.payload!['user_id'] as int;
|
||||
final clientId = pkt.payload!['client_id'] as String;
|
||||
|
||||
final localKp = await (_dt.db.snLocalKeyPair.select()
|
||||
..where((e) => e.id.equals(kpId))
|
||||
..limit(1))
|
||||
.getSingleOrNull();
|
||||
if (localKp == null) return;
|
||||
|
||||
logging.info(
|
||||
'[Kex] Reply to key exchange request of $kpId from user $userId',
|
||||
);
|
||||
|
||||
// We do not give the private key to the client
|
||||
_ws.conn?.sink.add(jsonEncode(
|
||||
WebSocketPackage(
|
||||
method: 'kex.ack',
|
||||
endpoint: 'id',
|
||||
payload: {
|
||||
'keypair_id': localKp.id,
|
||||
'user_id': localKp.accountId,
|
||||
'public_key': localKp.publicKey,
|
||||
'client_id': clientId,
|
||||
},
|
||||
).toJson(),
|
||||
));
|
||||
}
|
||||
|
||||
Future<SnKeyPair?> reloadActive({bool autoEnroll = true}) async {
|
||||
final kp = await (_dt.db.snLocalKeyPair.select()
|
||||
..where((e) => e.accountId.equals(_ua.user?.id ?? 0))
|
||||
..where((e) => e.privateKey.isNotNull())
|
||||
..where((e) => e.isActive.equals(true))
|
||||
..limit(1))
|
||||
.getSingleOrNull();
|
||||
|
||||
if (kp != null) {
|
||||
activeKp = SnKeyPair(
|
||||
id: kp.id,
|
||||
accountId: kp.accountId,
|
||||
publicKey: kp.publicKey,
|
||||
privateKey: kp.privateKey,
|
||||
);
|
||||
}
|
||||
|
||||
if (kp == null && autoEnroll) {
|
||||
return await enrollNew();
|
||||
}
|
||||
|
||||
return activeKp;
|
||||
}
|
||||
|
||||
Future<List<SnKeyPair>> listKeyPair() async {
|
||||
final kps = await (_dt.db.snLocalKeyPair.select()).get();
|
||||
return kps
|
||||
.map((e) => SnKeyPair(
|
||||
id: e.id,
|
||||
accountId: e.accountId,
|
||||
publicKey: e.publicKey,
|
||||
privateKey: e.privateKey,
|
||||
isActive: e.isActive,
|
||||
))
|
||||
.toList();
|
||||
}
|
||||
|
||||
Future<void> activeKeyPair(String kpId) async {
|
||||
final kp = await (_dt.db.snLocalKeyPair.select()
|
||||
..where((e) => e.id.equals(kpId))
|
||||
..where((e) => e.privateKey.isNotNull())
|
||||
..limit(1))
|
||||
.getSingleOrNull();
|
||||
if (kp == null) return;
|
||||
|
||||
await _dt.db.transaction(() async {
|
||||
await (_dt.db.update(_dt.db.snLocalKeyPair)
|
||||
..where((e) => e.isActive.equals(true)))
|
||||
.write(SnLocalKeyPairCompanion(isActive: Value(false)));
|
||||
|
||||
await (_dt.db.update(_dt.db.snLocalKeyPair)
|
||||
..where((e) => e.id.equals(kp.id)))
|
||||
.write(SnLocalKeyPairCompanion(isActive: Value(true)));
|
||||
});
|
||||
}
|
||||
|
||||
Future<SnKeyPair> enrollNew() async {
|
||||
if (!_ua.isAuthorized) throw Exception('Unauthorized');
|
||||
|
||||
final id = const Uuid().v4();
|
||||
final kp = await RSA.generate(2048);
|
||||
final kpMeta = SnKeyPair(
|
||||
id: id,
|
||||
accountId: _ua.user!.id,
|
||||
// This is work as expected
|
||||
// We need to share private key to let everyone can decode the message
|
||||
publicKey: kp.privateKey,
|
||||
privateKey: kp.publicKey,
|
||||
);
|
||||
|
||||
// Save the keypair to the local database
|
||||
// If there is already one with private key, it will be overwritten
|
||||
await _dt.db.transaction(() async {
|
||||
await (_dt.db.update(_dt.db.snLocalKeyPair)
|
||||
..where((e) => e.isActive.equals(true)))
|
||||
.write(SnLocalKeyPairCompanion(isActive: Value(false)));
|
||||
|
||||
await _dt.db.snLocalKeyPair.insertOne(
|
||||
SnLocalKeyPairCompanion.insert(
|
||||
id: kpMeta.id,
|
||||
accountId: kpMeta.accountId,
|
||||
publicKey: kpMeta.publicKey,
|
||||
privateKey: Value(kpMeta.privateKey),
|
||||
isActive: Value(true),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
await reloadActive(autoEnroll: false);
|
||||
|
||||
return kpMeta;
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/logger.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/types/link.dart';
|
||||
|
||||
@ -20,7 +20,7 @@ class SnLinkPreviewProvider {
|
||||
final target = b64.encode(url);
|
||||
if (_cache.containsKey(target)) return _cache[target];
|
||||
|
||||
log('[LinkPreview] Fetching $url ($target)');
|
||||
logging.debug('[LinkPreview] Fetching $url ($target)');
|
||||
|
||||
try {
|
||||
final resp = await _sn.client.get('/cgi/re/link/$target');
|
||||
@ -28,7 +28,7 @@ class SnLinkPreviewProvider {
|
||||
_cache[url] = meta;
|
||||
return meta;
|
||||
} catch (err) {
|
||||
log('[LinkPreview] Failed to fetch $url ($target)...');
|
||||
logging.warning('[LinkPreview] Failed to fetch $url ($target)...', err);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,20 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class AppNavListItem {
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final String screen;
|
||||
final IconData icon;
|
||||
|
||||
const AppNavListItem({
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.screen,
|
||||
required this.icon,
|
||||
});
|
||||
}
|
||||
|
||||
class AppNavDestination {
|
||||
final String label;
|
||||
final String screen;
|
||||
@ -24,13 +38,10 @@ class NavigationProvider extends ChangeNotifier {
|
||||
|
||||
int? get currentIndex => _currentIndex;
|
||||
|
||||
static const List<String> kShowBottomNavScreen = [
|
||||
'home',
|
||||
'explore',
|
||||
'account',
|
||||
'album',
|
||||
'chat',
|
||||
];
|
||||
List<String> get showBottomNavScreen => destinations
|
||||
.where((ele) => ele.isPinned)
|
||||
.map((ele) => ele.screen)
|
||||
.toList();
|
||||
|
||||
static const List<AppNavDestination> kAllDestination = [
|
||||
AppNavDestination(
|
||||
@ -48,37 +59,27 @@ class NavigationProvider extends ChangeNotifier {
|
||||
screen: 'chat',
|
||||
label: 'screenChat',
|
||||
),
|
||||
AppNavDestination(
|
||||
icon: Icon(Symbols.account_circle, weight: 400, opticalSize: 20),
|
||||
screen: 'account',
|
||||
label: 'screenAccount',
|
||||
),
|
||||
AppNavDestination(
|
||||
icon: Icon(Symbols.group, weight: 400, opticalSize: 20),
|
||||
screen: 'realm',
|
||||
label: 'screenRealm',
|
||||
),
|
||||
AppNavDestination(
|
||||
icon: Icon(Symbols.photo_library, weight: 400, opticalSize: 20),
|
||||
screen: 'album',
|
||||
label: 'screenAlbum',
|
||||
icon: Icon(Symbols.newspaper, weight: 400, opticalSize: 20),
|
||||
screen: 'news',
|
||||
label: 'screenNews',
|
||||
),
|
||||
AppNavDestination(
|
||||
icon: Icon(Symbols.diversity_4, weight: 400, opticalSize: 20),
|
||||
screen: 'friend',
|
||||
label: 'screenFriend',
|
||||
),
|
||||
AppNavDestination(
|
||||
icon: Icon(Symbols.notifications, weight: 400, opticalSize: 20),
|
||||
screen: 'notification',
|
||||
label: 'screenNotification',
|
||||
icon: Icon(Symbols.settings, weight: 400, opticalSize: 20),
|
||||
screen: 'settings',
|
||||
label: 'screenSettings',
|
||||
),
|
||||
];
|
||||
static const List<String> kDefaultPinnedDestination = [
|
||||
'home',
|
||||
'explore',
|
||||
'chat',
|
||||
'account',
|
||||
'realm',
|
||||
];
|
||||
|
||||
List<AppNavDestination> destinations = [];
|
||||
|
@ -1,21 +1,35 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
import 'package:bitsdojo_window/bitsdojo_window.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_udid/flutter_udid.dart';
|
||||
import 'package:local_notifier/local_notifier.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/logger.dart';
|
||||
import 'package:surface/providers/config.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/providers/userinfo.dart';
|
||||
import 'package:surface/providers/websocket.dart';
|
||||
import 'package:surface/types/notification.dart';
|
||||
import 'package:tray_manager/tray_manager.dart';
|
||||
|
||||
class NotificationProvider extends ChangeNotifier {
|
||||
late final SnNetworkProvider _sn;
|
||||
late final UserProvider _ua;
|
||||
late final WebSocketProvider _ws;
|
||||
late final ConfigProvider _cfg;
|
||||
|
||||
final AudioPlayer _notifySoundPlayer = AudioPlayer(playerId: 'notify-sound');
|
||||
|
||||
NotificationProvider(BuildContext context) {
|
||||
_sn = context.read<SnNetworkProvider>();
|
||||
_ua = context.read<UserProvider>();
|
||||
_ws = context.read<WebSocketProvider>();
|
||||
_cfg = context.read<ConfigProvider>();
|
||||
}
|
||||
|
||||
Future<void> registerPushNotifications() async {
|
||||
@ -37,11 +51,13 @@ class NotificationProvider extends ChangeNotifier {
|
||||
var deviceUuid = await FlutterUdid.consistentUdid;
|
||||
|
||||
if (deviceUuid.isEmpty) {
|
||||
log("Unable to active push notifications, couldn't get device uuid");
|
||||
logging.warning(
|
||||
'[Push Notification] Unable to active push notifications, couldn\'t get device uuid');
|
||||
return;
|
||||
} else {
|
||||
log('Device UUID is $deviceUuid');
|
||||
log('Registering device push notifications...');
|
||||
logging.info('[Push Notification] Device UUID is $deviceUuid');
|
||||
logging
|
||||
.info('[Push Notification] Registering device push notifications...');
|
||||
}
|
||||
|
||||
if (Platform.isIOS || Platform.isMacOS) {
|
||||
@ -51,15 +67,111 @@ class NotificationProvider extends ChangeNotifier {
|
||||
provider = 'fcm';
|
||||
token = await FirebaseMessaging.instance.getToken();
|
||||
}
|
||||
log('Device Push Token is $token');
|
||||
logging.info('[Push Notification] Device Push Token is $token');
|
||||
|
||||
try {
|
||||
await _sn.client.post(
|
||||
'/cgi/id/notifications/subscription',
|
||||
data: {
|
||||
'provider': provider,
|
||||
'device_token': token,
|
||||
'device_id': deviceUuid,
|
||||
'device_id': deviceUuid
|
||||
},
|
||||
);
|
||||
} catch (err) {
|
||||
logging.error(
|
||||
'[Push Notification] Unable to register push notifications: $err');
|
||||
}
|
||||
}
|
||||
|
||||
int showingCount = 0;
|
||||
int showingTrayCount = 0;
|
||||
List<SnNotification> notifications = List.empty(growable: true);
|
||||
|
||||
int? skippableNotifyChannel;
|
||||
bool isMuted = false;
|
||||
|
||||
void listen() {
|
||||
_ws.pk.stream.listen((event) {
|
||||
if (event.method == 'notifications.new') {
|
||||
final notification = SnNotification.fromJson(event.payload!);
|
||||
|
||||
final doHaptic = _cfg.prefs.getBool(kAppNotifyWithHaptic) ?? true;
|
||||
if (doHaptic) HapticFeedback.mediumImpact();
|
||||
|
||||
// April fool notification sfx
|
||||
if (_cfg.prefs.getBool(kAppAprilFoolFeatures) ?? true) {
|
||||
final now = DateTime.now();
|
||||
if (now.day == 1 && now.month == 4) {
|
||||
_notifySoundPlayer.play(
|
||||
AssetSource('audio/notify/metal-pipe.mp3'),
|
||||
volume: 0.6,
|
||||
ctx: AudioContext(
|
||||
android: AudioContextAndroid(
|
||||
contentType: AndroidContentType.sonification,
|
||||
usageType: AndroidUsageType.notificationEvent,
|
||||
),
|
||||
iOS: AudioContextIOS(category: AVAudioSessionCategory.ambient),
|
||||
),
|
||||
mode: PlayerMode.lowLatency,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (notification.topic == 'messaging.message' &&
|
||||
skippableNotifyChannel != null) {
|
||||
if (notification.metadata['channel_id'] != null &&
|
||||
notification.metadata['channel_id'] == skippableNotifyChannel) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (showingCount < 0) showingCount = 0;
|
||||
showingCount++;
|
||||
showingTrayCount++;
|
||||
notifications.add(notification);
|
||||
Future.delayed(const Duration(seconds: 5), () {
|
||||
if (showingCount >= 0) showingCount--;
|
||||
notifyListeners();
|
||||
});
|
||||
notifyListeners();
|
||||
updateTray();
|
||||
|
||||
if (!kIsWeb && !isMuted) {
|
||||
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
|
||||
LocalNotification notify = LocalNotification(
|
||||
title: notification.title,
|
||||
subtitle: notification.subtitle,
|
||||
body: notification.body,
|
||||
);
|
||||
notify.onClick = () {
|
||||
appWindow.show();
|
||||
};
|
||||
notify.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void clearTray() {
|
||||
showingTrayCount = 0;
|
||||
updateTray();
|
||||
}
|
||||
|
||||
void updateTray() {
|
||||
if (kIsWeb || Platform.isAndroid || Platform.isIOS) return;
|
||||
if (showingTrayCount == 0) {
|
||||
trayManager.setTitle('');
|
||||
} else {
|
||||
trayManager.setTitle(' $showingTrayCount');
|
||||
}
|
||||
}
|
||||
|
||||
void clear() {
|
||||
showingCount = 0;
|
||||
notifications.clear();
|
||||
updateTray();
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
@ -1,95 +1,101 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/providers/sn_attachment.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/providers/user_directory.dart';
|
||||
import 'package:surface/types/post.dart';
|
||||
|
||||
class SnPostContentProvider {
|
||||
late final SnNetworkProvider _sn;
|
||||
late final UserDirectoryProvider _ud;
|
||||
late final SnAttachmentProvider _attach;
|
||||
|
||||
SnPostContentProvider(BuildContext context) {
|
||||
_sn = context.read<SnNetworkProvider>();
|
||||
_ud = context.read<UserDirectoryProvider>();
|
||||
_attach = context.read<SnAttachmentProvider>();
|
||||
}
|
||||
|
||||
Future<List<SnPost>> _preloadRelatedDataInBatch(List<SnPost> out) async {
|
||||
Set<String> rids = {};
|
||||
for (var i = 0; i < out.length; i++) {
|
||||
rids.addAll(out[i].body['attachments']?.cast<String>() ?? []);
|
||||
if (out[i].body['thumbnail'] != null) {
|
||||
rids.add(out[i].body['thumbnail']);
|
||||
}
|
||||
if (out[i].repostTo != null) {
|
||||
out[i] = out[i].copyWith(
|
||||
repostTo: await _preloadRelatedDataSingle(out[i].repostTo!),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final attachments = await _attach.getMultiple(rids.toList());
|
||||
for (var i = 0; i < out.length; i++) {
|
||||
out[i] = out[i].copyWith(
|
||||
preload: SnPostPreload(
|
||||
thumbnail: attachments.where((ele) => ele?.rid == out[i].body['thumbnail']).firstOrNull,
|
||||
attachments: attachments.where((ele) => out[i].body['attachments']?.contains(ele?.rid) ?? false).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
await _ud.listAccount(
|
||||
attachments.where((ele) => ele != null).map((ele) => ele!.accountId).toSet(),
|
||||
);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<SnPost> _preloadRelatedDataSingle(SnPost out) async {
|
||||
Set<String> rids = {};
|
||||
rids.addAll(out.body['attachments']?.cast<String>() ?? []);
|
||||
if (out.body['thumbnail'] != null) {
|
||||
rids.add(out.body['thumbnail']);
|
||||
}
|
||||
if (out.repostTo != null) {
|
||||
out = out.copyWith(
|
||||
repostTo: await _preloadRelatedDataSingle(out.repostTo!),
|
||||
);
|
||||
}
|
||||
|
||||
final attachments = await _attach.getMultiple(rids.toList());
|
||||
out = out.copyWith(
|
||||
preload: SnPostPreload(
|
||||
thumbnail: attachments.where((ele) => ele?.rid == out.body['thumbnail']).firstOrNull,
|
||||
attachments: attachments.where((ele) => out.body['attachments']?.contains(ele?.rid) ?? false).toList(),
|
||||
),
|
||||
);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<List<SnPost>> listRecommendations() async {
|
||||
final resp = await _sn.client.get('/cgi/co/recommendations');
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/co/recommendations',
|
||||
options: Options(headers: {
|
||||
'X-API-Version': '2',
|
||||
}),
|
||||
);
|
||||
final out = _preloadRelatedDataInBatch(
|
||||
List.from(resp.data.map((ele) => SnPost.fromJson(ele))),
|
||||
);
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<List<SnFeedEntry>> getFeed({int take = 20, DateTime? cursor}) async {
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/co/recommendations/feed',
|
||||
queryParameters: {
|
||||
'take': take,
|
||||
if (cursor != null) 'cursor': cursor.toUtc().millisecondsSinceEpoch,
|
||||
},
|
||||
options: Options(headers: {'X-API-Version': '2'}),
|
||||
);
|
||||
final List<SnFeedEntry> out =
|
||||
List.from(resp.data.map((ele) => SnFeedEntry.fromJson(ele)));
|
||||
|
||||
List<SnPost> posts = List.empty(growable: true);
|
||||
for (var idx = 0; idx < out.length; idx++) {
|
||||
final ele = out[idx];
|
||||
if (ele.type == 'interactive.post') {
|
||||
posts.add(SnPost.fromJson(ele.data));
|
||||
}
|
||||
}
|
||||
posts = await _preloadRelatedDataInBatch(posts);
|
||||
|
||||
var postsIdx = 0;
|
||||
for (var idx = 0; idx < out.length; idx++) {
|
||||
final ele = out[idx];
|
||||
if (ele.type == 'interactive.post') {
|
||||
out[idx] = ele.copyWith(data: posts[postsIdx].toJson());
|
||||
postsIdx++;
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<(List<SnPost>, int)> listPosts({
|
||||
int take = 10,
|
||||
int offset = 0,
|
||||
String? type,
|
||||
String? author,
|
||||
Iterable<String>? categories,
|
||||
Iterable<String>? tags,
|
||||
String? realm,
|
||||
String? channel,
|
||||
bool isDraft = false,
|
||||
bool isShuffle = false,
|
||||
}) async {
|
||||
final resp = await _sn.client.get('/cgi/co/posts', queryParameters: {
|
||||
final resp = await _sn.client.get(
|
||||
isShuffle
|
||||
? '/cgi/co/recommendations/shuffle'
|
||||
: '/cgi/co/posts${isDraft ? '/drafts' : ''}',
|
||||
queryParameters: {
|
||||
'take': take,
|
||||
'offset': offset,
|
||||
if (type != null) 'type': type,
|
||||
if (author != null) 'author': author,
|
||||
});
|
||||
if (tags?.isNotEmpty ?? false) 'tags': tags!.join(','),
|
||||
if (categories?.isNotEmpty ?? false)
|
||||
'categories': categories!.join(','),
|
||||
if (realm != null) 'realm': realm,
|
||||
if (channel != null) 'channel': channel,
|
||||
},
|
||||
options: Options(headers: {
|
||||
'X-API-Version': '2',
|
||||
}),
|
||||
);
|
||||
final List<SnPost> out = await _preloadRelatedDataInBatch(
|
||||
List.from(resp.data['data']?.map((e) => SnPost.fromJson(e)) ?? []),
|
||||
);
|
||||
@ -102,10 +108,16 @@ class SnPostContentProvider {
|
||||
int take = 10,
|
||||
int offset = 0,
|
||||
}) async {
|
||||
final resp = await _sn.client.get('/cgi/co/posts/$parentId/replies', queryParameters: {
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/co/posts/$parentId/replies',
|
||||
queryParameters: {
|
||||
'take': take,
|
||||
'offset': offset,
|
||||
});
|
||||
},
|
||||
options: Options(headers: {
|
||||
'X-API-Version': '2',
|
||||
}),
|
||||
);
|
||||
final List<SnPost> out = await _preloadRelatedDataInBatch(
|
||||
List.from(resp.data['data']?.map((e) => SnPost.fromJson(e)) ?? []),
|
||||
);
|
||||
@ -118,13 +130,22 @@ class SnPostContentProvider {
|
||||
int take = 10,
|
||||
int offset = 0,
|
||||
Iterable<String>? tags,
|
||||
Iterable<String>? categories,
|
||||
}) async {
|
||||
final resp = await _sn.client.get('/cgi/co/posts/search', queryParameters: {
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/co/posts/search',
|
||||
queryParameters: {
|
||||
'take': take,
|
||||
'offset': offset,
|
||||
'probe': searchTerm,
|
||||
if (tags?.isNotEmpty ?? false) 'tags': tags!.join(','),
|
||||
});
|
||||
if (categories?.isNotEmpty ?? false)
|
||||
'categories': categories!.join(','),
|
||||
},
|
||||
options: Options(headers: {
|
||||
'X-API-Version': '2',
|
||||
}),
|
||||
);
|
||||
final List<SnPost> out = await _preloadRelatedDataInBatch(
|
||||
List.from(resp.data['data']?.map((e) => SnPost.fromJson(e)) ?? []),
|
||||
);
|
||||
@ -133,10 +154,20 @@ class SnPostContentProvider {
|
||||
}
|
||||
|
||||
Future<SnPost> getPost(dynamic id) async {
|
||||
final resp = await _sn.client.get('/cgi/co/posts/$id');
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/co/posts/$id',
|
||||
options: Options(headers: {
|
||||
'X-API-Version': '2',
|
||||
}),
|
||||
);
|
||||
final out = _preloadRelatedDataSingle(
|
||||
SnPost.fromJson(resp.data),
|
||||
);
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<SnPost> completePostData(SnPost post) async {
|
||||
final out = await _preloadRelatedDataSingle(post);
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,14 @@
|
||||
import 'dart:collection';
|
||||
import 'dart:convert';
|
||||
import 'dart:math' as math;
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:cross_file/cross_file.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/database/database.dart';
|
||||
import 'package:surface/providers/database.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/types/attachment.dart';
|
||||
|
||||
@ -13,36 +16,50 @@ const kConcurrentUploadChunks = 5;
|
||||
|
||||
class SnAttachmentProvider {
|
||||
late final SnNetworkProvider _sn;
|
||||
late final DatabaseProvider _dt;
|
||||
final Map<String, SnAttachment> _cache = {};
|
||||
|
||||
SnAttachmentProvider(BuildContext context) {
|
||||
_sn = context.read<SnNetworkProvider>();
|
||||
_dt = context.read<DatabaseProvider>();
|
||||
}
|
||||
|
||||
void putCache(Iterable<SnAttachment> items, {bool noCheck = false}) {
|
||||
for (final item in items) {
|
||||
if ((item.isAnalyzed && item.isUploaded) || noCheck) {
|
||||
if (item.isAnalyzed || noCheck) {
|
||||
_cache[item.rid] = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<SnAttachment> getOne(String rid, {noCache = false}) async {
|
||||
// In-memory cache
|
||||
if (!noCache && _cache.containsKey(rid)) {
|
||||
return _cache[rid]!;
|
||||
}
|
||||
|
||||
// On-disk cache
|
||||
final dbResp = await (_dt.db.snLocalAttachment.select()
|
||||
..where((e) => e.rid.equals(rid))
|
||||
..where((e) => e.cacheExpiredAt.isBiggerThanValue(DateTime.now())))
|
||||
.getSingleOrNull();
|
||||
if (dbResp != null) {
|
||||
_cache[rid] = dbResp.content;
|
||||
return dbResp.content;
|
||||
}
|
||||
// Remote server
|
||||
final resp = await _sn.client.get('/cgi/uc/attachments/$rid/meta');
|
||||
final out = SnAttachment.fromJson(resp.data);
|
||||
if (out.isAnalyzed && out.isUploaded) {
|
||||
if (out.isAnalyzed) {
|
||||
_cache[rid] = out;
|
||||
}
|
||||
_saveToLocal([out]);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<List<SnAttachment?>> getMultiple(List<String> rids,
|
||||
{noCache = false}) async {
|
||||
{bool noCache = false}) async {
|
||||
// In-memory cache
|
||||
final result = List<SnAttachment?>.filled(rids.length, null);
|
||||
final Map<String, int> randomMapping = {};
|
||||
for (int i = 0; i < rids.length; i++) {
|
||||
@ -53,9 +70,25 @@ class SnAttachmentProvider {
|
||||
result[i] = _cache[rid]!;
|
||||
}
|
||||
}
|
||||
final pendingFetch = randomMapping.keys;
|
||||
|
||||
if (pendingFetch.isNotEmpty) {
|
||||
var pendingFetch = randomMapping.keys;
|
||||
// On-disk cache
|
||||
if (pendingFetch.isEmpty) return result;
|
||||
if (!noCache) {
|
||||
final dbResp = await (_dt.db.snLocalAttachment.select()
|
||||
..where((e) => e.rid.isIn(pendingFetch))
|
||||
..where((e) => e.cacheExpiredAt.isBiggerThanValue(DateTime.now())))
|
||||
.get();
|
||||
for (final item in dbResp) {
|
||||
if (item.content.isAnalyzed) {
|
||||
_cache[item.rid] = item.content;
|
||||
}
|
||||
result[randomMapping[item.rid]!] = item.content;
|
||||
randomMapping.remove(item.rid);
|
||||
}
|
||||
pendingFetch = randomMapping.keys;
|
||||
}
|
||||
// Remote server
|
||||
if (pendingFetch.isEmpty) return result;
|
||||
final resp = await _sn.client.get(
|
||||
'/cgi/uc/attachments',
|
||||
queryParameters: {
|
||||
@ -63,25 +96,28 @@ class SnAttachmentProvider {
|
||||
'id': pendingFetch.join(','),
|
||||
},
|
||||
);
|
||||
final out = resp.data['data']
|
||||
final List<SnAttachment?> out = resp.data['data']
|
||||
.map((e) => e['id'] == 0 ? null : SnAttachment.fromJson(e))
|
||||
.cast<SnAttachment?>()
|
||||
.toList();
|
||||
|
||||
for (final item in out) {
|
||||
if (item == null) continue;
|
||||
if (item.isAnalyzed && item.isUploaded) {
|
||||
if (item.isAnalyzed) {
|
||||
_cache[item.rid] = item;
|
||||
}
|
||||
result[randomMapping[item.rid]!] = item;
|
||||
}
|
||||
}
|
||||
_saveToLocal(out.where((ele) => ele != null).cast());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static Map<String, String> mimetypeOverrides = {
|
||||
'mov': 'video/quicktime',
|
||||
'mp4': 'video/mp4'
|
||||
'mp4': 'video/mp4',
|
||||
'm4a': 'audio/mp4',
|
||||
'apng': 'image/apng',
|
||||
'webp': 'image/webp',
|
||||
};
|
||||
|
||||
Future<SnAttachment> directUploadOne(
|
||||
@ -91,6 +127,7 @@ class SnAttachmentProvider {
|
||||
Map<String, dynamic>? metadata, {
|
||||
String? mimetype,
|
||||
Function(double progress)? onProgress,
|
||||
bool analyzeNow = false,
|
||||
}) async {
|
||||
final filePayload = MultipartFile.fromBytes(data, filename: filename);
|
||||
final fileAlt = filename.contains('.')
|
||||
@ -116,6 +153,7 @@ class SnAttachmentProvider {
|
||||
final resp = await _sn.client.post(
|
||||
'/cgi/uc/attachments',
|
||||
data: formData,
|
||||
queryParameters: {'analyzeNow': analyzeNow},
|
||||
onSendProgress: (count, total) {
|
||||
if (onProgress != null) {
|
||||
onProgress(count / total);
|
||||
@ -126,7 +164,7 @@ class SnAttachmentProvider {
|
||||
return SnAttachment.fromJson(resp.data);
|
||||
}
|
||||
|
||||
Future<(SnAttachment, int)> chunkedUploadInitialize(
|
||||
Future<(SnAttachmentFragment, int)> chunkedUploadInitialize(
|
||||
int size,
|
||||
String filename,
|
||||
String pool,
|
||||
@ -146,7 +184,7 @@ class SnAttachmentProvider {
|
||||
mimetypeOverride = mimetype;
|
||||
}
|
||||
|
||||
final resp = await _sn.client.post('/cgi/uc/attachments/multipart', data: {
|
||||
final resp = await _sn.client.post('/cgi/uc/fragments', data: {
|
||||
'alt': fileAlt,
|
||||
'name': filename,
|
||||
'pool': pool,
|
||||
@ -156,20 +194,22 @@ class SnAttachmentProvider {
|
||||
});
|
||||
|
||||
return (
|
||||
SnAttachment.fromJson(resp.data['meta']),
|
||||
SnAttachmentFragment.fromJson(resp.data['meta']),
|
||||
resp.data['chunk_size'] as int
|
||||
);
|
||||
}
|
||||
|
||||
Future<SnAttachment> _chunkedUploadOnePart(
|
||||
Future<dynamic> _chunkedUploadOnePart(
|
||||
Uint8List data,
|
||||
String rid,
|
||||
String cid, {
|
||||
Function(double progress)? onProgress,
|
||||
bool analyzeNow = false,
|
||||
}) async {
|
||||
final resp = await _sn.client.post(
|
||||
'/cgi/uc/attachments/multipart/$rid/$cid',
|
||||
'/cgi/uc/fragments/$rid/$cid',
|
||||
data: data,
|
||||
queryParameters: {'analyzeNow': analyzeNow},
|
||||
options: Options(headers: {'Content-Type': 'application/octet-stream'}),
|
||||
onSendProgress: (count, total) {
|
||||
if (onProgress != null) {
|
||||
@ -178,21 +218,28 @@ class SnAttachmentProvider {
|
||||
},
|
||||
);
|
||||
|
||||
return SnAttachment.fromJson(resp.data);
|
||||
if (resp.data['attachment'] != null) {
|
||||
return SnAttachment.fromJson(resp.data['attachment']);
|
||||
} else {
|
||||
return SnAttachmentFragment.fromJson(resp.data['fragment']);
|
||||
}
|
||||
}
|
||||
|
||||
Future<SnAttachment> chunkedUploadParts(
|
||||
XFile file,
|
||||
SnAttachment place,
|
||||
SnAttachmentFragment place,
|
||||
int chunkSize, {
|
||||
Function(double progress)? onProgress,
|
||||
bool analyzeNow = false,
|
||||
}) async {
|
||||
final Map<String, dynamic> chunks = place.fileChunks ?? {};
|
||||
var currentTask = 0;
|
||||
final Map<String, dynamic> chunks = place.fileChunks;
|
||||
var completedTasks = 0;
|
||||
|
||||
final queue = Queue<Future<void>>();
|
||||
final activeTasks = <Future<void>>[];
|
||||
|
||||
late SnAttachment out;
|
||||
|
||||
for (final entry in chunks.entries) {
|
||||
queue.add(() async {
|
||||
final beginCursor = entry.value * chunkSize;
|
||||
@ -205,20 +252,26 @@ class SnAttachmentProvider {
|
||||
.expand((chunk) => chunk)
|
||||
.toList());
|
||||
|
||||
place = await _chunkedUploadOnePart(
|
||||
final result = await _chunkedUploadOnePart(
|
||||
data,
|
||||
place.rid,
|
||||
entry.key,
|
||||
onProgress: (chunkProgress) {
|
||||
final overallProgress =
|
||||
(currentTask + chunkProgress) / chunks.length;
|
||||
if (onProgress != null) {
|
||||
onProgress(overallProgress);
|
||||
}
|
||||
analyzeNow: analyzeNow,
|
||||
onProgress: (progress) {
|
||||
final overallProgress = (completedTasks + progress) / chunks.length;
|
||||
onProgress?.call(overallProgress);
|
||||
},
|
||||
);
|
||||
|
||||
currentTask++;
|
||||
completedTasks++;
|
||||
final overallProgress = completedTasks / chunks.length;
|
||||
onProgress?.call(overallProgress);
|
||||
|
||||
if (result is SnAttachmentFragment) {
|
||||
place = result;
|
||||
} else {
|
||||
out = result as SnAttachment;
|
||||
}
|
||||
}());
|
||||
}
|
||||
|
||||
@ -235,6 +288,49 @@ class SnAttachmentProvider {
|
||||
}
|
||||
}
|
||||
|
||||
return place;
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<SnAttachment> updateOne(
|
||||
SnAttachment item, {
|
||||
String? alt,
|
||||
int? thumbnailId,
|
||||
int? compressedId,
|
||||
Map<String, dynamic>? metadata,
|
||||
bool? isIndexable,
|
||||
}) async {
|
||||
final resp = await _sn.client.put('/cgi/uc/attachments/${item.id}', data: {
|
||||
'alt': alt ?? item.alt,
|
||||
'thumbnail': thumbnailId ?? item.thumbnailId,
|
||||
'compressed': compressedId ?? item.compressedId,
|
||||
'metadata': metadata ?? item.usermeta,
|
||||
'is_indexable': isIndexable ?? item.isIndexable,
|
||||
});
|
||||
final out = SnAttachment.fromJson(resp.data);
|
||||
_saveToLocal([out]);
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<void> _saveToLocal(Iterable<SnAttachment> out) async {
|
||||
for (final ele in out) {
|
||||
if (!ele.isAnalyzed || ele.destination == 0) continue;
|
||||
await _dt.db.snLocalAttachment.insertOne(
|
||||
SnLocalAttachmentCompanion.insert(
|
||||
id: Value(ele.id),
|
||||
rid: ele.rid,
|
||||
uuid: ele.uuid,
|
||||
content: ele,
|
||||
accountId: ele.accountId,
|
||||
cacheExpiredAt: DateTime.now().add(const Duration(hours: 1)),
|
||||
),
|
||||
onConflict: DoUpdate(
|
||||
(_) => SnLocalAttachmentCompanion.custom(
|
||||
content: Constant(jsonEncode(ele.toJson())),
|
||||
cacheExpiredAt:
|
||||
Constant(DateTime.now().add(const Duration(hours: 1))),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
@ -11,9 +10,26 @@ import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:surface/logger.dart';
|
||||
import 'package:surface/providers/config.dart';
|
||||
import 'package:surface/providers/widget.dart';
|
||||
import 'package:synchronized/synchronized.dart';
|
||||
import 'package:talker_dio_logger/talker_dio_logger_interceptor.dart';
|
||||
import 'package:talker_dio_logger/talker_dio_logger_settings.dart';
|
||||
|
||||
enum ServiceStatus { operational, downgraded, failed }
|
||||
|
||||
const Map<String, String> kServicesName = {
|
||||
'ai': 'Insights',
|
||||
'co': 'Interactive',
|
||||
're': 'Reader',
|
||||
'im': 'Messaging',
|
||||
'ma': 'Matrix',
|
||||
'uc': 'Paperclip',
|
||||
'wa': 'Wallet',
|
||||
'id': 'Passport',
|
||||
'pusher': 'Pusher',
|
||||
};
|
||||
|
||||
const kNetworkServerDirectory = [
|
||||
('Solar Network', 'https://api.sn.solsynth.dev'),
|
||||
@ -36,6 +52,19 @@ class SnNetworkProvider {
|
||||
|
||||
client = Dio();
|
||||
|
||||
client.interceptors.add(
|
||||
TalkerDioLogger(
|
||||
talker: logging,
|
||||
settings: const TalkerDioLoggerSettings(
|
||||
printRequestHeaders: false,
|
||||
printResponseHeaders: false,
|
||||
printResponseMessage: false,
|
||||
printResponseData: false,
|
||||
printRequestData: false,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
client.interceptors.add(RetryInterceptor(
|
||||
dio: client,
|
||||
retries: 3,
|
||||
@ -68,8 +97,6 @@ class SnNetworkProvider {
|
||||
_config.initialize().then((_) {
|
||||
_prefs = _config.prefs;
|
||||
client.options.baseUrl = _config.serverUrl;
|
||||
if (!context.mounted) return;
|
||||
_home.saveWidgetData("nex_server_url", client.options.baseUrl);
|
||||
});
|
||||
}
|
||||
|
||||
@ -92,7 +119,8 @@ class SnNetworkProvider {
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) async {
|
||||
final atk = await _getFreshAtk(client, prefs.getString(kAtkStoreKey), prefs.getString(kRtkStoreKey), (atk, rtk) {
|
||||
final atk = await _getFreshAtk(client, prefs.getString(kAtkStoreKey),
|
||||
prefs.getString(kRtkStoreKey), (atk, rtk) {
|
||||
prefs.setString(kAtkStoreKey, atk);
|
||||
prefs.setString(kRtkStoreKey, rtk);
|
||||
});
|
||||
@ -104,11 +132,16 @@ class SnNetworkProvider {
|
||||
},
|
||||
),
|
||||
);
|
||||
client.options.baseUrl = prefs.getString(kNetworkServerStoreKey) ?? kNetworkServerDefault;
|
||||
client.options.baseUrl =
|
||||
prefs.getString(kNetworkServerStoreKey) ?? kNetworkServerDefault;
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
Future<void> setConfigWithNative() async {
|
||||
_home.saveWidgetData("nex_server_url", client.options.baseUrl);
|
||||
}
|
||||
|
||||
static Future<String> _getUserAgent() async {
|
||||
final String platformInfo;
|
||||
if (kIsWeb) {
|
||||
@ -116,7 +149,8 @@ class SnNetworkProvider {
|
||||
platformInfo = 'Web; ${deviceInfo.vendor}';
|
||||
} else if (Platform.isAndroid) {
|
||||
final deviceInfo = await DeviceInfoPlugin().androidInfo;
|
||||
platformInfo = 'Android; ${deviceInfo.brand} ${deviceInfo.model}; ${deviceInfo.id}';
|
||||
platformInfo =
|
||||
'Android; ${deviceInfo.brand} ${deviceInfo.model}; ${deviceInfo.id}';
|
||||
} else if (Platform.isIOS) {
|
||||
final deviceInfo = await DeviceInfoPlugin().iosInfo;
|
||||
platformInfo = 'iOS; ${deviceInfo.model}; ${deviceInfo.name}';
|
||||
@ -125,7 +159,8 @@ class SnNetworkProvider {
|
||||
platformInfo = 'MacOS; ${deviceInfo.model}; ${deviceInfo.hostName}';
|
||||
} else if (Platform.isWindows) {
|
||||
final deviceInfo = await DeviceInfoPlugin().windowsInfo;
|
||||
platformInfo = 'Windows NT; ${deviceInfo.productName}; ${deviceInfo.computerName}';
|
||||
platformInfo =
|
||||
'Windows NT; ${deviceInfo.productName}; ${deviceInfo.computerName}';
|
||||
} else if (Platform.isLinux) {
|
||||
final deviceInfo = await DeviceInfoPlugin().linuxInfo;
|
||||
platformInfo = 'Linux; ${deviceInfo.prettyName}';
|
||||
@ -145,12 +180,15 @@ class SnNetworkProvider {
|
||||
final tkLock = Lock();
|
||||
|
||||
Future<String?> getFreshAtk() async {
|
||||
return await _getFreshAtk(client, _prefs.getString(kAtkStoreKey), _prefs.getString(kRtkStoreKey), (atk, rtk) {
|
||||
return await _getFreshAtk(
|
||||
client, _prefs.getString(kAtkStoreKey), _prefs.getString(kRtkStoreKey),
|
||||
(atk, rtk) {
|
||||
setTokenPair(atk, rtk);
|
||||
});
|
||||
}
|
||||
|
||||
static Future<String?> _getFreshAtk(Dio client, String? atk, String? rtk, Function(String atk, String rtk)? onRefresh) async {
|
||||
static Future<String?> _getFreshAtk(Dio client, String? atk, String? rtk,
|
||||
Function(String atk, String rtk)? onRefresh) async {
|
||||
if (_refreshCompleter != null) {
|
||||
return await _refreshCompleter!.future;
|
||||
} else {
|
||||
@ -182,7 +220,8 @@ class SnNetworkProvider {
|
||||
final payload = b64.decode(rawPayload);
|
||||
final exp = jsonDecode(payload)['exp'];
|
||||
if (exp <= DateTime.now().millisecondsSinceEpoch ~/ 1000) {
|
||||
log('Access token need refresh, doing it at ${DateTime.now()}');
|
||||
logging.debug(
|
||||
'[Auth] Access token need refresh, doing it at ${DateTime.now()}');
|
||||
final result = await _refreshToken(client.options.baseUrl, rtk);
|
||||
if (result == null) {
|
||||
atk = null;
|
||||
@ -196,12 +235,12 @@ class SnNetworkProvider {
|
||||
_refreshCompleter!.complete(atk);
|
||||
return atk;
|
||||
} else {
|
||||
log('Access token refresh failed...');
|
||||
logging.error('[Auth] Access token refresh failed...');
|
||||
_refreshCompleter!.complete(null);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
log('Failed to authenticate user: $err');
|
||||
logging.error('[Auth] Failed to authenticate user...', err);
|
||||
_refreshCompleter!.completeError(err);
|
||||
} finally {
|
||||
_refreshCompleter = null;
|
||||
@ -210,8 +249,11 @@ class SnNetworkProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
String getAttachmentUrl(String ky) {
|
||||
String getAttachmentUrl(String ky, {bool preview = true}) {
|
||||
if (ky.startsWith("http")) return ky;
|
||||
if (!preview) {
|
||||
return '${client.options.baseUrl}/cgi/uc/attachments/$ky?preview=false';
|
||||
}
|
||||
return '${client.options.baseUrl}/cgi/uc/attachments/$ky';
|
||||
}
|
||||
|
||||
@ -234,7 +276,8 @@ class SnNetworkProvider {
|
||||
return result.$1;
|
||||
}
|
||||
|
||||
static Future<(String, String)?> _refreshToken(String baseUrl, String? rtk) async {
|
||||
static Future<(String, String)?> _refreshToken(
|
||||
String baseUrl, String? rtk) async {
|
||||
if (rtk == null) return null;
|
||||
|
||||
final dio = Dio();
|
||||
|
90
lib/providers/sn_realm.dart
Normal file
@ -0,0 +1,90 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/database/database.dart';
|
||||
import 'package:surface/providers/database.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/types/realm.dart';
|
||||
|
||||
class SnRealmProvider extends ChangeNotifier {
|
||||
late final SnNetworkProvider _sn;
|
||||
late final DatabaseProvider _dt;
|
||||
|
||||
SnRealmProvider(BuildContext context) {
|
||||
_sn = context.read<SnNetworkProvider>();
|
||||
_dt = context.read<DatabaseProvider>();
|
||||
}
|
||||
|
||||
final Map<String, SnRealm> _cache = {};
|
||||
List<SnRealm> _availableRealms = List.empty(growable: true);
|
||||
|
||||
Future<void> refreshAvailableRealms() async {
|
||||
_availableRealms = await listAvailableRealms();
|
||||
}
|
||||
|
||||
List<SnRealm> get availableRealms => _availableRealms;
|
||||
|
||||
Future<List<SnRealm>> listAvailableRealms() async {
|
||||
final resp = await _sn.client.get('/cgi/id/realms/me/available');
|
||||
final out = List<SnRealm>.from(
|
||||
resp.data?.map((e) => SnRealm.fromJson(e)) ?? [],
|
||||
);
|
||||
for (final realm in out) {
|
||||
_cache[realm.alias] = realm;
|
||||
_cache[realm.id.toString()] = realm;
|
||||
}
|
||||
_saveToLocal(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
void addAvailableRealm(SnRealm realm) {
|
||||
_availableRealms.add(realm);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<SnRealm> getRealm(dynamic aliasOrId) async {
|
||||
if (_cache.containsKey(aliasOrId.toString())) {
|
||||
return _cache[aliasOrId.toString()]!;
|
||||
}
|
||||
final localResp = await (_dt.db.snLocalRealm.select()
|
||||
..where((e) =>
|
||||
e.id.equals(aliasOrId is int ? aliasOrId : 0) |
|
||||
e.alias.equals(aliasOrId.toString()))
|
||||
..where((e) => e.cacheExpiredAt.isBiggerThanValue(DateTime.now())))
|
||||
.getSingleOrNull();
|
||||
if (localResp != null) {
|
||||
_cache[localResp.content.id.toString()] = localResp.content;
|
||||
_cache[localResp.content.alias] = localResp.content;
|
||||
return localResp.content;
|
||||
}
|
||||
final resp = await _sn.client.get('/cgi/id/realms/$aliasOrId');
|
||||
final out = SnRealm.fromJson(resp.data);
|
||||
_cache[out.alias] = out;
|
||||
_cache[out.id.toString()] = out;
|
||||
_saveToLocal([out]);
|
||||
return out;
|
||||
}
|
||||
|
||||
Future<void> _saveToLocal(Iterable<SnRealm> out) async {
|
||||
for (final ele in out) {
|
||||
await _dt.db.snLocalRealm.insertOne(
|
||||
SnLocalRealmCompanion.insert(
|
||||
id: Value(ele.id),
|
||||
alias: ele.alias,
|
||||
content: ele,
|
||||
accountId: ele.accountId,
|
||||
cacheExpiredAt: DateTime.now().add(const Duration(hours: 1)),
|
||||
),
|
||||
onConflict: DoUpdate(
|
||||
(_) => SnLocalRealmCompanion.custom(
|
||||
content: Constant(jsonEncode(ele.toJson())),
|
||||
cacheExpiredAt:
|
||||
Constant(DateTime.now().add(const Duration(hours: 1))),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
132
lib/providers/sn_sticker.dart
Normal file
@ -0,0 +1,132 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:surface/database/database.dart';
|
||||
import 'package:surface/logger.dart';
|
||||
import 'package:surface/providers/database.dart';
|
||||
import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/types/attachment.dart';
|
||||
|
||||
class SnStickerProvider {
|
||||
late final SnNetworkProvider _sn;
|
||||
late final DatabaseProvider _dt;
|
||||
final Map<String, SnSticker?> _cache = {};
|
||||
|
||||
final Map<int, List<SnSticker>> stickersByPack = {};
|
||||
|
||||
List<SnSticker> get stickers =>
|
||||
_cache.values.where((ele) => ele != null).cast<SnSticker>().toList();
|
||||
|
||||
SnStickerProvider(BuildContext context) {
|
||||
_sn = context.read<SnNetworkProvider>();
|
||||
_dt = context.read<DatabaseProvider>();
|
||||
}
|
||||
|
||||
bool hasNotSticker(String alias) {
|
||||
return _cache.containsKey(alias) && _cache[alias] == null;
|
||||
}
|
||||
|
||||
void _cacheSticker(SnSticker sticker) {
|
||||
_cache['${sticker.pack.prefix}:${sticker.alias}'] = sticker;
|
||||
if (stickersByPack[sticker.pack.id] == null) {
|
||||
stickersByPack[sticker.pack.id] = List.empty(growable: true);
|
||||
}
|
||||
if (!stickersByPack[sticker.pack.id]!.contains(sticker)) {
|
||||
stickersByPack[sticker.pack.id]!.add(sticker);
|
||||
}
|
||||
}
|
||||
|
||||
void putSticker(Iterable<SnSticker> stickers) {
|
||||
for (final ele in stickers) {
|
||||
_cacheSticker(ele);
|
||||
}
|
||||
_saveStickerToLocal(stickers);
|
||||
_saveStickerPackToLocal(stickers.map((ele) => ele.pack).toSet());
|
||||
}
|
||||
|
||||
Future<SnSticker?> lookupSticker(String alias) async {
|
||||
// In-memory cache
|
||||
if (_cache.containsKey(alias)) {
|
||||
return _cache[alias];
|
||||
}
|
||||
// On-disk cache
|
||||
final localStickers = await (_dt.db.snLocalSticker.select()
|
||||
..where((e) => e.fullAlias.equals(alias)))
|
||||
.getSingleOrNull();
|
||||
if (localStickers != null) {
|
||||
_cache[alias] = localStickers.content;
|
||||
return localStickers.content;
|
||||
}
|
||||
// Remote server
|
||||
try {
|
||||
final resp = await _sn.client.get('/cgi/uc/stickers/lookup/$alias');
|
||||
final sticker = SnSticker.fromJson(resp.data);
|
||||
putSticker([sticker]);
|
||||
return sticker;
|
||||
} catch (err) {
|
||||
_cache[alias] = null;
|
||||
logging.warning('[Sticker] Failed to lookup sticker $alias', err);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<void> listSticker() async {
|
||||
final localPacks = await _dt.db.snLocalStickerPack.select().get();
|
||||
final localStickers = await _dt.db.snLocalSticker.select().get();
|
||||
final local = localStickers.map((ele) {
|
||||
return ele.content.copyWith(
|
||||
pack: localPacks
|
||||
.firstWhere((pk) => pk.content.id == ele.content.packId)
|
||||
.content,
|
||||
);
|
||||
});
|
||||
for (final sticker in local) {
|
||||
_cacheSticker(sticker);
|
||||
}
|
||||
try {
|
||||
final resp = await _sn.client.get('/cgi/uc/stickers');
|
||||
final data = resp.data;
|
||||
final stickers = List.from(data).map((ele) => SnSticker.fromJson(ele));
|
||||
for (final sticker in stickers) {
|
||||
_cacheSticker(sticker);
|
||||
}
|
||||
} catch (err) {
|
||||
logging.error('[Sticker] Failed to list stickers...', err);
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _saveStickerToLocal(Iterable<SnSticker> stickers) async {
|
||||
await _dt.db.snLocalSticker.insertAll(
|
||||
stickers.map(
|
||||
(ele) => SnLocalStickerCompanion.insert(
|
||||
id: Value(ele.id),
|
||||
alias: ele.alias,
|
||||
fullAlias: '${ele.pack.prefix}${ele.alias}',
|
||||
content: ele,
|
||||
createdAt: Value(ele.createdAt),
|
||||
),
|
||||
),
|
||||
onConflict: DoNothing(),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _saveStickerPackToLocal(Iterable<SnStickerPack> packs) async {
|
||||
final queries = packs
|
||||
.map(
|
||||
(ele) => _dt.db.snLocalStickerPack.insertOne(
|
||||
SnLocalStickerPackCompanion.insert(
|
||||
id: Value(ele.id),
|
||||
content: ele,
|
||||
createdAt: Value(ele.createdAt),
|
||||
),
|
||||
onConflict: DoUpdate((_) => SnLocalStickerPackCompanion.custom(
|
||||
content: Constant(jsonEncode(ele.toJson()))))),
|
||||
)
|
||||
.toList();
|
||||
await Future.wait(queries);
|
||||
}
|
||||
}
|