Compare commits
468 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38bef584e1 | ||
|
|
e62f727135 | ||
|
|
a0e7ef61fc | ||
|
|
fd8ae60dc1 | ||
|
|
093c2887c3 | ||
|
|
770678e32a | ||
|
|
07cc05f62e | ||
|
|
77719750ee | ||
|
|
fb2bbd87b7 | ||
|
|
6206b6f843 | ||
|
|
9e3fa2e4bc | ||
|
|
1f16d72667 | ||
|
|
6cf9157fb5 | ||
|
|
76ff9a562e | ||
|
|
ffeff09561 | ||
|
|
cc71bdce8f | ||
|
|
5d43df4f33 | ||
|
|
d29c3add79 | ||
|
|
4544b091a0 | ||
|
|
91244d5211 | ||
|
|
5cae7b3db1 | ||
|
|
702fe024c0 | ||
|
|
1ad0ff34df | ||
|
|
282c502b71 | ||
|
|
d6e989cad5 | ||
|
|
23388b5705 | ||
|
|
9ed56aa5d6 | ||
|
|
d9c5ab645c | ||
|
|
2cfb3c6755 | ||
|
|
e095c325b3 | ||
|
|
47f9978c46 | ||
|
|
2e1e13b843 | ||
|
|
7c2110c1f3 | ||
|
|
2a7ac6896c | ||
|
|
e13325ca22 | ||
|
|
e889a52f6f | ||
|
|
4d737b35da | ||
|
|
0fbd263562 | ||
|
|
f81f37505b | ||
|
|
58dd33d8a2 | ||
|
|
f24f27a13c | ||
|
|
87cc18aff8 | ||
|
|
b88219902f | ||
|
|
63090fb75f | ||
|
|
b5b520ab66 | ||
|
|
7a6052db81 | ||
|
|
a73520c9d8 | ||
|
|
55b63cd2e3 | ||
|
|
612ee18a93 | ||
|
|
ca5c9271a3 | ||
|
|
9feea4a724 | ||
|
|
3da99b6058 | ||
|
|
3b4dfa1381 | ||
|
|
1b1f9d9985 | ||
|
|
3f5eaa8f0a | ||
|
|
28a567986d | ||
|
|
68027fd23e | ||
|
|
2807c5ef19 | ||
|
|
0477bda929 | ||
|
|
d80b3fda7d | ||
|
|
a831c1703a | ||
|
|
e6cec49646 | ||
|
|
74d848311b | ||
|
|
c03df169b3 | ||
|
|
9b19cba161 | ||
|
|
9536a3c98e | ||
|
|
f0de8131ec | ||
|
|
aa18cb64bc | ||
|
|
7b36c91e0d | ||
|
|
fb0ceb110e | ||
|
|
20fbf0a655 | ||
|
|
46de86f1e4 | ||
|
|
05eabfd539 | ||
|
|
74942cd06e | ||
|
|
24da40ef05 | ||
|
|
e7fbcce9d9 | ||
|
|
ef5055f4f3 | ||
|
|
7cbc5ef902 | ||
|
|
03d96a32f2 | ||
|
|
5406c17158 | ||
|
|
29c6228616 | ||
|
|
3f4a44c828 | ||
|
|
327c9caed7 | ||
|
|
07560188cf | ||
|
|
2c64676415 | ||
|
|
29ddd88a5d | ||
|
|
543dc80b0b | ||
|
|
2008b1beea | ||
|
|
9aa597d6f0 | ||
|
|
1d85416434 | ||
|
|
bb64285c3a | ||
|
|
6a581830f4 | ||
|
|
f1d155c3f6 | ||
|
|
66e3b529b7 | ||
|
|
04cfd598e2 | ||
|
|
b94c8436eb | ||
|
|
dbfc555d9c | ||
|
|
5aacf867cd | ||
|
|
2f9db1d069 | ||
|
|
3c022b893a | ||
|
|
b74adc5311 | ||
|
|
ed8b237364 | ||
|
|
7170808d2b | ||
|
|
578a80dfb8 | ||
|
|
d72a5e0d3d | ||
|
|
2699af5d5a | ||
|
|
8298caddc3 | ||
|
|
1bcde1b55c | ||
|
|
5d492bfe93 | ||
|
|
655b3d7c50 | ||
|
|
e4278745d5 | ||
|
|
e266dc153b | ||
|
|
a482b744d2 | ||
|
|
d5bf742912 | ||
|
|
4346aecb61 | ||
|
|
bdfa080701 | ||
|
|
465a42a825 | ||
|
|
7d519990b2 | ||
|
|
19fd3a15e1 | ||
|
|
12250676f9 | ||
|
|
a1bb9cbb2b | ||
|
|
836df873f0 | ||
|
|
58cc8fc08b | ||
|
|
d1d5312ead | ||
|
|
f3595e379c | ||
|
|
5f8c2f90ff | ||
|
|
abc7b8364c | ||
|
|
627a105ba9 | ||
|
|
faef5d8af6 | ||
|
|
cf1dc3df78 | ||
|
|
a26e4eee18 | ||
|
|
efa4deef6a | ||
|
|
7e00930319 | ||
|
|
c08b2ae3df | ||
|
|
8ebbeb5274 | ||
|
|
c3b01d8573 | ||
|
|
43d8dedec4 | ||
|
|
cd97b649ff | ||
|
|
ac650b08fd | ||
|
|
e6c005dcba | ||
|
|
5acb7448b7 | ||
|
|
80168a58a7 | ||
|
|
ebae0d71b8 | ||
|
|
8c11e1724a | ||
|
|
d0597407d8 | ||
|
|
c3aa2abe11 | ||
|
|
3e0b2f5553 | ||
|
|
3d1275e19a | ||
|
|
d72d1aabe6 | ||
|
|
aac6d0df27 | ||
|
|
f700220ec1 | ||
|
|
04d9b93e17 | ||
|
|
989fad8554 | ||
|
|
2981a16e17 | ||
|
|
afff7634f9 | ||
|
|
95b2886bad | ||
|
|
d57905c2b3 | ||
|
|
ffe037f9f1 | ||
|
|
3a748e20c2 | ||
|
|
b0c2ed839d | ||
|
|
eee252bb74 | ||
|
|
59a8acc667 | ||
|
|
960f50824d | ||
|
|
63020ec302 | ||
|
|
71d4563b9d | ||
|
|
98bfd7370d | ||
|
|
45a81a5016 | ||
|
|
389fb0c4e9 | ||
|
|
fc72fe3a78 | ||
|
|
5f646dd125 | ||
|
|
6748233869 | ||
|
|
fef90ea363 | ||
|
|
0480611bf8 | ||
|
|
b4fbff0b6c | ||
|
|
5f5d5629f8 | ||
|
|
2d7f6fc2e7 | ||
|
|
5d6fd32496 | ||
|
|
48b24d12b2 | ||
|
|
f0dc912080 | ||
|
|
23f6044081 | ||
|
|
f52fe937ed | ||
|
|
97fe03e522 | ||
|
|
1ce2b5d946 | ||
|
|
c1003e39d1 | ||
|
|
b50073d281 | ||
|
|
37cdd78bda | ||
|
|
c13d637502 | ||
|
|
2298eed8bf | ||
|
|
8fab9167be | ||
|
|
965a01a4cd | ||
|
|
98bc7ce49b | ||
|
|
12873f8be0 | ||
|
|
6820b0b3b3 | ||
|
|
862093e1dd | ||
|
|
7751f383ca | ||
|
|
431521a8f5 | ||
|
|
f1b0e81b60 | ||
|
|
340271fea0 | ||
|
|
25c48cc08e | ||
|
|
0bcc4befa1 | ||
|
|
d24735b217 | ||
|
|
3643622e1b | ||
|
|
8fb2772093 | ||
|
|
4794a0be84 | ||
|
|
bd3d57056b | ||
|
|
15fc17066b | ||
|
|
afe34121af | ||
|
|
4f71383557 | ||
|
|
5aee0f642a | ||
|
|
38d799de24 | ||
|
|
0eb8d24394 | ||
|
|
f1822d69be | ||
|
|
ee9336f781 | ||
|
|
6fdd1389e6 | ||
|
|
00e601296c | ||
|
|
3bc58fb690 | ||
|
|
a52dfe7998 | ||
|
|
3d7a3cf33a | ||
|
|
6bba0cf986 | ||
|
|
1f447f98d8 | ||
|
|
208b5d7b5b | ||
|
|
87f44e87cd | ||
|
|
f2c8167124 | ||
|
|
3589e658c9 | ||
|
|
1f71630f51 | ||
|
|
322367c1b1 | ||
|
|
4eeac7dc18 | ||
|
|
74733275d8 | ||
|
|
100fed3622 | ||
|
|
3e8b76dbd8 | ||
|
|
da7178089f | ||
|
|
651ef2aa78 | ||
|
|
8c0e168009 | ||
|
|
fb36359a6d | ||
|
|
f2a92f2b02 | ||
|
|
3b562bfa3a | ||
|
|
22df6fb42e | ||
|
|
735457c231 | ||
|
|
b387ccdcf7 | ||
|
|
03ff48cf07 | ||
|
|
6db4222b1b | ||
|
|
72d8cd7ef0 | ||
|
|
2637c860e9 | ||
|
|
50b5af64dd | ||
|
|
e5682a9b25 | ||
|
|
1ee7801c0b | ||
|
|
c13e433e65 | ||
|
|
4aaecfd531 | ||
|
|
57b27d217c | ||
|
|
1e8f4e428a | ||
|
|
0693f98107 | ||
|
|
08a93416e8 | ||
|
|
3d36b4f866 | ||
|
|
9071d7b8c0 | ||
|
|
dff28bcf7f | ||
|
|
22585ca919 | ||
|
|
8a888051e5 | ||
|
|
0b5ac98282 | ||
|
|
d506f10e9f | ||
|
|
49129c1529 | ||
|
|
66204bae95 | ||
|
|
d47c138f23 | ||
|
|
a980fba3aa | ||
|
|
f3d5f0c9de | ||
|
|
28c58b41fe | ||
|
|
da385069f4 | ||
|
|
79870600d9 | ||
|
|
ac48ec5969 | ||
|
|
74e2175a7a | ||
|
|
a7fe88bea7 | ||
|
|
fedf29adb1 | ||
|
|
1ba052cc13 | ||
|
|
90c54b1f2a | ||
|
|
3e3e1d628c | ||
|
|
e9620af6fb | ||
|
|
b584204522 | ||
|
|
dc146cb1fe | ||
|
|
08e04cdcb1 | ||
|
|
063be9a13a | ||
|
|
8f6f434d8a | ||
|
|
616957e46f | ||
|
|
8a3506af89 | ||
|
|
85545dba64 | ||
|
|
fa4d8f2fbd | ||
|
|
8ae6156477 | ||
|
|
621a5cc4ab | ||
|
|
a4ea4689a2 | ||
|
|
a8935178a2 | ||
|
|
7f033c1cc4 | ||
|
|
eb9c2ce39a | ||
|
|
057e0de75a | ||
|
|
4102551108 | ||
|
|
ff4ccdc59c | ||
|
|
f51f133832 | ||
|
|
c4319a7370 | ||
|
|
041670b8e7 | ||
|
|
4cdf08cbfb | ||
|
|
9f96237b85 | ||
|
|
92d87f96e1 | ||
|
|
40d4353d05 | ||
|
|
a2b6e05cdf | ||
|
|
10c810ff03 | ||
|
|
51dac66998 | ||
|
|
9b9ea336be | ||
|
|
0e75ad42e2 | ||
|
|
ceecbaa904 | ||
|
|
58315ec50e | ||
|
|
1f2b5ba0a2 | ||
|
|
dc3e9e2f3d | ||
|
|
ff6df75adc | ||
|
|
07ceee79ff | ||
|
|
55859f3caa | ||
|
|
418b0e7db0 | ||
|
|
38199276f1 | ||
|
|
7f26f81e4f | ||
|
|
8211c94a74 | ||
|
|
dbdd9aa481 | ||
|
|
9339db900f | ||
|
|
2d7adbc68a | ||
|
|
bfa5accc29 | ||
|
|
f91f77ff2e | ||
|
|
1243123579 | ||
|
|
8e8c356659 | ||
|
|
b73f1be856 | ||
|
|
c7836be614 | ||
|
|
f88466a376 | ||
|
|
e60a9f0943 | ||
|
|
41e13e39bc | ||
|
|
431b7445c3 | ||
|
|
c301be3826 | ||
|
|
998b36f014 | ||
|
|
5b787a6759 | ||
|
|
cf0ea4a0a1 | ||
|
|
aea5a8ff76 | ||
|
|
fd1a8014c4 | ||
|
|
7e3bc2966e | ||
|
|
f1877641e5 | ||
|
|
240117b77e | ||
|
|
352d87ba76 | ||
|
|
b5dc22b77b | ||
|
|
9310728a11 | ||
|
|
e3fa17dd4f | ||
|
|
ae8fb14f9e | ||
|
|
7fb24d77c0 | ||
|
|
e426f2895b | ||
|
|
ee94e78533 | ||
|
|
78809873b0 | ||
|
|
4611727ab9 | ||
|
|
619dbe9b11 | ||
|
|
f522cc9444 | ||
|
|
3ae2986c25 | ||
|
|
cb2c6e4b89 | ||
|
|
fb86bb579b | ||
|
|
8535a579ca | ||
|
|
12f5ccaaa5 | ||
|
|
524d64a462 | ||
|
|
66961dce83 | ||
|
|
6f092bbb57 | ||
|
|
872ff633b6 | ||
|
|
d542291d8f | ||
|
|
de94afd966 | ||
|
|
907965531c | ||
|
|
91f50e8bdc | ||
|
|
718de09aa6 | ||
|
|
3b703d7262 | ||
|
|
efaa3ba453 | ||
|
|
9caac426ef | ||
|
|
cbebcb1bc9 | ||
|
|
01ecd73a62 | ||
|
|
6f2a37cbab | ||
|
|
eea508066c | ||
|
|
b3a255b3f1 | ||
|
|
ae98e4ae44 | ||
|
|
64535251e8 | ||
|
|
c742d7406c | ||
|
|
06f5f7f7d9 | ||
|
|
e6c86b19db | ||
|
|
55f83129b7 | ||
|
|
e943264823 | ||
|
|
a0152557ec | ||
|
|
f4bf79b067 | ||
|
|
ba7762305e | ||
|
|
7dbba75776 | ||
|
|
339a80e192 | ||
|
|
32d567120b | ||
|
|
d5718f96b8 | ||
|
|
95ba12e3cb | ||
|
|
82f06cee55 | ||
|
|
2f2d698545 | ||
|
|
90de0b687f | ||
|
|
d932271c60 | ||
|
|
5bfb98b70d | ||
|
|
fe1aacd37b | ||
|
|
8979525dc0 | ||
|
|
9d0332be0a | ||
|
|
9e37088f43 | ||
|
|
8f17fe98e0 | ||
|
|
8be4dfb346 | ||
|
|
46a42e02bc | ||
|
|
2597bc9f4e | ||
|
|
ec84589eca | ||
|
|
11b02b4f88 | ||
|
|
9e5262008f | ||
|
|
311a1274c5 | ||
|
|
276adec0ff | ||
|
|
54b5342af4 | ||
|
|
410efc924b | ||
|
|
e748a68153 | ||
|
|
4edfd4804f | ||
|
|
4c24ec7725 | ||
|
|
bdc7f4114f | ||
|
|
885738ac32 | ||
|
|
43bab3eeaa | ||
|
|
f424cb54f7 | ||
|
|
e6d3b2b098 | ||
|
|
e7e1c9aa5a | ||
|
|
173ae746a2 | ||
|
|
d9fc3619c2 | ||
|
|
cfe12f773f | ||
|
|
782025a0a6 | ||
|
|
a05e2f0d8d | ||
|
|
50b2b6c5b1 | ||
|
|
1afae74d1e | ||
|
|
da4120bddd | ||
|
|
c961acabbc | ||
|
|
7b6fcb467a | ||
|
|
e5bd187d4d | ||
|
|
90c6475c8c | ||
|
|
8fa9172818 | ||
|
|
cfcd12e879 | ||
|
|
1ef877d9a5 | ||
|
|
be06d68468 | ||
|
|
055b99f5b0 | ||
|
|
f37ab6e38e | ||
|
|
fe1e627cac | ||
|
|
1e252a6505 | ||
|
|
3a7faffa3a | ||
|
|
8b14249cd2 | ||
|
|
7243fb52ad | ||
|
|
1524b4a930 | ||
|
|
08bfe6f1c1 | ||
|
|
70dbd9e5b4 | ||
|
|
2577bedeac | ||
|
|
0c0c8f3584 | ||
|
|
3b1fd9e45a | ||
|
|
793862bee6 | ||
|
|
a196b0aba7 | ||
|
|
61723bd794 | ||
|
|
85060cd655 | ||
|
|
c4da31c213 | ||
|
|
a18baaae2c | ||
|
|
02a71d745d | ||
|
|
b7fed0377c | ||
|
|
325e4af356 | ||
|
|
6a668fc171 | ||
|
|
35befb2b3c | ||
|
|
86695f60a3 | ||
|
|
4e1e7a5a9c | ||
|
|
2677a86ffd | ||
|
|
a293018a87 | ||
|
|
c8a98b6429 | ||
|
|
16d06527be | ||
|
|
c867727e1c | ||
|
|
1a4c1cbbf4 | ||
|
|
c1a241c7e7 | ||
|
|
1368d6e7db | ||
|
|
908b513601 | ||
|
|
3023a383fc |
@@ -1,86 +0,0 @@
|
||||
@echo off
|
||||
|
||||
IF "%BUILD_DIR%"=="" SET BUILD_DIR=C:\TBuild
|
||||
SET LIB_DIR=%BUILD_DIR%\Libraries
|
||||
SET SRC_DIR=%BUILD_DIR%\tdesktop
|
||||
SET QT_VERSION=5_6_2
|
||||
|
||||
call:configureBuild
|
||||
call:getDependencies
|
||||
call:setupGYP
|
||||
cd %SRC_DIR%
|
||||
|
||||
echo Finished!
|
||||
|
||||
GOTO:EOF
|
||||
|
||||
:: FUNCTIONS
|
||||
:logInfo
|
||||
echo [INFO] %~1
|
||||
GOTO:EOF
|
||||
|
||||
:logError
|
||||
echo [ERROR] %~1
|
||||
GOTO:EOF
|
||||
|
||||
:getDependencies
|
||||
call:logInfo "Clone dependencies repository"
|
||||
git clone -q --depth 1 --branch master https://github.com/telegramdesktop/dependencies_windows.git %LIB_DIR%
|
||||
cd %LIB_DIR%
|
||||
|
||||
git clone --depth 1 --branch 0.9.1 https://github.com/ericniebler/range-v3
|
||||
|
||||
if exist prepare.bat (
|
||||
call prepare.bat
|
||||
) else (
|
||||
call:logError "Error cloning dependencies, trying again"
|
||||
rmdir %LIB_DIR% /S /Q
|
||||
call:getDependencies
|
||||
)
|
||||
GOTO:EOF
|
||||
|
||||
:setupGYP
|
||||
call:logInfo "Setup GYP/Ninja and generate VS solution"
|
||||
cd %LIB_DIR%
|
||||
git clone https://github.com/telegramdesktop/gyp.git
|
||||
cd gyp
|
||||
git checkout tdesktop
|
||||
SET PATH=%PATH%;%BUILD_DIR%\Libraries\gyp;%BUILD_DIR%\Libraries\ninja;
|
||||
cd %SRC_DIR%
|
||||
git submodule init
|
||||
git submodule update
|
||||
cd %SRC_DIR%\Telegram
|
||||
call gyp\refresh.bat --api-id 17349 --api-hash 344583e45741c457fe1862106095a5eb
|
||||
GOTO:EOF
|
||||
|
||||
:configureBuild
|
||||
call:logInfo "Configuring build"
|
||||
call:logInfo "Build version: %BUILD_VERSION%"
|
||||
set TDESKTOP_BUILD_DEFINES=
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_register_custom_scheme">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_crash_reports">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_CRASH_REPORTS
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_network_proxy">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_NETWORK_PROXY
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_desktop_file_generation">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_gtk_integration">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_GTK_INTEGRATION
|
||||
)
|
||||
|
||||
if not "%TDESKTOP_BUILD_DEFINES%" == "" (
|
||||
set "TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES:~1%"
|
||||
)
|
||||
|
||||
call:logInfo "Build Defines: %TDESKTOP_BUILD_DEFINES%"
|
||||
GOTO:EOF
|
||||
2
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
@@ -8,7 +8,7 @@ about: Report errors or unexpected behavior.
|
||||
Thanks for reporting issues of Telegram Desktop!
|
||||
|
||||
To make it easier for us to help you please enter detailed information below.
|
||||
-->
|
||||
-->
|
||||
### Steps to reproduce
|
||||
1.
|
||||
2.
|
||||
|
||||
103
.github/workflows/issue_closer.yml
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
name: Issue closer.
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: opened
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get the latest version.
|
||||
run: |
|
||||
tag=$(git ls-remote --tags git://github.com/$GITHUB_REPOSITORY | cut -f 2 | tail -n1)
|
||||
echo $tag
|
||||
echo ::set-env name=LATEST_TAG::$tag
|
||||
|
||||
- name: Check a version from an issue.
|
||||
uses: actions/github-script@0.4.0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
let errorStr = "Version not found.";
|
||||
|
||||
let item1 = "Version of Telegram Desktop";
|
||||
let item2 = "Used theme";
|
||||
let body = context.payload.issue.body;
|
||||
|
||||
console.log("Body of issue:\n" + body);
|
||||
let index1 = body.indexOf(item1);
|
||||
let index2 = body.indexOf(item2);
|
||||
index2 = (index2 == -1) ? Number.MAX_SAFE_INTEGER : index2;
|
||||
|
||||
console.log("Index 1: " + index1);
|
||||
console.log("Index 2: " + index2);
|
||||
|
||||
if (index1 == -1) {
|
||||
console.log(errorStr);
|
||||
return;
|
||||
}
|
||||
|
||||
function parseVersion(str) {
|
||||
let pattern = /[0-9]\.[0-9][0-9.]{0,}/g;
|
||||
return str.match(pattern);
|
||||
}
|
||||
function firstNum(version) {
|
||||
return version[0].split(".")[0];
|
||||
}
|
||||
|
||||
let issueVer = parseVersion(body.substring(index1 + item1.length, index2));
|
||||
|
||||
if (issueVer == undefined) {
|
||||
console.log(errorStr);
|
||||
return;
|
||||
}
|
||||
console.log("Version from issue: " + issueVer[0]);
|
||||
|
||||
let latestVer = parseVersion(process.env.LATEST_TAG);
|
||||
|
||||
if (latestVer == undefined) {
|
||||
console.log(errorStr);
|
||||
return;
|
||||
}
|
||||
console.log("Version from tags: " + latestVer[0]);
|
||||
|
||||
let issueNum = firstNum(issueVer);
|
||||
let latestNum = firstNum(latestVer);
|
||||
|
||||
if (issueNum <= latestNum && issueNum < 5) {
|
||||
console.log("Seems the version of this issue is fine!");
|
||||
return;
|
||||
}
|
||||
|
||||
let message = `
|
||||
Sorry, but according to the version you specify in this issue, \
|
||||
you are using the [Telegram for macOS](https://macos.telegram.org), \
|
||||
not the [Telegram Desktop](https://desktop.telegram.org).
|
||||
You can report your issue to [the group](https://t.me/macswift) \
|
||||
or to [the repository of Telegram for macOS](https://github.com/overtake/TelegramSwift).
|
||||
|
||||
If I made a mistake and closed your issue wrongly, please reopen it. Thanks!
|
||||
`;
|
||||
|
||||
let params = {
|
||||
owner: context.issue.owner,
|
||||
repo: context.issue.repo,
|
||||
issue_number: context.issue.number
|
||||
};
|
||||
|
||||
github.issues.createComment({
|
||||
...params,
|
||||
body: message
|
||||
});
|
||||
|
||||
github.issues.addLabels({
|
||||
...params,
|
||||
labels: ['TG macOS Swift']
|
||||
});
|
||||
|
||||
github.issues.update({
|
||||
...params,
|
||||
state: 'closed'
|
||||
});
|
||||
|
||||
493
.github/workflows/linux.yml
vendored
Normal file
@@ -0,0 +1,493 @@
|
||||
name: Linux.
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
|
||||
jobs:
|
||||
|
||||
linux:
|
||||
name: Ubuntu 14.04
|
||||
runs-on: ubuntu-latest
|
||||
container: ubuntu:trusty
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
defines:
|
||||
- ""
|
||||
|
||||
env:
|
||||
GIT: "https://github.com"
|
||||
QT: "5_12_5"
|
||||
QT_PREFIX: "/usr/local/desktop-app/Qt-5.12.5"
|
||||
OPENSSL_VER: "1_1_1"
|
||||
OPENSSL_PREFIX: "/usr/local/desktop-app/openssl-1.1.1"
|
||||
CMAKE_VER: "3.16.3"
|
||||
UPLOAD_ARTIFACT: "false"
|
||||
ONLY_CACHE: "false"
|
||||
MANUAL_CACHING: "3"
|
||||
DOC_PATH: "docs/building-cmake.md"
|
||||
|
||||
steps:
|
||||
- name: Get repository name.
|
||||
run: echo ::set-env name=REPO_NAME::${GITHUB_REPOSITORY##*/}
|
||||
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: First set up.
|
||||
run: |
|
||||
cd ..
|
||||
mv $REPO_NAME temp
|
||||
mkdir $REPO_NAME
|
||||
mv temp $REPO_NAME/$REPO_NAME
|
||||
cd $REPO_NAME
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install software-properties-common -y && \
|
||||
sudo apt-get install git libexif-dev liblzma-dev libz-dev libssl-dev \
|
||||
libgtk2.0-dev libice-dev libsm-dev libicu-dev libdrm-dev dh-autoreconf \
|
||||
autoconf automake build-essential libass-dev libfreetype6-dev \
|
||||
libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev \
|
||||
libvorbis-dev libenchant-dev libxcb1-dev libxcb-image0-dev libxcb-shm0-dev \
|
||||
libxcb-xfixes0-dev libxcb-keysyms1-dev libxcb-icccm4-dev libatspi2.0-dev \
|
||||
libxcb-render-util0-dev libxcb-util0-dev libxcb-xkb-dev libxrender-dev \
|
||||
libasound-dev libpulse-dev libxcb-sync0-dev libxcb-randr0-dev bison \
|
||||
libx11-xcb-dev libffi-dev libncurses5-dev pkg-config texi2html yasm \
|
||||
zlib1g-dev xutils-dev python-xcbgen chrpath gperf wget -y --force-yes && \
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
|
||||
sudo apt-get update && \
|
||||
sudo apt-get install gcc-8 g++-8 -y && \
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 && \
|
||||
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60 && \
|
||||
sudo update-alternatives --config gcc && \
|
||||
sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test -y
|
||||
|
||||
gcc --version
|
||||
|
||||
gcc --version > CACHE_KEY.txt
|
||||
echo $MANUAL_CACHING >> CACHE_KEY.txt
|
||||
md5cache=$(md5sum CACHE_KEY.txt | cut -c -32)
|
||||
echo ::set-env name=CACHE_KEY::$md5cache
|
||||
|
||||
mkdir -p Libraries
|
||||
cd Libraries
|
||||
echo ::set-env name=LibrariesPath::`pwd`
|
||||
|
||||
- name: Range-v3.
|
||||
run: |
|
||||
echo "Find necessary branch from doc."
|
||||
cloneRange=$(grep -A 1 "range-v3" $REPO_NAME/$DOC_PATH | sed -n 1p)
|
||||
cd $LibrariesPath
|
||||
echo $cloneRange
|
||||
eval $cloneRange
|
||||
|
||||
- name: Patches.
|
||||
run: |
|
||||
echo "Find necessary commit from doc."
|
||||
checkoutCommit=$(grep -A 1 "cd patches" $REPO_NAME/$DOC_PATH | sed -n 2p)
|
||||
cd $LibrariesPath
|
||||
git clone $GIT/desktop-app/patches.git
|
||||
cd patches
|
||||
eval $checkoutCommit
|
||||
|
||||
- name: CMake.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
file=cmake-$CMAKE_VER-Linux-x86_64.sh
|
||||
wget $GIT/Kitware/CMake/releases/download/v$CMAKE_VER/$file
|
||||
sudo mkdir /opt/cmake
|
||||
sudo sh $file --prefix=/opt/cmake --skip-license
|
||||
sudo ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
|
||||
|
||||
cmake --version
|
||||
|
||||
- name: Opus cache.
|
||||
id: cache-opus
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/opus
|
||||
key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }}
|
||||
- name: Opus.
|
||||
if: steps.cache-opus.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/xiph/opus
|
||||
cd opus
|
||||
git checkout v1.3
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j$(nproc)
|
||||
- name: Opus install.
|
||||
run: |
|
||||
cd $LibrariesPath/opus
|
||||
sudo make install
|
||||
|
||||
- name: Libva.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/01org/libva.git
|
||||
cd libva
|
||||
./autogen.sh --enable-static
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- name: Libvdpau.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone git://anongit.freedesktop.org/vdpau/libvdpau
|
||||
cd libvdpau
|
||||
git checkout libvdpau-1.2
|
||||
./autogen.sh --enable-static
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- name: FFmpeg cache.
|
||||
id: cache-ffmpeg
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/ffmpeg-cache
|
||||
key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}
|
||||
- name: FFmpeg build.
|
||||
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone --branch release/3.4 $GIT/FFmpeg/FFmpeg ffmpeg
|
||||
cd ffmpeg
|
||||
./configure --prefix=$LibrariesPath/ffmpeg-cache \
|
||||
--enable-protocol=file --enable-libopus \
|
||||
--disable-programs \
|
||||
--disable-doc \
|
||||
--disable-network \
|
||||
--disable-everything \
|
||||
--enable-hwaccel=h264_vaapi \
|
||||
--enable-hwaccel=h264_vdpau \
|
||||
--enable-hwaccel=mpeg4_vaapi \
|
||||
--enable-hwaccel=mpeg4_vdpau \
|
||||
--enable-decoder=aac \
|
||||
--enable-decoder=aac_at \
|
||||
--enable-decoder=aac_fixed \
|
||||
--enable-decoder=aac_latm \
|
||||
--enable-decoder=aasc \
|
||||
--enable-decoder=alac \
|
||||
--enable-decoder=alac_at \
|
||||
--enable-decoder=flac \
|
||||
--enable-decoder=gif \
|
||||
--enable-decoder=h264 \
|
||||
--enable-decoder=h264_vdpau \
|
||||
--enable-decoder=hevc \
|
||||
--enable-decoder=mp1 \
|
||||
--enable-decoder=mp1float \
|
||||
--enable-decoder=mp2 \
|
||||
--enable-decoder=mp2float \
|
||||
--enable-decoder=mp3 \
|
||||
--enable-decoder=mp3adu \
|
||||
--enable-decoder=mp3adufloat \
|
||||
--enable-decoder=mp3float \
|
||||
--enable-decoder=mp3on4 \
|
||||
--enable-decoder=mp3on4float \
|
||||
--enable-decoder=mpeg4 \
|
||||
--enable-decoder=mpeg4_vdpau \
|
||||
--enable-decoder=msmpeg4v2 \
|
||||
--enable-decoder=msmpeg4v3 \
|
||||
--enable-decoder=opus \
|
||||
--enable-decoder=pcm_alaw \
|
||||
--enable-decoder=pcm_alaw_at \
|
||||
--enable-decoder=pcm_f32be \
|
||||
--enable-decoder=pcm_f32le \
|
||||
--enable-decoder=pcm_f64be \
|
||||
--enable-decoder=pcm_f64le \
|
||||
--enable-decoder=pcm_lxf \
|
||||
--enable-decoder=pcm_mulaw \
|
||||
--enable-decoder=pcm_mulaw_at \
|
||||
--enable-decoder=pcm_s16be \
|
||||
--enable-decoder=pcm_s16be_planar \
|
||||
--enable-decoder=pcm_s16le \
|
||||
--enable-decoder=pcm_s16le_planar \
|
||||
--enable-decoder=pcm_s24be \
|
||||
--enable-decoder=pcm_s24daud \
|
||||
--enable-decoder=pcm_s24le \
|
||||
--enable-decoder=pcm_s24le_planar \
|
||||
--enable-decoder=pcm_s32be \
|
||||
--enable-decoder=pcm_s32le \
|
||||
--enable-decoder=pcm_s32le_planar \
|
||||
--enable-decoder=pcm_s64be \
|
||||
--enable-decoder=pcm_s64le \
|
||||
--enable-decoder=pcm_s8 \
|
||||
--enable-decoder=pcm_s8_planar \
|
||||
--enable-decoder=pcm_u16be \
|
||||
--enable-decoder=pcm_u16le \
|
||||
--enable-decoder=pcm_u24be \
|
||||
--enable-decoder=pcm_u24le \
|
||||
--enable-decoder=pcm_u32be \
|
||||
--enable-decoder=pcm_u32le \
|
||||
--enable-decoder=pcm_u8 \
|
||||
--enable-decoder=pcm_zork \
|
||||
--enable-decoder=vorbis \
|
||||
--enable-decoder=wavpack \
|
||||
--enable-decoder=wmalossless \
|
||||
--enable-decoder=wmapro \
|
||||
--enable-decoder=wmav1 \
|
||||
--enable-decoder=wmav2 \
|
||||
--enable-decoder=wmavoice \
|
||||
--enable-encoder=libopus \
|
||||
--enable-parser=aac \
|
||||
--enable-parser=aac_latm \
|
||||
--enable-parser=flac \
|
||||
--enable-parser=h264 \
|
||||
--enable-parser=hevc \
|
||||
--enable-parser=mpeg4video \
|
||||
--enable-parser=mpegaudio \
|
||||
--enable-parser=opus \
|
||||
--enable-parser=vorbis \
|
||||
--enable-demuxer=aac \
|
||||
--enable-demuxer=flac \
|
||||
--enable-demuxer=gif \
|
||||
--enable-demuxer=h264 \
|
||||
--enable-demuxer=hevc \
|
||||
--enable-demuxer=m4v \
|
||||
--enable-demuxer=mov \
|
||||
--enable-demuxer=mp3 \
|
||||
--enable-demuxer=ogg \
|
||||
--enable-demuxer=wav \
|
||||
--enable-muxer=ogg \
|
||||
--enable-muxer=opus
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
- name: FFmpeg install.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
#List of files from cmake/external/ffmpeg/CMakeLists.txt.
|
||||
copyLib() {
|
||||
mkdir -p ffmpeg/$1
|
||||
yes | cp -i ffmpeg-cache/lib/$1.a ffmpeg/$1/$1.a
|
||||
}
|
||||
copyLib libavformat
|
||||
copyLib libavcodec
|
||||
copyLib libswresample
|
||||
copyLib libswscale
|
||||
copyLib libavutil
|
||||
|
||||
sudo cp -R ffmpeg-cache/. /usr/local/
|
||||
|
||||
- name: PortAudio.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone https://git.assembla.com/portaudio.git
|
||||
cd portaudio
|
||||
git checkout 396fe4b669
|
||||
./configure
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- name: OpenAL Soft.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/kcat/openal-soft.git
|
||||
cd openal-soft
|
||||
git checkout openal-soft-1.19.1
|
||||
cd build
|
||||
cmake -D LIBTYPE:STRING=STATIC ..
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- name: OpenSSL cache.
|
||||
id: cache-openssl
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/openssl-cache
|
||||
key: ${{ runner.OS }}-${{ env.OPENSSL_VER }}-${{ env.CACHE_KEY }}
|
||||
- name: OpenSSL build.
|
||||
if: steps.cache-openssl.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/openssl/openssl openssl_$OPENSSL_VER
|
||||
cd openssl_$OPENSSL_VER
|
||||
git checkout OpenSSL_1_1_1-stable
|
||||
./config --prefix=$LibrariesPath/openssl-cache
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
- name: OpenSSL install.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
sudo mkdir -p $OPENSSL_PREFIX
|
||||
sudo cp -R openssl-cache/. $OPENSSL_PREFIX/
|
||||
|
||||
- name: Libxkbcommon.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/xkbcommon/libxkbcommon.git
|
||||
cd libxkbcommon
|
||||
git checkout xkbcommon-0.8.4
|
||||
./autogen.sh
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- name: Qt 5.12.5 cache.
|
||||
id: cache-qt
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/qt-cache
|
||||
key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_12_5.diff') }}
|
||||
- name: Qt 5.12.5 build.
|
||||
if: steps.cache-qt.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone git://code.qt.io/qt/qt5.git qt_$QT
|
||||
cd qt_$QT
|
||||
perl init-repository --module-subset=qtbase,qtimageformats,qtsvg
|
||||
git checkout v5.12.5
|
||||
git submodule update qtbase
|
||||
git submodule update qtimageformats
|
||||
git submodule update qtsvg
|
||||
cd qtbase
|
||||
git apply ../../patches/qtbase_$QT.diff
|
||||
cd src/plugins/platforminputcontexts
|
||||
git clone $GIT/desktop-app/fcitx.git
|
||||
git clone $GIT/desktop-app/hime.git
|
||||
git clone $GIT/desktop-app/nimf.git
|
||||
cd ../../../..
|
||||
|
||||
./configure -prefix "$LibrariesPath/qt-cache" \
|
||||
-release \
|
||||
-force-debug-info \
|
||||
-opensource \
|
||||
-confirm-license \
|
||||
-qt-zlib \
|
||||
-qt-libpng \
|
||||
-qt-libjpeg \
|
||||
-qt-harfbuzz \
|
||||
-qt-pcre \
|
||||
-qt-xcb \
|
||||
-system-freetype \
|
||||
-fontconfig \
|
||||
-no-opengl \
|
||||
-no-glib \
|
||||
-no-gtk \
|
||||
-static \
|
||||
-openssl-linked \
|
||||
-I "$OPENSSL_PREFIX/include" OPENSSL_LIBS="$OPENSSL_PREFIX/lib/libssl.a $OPENSSL_PREFIX/lib/libcrypto.a -ldl -lpthread" \
|
||||
-nomake examples \
|
||||
-nomake tests
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
- name: Qt 5.12.5 install.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
sudo mkdir -p $QT_PREFIX
|
||||
sudo cp -R qt-cache/. $QT_PREFIX/
|
||||
|
||||
- name: Breakpad cache.
|
||||
id: cache-breakpad
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/breakpad-cache
|
||||
key: ${{ runner.OS }}-breakpad-${{ env.CACHE_KEY }}
|
||||
- name: Breakpad clone.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone https://chromium.googlesource.com/breakpad/breakpad
|
||||
cd breakpad
|
||||
git checkout bc8fb886
|
||||
git clone https://chromium.googlesource.com/linux-syscall-support src/third_party/lss
|
||||
cd src/third_party/lss
|
||||
git checkout a91633d1
|
||||
- name: Breakpad build.
|
||||
if: steps.cache-breakpad.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
BreakpadCache=$LibrariesPath/breakpad-cache
|
||||
|
||||
git clone https://chromium.googlesource.com/external/gyp
|
||||
cd gyp
|
||||
git checkout 9f2a7bb1
|
||||
git apply ../patches/gyp.diff
|
||||
cd ..
|
||||
|
||||
cd breakpad
|
||||
./configure --prefix=$BreakpadCache
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
cd src
|
||||
rm -r testing
|
||||
git clone $GIT/google/googletest testing
|
||||
cd tools
|
||||
sed -i 's/minidump_upload.m/minidump_upload.cc/' linux/tools_linux.gypi
|
||||
../../../gyp/gyp --depth=. --generator-output=.. -Goutput_dir=../out tools.gyp --format=cmake
|
||||
cd ../../out/Default
|
||||
cmake .
|
||||
make -j$(nproc) dump_syms
|
||||
|
||||
mv dump_syms $BreakpadCache/
|
||||
- name: Breakpad install.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
sudo cp -R breakpad-cache/. /usr/local/
|
||||
mkdir -p breakpad/out/Default/
|
||||
cp breakpad-cache/dump_syms breakpad/out/Default/dump_syms
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
run: |
|
||||
cd $REPO_NAME/Telegram
|
||||
|
||||
DEFINE=""
|
||||
if [ -n "${{ matrix.defines }}" ]; then
|
||||
DEFINE="-D ${{ matrix.defines }}=ON"
|
||||
echo Define from matrix: $DEFINE
|
||||
fi
|
||||
|
||||
./configure.sh -D TDESKTOP_API_TEST=ON -D DESKTOP_APP_USE_PACKAGED=OFF $DEFINE
|
||||
|
||||
cd ../out/Debug
|
||||
make -j$(nproc)
|
||||
strip -s bin/Telegram
|
||||
|
||||
- name: Check.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
run: |
|
||||
filePath="$REPO_NAME/out/Debug/bin/Telegram"
|
||||
if test -f "$filePath"; then
|
||||
echo "Build successfully done! :)"
|
||||
|
||||
size=$(stat -c %s "$filePath")
|
||||
echo "File size of ${filePath}: ${size} Bytes."
|
||||
else
|
||||
echo "Build error, output file does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Move artifact.
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
cd $REPO_NAME/out/Debug/bin
|
||||
mkdir artifact
|
||||
mv Telegram artifact/
|
||||
- uses: actions/upload-artifact@master
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
name: Upload artifact.
|
||||
with:
|
||||
name: Telegram
|
||||
path: ${{ env.REPO_NAME }}/out/Debug/bin/artifact/
|
||||
456
.github/workflows/mac.yml
vendored
Normal file
@@ -0,0 +1,456 @@
|
||||
name: MacOS.
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
|
||||
jobs:
|
||||
|
||||
macos:
|
||||
name: MacOS
|
||||
runs-on: macos-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
defines:
|
||||
- ""
|
||||
env:
|
||||
MIN_MAC: "-mmacosx-version-min=10.12"
|
||||
UNGUARDED: "-Werror=unguarded-availability-new"
|
||||
GIT: "https://github.com"
|
||||
PREFIX: "/usr/local/macos"
|
||||
MACOSX_DEPLOYMENT_TARGET: "10.12"
|
||||
XZ: "xz-5.0.5"
|
||||
QT: "5_12_5"
|
||||
OPENSSL_VER: "1_1_1"
|
||||
QT_PREFIX: "/usr/local/desktop-app/Qt-5.12.5"
|
||||
LIBICONV_VER: "libiconv-1.15"
|
||||
UPLOAD_ARTIFACT: "false"
|
||||
ONLY_CACHE: "false"
|
||||
MANUAL_CACHING: "2"
|
||||
DOC_PATH: "docs/building-xcode.md"
|
||||
steps:
|
||||
- name: Get repository name.
|
||||
run: echo ::set-env name=REPO_NAME::${GITHUB_REPOSITORY##*/}
|
||||
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: First set up.
|
||||
run: |
|
||||
cd ..
|
||||
mv $REPO_NAME temp
|
||||
mkdir $REPO_NAME
|
||||
mv temp $REPO_NAME/$REPO_NAME
|
||||
cd $REPO_NAME
|
||||
|
||||
brew install automake fdk-aac lame libass libtool libvorbis libvpx \
|
||||
ninja opus sdl shtool texi2html theora x264 xvid yasm pkg-config
|
||||
|
||||
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
||||
|
||||
xcodebuild -version > CACHE_KEY.txt
|
||||
echo $MIN_MAC >> CACHE_KEY.txt
|
||||
echo $PREFIX >> CACHE_KEY.txt
|
||||
echo $MANUAL_CACHING >> CACHE_KEY.txt
|
||||
echo ::set-env name=CACHE_KEY::`md5 -q CACHE_KEY.txt`
|
||||
|
||||
echo ::add-path::$PWD/Libraries/depot_tools
|
||||
|
||||
mkdir -p Libraries/macos
|
||||
cd Libraries/macos
|
||||
echo ::set-env name=LibrariesPath::`pwd`
|
||||
|
||||
- name: Range-v3.
|
||||
run: |
|
||||
echo "Find necessary branch from doc."
|
||||
cloneRange=$(grep -A 1 "range-v3" $REPO_NAME/$DOC_PATH | sed -n 1p)
|
||||
cd $LibrariesPath
|
||||
echo $cloneRange
|
||||
eval $cloneRange
|
||||
|
||||
- name: Patches.
|
||||
run: |
|
||||
echo "Find necessary commit from doc."
|
||||
checkoutCommit=$(grep -A 1 "cd patches" $REPO_NAME/$DOC_PATH | sed -n 2p)
|
||||
cd $LibrariesPath
|
||||
git clone $GIT/desktop-app/patches.git
|
||||
cd Patches
|
||||
eval $checkoutCommit
|
||||
|
||||
- name: XZ.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
wget https://tukaani.org/xz/$XZ.tar.gz
|
||||
tar -xvzf $XZ.tar.gz
|
||||
cd $XZ
|
||||
CFLAGS="$MIN_MAC" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- name: Zlib.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/desktop-app/zlib.git
|
||||
cd zlib
|
||||
CFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- name: OpenSSL cache.
|
||||
id: cache-openssl
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/openssl_${{ env.OPENSSL_VER }}
|
||||
key: ${{ runner.OS }}-${{ env.OPENSSL_VER }}-${{ env.CACHE_KEY }}
|
||||
- name: OpenSSL.
|
||||
if: steps.cache-openssl.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/openssl/openssl openssl
|
||||
cd openssl
|
||||
git checkout OpenSSL_"$OPENSSL_VER"-stable
|
||||
./Configure \
|
||||
--prefix=$PREFIX \
|
||||
darwin64-x86_64-cc \
|
||||
-static \
|
||||
$MIN_MAC
|
||||
make build_libs -j$(nproc)
|
||||
|
||||
SSL_DIR=$LibrariesPath/openssl_${{ env.OPENSSL_VER }}
|
||||
mkdir -p $SSL_DIR/include
|
||||
copyLib() {
|
||||
cp $1.a $SSL_DIR/$1.a
|
||||
}
|
||||
copyLib libssl
|
||||
copyLib libcrypto
|
||||
sudo cp -R include/. $SSL_DIR/include/
|
||||
|
||||
- name: Opus cache.
|
||||
id: cache-opus
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/opus
|
||||
key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }}
|
||||
- name: Opus.
|
||||
if: steps.cache-opus.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/xiph/opus
|
||||
cd opus
|
||||
git checkout v1.3
|
||||
./autogen.sh
|
||||
CFLAGS="$MIN_MAC $UNGUARDED" CPPFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --prefix=$PREFIX
|
||||
make -j$(nproc)
|
||||
- name: Opus install.
|
||||
run: |
|
||||
cd $LibrariesPath/opus
|
||||
sudo make install
|
||||
|
||||
- name: Libiconv cache.
|
||||
id: cache-libiconv
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/${{ env.LIBICONV_VER }}
|
||||
key: ${{ runner.OS }}-${{ env.LIBICONV_VER }}-${{ env.CACHE_KEY }}
|
||||
- name: Libiconv.
|
||||
if: steps.cache-libiconv.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
wget https://ftp.gnu.org/pub/gnu/libiconv/"$LIBICONV_VER".tar.gz
|
||||
tar -xvzf "$LIBICONV_VER".tar.gz
|
||||
cd $LIBICONV_VER
|
||||
CFLAGS="$MIN_MAC $UNGUARDED" CPPFLAGS="$MIN_MAC $UNGUARDED" LDFLAGS="$MIN_MAC" ./configure --enable-static --prefix=$PREFIX
|
||||
make -j$(nproc)
|
||||
- name: Libiconv install.
|
||||
run: |
|
||||
cd $LibrariesPath/$LIBICONV_VER
|
||||
sudo make install
|
||||
|
||||
- name: FFmpeg cache.
|
||||
id: cache-ffmpeg
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/ffmpeg-cache
|
||||
key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}
|
||||
- name: FFmpeg.
|
||||
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/FFmpeg/FFmpeg.git ffmpeg
|
||||
cd ffmpeg
|
||||
git checkout release/3.4
|
||||
CFLAGS=`freetype-config --cflags`
|
||||
LDFLAGS=`freetype-config --libs`
|
||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
|
||||
|
||||
./configure --prefix=$LibrariesPath/ffmpeg-cache \
|
||||
--extra-cflags="$MIN_MAC $UNGUARDED" \
|
||||
--extra-cxxflags="$MIN_MAC $UNGUARDED" \
|
||||
--extra-ldflags="$MIN_MAC" \
|
||||
--enable-protocol=file --enable-libopus \
|
||||
--disable-programs \
|
||||
--disable-doc \
|
||||
--disable-network \
|
||||
--disable-everything \
|
||||
--enable-hwaccel=h264_videotoolbox \
|
||||
--enable-hwaccel=hevc_videotoolbox \
|
||||
--enable-hwaccel=mpeg1_videotoolbox \
|
||||
--enable-hwaccel=mpeg2_videotoolbox \
|
||||
--enable-hwaccel=mpeg4_videotoolbox \
|
||||
--enable-decoder=aac \
|
||||
--enable-decoder=aac_at \
|
||||
--enable-decoder=aac_fixed \
|
||||
--enable-decoder=aac_latm \
|
||||
--enable-decoder=aasc \
|
||||
--enable-decoder=alac \
|
||||
--enable-decoder=alac_at \
|
||||
--enable-decoder=flac \
|
||||
--enable-decoder=gif \
|
||||
--enable-decoder=h264 \
|
||||
--enable-decoder=hevc \
|
||||
--enable-decoder=mp1 \
|
||||
--enable-decoder=mp1float \
|
||||
--enable-decoder=mp2 \
|
||||
--enable-decoder=mp2float \
|
||||
--enable-decoder=mp3 \
|
||||
--enable-decoder=mp3adu \
|
||||
--enable-decoder=mp3adufloat \
|
||||
--enable-decoder=mp3float \
|
||||
--enable-decoder=mp3on4 \
|
||||
--enable-decoder=mp3on4float \
|
||||
--enable-decoder=mpeg4 \
|
||||
--enable-decoder=msmpeg4v2 \
|
||||
--enable-decoder=msmpeg4v3 \
|
||||
--enable-decoder=opus \
|
||||
--enable-decoder=pcm_alaw \
|
||||
--enable-decoder=pcm_alaw_at \
|
||||
--enable-decoder=pcm_f32be \
|
||||
--enable-decoder=pcm_f32le \
|
||||
--enable-decoder=pcm_f64be \
|
||||
--enable-decoder=pcm_f64le \
|
||||
--enable-decoder=pcm_lxf \
|
||||
--enable-decoder=pcm_mulaw \
|
||||
--enable-decoder=pcm_mulaw_at \
|
||||
--enable-decoder=pcm_s16be \
|
||||
--enable-decoder=pcm_s16be_planar \
|
||||
--enable-decoder=pcm_s16le \
|
||||
--enable-decoder=pcm_s16le_planar \
|
||||
--enable-decoder=pcm_s24be \
|
||||
--enable-decoder=pcm_s24daud \
|
||||
--enable-decoder=pcm_s24le \
|
||||
--enable-decoder=pcm_s24le_planar \
|
||||
--enable-decoder=pcm_s32be \
|
||||
--enable-decoder=pcm_s32le \
|
||||
--enable-decoder=pcm_s32le_planar \
|
||||
--enable-decoder=pcm_s64be \
|
||||
--enable-decoder=pcm_s64le \
|
||||
--enable-decoder=pcm_s8 \
|
||||
--enable-decoder=pcm_s8_planar \
|
||||
--enable-decoder=pcm_u16be \
|
||||
--enable-decoder=pcm_u16le \
|
||||
--enable-decoder=pcm_u24be \
|
||||
--enable-decoder=pcm_u24le \
|
||||
--enable-decoder=pcm_u32be \
|
||||
--enable-decoder=pcm_u32le \
|
||||
--enable-decoder=pcm_u8 \
|
||||
--enable-decoder=pcm_zork \
|
||||
--enable-decoder=vorbis \
|
||||
--enable-decoder=wavpack \
|
||||
--enable-decoder=wmalossless \
|
||||
--enable-decoder=wmapro \
|
||||
--enable-decoder=wmav1 \
|
||||
--enable-decoder=wmav2 \
|
||||
--enable-decoder=wmavoice \
|
||||
--enable-encoder=libopus \
|
||||
--enable-parser=aac \
|
||||
--enable-parser=aac_latm \
|
||||
--enable-parser=flac \
|
||||
--enable-parser=h264 \
|
||||
--enable-parser=hevc \
|
||||
--enable-parser=mpeg4video \
|
||||
--enable-parser=mpegaudio \
|
||||
--enable-parser=opus \
|
||||
--enable-parser=vorbis \
|
||||
--enable-demuxer=aac \
|
||||
--enable-demuxer=flac \
|
||||
--enable-demuxer=gif \
|
||||
--enable-demuxer=h264 \
|
||||
--enable-demuxer=hevc \
|
||||
--enable-demuxer=m4v \
|
||||
--enable-demuxer=mov \
|
||||
--enable-demuxer=mp3 \
|
||||
--enable-demuxer=ogg \
|
||||
--enable-demuxer=wav \
|
||||
--enable-muxer=ogg \
|
||||
--enable-muxer=opus
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
- name: FFmpeg install.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
#List of files from cmake/external/ffmpeg/CMakeLists.txt.
|
||||
copyLib() {
|
||||
mkdir -p ffmpeg/$1
|
||||
\cp -fR ffmpeg-cache/lib/$1.a ffmpeg/$1/$1.a
|
||||
}
|
||||
copyLib libavformat
|
||||
copyLib libavcodec
|
||||
copyLib libswresample
|
||||
copyLib libswscale
|
||||
copyLib libavutil
|
||||
|
||||
sudo cp -R ffmpeg-cache/. /usr/local/
|
||||
sudo cp -R ffmpeg-cache/include/. ffmpeg/
|
||||
|
||||
- name: OpenAL Soft.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/kcat/openal-soft.git
|
||||
cd openal-soft
|
||||
git checkout openal-soft-1.19.1
|
||||
cd build
|
||||
|
||||
CFLAGS="$UNGUARDED" CPPFLAGS="$UNGUARDED" cmake \
|
||||
-D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \
|
||||
-D ALSOFT_EXAMPLES=OFF \
|
||||
-D LIBTYPE:STRING=STATIC \
|
||||
-D CMAKE_OSX_DEPLOYMENT_TARGET:STRING=$MACOSX_DEPLOYMENT_TARGET ..
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
- name: Crashpad cache.
|
||||
id: cache-crashpad
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/crashpad
|
||||
key: ${{ runner.OS }}-crashpad-${{ env.CACHE_KEY }}-${{ hashFiles('**/crashpad.diff') }}-${{ hashFiles('**/mini_chromium.diff') }}
|
||||
- name: Crashpad.
|
||||
if: steps.cache-crashpad.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd Libraries
|
||||
echo Install GYP for Crashpad.
|
||||
git clone https://chromium.googlesource.com/external/gyp
|
||||
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
cd gyp
|
||||
git checkout 9f2a7bb1
|
||||
git apply $LibrariesPath/patches/gyp.diff
|
||||
./setup.py build
|
||||
sudo ./setup.py install
|
||||
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone https://chromium.googlesource.com/crashpad/crashpad.git
|
||||
cd crashpad
|
||||
git checkout feb3aa3923
|
||||
git apply ../patches/crashpad.diff
|
||||
cd third_party/mini_chromium
|
||||
git clone https://chromium.googlesource.com/chromium/mini_chromium
|
||||
cd mini_chromium
|
||||
git checkout 7c5b0c1ab4
|
||||
git apply ../../../../patches/mini_chromium.diff
|
||||
cd ../../gtest
|
||||
git clone https://chromium.googlesource.com/external/github.com/google/googletest gtest
|
||||
cd gtest
|
||||
git checkout d62d6c6556
|
||||
cd ../../..
|
||||
|
||||
build/gyp_crashpad.py -Dmac_deployment_target=10.10
|
||||
ninja -C out/Debug
|
||||
|
||||
- name: Qt 5.12.5 cache.
|
||||
id: cache-qt
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/qt-cache
|
||||
key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_12_5.diff') }}
|
||||
- name: Use cached Qt 5.12.5.
|
||||
if: steps.cache-qt.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
mv qt-cache Qt-5.12.5
|
||||
sudo mkdir -p $QT_PREFIX
|
||||
sudo mv -f Qt-5.12.5 "$(dirname "$QT_PREFIX")"/
|
||||
- name: Qt 5.12.5 build.
|
||||
if: steps.cache-qt.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone git://code.qt.io/qt/qt5.git qt$QT
|
||||
cd qt$QT
|
||||
perl init-repository --module-subset=qtbase,qtimageformats
|
||||
git checkout v5.12.5
|
||||
git submodule update qtbase
|
||||
git submodule update qtimageformats
|
||||
cd qtbase
|
||||
git apply ../../patches/qtbase_$QT.diff
|
||||
cd ..
|
||||
|
||||
./configure \
|
||||
-prefix "$QT_PREFIX" \
|
||||
-debug \
|
||||
-force-debug-info \
|
||||
-opensource \
|
||||
-confirm-license \
|
||||
-static \
|
||||
-opengl desktop \
|
||||
-no-openssl \
|
||||
-securetransport \
|
||||
-nomake examples \
|
||||
-nomake tests \
|
||||
-platform macx-clang
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
|
||||
make clean
|
||||
cp -r $QT_PREFIX $LibrariesPath/qt-cache
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
run: |
|
||||
cd $REPO_NAME/Telegram
|
||||
|
||||
DEFINE=""
|
||||
if [ -n "${{ matrix.defines }}" ]; then
|
||||
DEFINE="-D ${{ matrix.defines }}=ON"
|
||||
echo Define from matrix: $DEFINE
|
||||
fi
|
||||
|
||||
./configure.sh -D TDESKTOP_API_TEST=ON -D DESKTOP_APP_USE_PACKAGED=OFF $DEFINE
|
||||
|
||||
cd ../out
|
||||
|
||||
xcoderun='xcodebuild build -project Telegram.xcodeproj -scheme Telegram -destination "platform=macOS,arch=x86_64" -configuration Debug'
|
||||
bash -c "$xcoderun" || bash -c "$xcoderun" || bash -c "$xcoderun"
|
||||
|
||||
- name: Move artifact.
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
cd $REPO_NAME/out/Debug
|
||||
mkdir artifact
|
||||
mv Telegram.app artifact/
|
||||
mv Updater artifact/
|
||||
- uses: actions/upload-artifact@master
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
name: Upload artifact.
|
||||
with:
|
||||
name: Telegram
|
||||
path: ${{ env.REPO_NAME }}/out/Debug/artifact/
|
||||
99
.github/workflows/snap.yml
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
name: Snap.
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
|
||||
jobs:
|
||||
|
||||
linux:
|
||||
name: Ubuntu 18.04
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
env:
|
||||
UPLOAD_ARTIFACT: "false"
|
||||
ONLY_CACHE: "false"
|
||||
MANUAL_CACHING: "3"
|
||||
|
||||
steps:
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: First set up.
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-8 g++-8 -y
|
||||
sudo snap install --classic snapcraft
|
||||
|
||||
# Workaround for snapcraft
|
||||
# See https://forum.snapcraft.io/t/permissions-problem-using-snapcraft-in-azure-pipelines/13258
|
||||
sudo chown root:root /
|
||||
|
||||
snapcraft --version > CACHE_KEY.txt
|
||||
gcc-8 --version >> CACHE_KEY.txt
|
||||
echo $MANUAL_CACHING >> CACHE_KEY.txt
|
||||
md5cache=$(md5sum CACHE_KEY.txt | cut -c -32)
|
||||
echo ::set-env name=CACHE_KEY::$md5cache
|
||||
|
||||
awk -v RS="" -v ORS="\n\n" '/^ cmake:/' snap/snapcraft.yaml > CMAKE_CACHE_KEY.txt
|
||||
md5cache=$(md5sum CMAKE_CACHE_KEY.txt | cut -c -32)
|
||||
echo ::set-env name=CMAKE_CACHE_KEY::$md5cache
|
||||
|
||||
awk -v RS="" -v ORS="\n\n" '/^ enchant:/' snap/snapcraft.yaml > ENCHANT_CACHE_KEY.txt
|
||||
md5cache=$(md5sum ENCHANT_CACHE_KEY.txt | cut -c -32)
|
||||
echo ::set-env name=ENCHANT_CACHE_KEY::$md5cache
|
||||
|
||||
- name: CMake cache.
|
||||
id: cache-cmake
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: parts/cmake
|
||||
key: ${{ runner.OS }}-cmake-${{ env.CACHE_KEY }}-${{ env.CMAKE_CACHE_KEY }}
|
||||
|
||||
- name: CMake build.
|
||||
if: steps.cache-cmake.outputs.cache-hit != 'true'
|
||||
run: snapcraft build --destructive-mode cmake
|
||||
|
||||
- name: Enchant cache.
|
||||
id: cache-enchant
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: parts/enchant
|
||||
key: ${{ runner.OS }}-enchant-${{ env.CACHE_KEY }}-${{ env.ENCHANT_CACHE_KEY }}
|
||||
|
||||
- name: Enchant build.
|
||||
if: steps.cache-enchant.outputs.cache-hit != 'true'
|
||||
run: snapcraft build --destructive-mode enchant
|
||||
|
||||
- name: Telegram Desktop snap build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
run: snapcraft --destructive-mode
|
||||
|
||||
- name: Move artifact.
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
artifact_name=$(echo telegram-desktop_*.snap)
|
||||
echo ::set-env name=ARTIFACT_NAME::$artifact_name
|
||||
|
||||
mkdir artifact
|
||||
mv $artifact_name artifact
|
||||
|
||||
- uses: actions/upload-artifact@master
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
name: Upload artifact.
|
||||
with:
|
||||
name: ${{ env.ARTIFACT_NAME }}
|
||||
path: artifact
|
||||
|
||||
- name: Remove unneeded directories for cache.
|
||||
run: |
|
||||
rm -rf parts/{cmake,enchant}/{build,src,ubuntu}
|
||||
rm -rf parts/{cmake,enchant}/state/{stage,prime}
|
||||
357
.github/workflows/win.yml
vendored
Normal file
@@ -0,0 +1,357 @@
|
||||
name: Windows.
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
|
||||
jobs:
|
||||
|
||||
windows:
|
||||
name: Windows
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
defines:
|
||||
- ""
|
||||
env:
|
||||
SDK: "10.0.18362.0"
|
||||
VC: "call vcvars32.bat && cd Libraries"
|
||||
GIT: "https://github.com"
|
||||
QT: "5_12_5"
|
||||
OPENSSL_VER: "1_1_1"
|
||||
UPLOAD_ARTIFACT: "false"
|
||||
ONLY_CACHE: "false"
|
||||
MANUAL_CACHING: "2"
|
||||
DOC_PATH: "docs/building-msvc.md"
|
||||
steps:
|
||||
- name: Get repository name.
|
||||
shell: bash
|
||||
run: echo ::set-env name=REPO_NAME::${GITHUB_REPOSITORY##*/}
|
||||
|
||||
- name: Clone.
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up environment variables.
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ..
|
||||
move %REPO_NAME% temp
|
||||
mkdir %REPO_NAME%
|
||||
move temp %REPO_NAME%/%REPO_NAME%
|
||||
cd %REPO_NAME%
|
||||
|
||||
echo ::add-path::C:\Strawberry\perl\bin\
|
||||
echo ::add-path::"%programfiles%\NASM"
|
||||
|
||||
C:
|
||||
cd "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\"
|
||||
echo ::add-path::%cd%
|
||||
|
||||
call vcvars32.bat
|
||||
D:
|
||||
cd %GITHUB_WORKSPACE%
|
||||
msbuild -version > CACHE_KEY.txt
|
||||
echo %MANUAL_CACHING% >> CACHE_KEY.txt
|
||||
|
||||
mkdir Libraries
|
||||
cd Libraries
|
||||
echo ::set-env name=LibrariesPath::%cd%
|
||||
|
||||
- name: Generate cache key.
|
||||
shell: bash
|
||||
run: |
|
||||
echo ::set-env name=CACHE_KEY::`md5sum CACHE_KEY.txt | awk '{ print $1 }'`
|
||||
|
||||
- name: Choco installs.
|
||||
run: |
|
||||
choco install --no-progress -y nasm yasm jom ninja
|
||||
|
||||
- name: Range-v3.
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Find necessary branch from doc."
|
||||
cloneRange=$(grep -A 1 "range-v3" $REPO_NAME/$DOC_PATH | sed -n 1p)
|
||||
cd $LibrariesPath
|
||||
echo $cloneRange
|
||||
eval $cloneRange
|
||||
|
||||
- name: Patches.
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Find necessary commit from doc."
|
||||
checkoutCommit=$(grep -A 1 "cd patches" $REPO_NAME/$DOC_PATH | sed -n 2p)
|
||||
cd $LibrariesPath
|
||||
git clone $GIT/desktop-app/patches.git
|
||||
cd Patches
|
||||
eval $checkoutCommit
|
||||
|
||||
- name: LZMA.
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/telegramdesktop/lzma.git
|
||||
cd lzma
|
||||
cd C\Util\LzmaLib
|
||||
msbuild -m LzmaLib.sln /property:Configuration=Debug
|
||||
|
||||
- name: OpenSSL cache.
|
||||
id: cache-openssl
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/openssl_${{ env.OPENSSL_VER }}
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_KEY }}-${{ env.OPENSSL_VER }}
|
||||
- name: OpenSSL.
|
||||
if: steps.cache-openssl.outputs.cache-hit != 'true'
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/openssl/openssl.git openssl_%OPENSSL_VER%
|
||||
cd openssl_%OPENSSL_VER%
|
||||
git checkout OpenSSL_%OPENSSL_VER%-stable
|
||||
perl Configure no-shared debug-VC-WIN32
|
||||
nmake
|
||||
mkdir out32.dbg
|
||||
move libcrypto.lib out32.dbg
|
||||
move libssl.lib out32.dbg
|
||||
move ossl_static.pdb out32.dbg\ossl_static
|
||||
nmake clean
|
||||
move out32.dbg\ossl_static out32.dbg\ossl_static.pdb
|
||||
perl Configure no-shared VC-WIN32
|
||||
nmake
|
||||
mkdir out32
|
||||
move libcrypto.lib out32
|
||||
move libssl.lib out32
|
||||
move ossl_static.pdb out32
|
||||
|
||||
rmdir /S /Q test
|
||||
rmdir /S /Q .git
|
||||
|
||||
- name: Zlib.
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/telegramdesktop/zlib.git
|
||||
cd zlib
|
||||
git checkout tdesktop
|
||||
cd contrib\vstudio\vc14
|
||||
msbuild -m zlibstat.vcxproj /property:Configuration=Debug
|
||||
|
||||
- name: OpenAL Soft cache.
|
||||
id: cache-openal
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/openal-soft
|
||||
key: ${{ runner.OS }}-openal-soft-${{ env.CACHE_KEY }}
|
||||
- name: OpenAL Soft.
|
||||
shell: cmd
|
||||
if: steps.cache-openal.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/telegramdesktop/openal-soft.git
|
||||
cd openal-soft
|
||||
git checkout fix_capture
|
||||
cd build
|
||||
cmake ^
|
||||
-G "Visual Studio 16 2019" ^
|
||||
-A Win32 ^
|
||||
-D LIBTYPE:STRING=STATIC ^
|
||||
-D FORCE_STATIC_VCRT:STRING=ON ..
|
||||
|
||||
msbuild -m OpenAL.vcxproj /property:Configuration=Debug
|
||||
|
||||
- name: Breakpad cache.
|
||||
id: cache-breakpad
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/breakpad
|
||||
key: ${{ runner.OS }}-breakpad-${{ env.CACHE_KEY }}-${{ hashFiles('**/breakpad.diff') }}
|
||||
- name: Breakpad.
|
||||
env:
|
||||
GYP_MSVS_OVERRIDE_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\'
|
||||
GYP_MSVS_VERSION: 2019
|
||||
shell: cmd
|
||||
if: steps.cache-breakpad.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd %LibrariesPath%
|
||||
|
||||
echo Find any version of Python 2.
|
||||
for /D %%a in (C:\hostedtoolcache\windows\Python\2.*) do (
|
||||
SET PY2=%%a\x64
|
||||
)
|
||||
IF [%PY2%] == [] (
|
||||
echo Python 2 is not found.
|
||||
exit 1
|
||||
)
|
||||
echo Found %PY2%.
|
||||
|
||||
git clone %GIT%/telegramdesktop/gyp.git
|
||||
cd gyp
|
||||
SET PATH=%PY2%;%cd%;%PATH%
|
||||
git checkout tdesktop
|
||||
|
||||
cd %LibrariesPath%
|
||||
|
||||
git clone %GIT%/google/breakpad
|
||||
cd breakpad
|
||||
git checkout a1dbcdcb43
|
||||
git apply ../patches/breakpad.diff
|
||||
cd src
|
||||
git clone %GIT%/google/googletest testing
|
||||
cd client\windows
|
||||
call gyp --no-circular-check breakpad_client.gyp --format=ninja
|
||||
cd ..\..
|
||||
ninja -C out/Debug common crash_generation_client exception_handler
|
||||
ninja -C out/Release common crash_generation_client exception_handler
|
||||
cd tools\windows\dump_syms
|
||||
call gyp dump_syms.gyp
|
||||
|
||||
call vcvars32.bat
|
||||
msbuild -m dump_syms.vcxproj /property:Configuration=Release
|
||||
|
||||
- name: Opus cache.
|
||||
id: cache-opus
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/opus
|
||||
key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }}
|
||||
- name: Opus.
|
||||
if: steps.cache-opus.outputs.cache-hit != 'true'
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/telegramdesktop/opus.git
|
||||
cd opus
|
||||
git checkout tdesktop
|
||||
cd win32\VS2015
|
||||
msbuild -m opus.sln /property:Configuration=Debug /property:Platform="Win32"
|
||||
msbuild -m opus.sln /property:Configuration=Release /property:Platform="Win32"
|
||||
|
||||
- name: FFmpeg cache.
|
||||
id: cache-ffmpeg
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/ffmpeg
|
||||
key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}-2-${{ hashFiles('**/build_ffmpeg_win.sh') }}
|
||||
- name: FFmpeg.
|
||||
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
choco install --no-progress -y msys2
|
||||
|
||||
git clone %GIT%/FFmpeg/FFmpeg.git ffmpeg
|
||||
cd ffmpeg
|
||||
git checkout release/3.4
|
||||
set CHERE_INVOKING=enabled_from_arguments
|
||||
set MSYS2_PATH_TYPE=inherit
|
||||
call c:\tools\msys64\usr\bin\bash --login ../../%REPO_NAME%/Telegram/Patches/build_ffmpeg_win.sh
|
||||
|
||||
rmdir /S /Q .git
|
||||
|
||||
- name: Qt 5.12.5 cache.
|
||||
id: cache-qt
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.LibrariesPath }}/Qt-5.12.5
|
||||
key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_5_12_5.diff') }}
|
||||
- name: Configure Qt 5.12.5.
|
||||
if: steps.cache-qt.outputs.cache-hit != 'true'
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone git://code.qt.io/qt/qt5.git qt_%QT%
|
||||
cd qt_%QT%
|
||||
perl init-repository --module-subset=qtbase,qtimageformats
|
||||
git checkout v5.12.5
|
||||
git submodule update qtbase
|
||||
git submodule update qtimageformats
|
||||
cd qtbase
|
||||
git apply ../../patches/qtbase_%QT%.diff
|
||||
cd ..
|
||||
|
||||
SET SSL=%LibrariesPath%\openssl_1_1_1
|
||||
SET LIBS=libcrypto.lib Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib
|
||||
|
||||
configure ^
|
||||
-prefix "%LibrariesPath%\Qt-5.12.5" ^
|
||||
-debug ^
|
||||
-force-debug-info ^
|
||||
-opensource ^
|
||||
-confirm-license ^
|
||||
-static ^
|
||||
-static-runtime -I "%SSL%\include" ^
|
||||
-no-opengl ^
|
||||
-openssl-linked ^
|
||||
OPENSSL_LIBS_DEBUG="%SSL%\out32.dbg\libssl.lib %SSL%\out32.dbg\%LIBS%" ^
|
||||
OPENSSL_LIBS_RELEASE="%SSL%\out32\libssl.lib %SSL%\out32\%LIBS%" ^
|
||||
-mp ^
|
||||
-nomake examples ^
|
||||
-nomake tests ^
|
||||
-platform win32-msvc
|
||||
- name: Qt 5.12.5 build.
|
||||
if: steps.cache-qt.outputs.cache-hit != 'true'
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
cd qt_%QT%
|
||||
|
||||
jom -j%NUMBER_OF_PROCESSORS%
|
||||
jom -j%NUMBER_OF_PROCESSORS% install
|
||||
|
||||
cd ..
|
||||
rmdir /S /Q qt_%QT%
|
||||
|
||||
- name: Read defines.
|
||||
shell: bash
|
||||
run: |
|
||||
DEFINE=""
|
||||
if [ -n "${{ matrix.defines }}" ]; then
|
||||
DEFINE="-D ${{ matrix.defines }}=ON"
|
||||
echo Define from matrix: $DEFINE
|
||||
fi
|
||||
echo "::set-env name=TDESKTOP_BUILD_DEFINE::$DEFINE"
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
shell: cmd
|
||||
run: |
|
||||
cd %REPO_NAME%\Telegram
|
||||
|
||||
call configure.bat ^
|
||||
-D TDESKTOP_API_TEST=ON ^
|
||||
-D DESKTOP_APP_USE_PACKAGED=OFF ^
|
||||
%TDESKTOP_BUILD_DEFINE% ^
|
||||
-DCMAKE_SYSTEM_VERSION=%SDK%
|
||||
|
||||
call vcvars32.bat
|
||||
cd ..\out
|
||||
msbuild -m Telegram.sln /nologo /p:Configuration=Debug,Platform=Win32
|
||||
|
||||
- name: Move artifact.
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
cd %REPO_NAME%\out\Debug
|
||||
mkdir artifact
|
||||
move Telegram.exe artifact/
|
||||
move Updater.exe artifact/
|
||||
- uses: actions/upload-artifact@master
|
||||
name: Upload artifact.
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
with:
|
||||
name: Telegram
|
||||
path: ${{ env.REPO_NAME }}\out\Debug\artifact\
|
||||
1
.gitignore
vendored
@@ -43,6 +43,7 @@ stage
|
||||
/snap/plugins/__pycache__
|
||||
|
||||
/Telegram/*.user.*
|
||||
*.txt.user
|
||||
*.pro.user
|
||||
/Linux/
|
||||
/Telegram/Makefile
|
||||
|
||||
21
.gitmodules
vendored
@@ -28,9 +28,6 @@
|
||||
[submodule "Telegram/lib_base"]
|
||||
path = Telegram/lib_base
|
||||
url = https://github.com/desktop-app/lib_base.git
|
||||
[submodule "Telegram/gyp/helpers"]
|
||||
path = Telegram/gyp/helpers
|
||||
url = https://github.com/desktop-app/gyp_helpers.git
|
||||
[submodule "Telegram/codegen"]
|
||||
path = Telegram/codegen
|
||||
url = https://github.com/desktop-app/codegen.git
|
||||
@@ -49,3 +46,21 @@
|
||||
[submodule "Telegram/lib_spellcheck"]
|
||||
path = Telegram/lib_spellcheck
|
||||
url = https://github.com/desktop-app/lib_spellcheck
|
||||
[submodule "Telegram/lib_storage"]
|
||||
path = Telegram/lib_storage
|
||||
url = https://github.com/desktop-app/lib_storage.git
|
||||
[submodule "cmake"]
|
||||
path = cmake
|
||||
url = https://github.com/desktop-app/cmake_helpers.git
|
||||
[submodule "Telegram/ThirdParty/expected"]
|
||||
path = Telegram/ThirdParty/expected
|
||||
url = https://github.com/TartanLlama/expected
|
||||
[submodule "Telegram/ThirdParty/QR"]
|
||||
path = Telegram/ThirdParty/QR
|
||||
url = https://github.com/nayuki/QR-Code-generator
|
||||
[submodule "Telegram/lib_qr"]
|
||||
path = Telegram/lib_qr
|
||||
url = https://github.com/desktop-app/lib_qr.git
|
||||
[submodule "Telegram/ThirdParty/libdbusmenu-qt"]
|
||||
path = Telegram/ThirdParty/libdbusmenu-qt
|
||||
url = https://github.com/desktop-app/libdbusmenu-qt.git
|
||||
|
||||
65
.travis.yml
@@ -1,65 +0,0 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
language: cpp
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/travisCacheDir
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- BUILD_VERSION=""
|
||||
- BUILD_VERSION="disable_register_custom_scheme"
|
||||
- BUILD_VERSION="disable_crash_reports"
|
||||
- BUILD_VERSION="disable_network_proxy"
|
||||
- BUILD_VERSION="disable_desktop_file_generation"
|
||||
- BUILD_VERSION="disable_gtk_integration"
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- bison
|
||||
- build-essential
|
||||
- cmake
|
||||
- devscripts
|
||||
- dpatch
|
||||
- equivs
|
||||
- fakeroot
|
||||
- g++-8
|
||||
- gcc-8
|
||||
- git
|
||||
- gnome-common
|
||||
- gobject-introspection
|
||||
- gtk-doc-tools
|
||||
- libappindicator-dev
|
||||
- libasound2-dev
|
||||
- libdbusmenu-glib-dev
|
||||
- liblzma-dev
|
||||
- libopus-dev
|
||||
- libpulse-dev
|
||||
- libssl-dev
|
||||
- libdee-dev
|
||||
- libva-dev
|
||||
- libvdpau-dev
|
||||
- libxcb-xkb-dev
|
||||
- libxkbcommon-dev
|
||||
- lintian
|
||||
- quilt
|
||||
- valac
|
||||
- xutils-dev
|
||||
- yasm
|
||||
|
||||
before_install:
|
||||
- export CXX="g++-8" CC="gcc-8"
|
||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-8
|
||||
- sudo update-alternatives --config gcc
|
||||
- g++ --version
|
||||
|
||||
script:
|
||||
- .travis/build.sh
|
||||
718
.travis/build.sh
@@ -1,718 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
REPO="$PWD"
|
||||
|
||||
BUILD="$REPO/build"
|
||||
UPSTREAM="$REPO/upstream"
|
||||
EXTERNAL="$REPO/external"
|
||||
CACHE="$HOME/travisCacheDir"
|
||||
|
||||
QT_WAS_BUILT="0"
|
||||
|
||||
QT_VERSION=5.6.2
|
||||
|
||||
XKB_PATH="$BUILD/libxkbcommon"
|
||||
XKB_CACHE_VERSION="3"
|
||||
|
||||
QT_PATH="$BUILD/qt"
|
||||
QT_CACHE_VERSION="4"
|
||||
QT_PATCH="$UPSTREAM/Telegram/Patches/qtbase_${QT_VERSION//\./_}.diff"
|
||||
|
||||
BREAKPAD_PATH="$BUILD/breakpad"
|
||||
BREAKPAD_CACHE_VERSION="3"
|
||||
|
||||
GYP_PATH="$BUILD/gyp"
|
||||
GYP_CACHE_VERSION="3"
|
||||
GYP_PATCH="$UPSTREAM/Telegram/Patches/gyp.diff"
|
||||
|
||||
RANGE_PATH="$BUILD/range-v3"
|
||||
RANGE_CACHE_VERSION="3"
|
||||
|
||||
VA_PATH="$BUILD/libva"
|
||||
VA_CACHE_VERSION="3"
|
||||
|
||||
VDPAU_PATH="$BUILD/libvdpau"
|
||||
VDPAU_CACHE_VERSION="3"
|
||||
|
||||
FFMPEG_PATH="$BUILD/ffmpeg"
|
||||
FFMPEG_CACHE_VERSION="3"
|
||||
|
||||
OPENAL_PATH="$BUILD/openal-soft"
|
||||
OPENAL_CACHE_VERSION="4"
|
||||
|
||||
GYP_DEFINES=""
|
||||
|
||||
[[ ! $MAKE_ARGS ]] && MAKE_ARGS="--silent -j4"
|
||||
|
||||
run() {
|
||||
# Move files to subdir
|
||||
cd ..
|
||||
mv tdesktop tdesktop2
|
||||
mkdir tdesktop
|
||||
mv tdesktop2 "$UPSTREAM"
|
||||
|
||||
mkdir "$BUILD"
|
||||
|
||||
build
|
||||
check
|
||||
}
|
||||
|
||||
build() {
|
||||
mkdir -p "$EXTERNAL"
|
||||
|
||||
BUILD_VERSION_DATA=$(echo $BUILD_VERSION | cut -d'-' -f 1)
|
||||
|
||||
# libxkbcommon
|
||||
getXkbCommon
|
||||
|
||||
# libva
|
||||
getVa
|
||||
|
||||
# libvdpau
|
||||
getVdpau
|
||||
|
||||
# ffmpeg
|
||||
getFFmpeg
|
||||
|
||||
# openal_soft
|
||||
getOpenAL
|
||||
|
||||
# Patched Qt
|
||||
getCustomQt
|
||||
|
||||
# Breakpad
|
||||
getBreakpad
|
||||
|
||||
# Patched GYP (supports cmake precompiled headers)
|
||||
getGYP
|
||||
|
||||
# Range v3
|
||||
getRange
|
||||
|
||||
# Guideline Support Library
|
||||
getGSL
|
||||
|
||||
if [ "$QT_WAS_BUILT" == "1" ]; then
|
||||
error_msg "Qt was built, please restart the job :("
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Configure the build
|
||||
if [[ $BUILD_VERSION == *"disable_register_custom_scheme"* ]]; then
|
||||
GYP_DEFINES+=",TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_crash_reports"* ]]; then
|
||||
GYP_DEFINES+=",TDESKTOP_DISABLE_CRASH_REPORTS"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_network_proxy"* ]]; then
|
||||
GYP_DEFINES+=",TDESKTOP_DISABLE_NETWORK_PROXY"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_desktop_file_generation"* ]]; then
|
||||
GYP_DEFINES+=",TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION"
|
||||
fi
|
||||
|
||||
if [[ $BUILD_VERSION == *"disable_gtk_integration"* ]]; then
|
||||
GYP_DEFINES+=",TDESKTOP_DISABLE_GTK_INTEGRATION"
|
||||
fi
|
||||
|
||||
info_msg "Build defines: ${GYP_DEFINES}"
|
||||
|
||||
buildTelegram
|
||||
|
||||
travisEndFold
|
||||
}
|
||||
|
||||
getXkbCommon() {
|
||||
travisStartFold "Getting xkbcommon"
|
||||
|
||||
local XKB_CACHE="$CACHE/libxkbcommon"
|
||||
local XKB_CACHE_FILE="$XKB_CACHE/.cache.txt"
|
||||
local XKB_CACHE_KEY="${XKB_CACHE_VERSION}"
|
||||
local XKB_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$XKB_CACHE" ]; then
|
||||
mkdir -p "$XKB_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$XKB_CACHE" "$XKB_PATH"
|
||||
|
||||
if [ -f "$XKB_CACHE_FILE" ]; then
|
||||
local XKB_CACHE_KEY_FOUND=`tail -n 1 $XKB_CACHE_FILE`
|
||||
if [ "$XKB_CACHE_KEY" == "$XKB_CACHE_KEY_FOUND" ]; then
|
||||
XKB_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$XKB_CACHE_KEY_FOUND' does not match '$XKB_CACHE_KEY', rebuilding libxkbcommon"
|
||||
fi
|
||||
fi
|
||||
if [ "$XKB_CACHE_OUTDATED" == "1" ]; then
|
||||
buildXkbCommon
|
||||
sudo echo $XKB_CACHE_KEY > "$XKB_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached libxkbcommon"
|
||||
fi
|
||||
}
|
||||
|
||||
buildXkbCommon() {
|
||||
info_msg "Downloading and building libxkbcommon"
|
||||
|
||||
if [ -d "$EXTERNAL/libxkbcommon" ]; then
|
||||
rm -rf "$EXTERNAL/libxkbcommon"
|
||||
fi
|
||||
cd $XKB_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://github.com/xkbcommon/libxkbcommon.git
|
||||
|
||||
cd "$EXTERNAL/libxkbcommon"
|
||||
git checkout xkbcommon-0.8.4
|
||||
./autogen.sh --prefix=$XKB_PATH
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getRange() {
|
||||
travisStartFold "Getting range-v3"
|
||||
|
||||
local RANGE_CACHE="$CACHE/range-v3"
|
||||
local RANGE_CACHE_FILE="$RANGE_CACHE/.cache.txt"
|
||||
local RANGE_CACHE_KEY="${RANGE_CACHE_VERSION}"
|
||||
local RANGE_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$RANGE_CACHE" ]; then
|
||||
mkdir -p "$RANGE_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$RANGE_CACHE" "$RANGE_PATH"
|
||||
|
||||
if [ -f "$RANGE_CACHE_FILE" ]; then
|
||||
local RANGE_CACHE_KEY_FOUND=`tail -n 1 $RANGE_CACHE_FILE`
|
||||
if [ "$RANGE_CACHE_KEY" == "$RANGE_CACHE_KEY_FOUND" ]; then
|
||||
RANGE_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$RANGE_CACHE_KEY_FOUND' does not match '$RANGE_CACHE_KEY', getting range-v3"
|
||||
fi
|
||||
fi
|
||||
if [ "$RANGE_CACHE_OUTDATED" == "1" ]; then
|
||||
buildRange
|
||||
sudo echo $RANGE_CACHE_KEY > "$RANGE_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached range-v3"
|
||||
fi
|
||||
}
|
||||
|
||||
buildRange() {
|
||||
info_msg "Downloading range-v3"
|
||||
|
||||
if [ -d "$EXTERNAL/range-v3" ]; then
|
||||
rm -rf "$EXTERNAL/range-v3"
|
||||
fi
|
||||
cd $RANGE_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone --depth 1 --branch 0.9.1 https://github.com/ericniebler/range-v3
|
||||
|
||||
cd "$EXTERNAL/range-v3"
|
||||
cp -r * "$RANGE_PATH/"
|
||||
}
|
||||
|
||||
getVa() {
|
||||
travisStartFold "Getting libva"
|
||||
|
||||
local VA_CACHE="$CACHE/libva"
|
||||
local VA_CACHE_FILE="$VA_CACHE/.cache.txt"
|
||||
local VA_CACHE_KEY="${VA_CACHE_VERSION}"
|
||||
local VA_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$VA_CACHE" ]; then
|
||||
mkdir -p "$VA_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$VA_CACHE" "$VA_PATH"
|
||||
|
||||
if [ -f "$VA_CACHE_FILE" ]; then
|
||||
local VA_CACHE_KEY_FOUND=`tail -n 1 $VA_CACHE_FILE`
|
||||
if [ "$VA_CACHE_KEY" == "$VA_CACHE_KEY_FOUND" ]; then
|
||||
VA_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$VA_CACHE_KEY_FOUND' does not match '$VA_CACHE_KEY', rebuilding libva"
|
||||
fi
|
||||
fi
|
||||
if [ "$VA_CACHE_OUTDATED" == "1" ]; then
|
||||
buildVa
|
||||
sudo echo $VA_CACHE_KEY > "$VA_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached libva"
|
||||
fi
|
||||
}
|
||||
|
||||
buildVa() {
|
||||
info_msg "Downloading and building libva"
|
||||
|
||||
if [ -d "$EXTERNAL/libva" ]; then
|
||||
rm -rf "$EXTERNAL/libva"
|
||||
fi
|
||||
cd $VA_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://github.com/01org/libva
|
||||
|
||||
cd "$EXTERNAL/libva"
|
||||
./autogen.sh --prefix=$VA_PATH --enable-static
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getVdpau() {
|
||||
travisStartFold "Getting libvdpau"
|
||||
|
||||
local VDPAU_CACHE="$CACHE/libvdpau"
|
||||
local VDPAU_CACHE_FILE="$VDPAU_CACHE/.cache.txt"
|
||||
local VDPAU_CACHE_KEY="${VDPAU_CACHE_VERSION}"
|
||||
local VDPAU_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$VDPAU_CACHE" ]; then
|
||||
mkdir -p "$VDPAU_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$VDPAU_CACHE" "$VDPAU_PATH"
|
||||
|
||||
if [ -f "$VDPAU_CACHE_FILE" ]; then
|
||||
local VDPAU_CACHE_KEY_FOUND=`tail -n 1 $VDPAU_CACHE_FILE`
|
||||
if [ "$VDPAU_CACHE_KEY" == "$VDPAU_CACHE_KEY_FOUND" ]; then
|
||||
VDPAU_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$VDPAU_CACHE_KEY_FOUND' does not match '$VDPAU_CACHE_KEY', rebuilding libvdpau"
|
||||
fi
|
||||
fi
|
||||
if [ "$VDPAU_CACHE_OUTDATED" == "1" ]; then
|
||||
buildVdpau
|
||||
sudo echo $VDPAU_CACHE_KEY > "$VDPAU_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached libvdpau"
|
||||
fi
|
||||
}
|
||||
|
||||
buildVdpau() {
|
||||
info_msg "Downloading and building libvdpau"
|
||||
|
||||
if [ -d "$EXTERNAL/libvdpau" ]; then
|
||||
rm -rf "$EXTERNAL/libvdpau"
|
||||
fi
|
||||
cd $VDPAU_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone git://anongit.freedesktop.org/vdpau/libvdpau
|
||||
|
||||
cd "$EXTERNAL/libvdpau"
|
||||
git checkout libvdpau-1.2
|
||||
./autogen.sh --prefix=$VDPAU_PATH --enable-static
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getFFmpeg() {
|
||||
travisStartFold "Getting ffmpeg"
|
||||
|
||||
local FFMPEG_CACHE="$CACHE/ffmpeg"
|
||||
local FFMPEG_CACHE_FILE="$FFMPEG_CACHE/.cache.txt"
|
||||
local FFMPEG_CACHE_KEY="${FFMPEG_CACHE_VERSION}"
|
||||
local FFMPEG_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$FFMPEG_CACHE" ]; then
|
||||
mkdir -p "$FFMPEG_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$FFMPEG_CACHE" "$FFMPEG_PATH"
|
||||
|
||||
if [ -f "$FFMPEG_CACHE_FILE" ]; then
|
||||
local FFMPEG_CACHE_KEY_FOUND=`tail -n 1 $FFMPEG_CACHE_FILE`
|
||||
if [ "$FFMPEG_CACHE_KEY" == "$FFMPEG_CACHE_KEY_FOUND" ]; then
|
||||
FFMPEG_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$FFMPEG_CACHE_KEY_FOUND' does not match '$FFMPEG_CACHE_KEY', rebuilding ffmpeg"
|
||||
fi
|
||||
fi
|
||||
if [ "$FFMPEG_CACHE_OUTDATED" == "1" ]; then
|
||||
buildFFmpeg
|
||||
sudo echo $FFMPEG_CACHE_KEY > "$FFMPEG_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached ffmpeg"
|
||||
fi
|
||||
}
|
||||
|
||||
buildFFmpeg() {
|
||||
info_msg "Downloading and building ffmpeg"
|
||||
|
||||
if [ -d "$EXTERNAL/ffmpeg" ]; then
|
||||
rm -rf "$EXTERNAL/ffmpeg"
|
||||
fi
|
||||
cd $FFMPEG_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://git.ffmpeg.org/ffmpeg.git
|
||||
|
||||
cd "$EXTERNAL/ffmpeg"
|
||||
git checkout release/3.4
|
||||
|
||||
./configure \
|
||||
--prefix=$FFMPEG_PATH \
|
||||
--disable-debug \
|
||||
--disable-programs \
|
||||
--disable-doc \
|
||||
--disable-everything \
|
||||
--enable-gpl \
|
||||
--enable-version3 \
|
||||
--enable-libopus \
|
||||
--enable-decoder=aac \
|
||||
--enable-decoder=aac_latm \
|
||||
--enable-decoder=aasc \
|
||||
--enable-decoder=flac \
|
||||
--enable-decoder=gif \
|
||||
--enable-decoder=h264 \
|
||||
--enable-decoder=h264_vdpau \
|
||||
--enable-decoder=mp1 \
|
||||
--enable-decoder=mp1float \
|
||||
--enable-decoder=mp2 \
|
||||
--enable-decoder=mp2float \
|
||||
--enable-decoder=mp3 \
|
||||
--enable-decoder=mp3adu \
|
||||
--enable-decoder=mp3adufloat \
|
||||
--enable-decoder=mp3float \
|
||||
--enable-decoder=mp3on4 \
|
||||
--enable-decoder=mp3on4float \
|
||||
--enable-decoder=mpeg4 \
|
||||
--enable-decoder=mpeg4_vdpau \
|
||||
--enable-decoder=msmpeg4v2 \
|
||||
--enable-decoder=msmpeg4v3 \
|
||||
--enable-decoder=opus \
|
||||
--enable-decoder=vorbis \
|
||||
--enable-decoder=wavpack \
|
||||
--enable-decoder=wmalossless \
|
||||
--enable-decoder=wmapro \
|
||||
--enable-decoder=wmav1 \
|
||||
--enable-decoder=wmav2 \
|
||||
--enable-decoder=wmavoice \
|
||||
--enable-encoder=libopus \
|
||||
--enable-hwaccel=h264_vaapi \
|
||||
--enable-hwaccel=h264_vdpau \
|
||||
--enable-hwaccel=mpeg4_vaapi \
|
||||
--enable-hwaccel=mpeg4_vdpau \
|
||||
--enable-parser=aac \
|
||||
--enable-parser=aac_latm \
|
||||
--enable-parser=flac \
|
||||
--enable-parser=h264 \
|
||||
--enable-parser=mpeg4video \
|
||||
--enable-parser=mpegaudio \
|
||||
--enable-parser=opus \
|
||||
--enable-parser=vorbis \
|
||||
--enable-demuxer=aac \
|
||||
--enable-demuxer=flac \
|
||||
--enable-demuxer=gif \
|
||||
--enable-demuxer=h264 \
|
||||
--enable-demuxer=mov \
|
||||
--enable-demuxer=mp3 \
|
||||
--enable-demuxer=ogg \
|
||||
--enable-demuxer=wav \
|
||||
--enable-muxer=ogg \
|
||||
--enable-muxer=opus
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getOpenAL() {
|
||||
travisStartFold "Getting openal-soft"
|
||||
|
||||
local OPENAL_CACHE="$CACHE/openal-soft"
|
||||
local OPENAL_CACHE_FILE="$OPENAL_CACHE/.cache.txt"
|
||||
local OPENAL_CACHE_KEY="${OPENAL_CACHE_VERSION}"
|
||||
local OPENAL_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$OPENAL_CACHE" ]; then
|
||||
mkdir -p "$OPENAL_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$OPENAL_CACHE" "$OPENAL_PATH"
|
||||
|
||||
if [ -f "$OPENAL_CACHE_FILE" ]; then
|
||||
local OPENAL_CACHE_KEY_FOUND=`tail -n 1 $OPENAL_CACHE_FILE`
|
||||
if [ "$OPENAL_CACHE_KEY" == "$OPENAL_CACHE_KEY_FOUND" ]; then
|
||||
OPENAL_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$OPENAL_CACHE_KEY_FOUND' does not match '$OPENAL_CACHE_KEY', rebuilding openal-soft"
|
||||
fi
|
||||
fi
|
||||
if [ "$OPENAL_CACHE_OUTDATED" == "1" ]; then
|
||||
buildOpenAL
|
||||
sudo echo $OPENAL_CACHE_KEY > "$OPENAL_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached openal-soft"
|
||||
fi
|
||||
}
|
||||
|
||||
buildOpenAL() {
|
||||
info_msg "Downloading and building openal-soft"
|
||||
|
||||
if [ -d "$EXTERNAL/openal-soft" ]; then
|
||||
rm -rf "$EXTERNAL/openal-soft"
|
||||
fi
|
||||
cd $OPENAL_PATH
|
||||
sudo rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://github.com/kcat/openal-soft.git
|
||||
cd openal-soft
|
||||
git checkout openal-soft-1.19.1
|
||||
|
||||
cd "$EXTERNAL/openal-soft/build"
|
||||
cmake \
|
||||
-D CMAKE_INSTALL_PREFIX=$OPENAL_PATH \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D LIBTYPE=STATIC \
|
||||
-D ALSOFT_EXAMPLES=OFF \
|
||||
-D ALSOFT_TESTS=OFF \
|
||||
-D ALSOFT_UTILS=OFF \
|
||||
..
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getBreakpad() {
|
||||
travisStartFold "Getting breakpad"
|
||||
|
||||
local BREAKPAD_CACHE="$CACHE/breakpad"
|
||||
local BREAKPAD_CACHE_FILE="$BREAKPAD_CACHE/.cache.txt"
|
||||
local BREAKPAD_CACHE_KEY="${BREAKPAD_CACHE_VERSION}"
|
||||
local BREAKPAD_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$BREAKPAD_CACHE" ]; then
|
||||
mkdir -p "$BREAKPAD_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$BREAKPAD_CACHE" "$BREAKPAD_PATH"
|
||||
|
||||
if [ -f "$BREAKPAD_CACHE_FILE" ]; then
|
||||
local BREAKPAD_CACHE_KEY_FOUND=`tail -n 1 $BREAKPAD_CACHE_FILE`
|
||||
if [ "$BREAKPAD_CACHE_KEY" == "$BREAKPAD_CACHE_KEY_FOUND" ]; then
|
||||
BREAKPAD_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$BREAKPAD_CACHE_KEY_FOUND' does not match '$BREAKPAD_CACHE_KEY', rebuilding breakpad"
|
||||
fi
|
||||
fi
|
||||
if [ "$BREAKPAD_CACHE_OUTDATED" == "1" ]; then
|
||||
buildBreakpad
|
||||
sudo echo $BREAKPAD_CACHE_KEY > "$BREAKPAD_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached breakpad"
|
||||
fi
|
||||
}
|
||||
|
||||
buildBreakpad() {
|
||||
info_msg "Downloading and building breakpad"
|
||||
|
||||
if [ -d "$EXTERNAL/breakpad" ]; then
|
||||
rm -rf "$EXTERNAL/breakpad"
|
||||
fi
|
||||
cd $BREAKPAD_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://chromium.googlesource.com/breakpad/breakpad
|
||||
|
||||
cd "$EXTERNAL/breakpad/src/third_party"
|
||||
git clone https://chromium.googlesource.com/linux-syscall-support lss
|
||||
|
||||
cd "$EXTERNAL/breakpad"
|
||||
./configure --prefix=$BREAKPAD_PATH
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
}
|
||||
|
||||
getCustomQt() {
|
||||
travisStartFold "Getting patched Qt"
|
||||
|
||||
local QT_CACHE="$CACHE/qtPatched"
|
||||
local QT_CACHE_FILE="$QT_CACHE/.cache.txt"
|
||||
local QT_PATCH_CHECKSUM=`sha1sum $QT_PATCH`
|
||||
local QT_CACHE_KEY="${QT_VERSION}_${QT_CACHE_VERSION}_${QT_PATCH_CHECKSUM:0:32}"
|
||||
local QT_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$QT_CACHE" ]; then
|
||||
mkdir -p "$QT_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$QT_CACHE" "$QT_PATH"
|
||||
|
||||
if [ -f "$QT_CACHE_FILE" ]; then
|
||||
local QT_CACHE_KEY_FOUND=`tail -n 1 $QT_CACHE_FILE`
|
||||
if [ "$QT_CACHE_KEY" == "$QT_CACHE_KEY_FOUND" ]; then
|
||||
QT_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$QT_CACHE_KEY_FOUND' does not match '$QT_CACHE_KEY', rebuilding patched Qt"
|
||||
fi
|
||||
fi
|
||||
if [ "$QT_CACHE_OUTDATED" == "1" ]; then
|
||||
buildCustomQt
|
||||
sudo echo $QT_CACHE_KEY > "$QT_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached patched Qt"
|
||||
fi
|
||||
|
||||
export PATH="$QT_PATH/bin:$PATH"
|
||||
}
|
||||
|
||||
buildCustomQt() {
|
||||
QT_WAS_BUILT="1"
|
||||
info_msg "Downloading and building patched qt"
|
||||
|
||||
if [ -d "$EXTERNAL/qt${QT_VERSION}" ]; then
|
||||
sudo rm -rf "$EXTERNAL/qt${QT_VERSION}"
|
||||
fi
|
||||
cd $QT_PATH
|
||||
sudo rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone git://code.qt.io/qt/qt5.git qt${QT_VERSION}
|
||||
|
||||
cd "$EXTERNAL/qt${QT_VERSION}"
|
||||
perl init-repository --branch --module-subset=qtbase,qtimageformats
|
||||
git checkout v${QT_VERSION}
|
||||
cd qtbase && git checkout v${QT_VERSION} && cd ..
|
||||
cd qtimageformats && git checkout v${QT_VERSION} && cd ..
|
||||
|
||||
cd "$EXTERNAL/qt${QT_VERSION}/qtbase"
|
||||
git apply "$QT_PATCH"
|
||||
cd ..
|
||||
|
||||
cd "$EXTERNAL/qt${QT_VERSION}/qtbase/src/plugins/platforminputcontexts"
|
||||
git clone https://github.com/telegramdesktop/fcitx.git
|
||||
git clone https://github.com/telegramdesktop/hime.git
|
||||
git clone https://github.com/telegramdesktop/nimf.git
|
||||
cd ../../../..
|
||||
|
||||
./configure -prefix $QT_PATH -release -opensource -confirm-license -qt-zlib \
|
||||
-qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \
|
||||
-qt-xkbcommon-x11 -no-opengl -no-gtkstyle -static \
|
||||
-nomake examples -nomake tests -no-mirclient \
|
||||
-dbus-runtime -no-gstreamer -no-mtdev # <- Not sure about these
|
||||
make $MAKE_ARGS
|
||||
sudo make install
|
||||
}
|
||||
|
||||
getGSL() {
|
||||
cd "$UPSTREAM"
|
||||
git submodule init
|
||||
git submodule update
|
||||
}
|
||||
|
||||
getGYP() {
|
||||
travisStartFold "Getting patched GYP"
|
||||
|
||||
local GYP_CACHE="$CACHE/gyp"
|
||||
local GYP_CACHE_FILE="$GYP_CACHE/.cache.txt"
|
||||
local GYP_PATCH_CHECKSUM=`sha1sum $GYP_PATCH`
|
||||
local GYP_CACHE_KEY="${GYP_CACHE_VERSION}_${GYP_PATCH_CHECKSUM:0:32}"
|
||||
local GYP_CACHE_OUTDATED="1"
|
||||
|
||||
if [ ! -d "$GYP_CACHE" ]; then
|
||||
mkdir -p "$GYP_CACHE"
|
||||
fi
|
||||
|
||||
ln -sf "$GYP_CACHE" "$GYP_PATH"
|
||||
|
||||
if [ -f "$GYP_CACHE_FILE" ]; then
|
||||
local GYP_CACHE_KEY_FOUND=`tail -n 1 $GYP_CACHE_FILE`
|
||||
if [ "$GYP_CACHE_KEY" == "$GYP_CACHE_KEY_FOUND" ]; then
|
||||
GYP_CACHE_OUTDATED="0"
|
||||
else
|
||||
info_msg "Cache key '$GYP_CACHE_KEY_FOUND' does not match '$GYP_CACHE_KEY', rebuilding patched GYP"
|
||||
fi
|
||||
fi
|
||||
if [ "$GYP_CACHE_OUTDATED" == "1" ]; then
|
||||
buildGYP
|
||||
sudo echo $GYP_CACHE_KEY > "$GYP_CACHE_FILE"
|
||||
else
|
||||
info_msg "Using cached patched GYP"
|
||||
fi
|
||||
}
|
||||
|
||||
buildGYP() {
|
||||
info_msg "Downloading and building patched GYP"
|
||||
|
||||
if [ -d "$EXTERNAL/gyp" ]; then
|
||||
rm -rf "$EXTERNAL/gyp"
|
||||
fi
|
||||
cd $GYP_PATH
|
||||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone https://chromium.googlesource.com/external/gyp
|
||||
|
||||
cd "$EXTERNAL/gyp"
|
||||
git checkout 702ac58e47
|
||||
git apply "$GYP_PATCH"
|
||||
cp -r * "$GYP_PATH/"
|
||||
}
|
||||
|
||||
buildTelegram() {
|
||||
travisStartFold "Build tdesktop"
|
||||
|
||||
cd "$UPSTREAM/Telegram/gyp"
|
||||
"$GYP_PATH/gyp" \
|
||||
-Dapi_id=17349 \
|
||||
-Dapi_hash=344583e45741c457fe1862106095a5eb \
|
||||
-Dbuild_defines=${GYP_DEFINES:1} \
|
||||
-Dlinux_path_xkbcommon=$XKB_PATH \
|
||||
-Dlinux_path_va=$VA_PATH \
|
||||
-Dlinux_path_vdpau=$VDPAU_PATH \
|
||||
-Dlinux_path_ffmpeg=$FFMPEG_PATH \
|
||||
-Dlinux_path_openal=$OPENAL_PATH \
|
||||
-Dlinux_path_range=$RANGE_PATH \
|
||||
-Dlinux_path_qt=$QT_PATH \
|
||||
-Dlinux_path_breakpad=$BREAKPAD_PATH \
|
||||
-Dlinux_path_libexif_lib=/usr/local/lib \
|
||||
-Dlinux_path_opus_include=/usr/include/opus \
|
||||
-Dlinux_lib_ssl=-lssl \
|
||||
-Dlinux_lib_crypto=-lcrypto \
|
||||
-Dlinux_lib_icu=-licuuc\ -licutu\ -licui18n \
|
||||
--depth=. --generator-output=.. --format=cmake -Goutput_dir=../out \
|
||||
Telegram.gyp
|
||||
cd "$UPSTREAM/out/Debug"
|
||||
|
||||
export ASM="gcc"
|
||||
cmake .
|
||||
make $MAKE_ARGS
|
||||
}
|
||||
|
||||
check() {
|
||||
local filePath="$UPSTREAM/out/Debug/Telegram"
|
||||
if test -f "$filePath"; then
|
||||
success_msg "Build successfully done! :)"
|
||||
|
||||
local size;
|
||||
size=$(stat -c %s "$filePath")
|
||||
success_msg "File size of ${filePath}: ${size} Bytes"
|
||||
else
|
||||
error_msg "Build error, output file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
source ./.travis/common.sh
|
||||
|
||||
run
|
||||
@@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# set colors
|
||||
RCol='\e[0m' # Text Reset
|
||||
|
||||
# Regular Bold Underline High Intensity BoldHigh Intens Background High Intensity Backgrounds
|
||||
Bla='\e[0;30m'; BBla='\e[1;30m'; UBla='\e[4;30m'; IBla='\e[0;90m'; BIBla='\e[1;90m'; On_Bla='\e[40m'; On_IBla='\e[0;100m';
|
||||
Red='\e[0;31m'; BRed='\e[1;31m'; URed='\e[4;31m'; IRed='\e[0;91m'; BIRed='\e[1;91m'; On_Red='\e[41m'; On_IRed='\e[0;101m';
|
||||
Gre='\e[0;32m'; BGre='\e[1;32m'; UGre='\e[4;32m'; IGre='\e[0;92m'; BIGre='\e[1;92m'; On_Gre='\e[42m'; On_IGre='\e[0;102m';
|
||||
Yel='\e[0;33m'; BYel='\e[1;33m'; UYel='\e[4;33m'; IYel='\e[0;93m'; BIYel='\e[1;93m'; On_Yel='\e[43m'; On_IYel='\e[0;103m';
|
||||
Blu='\e[0;34m'; BBlu='\e[1;34m'; UBlu='\e[4;34m'; IBlu='\e[0;94m'; BIBlu='\e[1;94m'; On_Blu='\e[44m'; On_IBlu='\e[0;104m';
|
||||
Pur='\e[0;35m'; BPur='\e[1;35m'; UPur='\e[4;35m'; IPur='\e[0;95m'; BIPur='\e[1;95m'; On_Pur='\e[45m'; On_IPur='\e[0;105m';
|
||||
Cya='\e[0;36m'; BCya='\e[1;36m'; UCya='\e[4;36m'; ICya='\e[0;96m'; BICya='\e[1;96m'; On_Cya='\e[46m'; On_ICya='\e[0;106m';
|
||||
Whi='\e[0;37m'; BWhi='\e[1;37m'; UWhi='\e[4;37m'; IWhi='\e[0;97m'; BIWhi='\e[1;97m'; On_Whi='\e[47m'; On_IWhi='\e[0;107m';
|
||||
|
||||
start_msg() {
|
||||
echo -e "\n${Gre}$*${RCol}"
|
||||
}
|
||||
|
||||
info_msg() {
|
||||
sameLineInfoMessage "\n$1"
|
||||
}
|
||||
|
||||
error_msg() {
|
||||
echo -e "\n${BRed}$*${RCol}"
|
||||
}
|
||||
|
||||
success_msg() {
|
||||
echo -e "\n${BGre}$*${RCol}"
|
||||
}
|
||||
|
||||
sameLineInfoMessage() {
|
||||
echo -e "${Cya}$*${RCol}"
|
||||
}
|
||||
|
||||
TRAVIS_LAST_FOLD=""
|
||||
|
||||
travisStartFold() {
|
||||
local TITLE="$1"
|
||||
local NAME=$(sanitizeName "$TITLE")
|
||||
|
||||
if [ "$TRAVIS_LAST_FOLD" != "" ]; then
|
||||
travisEndFold
|
||||
fi
|
||||
|
||||
echo "travis_fold:start:$NAME"
|
||||
sameLineInfoMessage "$TITLE"
|
||||
|
||||
TRAVIS_LAST_FOLD="$NAME"
|
||||
}
|
||||
|
||||
travisEndFold() {
|
||||
if [ "$TRAVIS_LAST_FOLD" == "" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo "travis_fold:end:$TRAVIS_LAST_FOLD"
|
||||
TRAVIS_LAST_FOLD=""
|
||||
}
|
||||
|
||||
sanitizeName() {
|
||||
local NAME="${1// /_}"
|
||||
local NAME="${NAME,,}"
|
||||
echo "$NAME"
|
||||
}
|
||||
37
CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
# This file is part of Telegram Desktop,
|
||||
# the official desktop application for the Telegram messaging service.
|
||||
#
|
||||
# For license and copyright information please follow this link:
|
||||
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
cmake_policy(SET CMP0076 NEW)
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
include(cmake/validate_special_target.cmake)
|
||||
include(cmake/version.cmake)
|
||||
desktop_app_parse_version(Telegram/build/version)
|
||||
|
||||
project(Telegram
|
||||
LANGUAGES C CXX
|
||||
VERSION ${desktop_app_version_cmake}
|
||||
DESCRIPTION "Official Telegram Desktop messenger"
|
||||
HOMEPAGE_URL "https://desktop.telegram.org"
|
||||
)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Telegram)
|
||||
|
||||
include(cmake/variables.cmake)
|
||||
include(cmake/nice_target_sources.cmake)
|
||||
include(cmake/target_link_static_libraries.cmake)
|
||||
include(cmake/target_link_frameworks.cmake)
|
||||
include(cmake/init_target.cmake)
|
||||
include(cmake/generate_target.cmake)
|
||||
|
||||
include(cmake/options.cmake)
|
||||
|
||||
include(cmake/external/qt/package.cmake)
|
||||
|
||||
add_subdirectory(cmake)
|
||||
add_subdirectory(Telegram)
|
||||
2
LEGAL
@@ -1,7 +1,7 @@
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
Copyright (c) 2014-2019 John Preston, https://desktop.telegram.org
|
||||
Copyright (c) 2014-2020 The Telegram Desktop Authors.
|
||||
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
18
README.md
@@ -3,8 +3,9 @@
|
||||
This is the complete source code and the build instructions for the alpha version of the official desktop client for the [Telegram][telegram] messenger, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol.
|
||||
|
||||
[](https://github.com/telegramdesktop/tdesktop/releases)
|
||||
[](https://travis-ci.org/telegramdesktop/tdesktop)
|
||||
[](https://ci.appveyor.com/project/telegramdesktop/tdesktop)
|
||||
[](https://github.com/telegramdesktop/tdesktop/actions)
|
||||
[](https://github.com/telegramdesktop/tdesktop/actions)
|
||||
[](https://github.com/telegramdesktop/tdesktop/actions)
|
||||
|
||||
[![Preview of Telegram Desktop][preview_image]][preview_image_url]
|
||||
|
||||
@@ -15,17 +16,16 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
|
||||
* Windows XP - Windows 10 (**not** RT)
|
||||
* Mac OS X 10.8 - Mac OS X 10.15
|
||||
* Mac OS X 10.6 - Mac OS X 10.7 (separate build)
|
||||
* Ubuntu 12.04 - Ubuntu 19.04
|
||||
* Fedora 22 - Fedora 30
|
||||
* Ubuntu 12.04 - Ubuntu 19.10
|
||||
* Fedora 22 - Fedora 31
|
||||
* [Snappy](https://snapcraft.io/telegram-desktop)
|
||||
* [Flathub](https://flathub.org/apps/details/org.telegram.desktop)
|
||||
|
||||
## Third-party
|
||||
|
||||
* Qt 5.3.2 and 5.6.2, slightly patched ([LGPL](http://doc.qt.io/qt-5/lgpl.html))
|
||||
* OpenSSL 1.0.1g ([OpenSSL License](https://www.openssl.org/source/license.html))
|
||||
* zlib 1.2.8 ([zlib License](http://www.zlib.net/zlib_license.html))
|
||||
* libexif 0.6.20 ([LGPL](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html))
|
||||
* Qt 5.12.5 and 5.6.2, slightly patched ([LGPL](http://doc.qt.io/qt-5/lgpl.html))
|
||||
* OpenSSL 1.1.1 ([OpenSSL License](https://www.openssl.org/source/license.html))
|
||||
* zlib 1.2.11 ([zlib License](http://www.zlib.net/zlib_license.html))
|
||||
* LZMA SDK 9.20 ([public domain](http://www.7-zip.org/sdk.html))
|
||||
* liblzma ([public domain](http://tukaani.org/xz/))
|
||||
* Google Breakpad ([License](https://chromium.googlesource.com/breakpad/breakpad/+/master/LICENSE))
|
||||
@@ -42,6 +42,8 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
|
||||
* Emoji alpha codes ([MIT License](https://github.com/emojione/emojione/blob/master/extras/alpha-codes/LICENSE.md))
|
||||
* Catch test framework ([Boost License](https://github.com/philsquared/Catch/blob/master/LICENSE.txt))
|
||||
* xxHash ([BSD License](https://github.com/Cyan4973/xxHash/blob/dev/LICENSE))
|
||||
* QR Code generator ([MIT License](https://github.com/nayuki/QR-Code-generator#license))
|
||||
* CMake ([New BSD License](https://github.com/Kitware/CMake/blob/master/Copyright.txt))
|
||||
|
||||
## Build instructions
|
||||
|
||||
|
||||
1212
Telegram/CMakeLists.txt
Normal file
BIN
Telegram/Resources/icons/intro_qr_plane.png
Normal file
|
After Width: | Height: | Size: 635 B |
BIN
Telegram/Resources/icons/intro_qr_plane@2x.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Telegram/Resources/icons/intro_qr_plane@3x.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 513 B |
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 1.6 KiB |
BIN
Telegram/Resources/icons/mediaview_rotate.png
Normal file
|
After Width: | Height: | Size: 912 B |
BIN
Telegram/Resources/icons/mediaview_rotate@2x.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Telegram/Resources/icons/mediaview_rotate@3x.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
Telegram/Resources/icons/player_check.png
Normal file
|
After Width: | Height: | Size: 281 B |
BIN
Telegram/Resources/icons/player_check@2x.png
Normal file
|
After Width: | Height: | Size: 476 B |
BIN
Telegram/Resources/icons/player_check@3x.png
Normal file
|
After Width: | Height: | Size: 695 B |
BIN
Telegram/Resources/icons/player_fullscreen.png
Normal file
|
After Width: | Height: | Size: 359 B |
BIN
Telegram/Resources/icons/player_fullscreen@2x.png
Normal file
|
After Width: | Height: | Size: 639 B |
BIN
Telegram/Resources/icons/player_fullscreen@3x.png
Normal file
|
After Width: | Height: | Size: 919 B |
BIN
Telegram/Resources/icons/player_minimize.png
Normal file
|
After Width: | Height: | Size: 341 B |
BIN
Telegram/Resources/icons/player_minimize@2x.png
Normal file
|
After Width: | Height: | Size: 594 B |
BIN
Telegram/Resources/icons/player_minimize@3x.png
Normal file
|
After Width: | Height: | Size: 879 B |
BIN
Telegram/Resources/icons/player_more.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
Telegram/Resources/icons/player_more@2x.png
Normal file
|
After Width: | Height: | Size: 361 B |
BIN
Telegram/Resources/icons/player_more@3x.png
Normal file
|
After Width: | Height: | Size: 566 B |
BIN
Telegram/Resources/icons/player_pause.png
Normal file
|
After Width: | Height: | Size: 215 B |
BIN
Telegram/Resources/icons/player_pause@2x.png
Normal file
|
After Width: | Height: | Size: 400 B |
BIN
Telegram/Resources/icons/player_pause@3x.png
Normal file
|
After Width: | Height: | Size: 593 B |
BIN
Telegram/Resources/icons/player_pip.png
Normal file
|
After Width: | Height: | Size: 319 B |
BIN
Telegram/Resources/icons/player_pip@2x.png
Normal file
|
After Width: | Height: | Size: 530 B |
BIN
Telegram/Resources/icons/player_pip@3x.png
Normal file
|
After Width: | Height: | Size: 877 B |
BIN
Telegram/Resources/icons/player_pip_close.png
Normal file
|
After Width: | Height: | Size: 253 B |
BIN
Telegram/Resources/icons/player_pip_close@2x.png
Normal file
|
After Width: | Height: | Size: 427 B |
BIN
Telegram/Resources/icons/player_pip_close@3x.png
Normal file
|
After Width: | Height: | Size: 747 B |
BIN
Telegram/Resources/icons/player_pip_enlarge.png
Normal file
|
After Width: | Height: | Size: 361 B |
BIN
Telegram/Resources/icons/player_pip_enlarge@2x.png
Normal file
|
After Width: | Height: | Size: 574 B |
BIN
Telegram/Resources/icons/player_pip_enlarge@3x.png
Normal file
|
After Width: | Height: | Size: 845 B |
BIN
Telegram/Resources/icons/player_pip_pause.png
Normal file
|
After Width: | Height: | Size: 242 B |
BIN
Telegram/Resources/icons/player_pip_pause@2x.png
Normal file
|
After Width: | Height: | Size: 452 B |
BIN
Telegram/Resources/icons/player_pip_pause@3x.png
Normal file
|
After Width: | Height: | Size: 662 B |
BIN
Telegram/Resources/icons/player_pip_play.png
Normal file
|
After Width: | Height: | Size: 334 B |
BIN
Telegram/Resources/icons/player_pip_play@2x.png
Normal file
|
After Width: | Height: | Size: 631 B |
BIN
Telegram/Resources/icons/player_pip_play@3x.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Telegram/Resources/icons/player_play.png
Normal file
|
After Width: | Height: | Size: 362 B |
BIN
Telegram/Resources/icons/player_play@2x.png
Normal file
|
After Width: | Height: | Size: 659 B |
BIN
Telegram/Resources/icons/player_play@3x.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Telegram/Resources/icons/player_volume_off.png
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
Telegram/Resources/icons/player_volume_off@2x.png
Normal file
|
After Width: | Height: | Size: 854 B |
BIN
Telegram/Resources/icons/player_volume_off@3x.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Telegram/Resources/icons/player_volume_on.png
Normal file
|
After Width: | Height: | Size: 482 B |
BIN
Telegram/Resources/icons/player_volume_on@2x.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Telegram/Resources/icons/player_volume_on@3x.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
Telegram/Resources/icons/player_volume_small.png
Normal file
|
After Width: | Height: | Size: 341 B |
BIN
Telegram/Resources/icons/player_volume_small@2x.png
Normal file
|
After Width: | Height: | Size: 668 B |
BIN
Telegram/Resources/icons/player_volume_small@3x.png
Normal file
|
After Width: | Height: | Size: 962 B |
BIN
Telegram/Resources/icons/poll_choice_right.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
Telegram/Resources/icons/poll_choice_right@2x.png
Normal file
|
After Width: | Height: | Size: 219 B |
BIN
Telegram/Resources/icons/poll_choice_right@3x.png
Normal file
|
After Width: | Height: | Size: 294 B |
BIN
Telegram/Resources/icons/poll_choice_wrong.png
Normal file
|
After Width: | Height: | Size: 157 B |
BIN
Telegram/Resources/icons/poll_choice_wrong@2x.png
Normal file
|
After Width: | Height: | Size: 213 B |
BIN
Telegram/Resources/icons/poll_choice_wrong@3x.png
Normal file
|
After Width: | Height: | Size: 260 B |
BIN
Telegram/Resources/icons/poll_select_check.png
Normal file
|
After Width: | Height: | Size: 249 B |
BIN
Telegram/Resources/icons/poll_select_check@2x.png
Normal file
|
After Width: | Height: | Size: 364 B |
BIN
Telegram/Resources/icons/poll_select_check@3x.png
Normal file
|
After Width: | Height: | Size: 556 B |
@@ -158,6 +158,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_deleted_message" = "Deleted message";
|
||||
"lng_pinned_message" = "Pinned message";
|
||||
"lng_pinned_poll" = "Pinned poll";
|
||||
"lng_pinned_quiz" = "Pinned quiz";
|
||||
"lng_pinned_unpin_sure" = "Would you like to unpin this message?";
|
||||
"lng_pinned_pin_sure" = "Would you like to pin this message?";
|
||||
"lng_pinned_pin" = "Pin";
|
||||
@@ -178,8 +179,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_photo_caption" = "Caption";
|
||||
"lng_photos_comment" = "Comment";
|
||||
|
||||
"lng_intro_qr_title" = "Scan From Mobile Telegram";
|
||||
"lng_intro_qr_step1" = "Open Telegram on your phone";
|
||||
"lng_intro_qr_step2" = "Go to Settings > Devices > Scan QR Code";
|
||||
"lng_intro_qr_step3" = "Scan this image to Log In";
|
||||
"lng_intro_qr_skip" = "Or log in using your phone number";
|
||||
|
||||
"lng_phone_title" = "Your Phone Number";
|
||||
"lng_phone_desc" = "Please confirm your country code and\nenter your mobile phone number.";
|
||||
"lng_phone_to_qr" = "Quick log in using QR code";
|
||||
"lng_country_code" = "Country Code";
|
||||
"lng_bad_country_code" = "Invalid Country Code";
|
||||
"lng_country_ph" = "Search";
|
||||
@@ -408,7 +416,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_settings_system_integration" = "System integration";
|
||||
"lng_settings_performance" = "Performance";
|
||||
"lng_settings_enable_animations" = "Enable animations";
|
||||
"lng_settings_autoplay_gifs" = "Autoplay GIFs";
|
||||
"lng_settings_sensitive_title" = "Sensitive content";
|
||||
"lng_settings_sensitive_disable_filtering" = "Disable filtering";
|
||||
"lng_settings_sensitive_about" = "Display sensitive media in public channels on all your Telegram devices.";
|
||||
|
||||
"lng_settings_spellchecker" = "Spell checker";
|
||||
"lng_settings_system_spellchecker" = "Use system spell checker";
|
||||
@@ -1143,12 +1153,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_media_auto_in_groups" = "In groups";
|
||||
"lng_media_auto_in_channels" = "In channels";
|
||||
"lng_media_auto_title" = "Automatically download";
|
||||
"lng_media_auto_play" = "Autoplay";
|
||||
"lng_media_photo_title" = "Photos";
|
||||
"lng_media_video_title" = "Video files";
|
||||
"lng_media_audio_title" = "Voice messages";
|
||||
"lng_media_video_messages_title" = "Round video messages";
|
||||
"lng_media_file_title" = "Files";
|
||||
"lng_media_music_title" = "Music";
|
||||
"lng_media_animation_title" = "Animated GIFs";
|
||||
"lng_media_size_limit" = "Limit by size";
|
||||
"lng_media_size_up_to" = "up to {size}";
|
||||
@@ -1259,6 +1268,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_cant_invite_make_admin" = "Make admin";
|
||||
|
||||
"lng_send_button" = "Send";
|
||||
"lng_schedule_button" = "Schedule";
|
||||
"lng_send_silent_message" = "Send without sound";
|
||||
"lng_schedule_message" = "Schedule message";
|
||||
"lng_reminder_message" = "Set a reminder";
|
||||
@@ -1286,6 +1296,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
"lng_scheduled_messages" = "Scheduled Messages";
|
||||
"lng_reminder_messages" = "Reminders";
|
||||
"lng_scheduled_date" = "Scheduled for {date}";
|
||||
"lng_scheduled_date_until_online" = "Scheduled until online";
|
||||
"lng_scheduled_send_until_online" = "Send when online";
|
||||
"lng_scheduled_send_now" = "Send message now?";
|
||||
"lng_scheduled_send_now_many#one" = "Send {count} message now?";
|
||||
"lng_scheduled_send_now_many#other" = "Send {count} messages now?";
|
||||
@@ -1445,6 +1458,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_send_album" = "Send as an album";
|
||||
"lng_send_photo" = "Send as a photo";
|
||||
"lng_send_file" = "Send as a file";
|
||||
"lng_send_media_invalid_files" = "Sorry, no valid files found.";
|
||||
|
||||
"lng_forward_choose" = "Choose recipient...";
|
||||
"lng_forward_cant" = "Sorry, no way to forward here :(";
|
||||
@@ -1565,6 +1579,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_mediaview_saved_to" = "Image was saved to your {downloads} folder";
|
||||
"lng_mediaview_downloads" = "Downloads";
|
||||
"lng_mediaview_video_loading" = "Loading - {percent}";
|
||||
"lng_mediaview_playback_speed" = "Playback speed";
|
||||
"lng_mediaview_playback_speed_normal" = "Normal";
|
||||
|
||||
"lng_theme_preview_title" = "Theme Preview";
|
||||
"lng_theme_preview_generating" = "Generating color theme preview...";
|
||||
@@ -1789,6 +1805,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_restricted_send_inline_all" = "Posting inline content isn't allowed in this group.";
|
||||
"lng_restricted_send_polls_all" = "Posting polls isn't allowed in this group.";
|
||||
|
||||
"lng_restricted_send_public_polls" = "Sorry, public polls can't be forwarded to channels.";
|
||||
|
||||
"lng_exceptions_list_title" = "Exceptions";
|
||||
"lng_removed_list_title" = "Removed users";
|
||||
|
||||
@@ -2158,10 +2176,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_launch_exe_dont_ask" = "Don't ask me again";
|
||||
|
||||
"lng_polls_anonymous" = "Anonymous Poll";
|
||||
"lng_polls_public" = "Poll";
|
||||
"lng_polls_anonymous_quiz" = "Anonymous Quiz";
|
||||
"lng_polls_public_quiz" = "Quiz";
|
||||
"lng_polls_closed" = "Final results";
|
||||
"lng_polls_votes_count#one" = "{count} vote";
|
||||
"lng_polls_votes_count#other" = "{count} votes";
|
||||
"lng_polls_votes_none" = "No votes";
|
||||
"lng_polls_answers_count#one" = "{count} answer";
|
||||
"lng_polls_answers_count#other" = "{count} answers";
|
||||
"lng_polls_answers_none" = "No answers";
|
||||
"lng_polls_submit_votes" = "Vote";
|
||||
"lng_polls_view_results" = "View results";
|
||||
"lng_polls_retract" = "Retract vote";
|
||||
"lng_polls_stop" = "Stop poll";
|
||||
"lng_polls_stop_warning" = "If you stop this poll now, nobody will be able to vote in it anymore. This action cannot be undone.";
|
||||
@@ -2175,7 +2201,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_polls_create_limit#one" = "You can add {count} more option.";
|
||||
"lng_polls_create_limit#other" = "You can add {count} more options.";
|
||||
"lng_polls_create_maximum" = "You have added the maximum number of options.";
|
||||
"lng_polls_create_settings" = "Settings";
|
||||
"lng_polls_create_anonymous" = "Anonymous Votes";
|
||||
"lng_polls_create_multiple_choice" = "Multiple Answers";
|
||||
"lng_polls_create_quiz_mode" = "Quiz Mode";
|
||||
"lng_polls_create_button" = "Create";
|
||||
"lng_polls_create_one_answer" = "Quiz has only one right answer.";
|
||||
"lng_polls_choose_question" = "Please enter a question.";
|
||||
"lng_polls_choose_answers" = "Please enter at least two options.";
|
||||
"lng_polls_choose_correct" = "Please choose the correct answer.";
|
||||
|
||||
"lng_polls_poll_results_title" = "Poll results";
|
||||
"lng_polls_quiz_results_title" = "Quiz results";
|
||||
"lng_polls_show_more#one" = "Show more ({count})";
|
||||
"lng_polls_show_more#other" = "Show more ({count})";
|
||||
"lng_polls_votes_collapse" = "Collapse";
|
||||
|
||||
"lng_outdated_title" = "PLEASE UPDATE YOUR OPERATING SYSTEM.";
|
||||
"lng_outdated_soon" = "Otherwise, Telegram Desktop will stop updating on {date}.";
|
||||
@@ -2231,6 +2271,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_mac_menu_new_group" = "New Group";
|
||||
"lng_mac_menu_new_channel" = "New Channel";
|
||||
"lng_mac_menu_show" = "Show Telegram";
|
||||
"lng_mac_menu_emoji_and_symbols" = "Emoji & Symbols";
|
||||
|
||||
"lng_mac_touchbar_favorite_stickers" = "Favorite stickers";
|
||||
|
||||
|
||||
@@ -56,5 +56,6 @@
|
||||
</qresource>
|
||||
<qresource prefix="/misc">
|
||||
<file alias="default_shortcuts-custom.json">../../default_shortcuts-custom.json</file>
|
||||
<file alias="telegramdesktop.desktop">../../../../lib/xdg/telegramdesktop.desktop</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -71,7 +71,7 @@ inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int =
|
||||
inputMediaGame#d33f43f3 id:InputGame = InputMedia;
|
||||
inputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;
|
||||
inputMediaGeoLive#ce4e82fd flags:# stopped:flags.0?true geo_point:InputGeoPoint period:flags.1?int = InputMedia;
|
||||
inputMediaPoll#6b3765b poll:Poll = InputMedia;
|
||||
inputMediaPoll#abe9ca25 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> = InputMedia;
|
||||
|
||||
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
|
||||
inputChatUploadedPhoto#927c55b4 file:InputFile = InputChatPhoto;
|
||||
@@ -89,6 +89,7 @@ inputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes
|
||||
inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
|
||||
inputTakeoutFileLocation#29be5899 = InputFileLocation;
|
||||
inputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
|
||||
inputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;
|
||||
inputPeerPhotoFileLocation#27d69997 flags:# big:flags.0?true peer:InputPeer volume_id:long local_id:int = InputFileLocation;
|
||||
inputStickerSetThumb#dbaeae9 stickerset:InputStickerSet volume_id:long local_id:int = InputFileLocation;
|
||||
|
||||
@@ -213,6 +214,7 @@ peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bo
|
||||
peerSettings#818426cd flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true = PeerSettings;
|
||||
|
||||
wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
|
||||
wallPaperNoFile#8af40b25 flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
|
||||
|
||||
inputReportReasonSpam#58dbcab8 = ReportReason;
|
||||
inputReportReasonViolence#1e22c78d = ReportReason;
|
||||
@@ -347,6 +349,9 @@ updatePeerLocated#b4afcfb0 peers:Vector<PeerLocated> = Update;
|
||||
updateNewScheduledMessage#39a51dfb message:Message = Update;
|
||||
updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
|
||||
updateTheme#8216fba3 theme:Theme = Update;
|
||||
updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;
|
||||
updateLoginToken#564fe691 = Update;
|
||||
updateMessagePollVote#42f88f2c poll_id:long user_id:int options:Vector<bytes> = Update;
|
||||
|
||||
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
|
||||
|
||||
@@ -496,7 +501,7 @@ messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMess
|
||||
|
||||
webPageEmpty#eb1477e8 id:long = WebPage;
|
||||
webPagePending#c586da1c id:long date:int = WebPage;
|
||||
webPage#fa64e172 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document documents:flags.11?Vector<Document> cached_page:flags.10?Page = WebPage;
|
||||
webPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector<WebPageAttribute> = WebPage;
|
||||
webPageNotModified#85849473 = WebPage;
|
||||
|
||||
authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
|
||||
@@ -542,6 +547,7 @@ keyboardButtonGame#50f41ccf text:string = KeyboardButton;
|
||||
keyboardButtonBuy#afd93fbb text:string = KeyboardButton;
|
||||
keyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;
|
||||
inputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;
|
||||
keyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;
|
||||
|
||||
keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
|
||||
|
||||
@@ -1011,11 +1017,11 @@ help.userInfo#1eb3758 message:string entities:Vector<MessageEntity> author:strin
|
||||
|
||||
pollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;
|
||||
|
||||
poll#d5529d06 id:long flags:# closed:flags.0?true question:string answers:Vector<PollAnswer> = Poll;
|
||||
poll#d5529d06 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector<PollAnswer> = Poll;
|
||||
|
||||
pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true option:bytes voters:int = PollAnswerVoters;
|
||||
pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;
|
||||
|
||||
pollResults#5755785a flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int = PollResults;
|
||||
pollResults#c87024a2 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<int> = PollResults;
|
||||
|
||||
chatOnlines#f041e250 onlines:int = ChatOnlines;
|
||||
|
||||
@@ -1027,15 +1033,16 @@ chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags
|
||||
|
||||
inputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;
|
||||
inputWallPaperSlug#72091c80 slug:string = InputWallPaper;
|
||||
inputWallPaperNoFile#8427bbac = InputWallPaper;
|
||||
|
||||
account.wallPapersNotModified#1c199183 = account.WallPapers;
|
||||
account.wallPapers#702b65a9 hash:int wallpapers:Vector<WallPaper> = account.WallPapers;
|
||||
|
||||
codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;
|
||||
|
||||
wallPaperSettings#a12f40b8 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int intensity:flags.3?int = WallPaperSettings;
|
||||
wallPaperSettings#5086cf8 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;
|
||||
|
||||
autoDownloadSettings#d246fd47 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int = AutoDownloadSettings;
|
||||
autoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings;
|
||||
|
||||
account.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;
|
||||
|
||||
@@ -1072,15 +1079,36 @@ restrictionReason#d072acb4 platform:string reason:string text:string = Restricti
|
||||
inputTheme#3c5693e9 id:long access_hash:long = InputTheme;
|
||||
inputThemeSlug#f5890df1 slug:string = InputTheme;
|
||||
|
||||
themeDocumentNotModified#483d270c = Theme;
|
||||
theme#f7d90ce0 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:flags.2?Document installs_count:int = Theme;
|
||||
theme#28f1114 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:int = Theme;
|
||||
|
||||
account.themesNotModified#f41eb622 = account.Themes;
|
||||
account.themes#7f676421 hash:int themes:Vector<Theme> = account.Themes;
|
||||
|
||||
wallet.liteResponse#764386d7 response:bytes = wallet.LiteResponse;
|
||||
auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;
|
||||
auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;
|
||||
auth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;
|
||||
|
||||
wallet.secretSalt#dd484d64 salt:bytes = wallet.KeySecretSalt;
|
||||
account.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;
|
||||
|
||||
messages.inactiveChats#a927fec5 dates:Vector<int> chats:Vector<Chat> users:Vector<User> = messages.InactiveChats;
|
||||
|
||||
baseThemeClassic#c3a12462 = BaseTheme;
|
||||
baseThemeDay#fbd81688 = BaseTheme;
|
||||
baseThemeNight#b7b31ea8 = BaseTheme;
|
||||
baseThemeTinted#6d5f77ee = BaseTheme;
|
||||
baseThemeArctic#5b11125a = BaseTheme;
|
||||
|
||||
inputThemeSettings#bd507cd1 flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;
|
||||
|
||||
themeSettings#9c14984a flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?WallPaper = ThemeSettings;
|
||||
|
||||
webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute;
|
||||
|
||||
messageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote;
|
||||
messageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote;
|
||||
messageUserVoteMultiple#e8fe0de user_id:int options:Vector<bytes> date:int = MessageUserVote;
|
||||
|
||||
messages.votesList#823f649 flags:# count:int votes:Vector<MessageUserVote> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
|
||||
|
||||
---functions---
|
||||
|
||||
@@ -1107,6 +1135,9 @@ auth.recoverPassword#4ea56e92 code:string = auth.Authorization;
|
||||
auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;
|
||||
auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;
|
||||
auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;
|
||||
auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector<int> = auth.LoginToken;
|
||||
auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
|
||||
auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
|
||||
|
||||
account.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<int> = Bool;
|
||||
account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector<int> = Bool;
|
||||
@@ -1164,12 +1195,15 @@ account.resetWallPapers#bb3b9804 = Bool;
|
||||
account.getAutoDownloadSettings#56da0b3f = account.AutoDownloadSettings;
|
||||
account.saveAutoDownloadSettings#76f36233 flags:# low:flags.0?true high:flags.1?true settings:AutoDownloadSettings = Bool;
|
||||
account.uploadTheme#1c3db333 flags:# file:InputFile thumb:flags.0?InputFile file_name:string mime_type:string = Document;
|
||||
account.createTheme#2b7ffd7f slug:string title:string document:InputDocument = Theme;
|
||||
account.updateTheme#3b8ea202 flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument = Theme;
|
||||
account.createTheme#8432c21f flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
|
||||
account.updateTheme#5cb367d5 flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
|
||||
account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool;
|
||||
account.installTheme#7ae43737 flags:# dark:flags.0?true format:flags.1?string theme:flags.1?InputTheme = Bool;
|
||||
account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme;
|
||||
account.getThemes#285946f8 format:string hash:int = account.Themes;
|
||||
account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;
|
||||
account.getContentSettings#8b9b4dae = account.ContentSettings;
|
||||
account.getMultiWallPapers#65ad71dc wallpapers:Vector<InputWallPaper> = Vector<WallPaper>;
|
||||
|
||||
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
|
||||
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
|
||||
@@ -1312,6 +1346,7 @@ messages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Message
|
||||
messages.getScheduledMessages#bdbb0464 peer:InputPeer id:Vector<int> = messages.Messages;
|
||||
messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates;
|
||||
messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = Updates;
|
||||
messages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;
|
||||
|
||||
updates.getState#edd4882a = updates.State;
|
||||
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
|
||||
@@ -1323,7 +1358,7 @@ photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
|
||||
photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;
|
||||
|
||||
upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
|
||||
upload.getFile#b15a9afc flags:# precise:flags.0?true location:InputFileLocation offset:int limit:int = upload.File;
|
||||
upload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;
|
||||
upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
|
||||
upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
|
||||
upload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile;
|
||||
@@ -1385,6 +1420,7 @@ channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel =
|
||||
channels.editCreator#8f38cd1f channel:InputChannel user_id:InputUser password:InputCheckPasswordSRP = Updates;
|
||||
channels.editLocation#58e63f6d channel:InputChannel geo_point:InputGeoPoint address:string = Bool;
|
||||
channels.toggleSlowMode#edd49ef0 channel:InputChannel seconds:int = Updates;
|
||||
channels.getInactiveChannels#11e831ee = messages.InactiveChats;
|
||||
|
||||
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
|
||||
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
|
||||
@@ -1419,7 +1455,4 @@ langpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLangua
|
||||
folders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates;
|
||||
folders.deleteFolder#1c295881 folder_id:int = Updates;
|
||||
|
||||
wallet.sendLiteRequest#e2c9d33e body:bytes = wallet.LiteResponse;
|
||||
wallet.getKeySecretSalt#b57f346 revoke:Bool = wallet.KeySecretSalt;
|
||||
|
||||
// LAYER 106
|
||||
// LAYER 109
|
||||
|
||||
@@ -21,6 +21,8 @@ p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce
|
||||
p_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;
|
||||
p_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data;
|
||||
|
||||
bind_auth_key_inner#75a3f765 nonce:long temp_auth_key_id:long perm_auth_key_id:long temp_session_id:long expires_at:int = BindAuthKeyInner;
|
||||
|
||||
server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;
|
||||
server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
|
||||
ProcessorArchitecture="ARCHITECTURE"
|
||||
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
|
||||
Version="1.9.0.0" />
|
||||
Version="1.9.11.0" />
|
||||
<Properties>
|
||||
<DisplayName>Telegram Desktop</DisplayName>
|
||||
<PublisherDisplayName>Telegram FZ-LLC</PublisherDisplayName>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Windows 10 -->
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!-- Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
</application>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
@@ -33,8 +33,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,9,0,0
|
||||
PRODUCTVERSION 1,9,0,0
|
||||
FILEVERSION 1,9,11,0
|
||||
PRODUCTVERSION 1,9,11,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -51,10 +51,10 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram FZ-LLC"
|
||||
VALUE "FileDescription", "Telegram Desktop"
|
||||
VALUE "FileVersion", "1.9.0.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2019"
|
||||
VALUE "FileVersion", "1.9.11.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2020"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "1.9.0.0"
|
||||
VALUE "ProductVersion", "1.9.11.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -24,8 +24,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,9,0,0
|
||||
PRODUCTVERSION 1,9,0,0
|
||||
FILEVERSION 1,9,11,0
|
||||
PRODUCTVERSION 1,9,11,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -42,10 +42,10 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram FZ-LLC"
|
||||
VALUE "FileDescription", "Telegram Desktop Updater"
|
||||
VALUE "FileVersion", "1.9.0.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2019"
|
||||
VALUE "FileVersion", "1.9.11.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2020"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "1.9.0.0"
|
||||
VALUE "ProductVersion", "1.9.11.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -53,10 +53,10 @@ void RemoveQuarantineAttribute(NSString *path) {
|
||||
}
|
||||
|
||||
void RemoveQuarantineFromBundle(NSString *path) {
|
||||
RemoveQuarantineAttribute(path);
|
||||
RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/MacOS/Telegram"]);
|
||||
RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Helpers/crashpad_handler"]);
|
||||
RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Frameworks/Updater"]);
|
||||
RemoveQuarantineAttribute(path);
|
||||
RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/MacOS/Telegram"]);
|
||||
RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Helpers/crashpad_handler"]);
|
||||
RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Frameworks/Updater"]);
|
||||
}
|
||||
|
||||
void delFolder() {
|
||||
|
||||
@@ -21,6 +21,7 @@ struct SendOptions {
|
||||
enum class SendType {
|
||||
Normal,
|
||||
Scheduled,
|
||||
ScheduledToUser, // For "Send when online".
|
||||
};
|
||||
|
||||
struct SendAction {
|
||||
|
||||
51
Telegram/SourceFiles/api/api_self_destruct.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "api/api_self_destruct.h"
|
||||
|
||||
#include "apiwrap.h"
|
||||
|
||||
namespace Api {
|
||||
|
||||
SelfDestruct::SelfDestruct(not_null<ApiWrap*> api)
|
||||
: _api(api->instance()) {
|
||||
}
|
||||
|
||||
void SelfDestruct::reload() {
|
||||
if (_requestId) {
|
||||
return;
|
||||
}
|
||||
_requestId = _api.request(MTPaccount_GetAccountTTL(
|
||||
)).done([=](const MTPAccountDaysTTL &result) {
|
||||
_requestId = 0;
|
||||
result.match([&](const MTPDaccountDaysTTL &data) {
|
||||
_days = data.vdays().v;
|
||||
});
|
||||
}).fail([=](const RPCError &error) {
|
||||
_requestId = 0;
|
||||
}).send();
|
||||
}
|
||||
|
||||
rpl::producer<int> SelfDestruct::days() const {
|
||||
using namespace rpl::mappers;
|
||||
|
||||
return _days.value() | rpl::filter(_1 != 0);
|
||||
}
|
||||
|
||||
void SelfDestruct::update(int days) {
|
||||
_api.request(_requestId).cancel();
|
||||
_requestId = _api.request(MTPaccount_SetAccountTTL(
|
||||
MTP_accountDaysTTL(MTP_int(days))
|
||||
)).done([=](const MTPBool &result) {
|
||||
_requestId = 0;
|
||||
}).fail([=](const RPCError &result) {
|
||||
_requestId = 0;
|
||||
}).send();
|
||||
_days = days;
|
||||
}
|
||||
|
||||
} // namespace Api
|
||||
32
Telegram/SourceFiles/api/api_self_destruct.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "mtproto/sender.h"
|
||||
|
||||
class ApiWrap;
|
||||
|
||||
namespace Api {
|
||||
|
||||
class SelfDestruct final {
|
||||
public:
|
||||
explicit SelfDestruct(not_null<ApiWrap*> api);
|
||||
|
||||
void reload();
|
||||
void update(int days);
|
||||
|
||||
rpl::producer<int> days() const;
|
||||
|
||||
private:
|
||||
MTP::Sender _api;
|
||||
mtpRequestId _requestId = 0;
|
||||
rpl::variable<int> _days = 0;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Api
|
||||
74
Telegram/SourceFiles/api/api_sensitive_content.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "api/api_sensitive_content.h"
|
||||
|
||||
#include "apiwrap.h"
|
||||
#include "main/main_session.h"
|
||||
#include "main/main_account.h"
|
||||
#include "main/main_app_config.h"
|
||||
|
||||
namespace Api {
|
||||
namespace {
|
||||
|
||||
constexpr auto kRefreshAppConfigTimeout = 3 * crl::time(1000);
|
||||
|
||||
} // namespace
|
||||
|
||||
SensitiveContent::SensitiveContent(not_null<ApiWrap*> api)
|
||||
: _session(&api->session())
|
||||
, _api(api->instance())
|
||||
, _appConfigReloadTimer([=] { _session->account().appConfig().refresh(); }) {
|
||||
}
|
||||
|
||||
void SensitiveContent::reload() {
|
||||
if (_requestId) {
|
||||
return;
|
||||
}
|
||||
_requestId = _api.request(MTPaccount_GetContentSettings(
|
||||
)).done([=](const MTPaccount_ContentSettings &result) {
|
||||
_requestId = 0;
|
||||
result.match([&](const MTPDaccount_contentSettings &data) {
|
||||
_enabled = data.is_sensitive_enabled();
|
||||
_canChange = data.is_sensitive_can_change();
|
||||
});
|
||||
}).fail([=](const RPCError &error) {
|
||||
_requestId = 0;
|
||||
}).send();
|
||||
}
|
||||
|
||||
bool SensitiveContent::enabledCurrent() const {
|
||||
return _enabled.current();
|
||||
}
|
||||
|
||||
rpl::producer<bool> SensitiveContent::enabled() const {
|
||||
return _enabled.value();
|
||||
}
|
||||
|
||||
rpl::producer<bool> SensitiveContent::canChange() const {
|
||||
return _canChange.value();
|
||||
}
|
||||
|
||||
void SensitiveContent::update(bool enabled) {
|
||||
if (!_canChange.current()) {
|
||||
return;
|
||||
}
|
||||
using Flag = MTPaccount_SetContentSettings::Flag;
|
||||
_api.request(_requestId).cancel();
|
||||
_requestId = _api.request(MTPaccount_SetContentSettings(
|
||||
MTP_flags(enabled ? Flag::f_sensitive_enabled : Flag(0))
|
||||
)).done([=](const MTPBool &result) {
|
||||
_requestId = 0;
|
||||
}).fail([=](const RPCError &error) {
|
||||
_requestId = 0;
|
||||
}).send();
|
||||
_enabled = enabled;
|
||||
|
||||
_appConfigReloadTimer.callOnce(kRefreshAppConfigTimeout);
|
||||
}
|
||||
|
||||
} // namespace Api
|
||||
42
Telegram/SourceFiles/api/api_sensitive_content.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "mtproto/sender.h"
|
||||
#include "base/timer.h"
|
||||
|
||||
class ApiWrap;
|
||||
|
||||
namespace Main {
|
||||
class Session;
|
||||
} // namespace Main
|
||||
|
||||
namespace Api {
|
||||
|
||||
class SensitiveContent final {
|
||||
public:
|
||||
explicit SensitiveContent(not_null<ApiWrap*> api);
|
||||
|
||||
void reload();
|
||||
void update(bool enabled);
|
||||
|
||||
[[nodiscard]] bool enabledCurrent() const;
|
||||
[[nodiscard]] rpl::producer<bool> enabled() const;
|
||||
[[nodiscard]] rpl::producer<bool> canChange() const;
|
||||
|
||||
private:
|
||||
const not_null<Main::Session*> _session;
|
||||
MTP::Sender _api;
|
||||
mtpRequestId _requestId = 0;
|
||||
rpl::variable<bool> _enabled = false;
|
||||
rpl::variable<bool> _canChange = false;
|
||||
base::Timer _appConfigReloadTimer;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Api
|
||||
@@ -8,6 +8,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "apiwrap.h"
|
||||
|
||||
#include "api/api_text_entities.h"
|
||||
#include "api/api_self_destruct.h"
|
||||
#include "api/api_sensitive_content.h"
|
||||
#include "data/data_drafts.h"
|
||||
#include "data/data_photo.h"
|
||||
#include "data/data_web_page.h"
|
||||
@@ -40,6 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
//#include "history/feed/history_feed_section.h" // #feed
|
||||
#include "storage/localstorage.h"
|
||||
#include "main/main_session.h"
|
||||
#include "main/main_account.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "boxes/stickers_box.h"
|
||||
#include "boxes/sticker_set_box.h"
|
||||
@@ -54,7 +57,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/emoji_config.h"
|
||||
#include "support/support_helper.h"
|
||||
#include "storage/localimageloader.h"
|
||||
#include "storage/file_download.h"
|
||||
#include "storage/download_manager_mtproto.h"
|
||||
#include "storage/file_upload.h"
|
||||
#include "storage/storage_facade.h"
|
||||
#include "storage/storage_shared_media.h"
|
||||
@@ -222,7 +225,8 @@ bool ApiWrap::BlockedUsersSlice::operator!=(const BlockedUsersSlice &other) cons
|
||||
}
|
||||
|
||||
ApiWrap::ApiWrap(not_null<Main::Session*> session)
|
||||
: _session(session)
|
||||
: MTP::Sender(session->account().mtp())
|
||||
, _session(session)
|
||||
, _messageDataResolveDelayed([=] { resolveMessageDatas(); })
|
||||
, _webPagesTimer([=] { resolveWebPages(); })
|
||||
, _draftsSaveTimer([=] { saveDraftsToCloud(); })
|
||||
@@ -231,7 +235,9 @@ ApiWrap::ApiWrap(not_null<Main::Session*> session)
|
||||
, _fileLoader(std::make_unique<TaskQueue>(kFileLoaderQueueStopTimeout))
|
||||
//, _feedReadTimer([=] { readFeeds(); }) // #feed
|
||||
, _proxyPromotionTimer([=] { refreshProxyPromotion(); })
|
||||
, _updateNotifySettingsTimer([=] { sendNotifySettingsUpdates(); }) {
|
||||
, _updateNotifySettingsTimer([=] { sendNotifySettingsUpdates(); })
|
||||
, _selfDestruct(std::make_unique<Api::SelfDestruct>(this))
|
||||
, _sensitiveContent(std::make_unique<Api::SensitiveContent>(this)) {
|
||||
crl::on_main([=] {
|
||||
// You can't use _session->lifetime() in the constructor,
|
||||
// only queued, because it is not constructed yet.
|
||||
@@ -244,6 +250,8 @@ ApiWrap::ApiWrap(not_null<Main::Session*> session)
|
||||
});
|
||||
}
|
||||
|
||||
ApiWrap::~ApiWrap() = default;
|
||||
|
||||
Main::Session &ApiWrap::session() const {
|
||||
return *_session;
|
||||
}
|
||||
@@ -280,11 +288,11 @@ void ApiWrap::refreshProxyPromotion() {
|
||||
return;
|
||||
}
|
||||
const auto key = [&]() -> std::pair<QString, uint32> {
|
||||
if (Global::ProxySettings() != ProxyData::Settings::Enabled) {
|
||||
if (Global::ProxySettings() != MTP::ProxyData::Settings::Enabled) {
|
||||
return {};
|
||||
}
|
||||
const auto &proxy = Global::SelectedProxy();
|
||||
if (proxy.type != ProxyData::Type::Mtproto) {
|
||||
if (proxy.type != MTP::ProxyData::Type::Mtproto) {
|
||||
return {};
|
||||
}
|
||||
return { proxy.host, proxy.port };
|
||||
@@ -571,6 +579,13 @@ void ApiWrap::sendMessageFail(
|
||||
requestFullPeer(peer);
|
||||
}
|
||||
}
|
||||
} else if (error.type() == qstr("SCHEDULE_STATUS_PRIVATE")) {
|
||||
auto &scheduled = _session->data().scheduledMessages();
|
||||
Assert(peer->isUser());
|
||||
if (const auto item = scheduled.lookupItem(peer->id, itemId.msg)) {
|
||||
scheduled.removeSending(item);
|
||||
Ui::show(Box<InformBox>(tr::lng_cant_do_this(tr::now)));
|
||||
}
|
||||
}
|
||||
if (const auto item = _session->data().message(itemId)) {
|
||||
Assert(randomId != 0);
|
||||
@@ -2971,12 +2986,12 @@ void ApiWrap::requestFileReference(
|
||||
|
||||
void ApiWrap::refreshFileReference(
|
||||
Data::FileOrigin origin,
|
||||
not_null<mtpFileLoader*> loader,
|
||||
not_null<Storage::DownloadMtprotoTask*> task,
|
||||
int requestId,
|
||||
const QByteArray ¤t) {
|
||||
return refreshFileReference(origin, crl::guard(loader, [=](
|
||||
return refreshFileReference(origin, crl::guard(task, [=](
|
||||
const UpdatedFileReferences &data) {
|
||||
loader->refreshFileReferenceFrom(data, requestId, current);
|
||||
task->refreshFileReferenceFrom(data, requestId, current);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -3644,10 +3659,22 @@ void ApiWrap::applyUpdateNoPtsCheck(const MTPUpdate &update) {
|
||||
auto &d = update.c_updateNewMessage();
|
||||
auto needToAdd = true;
|
||||
if (d.vmessage().type() == mtpc_message) { // index forwarded messages to links _overview
|
||||
if (_session->data().checkEntitiesAndViewsUpdate(d.vmessage().c_message())) { // already in blocks
|
||||
const auto &data = d.vmessage().c_message();
|
||||
if (_session->data().checkEntitiesAndViewsUpdate(data)) { // already in blocks
|
||||
LOG(("Skipping message, because it is already in blocks!"));
|
||||
needToAdd = false;
|
||||
}
|
||||
if (needToAdd && !data.is_from_scheduled()) {
|
||||
// If we still need to add a new message,
|
||||
// we should first check if this message is in
|
||||
// the list of scheduled messages.
|
||||
// This is necessary to correctly update the file reference.
|
||||
// Note that when a message is scheduled until online
|
||||
// while the recipient is already online, the server sends
|
||||
// an ordinary new message with skipped "from_scheduled" flag.
|
||||
_session->data().scheduledMessages().checkEntitiesAndUpdate(
|
||||
data);
|
||||
}
|
||||
}
|
||||
if (needToAdd) {
|
||||
_session->data().addNewMessage(
|
||||
@@ -5798,42 +5825,12 @@ auto ApiWrap::blockedUsersSlice() -> rpl::producer<BlockedUsersSlice> {
|
||||
: (_blockedUsersChanges.events() | rpl::type_erased());
|
||||
}
|
||||
|
||||
void ApiWrap::reloadSelfDestruct() {
|
||||
if (_selfDestructRequestId) {
|
||||
return;
|
||||
}
|
||||
_selfDestructRequestId = request(MTPaccount_GetAccountTTL(
|
||||
)).done([=](const MTPAccountDaysTTL &result) {
|
||||
_selfDestructRequestId = 0;
|
||||
result.match([&](const MTPDaccountDaysTTL &data) {
|
||||
setSelfDestructDays(data.vdays().v);
|
||||
});
|
||||
}).fail([=](const RPCError &error) {
|
||||
_selfDestructRequestId = 0;
|
||||
}).send();
|
||||
Api::SelfDestruct &ApiWrap::selfDestruct() {
|
||||
return *_selfDestruct;
|
||||
}
|
||||
|
||||
rpl::producer<int> ApiWrap::selfDestructValue() const {
|
||||
return _selfDestructDays
|
||||
? _selfDestructChanges.events_starting_with_copy(*_selfDestructDays)
|
||||
: (_selfDestructChanges.events() | rpl::type_erased());
|
||||
}
|
||||
|
||||
void ApiWrap::saveSelfDestruct(int days) {
|
||||
request(_selfDestructRequestId).cancel();
|
||||
_selfDestructRequestId = request(MTPaccount_SetAccountTTL(
|
||||
MTP_accountDaysTTL(MTP_int(days))
|
||||
)).done([=](const MTPBool &result) {
|
||||
_selfDestructRequestId = 0;
|
||||
}).fail([=](const RPCError &result) {
|
||||
_selfDestructRequestId = 0;
|
||||
}).send();
|
||||
setSelfDestructDays(days);
|
||||
}
|
||||
|
||||
void ApiWrap::setSelfDestructDays(int days) {
|
||||
_selfDestructDays = days;
|
||||
_selfDestructChanges.fire_copy(days);
|
||||
Api::SensitiveContent &ApiWrap::sensitiveContent() {
|
||||
return *_sensitiveContent;
|
||||
}
|
||||
|
||||
void ApiWrap::createPoll(
|
||||
@@ -5864,12 +5861,24 @@ void ApiWrap::createPoll(
|
||||
sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_date;
|
||||
}
|
||||
|
||||
const auto inputFlags = data.quiz()
|
||||
? MTPDinputMediaPoll::Flag::f_correct_answers
|
||||
: MTPDinputMediaPoll::Flag(0);
|
||||
auto correct = QVector<MTPbytes>();
|
||||
for (const auto &answer : data.answers) {
|
||||
if (answer.correct) {
|
||||
correct.push_back(MTP_bytes(answer.option));
|
||||
}
|
||||
}
|
||||
const auto replyTo = action.replyTo;
|
||||
history->sendRequestId = request(MTPmessages_SendMedia(
|
||||
MTP_flags(sendFlags),
|
||||
peer->input,
|
||||
MTP_int(replyTo),
|
||||
MTP_inputMediaPoll(PollDataToMTP(&data)),
|
||||
MTP_inputMediaPoll(
|
||||
MTP_flags(inputFlags),
|
||||
PollDataToMTP(&data),
|
||||
MTP_vector<MTPbytes>(correct)),
|
||||
MTP_string(),
|
||||
MTP_long(rand_value<uint64>()),
|
||||
MTPReplyMarkup(),
|
||||
@@ -5901,13 +5910,13 @@ void ApiWrap::sendPollVotes(
|
||||
const auto hideSending = [=] {
|
||||
if (showSending) {
|
||||
if (const auto item = _session->data().message(itemId)) {
|
||||
poll->sendingVote = QByteArray();
|
||||
poll->sendingVotes.clear();
|
||||
_session->data().requestItemRepaint(item);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (showSending) {
|
||||
poll->sendingVote = options.front();
|
||||
poll->sendingVotes = options;
|
||||
_session->data().requestItemRepaint(item);
|
||||
}
|
||||
|
||||
@@ -5943,12 +5952,24 @@ void ApiWrap::closePoll(not_null<HistoryItem*> item) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto inputFlags = poll->quiz()
|
||||
? MTPDinputMediaPoll::Flag::f_correct_answers
|
||||
: MTPDinputMediaPoll::Flag(0);
|
||||
auto correct = QVector<MTPbytes>();
|
||||
for (const auto &answer : poll->answers) {
|
||||
if (answer.correct) {
|
||||
correct.push_back(MTP_bytes(answer.option));
|
||||
}
|
||||
}
|
||||
const auto requestId = request(MTPmessages_EditMessage(
|
||||
MTP_flags(MTPmessages_EditMessage::Flag::f_media),
|
||||
item->history()->peer->input,
|
||||
MTP_int(item->id),
|
||||
MTPstring(),
|
||||
MTP_inputMediaPoll(PollDataToMTP(poll)),
|
||||
MTP_inputMediaPoll(
|
||||
MTP_flags(inputFlags),
|
||||
PollDataToMTP(poll, true),
|
||||
MTP_vector<MTPbytes>(correct)),
|
||||
MTPReplyMarkup(),
|
||||
MTPVector<MTPMessageEntity>(),
|
||||
MTP_int(0) // schedule_date
|
||||
@@ -6105,5 +6126,3 @@ void ApiWrap::sendReadRequest(not_null<PeerData*> peer, MsgId upTo) {
|
||||
}();
|
||||
_readRequests.emplace(peer, requestId, upTo);
|
||||
}
|
||||
|
||||
ApiWrap::~ApiWrap() = default;
|
||||
|
||||
@@ -20,7 +20,6 @@ struct MessageGroupId;
|
||||
struct SendingAlbum;
|
||||
enum class SendMediaType;
|
||||
struct FileLoadTo;
|
||||
class mtpFileLoader;
|
||||
|
||||
namespace Main {
|
||||
class Session;
|
||||
@@ -38,6 +37,7 @@ class Result;
|
||||
namespace Storage {
|
||||
enum class SharedMediaType : signed char;
|
||||
struct PreparedList;
|
||||
class DownloadMtprotoTask;
|
||||
} // namespace Storage
|
||||
|
||||
namespace Dialogs {
|
||||
@@ -83,6 +83,9 @@ QString RequestKey(Types &&...values) {
|
||||
return result;
|
||||
}
|
||||
|
||||
class SelfDestruct;
|
||||
class SensitiveContent;
|
||||
|
||||
} // namespace Api
|
||||
|
||||
class ApiWrap : public MTP::Sender, private base::Subscriber {
|
||||
@@ -131,6 +134,7 @@ public:
|
||||
};
|
||||
|
||||
explicit ApiWrap(not_null<Main::Session*> session);
|
||||
~ApiWrap();
|
||||
|
||||
Main::Session &session() const;
|
||||
|
||||
@@ -201,7 +205,7 @@ public:
|
||||
FileReferencesHandler &&handler);
|
||||
void refreshFileReference(
|
||||
Data::FileOrigin origin,
|
||||
not_null<mtpFileLoader*> loader,
|
||||
not_null<Storage::DownloadMtprotoTask*> task,
|
||||
int requestId,
|
||||
const QByteArray ¤t);
|
||||
|
||||
@@ -465,9 +469,8 @@ public:
|
||||
void reloadBlockedUsers();
|
||||
rpl::producer<BlockedUsersSlice> blockedUsersSlice();
|
||||
|
||||
void reloadSelfDestruct();
|
||||
rpl::producer<int> selfDestructValue() const;
|
||||
void saveSelfDestruct(int days);
|
||||
[[nodiscard]] Api::SelfDestruct &selfDestruct();
|
||||
[[nodiscard]] Api::SensitiveContent &sensitiveContent();
|
||||
|
||||
void createPoll(
|
||||
const PollData &data,
|
||||
@@ -480,8 +483,6 @@ public:
|
||||
void closePoll(not_null<HistoryItem*> item);
|
||||
void reloadPollResults(not_null<HistoryItem*> item);
|
||||
|
||||
~ApiWrap();
|
||||
|
||||
private:
|
||||
struct MessageDataRequest {
|
||||
using Callbacks = QList<RequestMessageDataCallback>;
|
||||
@@ -679,8 +680,6 @@ private:
|
||||
const QVector<MTPPrivacyRule> &rules);
|
||||
void updatePrivacyLastSeens(const QVector<MTPPrivacyRule> &rules);
|
||||
|
||||
void setSelfDestructDays(int days);
|
||||
|
||||
void migrateDone(
|
||||
not_null<PeerData*> peer,
|
||||
not_null<ChannelData*> channel);
|
||||
@@ -874,9 +873,8 @@ private:
|
||||
std::optional<BlockedUsersSlice> _blockedUsersSlice;
|
||||
rpl::event_stream<BlockedUsersSlice> _blockedUsersChanges;
|
||||
|
||||
mtpRequestId _selfDestructRequestId = 0;
|
||||
std::optional<int> _selfDestructDays;
|
||||
rpl::event_stream<int> _selfDestructChanges;
|
||||
const std::unique_ptr<Api::SelfDestruct> _selfDestruct;
|
||||
const std::unique_ptr<Api::SensitiveContent> _sensitiveContent;
|
||||
|
||||
base::flat_map<FullMsgId, mtpRequestId> _pollVotesRequestIds;
|
||||
base::flat_map<FullMsgId, mtpRequestId> _pollCloseRequestIds;
|
||||
|
||||
@@ -41,8 +41,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "numbers.h"
|
||||
#include "observer_peer.h"
|
||||
#include "main/main_session.h"
|
||||
#include "styles/style_boxes.h"
|
||||
#include "styles/style_overview.h"
|
||||
#include "styles/style_mediaview.h"
|
||||
#include "styles/style_media_view.h"
|
||||
#include "styles/style_chat_helpers.h"
|
||||
#include "styles/style_history.h"
|
||||
#include "styles/style_layers.h"
|
||||
@@ -180,6 +181,8 @@ namespace App {
|
||||
prepareCorners(MessageInSelectedCorners, st::historyMessageRadius, st::msgInBgSelected, &st::msgInShadowSelected);
|
||||
prepareCorners(MessageOutCorners, st::historyMessageRadius, st::msgOutBg, &st::msgOutShadow);
|
||||
prepareCorners(MessageOutSelectedCorners, st::historyMessageRadius, st::msgOutBgSelected, &st::msgOutShadowSelected);
|
||||
|
||||
prepareCorners(SendFilesBoxAlbumGroupCorners, st::sendBoxAlbumGroupRadius, st::callFingerprintBg);
|
||||
}
|
||||
|
||||
void createCorners() {
|
||||
@@ -316,12 +319,12 @@ namespace App {
|
||||
}
|
||||
|
||||
QImage readImage(QByteArray data, QByteArray *format, bool opaque, bool *animated) {
|
||||
QByteArray tmpFormat;
|
||||
QByteArray tmpFormat;
|
||||
QImage result;
|
||||
QBuffer buffer(&data);
|
||||
if (!format) {
|
||||
format = &tmpFormat;
|
||||
}
|
||||
if (!format) {
|
||||
format = &tmpFormat;
|
||||
}
|
||||
{
|
||||
QImageReader reader(&buffer, *format);
|
||||
#ifndef OS_MAC_OLD
|
||||
|
||||
@@ -63,6 +63,8 @@ enum RoundCorners : int {
|
||||
MessageOutCorners,
|
||||
MessageOutSelectedCorners,
|
||||
|
||||
SendFilesBoxAlbumGroupCorners,
|
||||
|
||||
RoundCornersCount
|
||||
};
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ void ShowAddParticipantsError(
|
||||
Ui::show(Box<InformBox>(text), Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
class RevokePublicLinkBox::Inner : public TWidget, private MTP::Sender {
|
||||
class RevokePublicLinkBox::Inner : public TWidget {
|
||||
public:
|
||||
Inner(
|
||||
QWidget *parent,
|
||||
@@ -228,6 +228,7 @@ private:
|
||||
void updateSelected();
|
||||
|
||||
const not_null<Main::Session*> _session;
|
||||
MTP::Sender _api;
|
||||
|
||||
PeerData *_selected = nullptr;
|
||||
PeerData *_pressed = nullptr;
|
||||
@@ -450,6 +451,7 @@ GroupInfoBox::GroupInfoBox(
|
||||
const QString &title,
|
||||
Fn<void(not_null<ChannelData*>)> channelDone)
|
||||
: _navigation(navigation)
|
||||
, _api(_navigation->session().api().instance())
|
||||
, _type(type)
|
||||
, _initialTitle(title)
|
||||
, _channelDone(std::move(channelDone)) {
|
||||
@@ -569,7 +571,7 @@ void GroupInfoBox::createGroup(
|
||||
if (inputs.empty()) {
|
||||
return;
|
||||
}
|
||||
_creationRequestId = request(MTPmessages_CreateChat(
|
||||
_creationRequestId = _api.request(MTPmessages_CreateChat(
|
||||
MTP_vector<MTPInputUser>(inputs),
|
||||
MTP_string(title)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
@@ -645,7 +647,7 @@ void GroupInfoBox::createChannel(const QString &title, const QString &descriptio
|
||||
const auto flags = (_type == Type::Megagroup)
|
||||
? MTPchannels_CreateChannel::Flag::f_megagroup
|
||||
: MTPchannels_CreateChannel::Flag::f_broadcast;
|
||||
_creationRequestId = request(MTPchannels_CreateChannel(
|
||||
_creationRequestId = _api.request(MTPchannels_CreateChannel(
|
||||
MTP_flags(flags),
|
||||
MTP_string(title),
|
||||
MTP_string(description),
|
||||
@@ -682,7 +684,7 @@ void GroupInfoBox::createChannel(const QString &title, const QString &descriptio
|
||||
std::move(image));
|
||||
}
|
||||
_createdChannel = channel;
|
||||
_creationRequestId = request(MTPmessages_ExportChatInvite(
|
||||
_creationRequestId = _api.request(MTPmessages_ExportChatInvite(
|
||||
_createdChannel->input
|
||||
)).done([=](const MTPExportedChatInvite &result) {
|
||||
_creationRequestId = 0;
|
||||
@@ -1287,6 +1289,7 @@ RevokePublicLinkBox::Inner::Inner(
|
||||
Fn<void()> revokeCallback)
|
||||
: TWidget(parent)
|
||||
, _session(session)
|
||||
, _api(_session->api().instance())
|
||||
, _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom())
|
||||
, _revokeWidth(st::normalFont->width(tr::lng_channels_too_much_public_revoke(tr::now)))
|
||||
, _revokeCallback(std::move(revokeCallback)) {
|
||||
@@ -1294,7 +1297,7 @@ RevokePublicLinkBox::Inner::Inner(
|
||||
|
||||
resize(width(), 5 * _rowHeight);
|
||||
|
||||
request(MTPchannels_GetAdminedPublicChannels(
|
||||
_api.request(MTPchannels_GetAdminedPublicChannels(
|
||||
MTP_flags(0)
|
||||
)).done([=](const MTPmessages_Chats &result) {
|
||||
const auto &chats = result.match([](const auto &data) {
|
||||
@@ -1401,7 +1404,7 @@ void RevokePublicLinkBox::Inner::mouseReleaseEvent(QMouseEvent *e) {
|
||||
auto confirmText = tr::lng_channels_too_much_public_revoke(tr::now);
|
||||
_weakRevokeConfirmBox = Ui::show(Box<ConfirmBox>(text, confirmText, crl::guard(this, [this, pressed]() {
|
||||
if (_revokeRequestId) return;
|
||||
_revokeRequestId = request(MTPchannels_UpdateUsername(
|
||||
_revokeRequestId = _api.request(MTPchannels_UpdateUsername(
|
||||
pressed->asChannel()->inputChannel,
|
||||
MTP_string()
|
||||
)).done([=](const MTPBool &result) {
|
||||
|
||||
@@ -94,7 +94,7 @@ private:
|
||||
|
||||
};
|
||||
|
||||
class GroupInfoBox : public Ui::BoxContent, private MTP::Sender {
|
||||
class GroupInfoBox : public Ui::BoxContent {
|
||||
public:
|
||||
enum class Type {
|
||||
Group,
|
||||
@@ -124,6 +124,7 @@ private:
|
||||
void updateMaxHeight();
|
||||
|
||||
const not_null<Window::SessionNavigation*> _navigation;
|
||||
MTP::Sender _api;
|
||||
|
||||
Type _type = Type::Group;
|
||||
QString _initialTitle;
|
||||
|
||||
@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "lang/lang_keys.h"
|
||||
#include "main/main_session.h"
|
||||
#include "data/data_session.h"
|
||||
#include "data/data_auto_download.h"
|
||||
#include "ui/widgets/continuous_sliders.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
@@ -24,8 +25,53 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
namespace {
|
||||
|
||||
constexpr auto kMegabyte = 1024 * 1024;
|
||||
constexpr auto kDefaultLimit = 10 * kMegabyte;
|
||||
constexpr auto kDefaultDownloadLimit = 10 * kMegabyte;
|
||||
constexpr auto kDefaultAutoPlayLimit = 50 * kMegabyte;
|
||||
|
||||
using Type = Data::AutoDownload::Type;
|
||||
|
||||
not_null<int*> AddSizeLimitSlider(
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
const base::flat_map<Type, int> &values,
|
||||
int defaultValue) {
|
||||
using namespace Settings;
|
||||
using Pair = base::flat_map<Type, int>::value_type;
|
||||
|
||||
const auto limits = Ui::CreateChild<rpl::event_stream<int>>(
|
||||
container.get());
|
||||
const auto currentLimit = ranges::max_element(
|
||||
values,
|
||||
std::less<>(),
|
||||
[](Pair pair) { return pair.second; })->second;
|
||||
const auto initialLimit = currentLimit ? currentLimit : defaultValue;
|
||||
const auto result = Ui::CreateChild<int>(container.get(), initialLimit);
|
||||
AddButtonWithLabel(
|
||||
container,
|
||||
tr::lng_media_size_limit(),
|
||||
limits->events_starting_with_copy(
|
||||
initialLimit
|
||||
) | rpl::map([](int value) {
|
||||
return tr::lng_media_size_up_to(
|
||||
tr::now,
|
||||
lt_size,
|
||||
QString::number(value / kMegabyte) + " MB");
|
||||
}),
|
||||
st::autoDownloadLimitButton
|
||||
)->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
const auto slider = container->add(
|
||||
object_ptr<Ui::MediaSlider>(container, st::autoDownloadLimitSlider),
|
||||
st::autoDownloadLimitPadding);
|
||||
slider->resize(st::autoDownloadLimitSlider.seekSize);
|
||||
slider->setPseudoDiscrete(
|
||||
Export::View::kSizeValueCount,
|
||||
Export::View::SizeLimitByIndex,
|
||||
*result,
|
||||
[=](int value) {
|
||||
*result = value;
|
||||
limits->fire_copy(value);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
AutoDownloadBox::AutoDownloadBox(
|
||||
@@ -41,12 +87,13 @@ void AutoDownloadBox::prepare() {
|
||||
}
|
||||
|
||||
void AutoDownloadBox::setupContent() {
|
||||
using namespace rpl::mappers;
|
||||
using namespace Settings;
|
||||
using namespace Data::AutoDownload;
|
||||
using namespace rpl::mappers;
|
||||
using Type = Data::AutoDownload::Type;
|
||||
using Pair = base::flat_map<Type, int>::value_type;
|
||||
|
||||
setTitle(tr::lng_media_auto_title());
|
||||
setTitle(tr::lng_profile_settings_section());
|
||||
|
||||
const auto settings = &_session->settings().autoDownload();
|
||||
const auto checked = [=](Source source, Type type) {
|
||||
@@ -59,17 +106,10 @@ void AutoDownloadBox::setupContent() {
|
||||
this,
|
||||
std::move(wrap)));
|
||||
|
||||
static const auto kHidden = {
|
||||
Type::Video,
|
||||
Type::Music,
|
||||
Type::VoiceMessage
|
||||
};
|
||||
|
||||
const auto values = Ui::CreateChild<base::flat_map<Type, int>>(content);
|
||||
const auto add = [&](Type type, rpl::producer<QString> label) {
|
||||
if (ranges::find(kHidden, type) != end(kHidden)) {
|
||||
return;
|
||||
}
|
||||
const auto add = [&](
|
||||
not_null<base::flat_map<Type, int>*> values,
|
||||
Type type,
|
||||
rpl::producer<QString> label) {
|
||||
const auto value = settings->bytesLimit(_source, type);
|
||||
AddButton(
|
||||
content,
|
||||
@@ -83,77 +123,78 @@ void AutoDownloadBox::setupContent() {
|
||||
}, content->lifetime());
|
||||
values->emplace(type, value);
|
||||
};
|
||||
add(Type::Photo, tr::lng_media_photo_title());
|
||||
add(Type::VoiceMessage, tr::lng_media_audio_title());
|
||||
add(Type::VideoMessage, tr::lng_media_video_messages_title());
|
||||
add(Type::Video, tr::lng_media_video_title());
|
||||
add(Type::File, tr::lng_media_file_title());
|
||||
add(Type::Music, tr::lng_media_music_title());
|
||||
add(Type::GIF, tr::lng_media_animation_title());
|
||||
|
||||
const auto limits = Ui::CreateChild<rpl::event_stream<int>>(content);
|
||||
using Pair = base::flat_map<Type, int>::value_type;
|
||||
const auto settingsLimit = ranges::max_element(
|
||||
*values,
|
||||
std::less<>(),
|
||||
[](Pair pair) { return pair.second; })->second;
|
||||
const auto initialLimit = settingsLimit ? settingsLimit : kDefaultLimit;
|
||||
const auto limit = Ui::CreateChild<int>(content, initialLimit);
|
||||
AddButtonWithLabel(
|
||||
AddSubsectionTitle(content, tr::lng_media_auto_title());
|
||||
|
||||
const auto downloadValues = Ui::CreateChild<base::flat_map<Type, int>>(
|
||||
content);
|
||||
add(downloadValues, Type::Photo, tr::lng_media_photo_title());
|
||||
add(downloadValues, Type::File, tr::lng_media_file_title());
|
||||
|
||||
const auto downloadLimit = AddSizeLimitSlider(
|
||||
content,
|
||||
tr::lng_media_size_limit(),
|
||||
limits->events_starting_with_copy(
|
||||
initialLimit
|
||||
) | rpl::map([](int value) {
|
||||
return tr::lng_media_size_up_to(
|
||||
tr::now,
|
||||
lt_size,
|
||||
QString::number(value / kMegabyte) + " MB");
|
||||
}),
|
||||
st::autoDownloadLimitButton
|
||||
)->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
const auto slider = content->add(
|
||||
object_ptr<Ui::MediaSlider>(content, st::autoDownloadLimitSlider),
|
||||
st::autoDownloadLimitPadding);
|
||||
slider->resize(st::autoDownloadLimitSlider.seekSize);
|
||||
slider->setPseudoDiscrete(
|
||||
Export::View::kSizeValueCount,
|
||||
Export::View::SizeLimitByIndex,
|
||||
*limit,
|
||||
[=](int value) {
|
||||
*limit = value;
|
||||
limits->fire_copy(value);
|
||||
});
|
||||
*downloadValues,
|
||||
kDefaultDownloadLimit);
|
||||
|
||||
AddSkip(content);
|
||||
AddSubsectionTitle(content, tr::lng_media_auto_play());
|
||||
|
||||
const auto autoPlayValues = Ui::CreateChild<base::flat_map<Type, int>>(
|
||||
content);
|
||||
add(
|
||||
autoPlayValues,
|
||||
Type::AutoPlayVideoMessage,
|
||||
tr::lng_media_video_messages_title());
|
||||
add(autoPlayValues, Type::AutoPlayVideo, tr::lng_media_video_title());
|
||||
add(autoPlayValues, Type::AutoPlayGIF, tr::lng_media_animation_title());
|
||||
|
||||
const auto autoPlayLimit = AddSizeLimitSlider(
|
||||
content,
|
||||
*autoPlayValues,
|
||||
kDefaultAutoPlayLimit);
|
||||
|
||||
const auto limitByType = [=](Type type) {
|
||||
return (ranges::find(kAutoPlayTypes, type) != end(kAutoPlayTypes))
|
||||
? *autoPlayLimit
|
||||
: *downloadLimit;
|
||||
};
|
||||
|
||||
addButton(tr::lng_connection_save(), [=] {
|
||||
auto allowMore = ranges::view::all(
|
||||
*values
|
||||
) | ranges::view::filter([&](Pair pair) {
|
||||
auto &&values = ranges::view::concat(
|
||||
*downloadValues,
|
||||
*autoPlayValues);
|
||||
auto allowMore = values | ranges::view::filter([&](Pair pair) {
|
||||
const auto [type, enabled] = pair;
|
||||
const auto value = enabled ? *limit : 0;
|
||||
const auto value = enabled ? limitByType(type) : 0;
|
||||
const auto old = settings->bytesLimit(_source, type);
|
||||
return (old < value);
|
||||
}) | ranges::view::transform([](Pair pair) {
|
||||
return pair.first;
|
||||
});
|
||||
const auto less = ranges::find_if(*autoPlayValues, [&](Pair pair) {
|
||||
const auto [type, enabled] = pair;
|
||||
const auto value = enabled ? limitByType(type) : 0;
|
||||
return value < settings->bytesLimit(_source, type);
|
||||
}) != end(*autoPlayValues);
|
||||
const auto allowMoreTypes = base::flat_set<Type>(
|
||||
allowMore.begin(),
|
||||
allowMore.end());
|
||||
|
||||
const auto changed = ranges::find_if(*values, [&](Pair pair) {
|
||||
const auto changed = ranges::find_if(values, [&](Pair pair) {
|
||||
const auto [type, enabled] = pair;
|
||||
const auto value = enabled ? *limit : 0;
|
||||
return settings->bytesLimit(_source, type) != value;
|
||||
}) != end(*values);
|
||||
const auto value = enabled ? limitByType(type) : 0;
|
||||
return value != settings->bytesLimit(_source, type);
|
||||
}) != end(values);
|
||||
|
||||
const auto &kHidden = kStreamedTypes;
|
||||
const auto hiddenChanged = ranges::find_if(kHidden, [&](Type type) {
|
||||
const auto now = settings->bytesLimit(_source, type);
|
||||
return (now > 0) && (now != *limit);
|
||||
return (now > 0) && (now != limitByType(type));
|
||||
}) != end(kHidden);
|
||||
|
||||
if (changed) {
|
||||
for (const auto [type, enabled] : *values) {
|
||||
const auto value = enabled ? *limit : 0;
|
||||
for (const auto [type, enabled] : values) {
|
||||
const auto value = enabled ? limitByType(type) : 0;
|
||||
settings->setBytesLimit(_source, type, value);
|
||||
}
|
||||
}
|
||||
@@ -161,7 +202,10 @@ void AutoDownloadBox::setupContent() {
|
||||
for (const auto type : kHidden) {
|
||||
const auto now = settings->bytesLimit(_source, type);
|
||||
if (now > 0) {
|
||||
settings->setBytesLimit(_source, type, *limit);
|
||||
settings->setBytesLimit(
|
||||
_source,
|
||||
type,
|
||||
limitByType(type));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,6 +219,9 @@ void AutoDownloadBox::setupContent() {
|
||||
!= allowMoreTypes.end()) {
|
||||
_session->data().documentLoadSettingsChanged();
|
||||
}
|
||||
if (less) {
|
||||
_session->data().checkPlayingVideoFiles();
|
||||
}
|
||||
closeBox();
|
||||
});
|
||||
addButton(tr::lng_cancel(), [=] { closeBox(); });
|
||||
|
||||
@@ -53,10 +53,7 @@ QImage TakeMiddleSample(QImage original, QSize size) {
|
||||
|
||||
} // namespace
|
||||
|
||||
class BackgroundBox::Inner
|
||||
: public Ui::RpWidget
|
||||
, private MTP::Sender
|
||||
, private base::Subscriber {
|
||||
class BackgroundBox::Inner : public Ui::RpWidget, private base::Subscriber {
|
||||
public:
|
||||
Inner(
|
||||
QWidget *parent,
|
||||
@@ -114,6 +111,7 @@ private:
|
||||
void validatePaperThumbnail(const Paper &paper) const;
|
||||
|
||||
const not_null<Main::Session*> _session;
|
||||
MTP::Sender _api;
|
||||
|
||||
std::vector<Paper> _papers;
|
||||
|
||||
@@ -185,6 +183,7 @@ BackgroundBox::Inner::Inner(
|
||||
not_null<Main::Session*> session)
|
||||
: RpWidget(parent)
|
||||
, _session(session)
|
||||
, _api(_session->api().instance())
|
||||
, _check(std::make_unique<Ui::RoundCheckbox>(st::overviewCheck, [=] { update(); })) {
|
||||
_check->setChecked(true, Ui::RoundCheckbox::SetStyle::Fast);
|
||||
if (_session->data().wallpapers().empty()) {
|
||||
@@ -209,7 +208,7 @@ BackgroundBox::Inner::Inner(
|
||||
}
|
||||
|
||||
void BackgroundBox::Inner::requestPapers() {
|
||||
request(MTPaccount_GetWallPapers(
|
||||
_api.request(MTPaccount_GetWallPapers(
|
||||
MTP_int(_session->data().wallpapersHash())
|
||||
)).done([=](const MTPaccount_WallPapers &result) {
|
||||
if (_session->data().updateWallpapers(result)) {
|
||||
|
||||
@@ -716,6 +716,9 @@ void BackgroundPreviewBox::checkLoadedDocument() {
|
||||
return;
|
||||
}
|
||||
const auto generateCallback = [=](QImage &&image) {
|
||||
if (image.isNull()) {
|
||||
return;
|
||||
}
|
||||
crl::async([
|
||||
this,
|
||||
image = std::move(image),
|
||||
|
||||