Compare commits

...

889 Commits

Author SHA1 Message Date
John Preston
b7c14f17a7 Version 5.3: Fix build with Xcode. 2024-07-31 23:06:39 +02:00
John Preston
0b6bd7075a Version 5.3.
- View recent and popular web apps in chats search.
- Open several web apps in different windows.
- Gift Telegram Stars to your friends.
- Send location marks and venues.
- Open tonsite:// links in webview.
- Edit order of stickers in your packs.
2024-07-31 19:06:47 +02:00
John Preston
148690d8b1 Open .ton as a tonsite. 2024-07-31 18:59:31 +02:00
John Preston
a422aec99a Fix cancel of bot app confirm. 2024-07-31 18:59:24 +02:00
John Preston
813d0501da Fix build on Windows. 2024-07-31 18:58:44 +02:00
John Preston
db80096e6b Use corporate sign certificate identity. 2024-07-31 17:03:56 +02:00
John Preston
cf896aeb13 Improve focusing of shown layers. 2024-07-31 17:03:56 +02:00
John Preston
76314e3c03 Close additional windows on passcode lock. 2024-07-31 17:03:56 +02:00
John Preston
8959679b3c Make IV internal links bg semi-transparent. 2024-07-31 17:03:56 +02:00
John Preston
bb6c94ef4f Handle tonsite:// links from the system. 2024-07-31 17:03:56 +02:00
John Preston
fb9ce6d3a8 Provide canGo[Back|Forward] for tonsite-s. 2024-07-31 17:03:56 +02:00
John Preston
dac4389e37 Fix build on Linux. 2024-07-31 17:03:55 +02:00
John Preston
a25b2e9700 Show webview error in Iv::Controller. 2024-07-31 17:03:55 +02:00
John Preston
699a7bdc58 Fix possible crash in message field.
Fixes #28203.
2024-07-31 17:03:55 +02:00
John Preston
4108debca0 Fix possible crash in web apps. 2024-07-31 17:03:55 +02:00
John Preston
8b2bbfba6a Navigate back/forward in tonsite pages. 2024-07-31 17:03:55 +02:00
John Preston
4f37343e8b Use special webview storage for tonsite. 2024-07-31 17:03:55 +02:00
John Preston
2dcf40817e Initial tonsite:// show in IV window. 2024-07-31 17:03:55 +02:00
John Preston
3eeb01be61 Save Celsius/Fahrenheit in Settings. 2024-07-31 17:03:55 +02:00
John Preston
6a8a85e395 Implement recent/popular apps list. 2024-07-31 17:03:55 +02:00
John Preston
031233ea98 Remove some code duplication. 2024-07-31 17:03:54 +02:00
John Preston
4b09050061 Implement Stars gift view from service messages. 2024-07-31 17:03:54 +02:00
John Preston
992c876930 Show correct presents in Stars gifts. 2024-07-31 17:03:54 +02:00
John Preston
a5ffd8b7cf Request new main web app. 2024-07-31 17:03:54 +02:00
John Preston
5fdd4eba80 Implement weather area in stories. 2024-07-31 17:03:54 +02:00
John Preston
54ce85f8e6 Show nice star in stars payments. 2024-07-31 17:03:54 +02:00
23rd
0bfb0fd045 Added initial ability to gift credits to users. 2024-07-31 17:03:54 +02:00
23rd
8ad2d3d39a Added api support to create invoice for credit gifts. 2024-07-31 17:03:54 +02:00
23rd
b8a19b56b6 Removed window session controller usage from list of credit options. 2024-07-31 17:03:54 +02:00
23rd
24b93a5eff Added support for credits gift options to list of credit options. 2024-07-31 17:03:53 +02:00
23rd
127f651d5e Added api support to get credits gift options. 2024-07-31 17:03:53 +02:00
23rd
e760a0983f Added gift sticker to ReceiptCreditsBox for gifts. 2024-07-31 17:03:53 +02:00
23rd
3f2cb8f8c9 Added file origin to sticker pack for gifts. 2024-07-31 17:03:53 +02:00
23rd
bcb6e9e1af Removed unused include directives from settings_common_session. 2024-07-31 17:03:53 +02:00
23rd
847d66c973 Added initial support of received gifts in list of credits history. 2024-07-31 17:03:53 +02:00
John Preston
5c797d1f31 Update API scheme to layer 185. 2024-07-31 17:03:53 +02:00
23rd
f749616dd8 Added additional request of special sticker pack on failing view pack. 2024-07-31 16:50:48 +03:00
23rd
3cc92e01fe Added ability to force request favorite stickers. 2024-07-31 16:50:04 +03:00
23rd
06f2b23687 Added badge to header for owned sticker sets in stickers list. 2024-07-31 13:05:29 +03:00
23rd
6a167b33f5 Added ability to delete sticker from sticker set box. 2024-07-31 11:57:19 +03:00
23rd
850155b3be Added shake animation while reordering to sticker set box. 2024-07-31 11:57:19 +03:00
23rd
358e586801 Added api support to reorder stickers from sticker set box. 2024-07-31 11:57:19 +03:00
23rd
54214ff2ad Added initial ability to drag stickers in sticker set box. 2024-07-30 13:52:32 +03:00
23rd
06fc813e95 Added loading state to box for renaming of stickers set. 2024-07-30 13:52:32 +03:00
23rd
0046bae53f Added ability to change name of sticker set from sticker set box. 2024-07-30 13:52:32 +03:00
23rd
aeb5e57061 Fixed profile opening of group call participant in separate windows. 2024-07-30 13:52:27 +03:00
23rd
a32b781e49 Improved Controller::invokeForSessionController for separate windows. 2024-07-30 13:52:27 +03:00
23rd
caef698e54 Fixed recursive invoking of Application::windowFor. 2024-07-30 13:52:27 +03:00
23rd
e9650385ad Added ability to provide custom style to widget with infinite animation. 2024-07-30 10:54:38 +03:00
23rd
f55584b160 Fixed position of click handler for via bot header in message view. 2024-07-30 10:54:38 +03:00
John Preston
b0981ea8e3 Beta version 5.2.6.
- Fix launching on X11. (Linux)
2024-07-29 11:02:25 +03:00
Ilya Fedin
a141d01a23 Fix macOS packaged action 2024-07-27 22:59:48 +02:00
John Preston
6a000207ee Beta version 5.2.5.
- Fix media viewer context menu.
- Fix blockquotes layout in messages.
2024-07-27 07:48:35 +02:00
John Preston
ee6edf9caa Force venue icon format. 2024-07-27 07:45:59 +02:00
John Preston
37907636e6 Fix build with Xcode. 2024-07-27 07:44:51 +02:00
John Preston
3f0f3a3c11 Focus existing location picker. 2024-07-26 17:28:04 +02:00
John Preston
db0856f71c Support t.me/username?profile links. 2024-07-26 17:28:03 +02:00
John Preston
86cdda2277 Fix text with blockquotes geometry counting. 2024-07-26 17:28:03 +02:00
John Preston
3888e8084a Update tg_owt, lib_webrtc and patches. 2024-07-26 13:02:38 +02:00
Ilya Fedin
517b456670 Add hit test for window context menu 2024-07-26 10:19:55 +02:00
John Preston
77d6e19214 Beta version 5.2.4.
- Allow opening several web apps.
- Send location marks and venues.
2024-07-25 10:33:57 +03:00
John Preston
fb64452495 Fix build on Linux. 2024-07-25 10:33:57 +03:00
John Preston
24fabf2590 Fix build on Windows. 2024-07-24 18:43:18 +02:00
John Preston
9b2847a11d Update submodules. 2024-07-24 18:15:28 +02:00
Ilya Fedin
c18e8fd777 Enable exceptions for C on Linux 2024-07-24 18:12:30 +02:00
Ilya Fedin
f4afa762d8 Replace -fstack-protector-all with -fstack-protector-strong to avoid slowdown of functions not using stack 2024-07-24 18:12:30 +02:00
Ilya Fedin
5e1fb6ebbf Add -fasynchronous-unwind-tables and -mno-omit-leaf-frame-pointer for better debugging on Linux 2024-07-24 18:12:30 +02:00
Ilya Fedin
2c7922ce7b Get release CFLAGS from Dockerfile on Linux 2024-07-24 18:12:30 +02:00
Ilya Fedin
ac78ae823c Reduce portal autostart dialog modality to parent window 2024-07-24 18:10:56 +02:00
John Preston
1ef6f462f6 Preserve link preview settings on reschedule. 2024-07-24 18:06:08 +02:00
John Preston
c81f406759 Use xz repository from GitHub.
Fixes #28189.
2024-07-24 18:06:07 +02:00
John Preston
889ec0c731 Replace \r\n with \n on paste.
Fixes #28181.
2024-07-24 18:25:33 +03:00
John Preston
677fbdd84e Fix webrtc camera usage on Linux. 2024-07-24 17:56:47 +03:00
John Preston
1ebe3255e0 Fix share focus in IV. 2024-07-24 16:09:04 +02:00
John Preston
c70866a995 Fix child native window focus. 2024-07-24 16:09:04 +02:00
John Preston
fd982b90db Implement separate instances for web apps. 2024-07-24 13:46:22 +02:00
John Preston
9461095c88 Fix build with GCC. 2024-07-19 13:01:08 +03:00
John Preston
a2fa1a52e2 Pass VideoCaptureOptions on Linux. 2024-07-19 11:58:26 +02:00
John Preston
a847969e9c Attempt to fix bad input field layout on Qt 6. 2024-07-19 11:58:26 +02:00
John Preston
4d647e64b7 Fix chat links with '-' in slug.
Fixes https://bugs.telegram.org/c/41902.
2024-07-19 11:58:26 +02:00
John Preston
f8b756d447 Improve bot checkout error messages. 2024-07-19 11:58:26 +02:00
John Preston
484c647b5b Fix bot about text layout on wide windows. 2024-07-19 11:58:26 +02:00
John Preston
730c968b1e Use always 1:1 ratio in limits boxes.
Otherwise "Free" label doesn't fit in 2:20 shareable folders.
2024-07-19 11:58:26 +02:00
John Preston
8a6a749296 Show error on attempt to scan QR in bot app.
Fixes #26886.
2024-07-19 11:58:26 +02:00
John Preston
2f22a8f46b Add Windows on ARM to build scripts. 2024-07-19 11:58:26 +02:00
John Preston
f123a9e16c Add openh264 to Dockerfile. 2024-07-19 11:58:20 +02:00
John Preston
11c45b0342 Update submodules. 2024-07-19 11:57:44 +02:00
John Preston
2cd6bfef06 Fix H265 in webrtc. 2024-07-19 11:57:41 +02:00
John Preston
61ca619db4 Fix build on macOS. 2024-07-19 11:56:57 +02:00
John Preston
675ee9088f Fix build on Windows. 2024-07-19 11:56:57 +02:00
John Preston
28a6aa45b9 Update msys2 and patches. 2024-07-19 11:56:57 +02:00
John Preston
08ec9e6bfd Fix build on macOS with new dependencies. 2024-07-19 11:56:54 +02:00
John Preston
ee9f99a754 Add some Windows on ARM special cases. 2024-07-19 11:56:34 +02:00
John Preston
2412183b83 Build most dependencies for Windows on ARM. 2024-07-19 11:56:34 +02:00
John Preston
e83704982f Set initial location correctly. 2024-07-19 11:56:34 +02:00
John Preston
6f86acf712 Use system reverse geocoding on macOS. 2024-07-19 11:56:34 +02:00
John Preston
c22698084f Location search cancel by X button. 2024-07-19 11:56:34 +02:00
John Preston
8c55364afa Allow editing business location in Settings. 2024-07-19 11:56:34 +02:00
John Preston
2c3ef13b01 Update tg_owt to M123. 2024-07-19 11:56:25 +02:00
John Preston
03454ca3b4 Fix sticker quote reply layout. 2024-07-19 11:20:54 +02:00
John Preston
8a92c89f39 Add fsqr promo footer. 2024-07-19 11:20:54 +02:00
John Preston
b83b403b75 Pass correct peer to venue search. 2024-07-19 11:20:54 +02:00
John Preston
8aac07b3c0 Show empty venue search states. 2024-07-19 11:20:54 +02:00
John Preston
b4dfc25df5 Implement venues search. 2024-07-19 11:20:54 +02:00
John Preston
917d1841c1 Try better webview focusing. 2024-07-19 11:20:54 +02:00
John Preston
8ce10d5503 Send chosen venues. 2024-07-19 11:20:54 +02:00
John Preston
a130bb1be6 Search for venues by location. 2024-07-19 11:20:54 +02:00
John Preston
de52ac6b28 Resolve different addresses. 2024-07-19 11:20:54 +02:00
John Preston
310837c9e1 Add venues list and chosen place name. 2024-07-19 11:20:54 +02:00
John Preston
8e6d7bb190 Improve location picker design. 2024-07-19 11:20:53 +02:00
John Preston
025ab40687 Implement location sending on macOS. 2024-07-19 11:20:53 +02:00
John Preston
2a5071b66c Initial location sending on Windows. 2024-07-19 11:20:53 +02:00
23rd
2a63496054 Extended conditions to ability to view channel message statistics. 2024-07-18 01:54:05 +03:00
23rd
a52d4eb4e8 Fixed peer in list of credits history entries. 2024-07-17 18:11:22 +03:00
23rd
4f7a124f3e Added phrases to credits history entries when peer type is premium bot. 2024-07-17 10:04:14 +02:00
23rd
4b9eb37bd5 Added phrases for single winner of giveaway in channels. 2024-07-17 10:04:14 +02:00
23rd
1d5e4040f4 Added api support of flag to view credits stats from full channel. 2024-07-17 10:04:13 +02:00
23rd
6818b8d8dc Fixed row name in table for credits history entries in earn box. 2024-07-17 10:04:13 +02:00
23rd
3f0b962ae5 Fixed color reset for chat filters on saving. 2024-07-17 10:04:13 +02:00
23rd
8ac1ad3484 Updated Qt to 6.2.9 on macOS. 2024-07-17 10:04:13 +02:00
John Preston
c6e1cf639e Update API scheme to layer 184. 2024-07-17 10:04:13 +02:00
Ilya Fedin
5b9278eced Switch Docker to distro-provided cmake 2024-07-15 09:21:47 +02:00
John Preston
03d4dd00d4 Delete selection on Ctrl+Backspace.
Fixes #28143.
2024-07-12 10:32:59 +02:00
John Preston
f7d698b9ff Fix last seen within week/month. 2024-07-12 08:45:45 +02:00
John Preston
46b69a938b Revert "Register tg:// scheme on initial launch."
This reverts commit 8cbeadc68a.
2024-07-12 08:45:45 +02:00
John Preston
ebba58217c Don't set focus to shown third section.
I hope it fixes #28142.
2024-07-12 08:45:45 +02:00
John Preston
94ad8f9bc3 Don't register collapsed row click as userpic.
Fixes #28149.
2024-07-12 08:45:44 +02:00
John Preston
6effac7915 Migrate games to AttachWebView. 2024-07-12 08:45:44 +02:00
John Preston
78093173a9 Version 5.2.3.
- Fix crash in bot star stats page.
- Bug fixes and other minor improvements.
2024-07-07 09:01:58 +04:00
John Preston
a01d48f063 Update submodules. 2024-07-06 22:21:04 +04:00
John Preston
149c69c9f5 Use a separate string for Your Stars in Settings. 2024-07-06 22:13:44 +04:00
John Preston
df277b366b Fix build on Windows. 2024-07-06 13:31:44 +04:00
John Preston
f20475f07e Show forbidden icon on disabled webview button. 2024-07-06 13:31:27 +04:00
John Preston
b6664625ea Fix assigning text after formatted text.
Fixes #28115.
2024-07-06 13:31:27 +04:00
John Preston
1028219276 Allow chats list preview for narrow photos. 2024-07-06 11:08:42 +04:00
John Preston
219671a3bc Fix archive in Main Menu context menu. 2024-07-06 11:08:42 +04:00
John Preston
8c97e915ec Create .mm source blanks for macOS modules. 2024-07-06 11:08:42 +04:00
John Preston
b648548001 Don't insert "data:image.." after image paste cancel. 2024-07-06 11:08:42 +04:00
23rd
b377c02ad3 Added support of min boost level for channel ads to feature list. 2024-07-06 11:08:41 +04:00
23rd
66d6b461f3 Fixed support type of credits history entry for ads in earn section. 2024-07-06 11:08:41 +04:00
John Preston
054a6db3ae Fix warnings on Windows in submodules. 2024-07-06 11:08:36 +04:00
Ilya Fedin
bf7042df44 Enable warnings as errors on Windows 2024-07-06 11:05:28 +04:00
Ilya Fedin
aa140b2919 Fix warnings on Windows 2024-07-06 11:05:28 +04:00
Ilya Fedin
8d0d9bb0bd Delay clearing transient parent until the pip window is really exposed 2024-07-06 09:17:04 +04:00
Daniel Novomeský
9ca9904732 Upgrade libjxl to v0.10.3 2024-07-05 21:30:00 +04:00
Daniel Novomeský
e6e1b9446d Upgrade libjxl on Linux to 0.10.3 2024-07-03 20:04:32 +04:00
John Preston
a507d28b49 Version 5.2.2.
- Fix topics search in topic groups.
- Fix Instant View pages content updating.
2024-07-02 19:03:07 +04:00
John Preston
ec2faca145 Fix couple of crashes in secondary windows. 2024-07-02 18:08:24 +04:00
John Preston
17bb430006 Register tg:// scheme on first launch.
Also, allow disabling tg:// re-registration on update.
2024-07-02 13:34:52 +04:00
John Preston
8cbeadc68a Register tg:// scheme on initial launch. 2024-07-02 13:22:33 +04:00
John Preston
3947056654 Use cached views count from not modified page. 2024-07-02 10:40:39 +04:00
John Preston
ad7d1fddf0 Reload IV on each open, take hash into account.
Fixes #28111.
2024-07-02 10:27:26 +04:00
John Preston
ab20f8eb31 Fix topics search in topic groups.
Fixes #28110.
2024-07-02 09:53:56 +04:00
John Preston
f75429cbaa Version 5.2.1: Shorten webview socket path.
Fixes #28106.
2024-07-01 21:35:39 +04:00
John Preston
dc8c4a8332 Version 5.2.1: No auto-enable system password unlock on macOS. 2024-07-01 21:03:05 +04:00
John Preston
096530c96a Version 5.2.1: Fix drafts / translations crash on macOS. 2024-07-01 19:21:27 +04:00
23rd
ed0850d823 Renamed files for bot and channel earn sections with different names. 2024-07-01 15:40:39 +03:00
John Preston
4a2173deaf Version 5.2.1.
- Fix crash when opening topic in a new window.
- Fix crash in topic search scope dropdown.
- Fix crash in video player.
- Fix feeze and crash in Instant View (Windows).
- Allow unlock by Apple Watch or System Password (macOS).
2024-07-01 15:01:35 +04:00
John Preston
f40a584905 Support unlock with Watch/SystemPassword. 2024-07-01 15:01:35 +04:00
John Preston
e54204b136 Don't allow forwarding local items by drag. 2024-07-01 13:20:45 +04:00
John Preston
715dff0a3e Fix a crash and a memory leak in video player.
Fixes #28104.
2024-07-01 11:03:19 +04:00
23rd
558daa3382 Fixed align of icons in list of top-up credit options. 2024-07-01 10:50:52 +04:00
GitHub Action
7265297b19 Update User-Agent for DNS to Chrome 126.0.0.0. 2024-07-01 10:49:45 +04:00
John Preston
1fac6db8bd Fix crash in topic search context menu destruction. 2024-07-01 10:46:34 +04:00
John Preston
c9bd776d1e Fix freeze in IV due to cyclic focus request. 2024-07-01 10:38:41 +04:00
John Preston
179e81478e Ignore filter switching in separate window archive. 2024-07-01 09:21:18 +04:00
John Preston
9ef74c510c Fix crash in opening topics in a new window. 2024-07-01 09:07:45 +04:00
Ilya Fedin
36f6917bd3 Query QWindow::windowState in media viewer 2024-07-01 07:56:55 +04:00
John Preston
707951accb Version 5.2: Fix build with GCC. 2024-06-30 23:59:03 +04:00
John Preston
7eb98b50ec Version 5.2.
- Pay for content with Telegram Stars.
- Enable local passcode unlock by Windows Hello and Touch ID.
- Allow opening forums, topics and archive in a separate window.
2024-06-30 21:21:51 +04:00
John Preston
65f7bdb914 Update API scheme on layer 183. 2024-06-30 21:16:11 +04:00
John Preston
876c47c436 Add 'section_separator_color' to webview palette. 2024-06-30 21:16:11 +04:00
John Preston
e8f16840de Fix wrong search focusing.
Fixes #28052.
2024-06-30 21:16:11 +04:00
John Preston
dd57ad567f Don't break by '/', '.' in the middle of the word.
Fixes #27999.
2024-06-30 21:16:11 +04:00
John Preston
54934fb835 Fix problems with message effect preview. 2024-06-30 21:16:11 +04:00
John Preston
bd49887607 Fix paid media price tag background. 2024-06-30 21:16:11 +04:00
John Preston
aaa72b7c30 Improve system unlock button area. 2024-06-30 21:16:10 +04:00
John Preston
4cafacc8db Add message effects promo section. 2024-06-30 21:16:10 +04:00
John Preston
374b3c68ac Fix cancel search with a similar channel open.
Fixes #28079.
2024-06-30 21:16:10 +04:00
John Preston
69d21f73ef Separate window for forums/topics/sublists/archive. 2024-06-30 21:16:10 +04:00
23rd
6dc3bd65e8 Improved spell checking on macOS. 2024-06-30 21:16:10 +04:00
23rd
deb9aa435b Improved first display of personal channel in user profiles. 2024-06-30 21:16:10 +04:00
23rd
68cb568898 Fixed build with Qt6. 2024-06-30 21:16:10 +04:00
23rd
1ed81b1c9c Improved process of mtp updates for revenue credits in earn section. 2024-06-30 21:16:10 +04:00
23rd
a95fb5b28d Slightly improved withdraw phrases to fit small buttons. 2024-06-30 21:16:10 +04:00
23rd
4f7b5ca7da Added process of server notification for disabled withdrawal feature. 2024-06-30 21:16:10 +04:00
23rd
29b7673b88 Simplified handle of incoming credit history entries. 2024-06-30 21:16:10 +04:00
23rd
66f375d2c6 Fixed endless memory copying in list of credits history entries. 2024-06-30 21:16:10 +04:00
John Preston
77d214d2a5 Support paid_media_allowed flag in ChannelFull. 2024-06-30 21:16:10 +04:00
John Preston
09e6077e97 Suggest global search of cashtags. 2024-06-30 21:16:10 +04:00
John Preston
631d6abb06 Improve formatting in message field. 2024-06-30 21:16:10 +04:00
John Preston
c833b8a1b0 Make purchased media badge better looking. 2024-06-30 21:16:10 +04:00
John Preston
b58c03f0de Fix build with Xcode. 2024-06-30 21:16:10 +04:00
John Preston
1988435cdf Add a Windows Hello / Touch ID system unlock. 2024-06-30 21:16:10 +04:00
John Preston
7e704d9529 Show price in my/purchased paid media. 2024-06-30 21:16:10 +04:00
John Preston
a39a8dbd2c Show paid media from transactions history. 2024-06-30 21:16:10 +04:00
John Preston
90dfae52f5 Show nice thumbnails for paid albums. 2024-06-30 21:16:10 +04:00
John Preston
dfc422b505 Show paid media albums with context. 2024-06-30 21:16:10 +04:00
John Preston
54cc12cf22 Show media payments as outgoing. 2024-06-30 21:16:10 +04:00
John Preston
d81e832ae6 Use lang key for about stars link. 2024-06-30 21:16:10 +04:00
John Preston
1399d2501d Show first paid media in transactions history. 2024-06-30 21:16:09 +04:00
John Preston
57254ca259 Show a credits emoji in chats list preview. 2024-06-30 21:16:09 +04:00
John Preston
043e3ae97e Use star emoji fallback for credits custom emoji. 2024-06-30 21:16:09 +04:00
John Preston
68b9a8bc6a Fix file reference refresh for paid media. 2024-06-30 21:16:09 +04:00
23rd
157d5c743b Renamed file for data of credits earn statistics. 2024-06-30 21:16:09 +04:00
23rd
54d0290ba2 Added warning to channel earn section when user has no cloud password. 2024-06-30 21:16:09 +04:00
23rd
0fc2df8eec Added transaction link and date to details of credits history entries. 2024-06-30 21:16:09 +04:00
23rd
d9caf15d1d Added initial ability to reinvest existing credits for channels. 2024-06-30 21:16:09 +04:00
23rd
b674826392 Added special widget for credits input to section of channel earn. 2024-06-30 21:16:09 +04:00
23rd
37181f9d0a Moved out special widget for credits input to single place. 2024-06-30 21:16:09 +04:00
23rd
93aebc747d Moved out special input for credits to td_ui. 2024-06-30 21:16:09 +04:00
23rd
a84ac933dd Added support of api update to history lists in section of channel earn. 2024-06-30 21:16:09 +04:00
23rd
b79c306bfe Added list of credits history to section of channel earn. 2024-06-30 21:16:09 +04:00
23rd
57d62423b3 Moved out custom slider class with natural width to single place. 2024-06-30 21:16:09 +04:00
23rd
f4674389d5 Added chart of credits revenue to section of channel earn. 2024-06-30 21:16:09 +04:00
23rd
63c4c5064f Added support of api updates for overview in channel earn section. 2024-06-30 21:16:09 +04:00
23rd
ae1f364730 Added rpl support to label with icon in section of channel earn. 2024-06-30 21:16:09 +04:00
23rd
c6e322de86 Added credits oveview to section of channel earn. 2024-06-30 21:16:09 +04:00
23rd
68bf6f991c Moved out util for wrapping credits icon to widget. 2024-06-30 21:16:09 +04:00
23rd
b15f5f8596 Added credits data to saved state of channel earn section. 2024-06-30 21:16:09 +04:00
23rd
27a71a8dcd Renamed BotEarnStatistics to CreditsEarnStatistics. 2024-06-30 21:16:08 +04:00
John Preston
2044f8f9ad Update API scheme on layer 183. 2024-06-30 21:16:08 +04:00
23rd
ffa4b1db87 Fixed withdrawal button for credits with minimal amount. 2024-06-30 21:16:08 +04:00
23rd
cad25ae644 Fixed unique row id in lists of credits history entries. 2024-06-30 21:16:08 +04:00
23rd
21094fe11b Slightly improved process of incoming credit history entries. 2024-06-30 21:16:08 +04:00
23rd
101dbdf243 Added support of MTP updates to lists of credits history entries. 2024-06-30 21:16:08 +04:00
John Preston
0dc92762bc Show link to message in transactions history. 2024-06-30 21:16:08 +04:00
John Preston
5fdaa6b91f Record bareMsgId in CreditsHistoryEntry. 2024-06-30 21:16:08 +04:00
John Preston
968d036834 Use Ui::NumberInput for the paid media price. 2024-06-30 21:16:08 +04:00
John Preston
d47c5df73d Nice price tag on sending media. 2024-06-30 21:16:08 +04:00
John Preston
6c1e7357c6 Nice unlock media stars, unlock done tooltip. 2024-06-30 21:16:08 +04:00
John Preston
479b63c33a Customize pay-by-stars box for paid media. 2024-06-30 21:16:08 +04:00
John Preston
950a946a16 Show correct chat preview for paid media. 2024-06-30 21:16:08 +04:00
John Preston
5f8da27c86 Display nice price tag, handle pay in albums. 2024-06-30 21:16:08 +04:00
John Preston
a9bd7803e6 Edit price on send, send single paid media. 2024-06-30 21:16:08 +04:00
John Preston
3ece9b1566 Update API scheme to layer 183. Paid media. 2024-06-30 21:16:08 +04:00
John Preston
e71a067f4b Fix build on Windows. 2024-06-30 21:16:08 +04:00
23rd
ebf456abe4 Added initial support of lists for credits history entries in bot earn. 2024-06-30 21:16:08 +04:00
23rd
3552da5ce7 Added additional row in table for some types of credits history entries. 2024-06-30 21:16:08 +04:00
23rd
b5bd0f53ad Added support of new statuses of credits history entries. 2024-06-30 21:16:08 +04:00
23rd
7d115b3fab Improved api support to credit history entries. 2024-06-30 21:16:08 +04:00
23rd
d0a030ab58 Added support of minimal amount of credits to withdrawal button. 2024-06-30 21:16:08 +04:00
23rd
712c06756e Added icon to label in withdrawal button from bot earn section. 2024-06-30 21:16:08 +04:00
23rd
301ffc15ef Added countdown label to withdrawal button in bot earn section. 2024-06-30 21:16:07 +04:00
23rd
3c4a711b5d Added withdrawal button to bot earn sections. 2024-06-30 21:16:07 +04:00
23rd
989145726d Made withdrawal button handler in earn sections more universal. 2024-06-30 21:16:07 +04:00
23rd
9eebd3b514 Added statistical chart and balance overview to bot earn section. 2024-06-30 21:16:07 +04:00
23rd
eb997ae9e3 Added initial implementation of filter for MTP updates. 2024-06-30 21:16:07 +04:00
23rd
db4c9b83f3 Added credits icon to statistical charts. 2024-06-30 21:16:07 +04:00
23rd
1196b6a3fb Moved out generating of credits icon to td_ui. 2024-06-30 21:16:07 +04:00
23rd
bef216bc93 Moved out colorizing of svg star to td_ui. 2024-06-30 21:16:07 +04:00
23rd
811d75e383 Improved display of different inner currencies in statistical charts. 2024-06-30 21:16:07 +04:00
23rd
049cde48ee Added initial api support of bot earn statistics. 2024-06-30 21:16:07 +04:00
23rd
cb65c50c19 Moved out deserialization of MTP statistical graph to separated file. 2024-06-30 21:16:07 +04:00
23rd
f23c9a61bc Moved out StatisticsRequestSender to separated file. 2024-06-30 21:16:07 +04:00
23rd
b5d5ff3cbb Improved naming of classes for channel earn. 2024-06-30 21:16:07 +04:00
23rd
c5ba0fa705 Added initial structure for bot earn data. 2024-06-30 21:16:07 +04:00
23rd
71893f4ef7 Added initial implementation of entry point to bot earn section. 2024-06-30 21:16:07 +04:00
23rd
4a60c57661 Added dummy files of bot earn section. 2024-06-30 21:16:07 +04:00
John Preston
fbbcc21198 Update API scheme to layer 182. 2024-06-30 21:16:07 +04:00
Ilya Fedin
d993386756 Fix debug-only openssl build on Windows 2024-06-30 11:31:57 +04:00
Ilya Fedin
30819509d3 Set shortcut context for global menu shortcuts 2024-06-30 10:11:40 +04:00
mrbesen
10c3fe0f63 add option to export html and json in global export 2024-06-27 10:49:39 +04:00
Ilya Fedin
3498a7f0ee Update submodules 2024-06-24 16:23:32 +04:00
Ilya Fedin
648b23b548 Do non-getting XCB requests synchronously 2024-06-24 16:23:32 +04:00
Ilya Fedin
ba89912834 Switch more XCB code to base::Platform::XCB::Connection 2024-06-24 16:23:32 +04:00
Ilya Fedin
c1bc7e6ab1 Simplify PipPanel::handleWaylandResize 2024-06-22 11:32:36 +04:00
Ilya Fedin
eea50ed6b0 Delay UpdatePowerSaveBlocker to show in media viewer 2024-06-22 11:32:36 +04:00
Ilya Fedin
006d6fe2c0 Use RpWidget::screenValue 2024-06-22 11:32:36 +04:00
Ilya Fedin
5180e0ec57 Use QWidget::setScreen with Qt 6 2024-06-22 11:32:36 +04:00
Ilya Fedin
490ec7949f Don't call hide/createWinId just to call show right after that in Window::Notifications::Default::HideAllButton 2024-06-22 11:32:36 +04:00
Ilya Fedin
671a15d763 Update skip taskbar hint on Linux without QWindow events 2024-06-22 11:32:36 +04:00
Ilya Fedin
d2d5226dc7 Update exposed state for connecting widgets without QWindow events 2024-06-22 11:32:36 +04:00
Ilya Fedin
b58ece3a38 Update lib_ui 2024-06-22 11:32:36 +04:00
Ilya Fedin
2b4a2b5b97 Fix a crash in Dialogs::Widget::setupStories 2024-06-22 11:32:36 +04:00
Ilya Fedin
382b175db2 Fix build on Linux 2024-06-22 11:32:36 +04:00
John Preston
2db81211c8 Fix configure on macOS. 2024-06-21 22:38:49 +04:00
John Preston
46157c99c4 Allow saving empty syntax highlight language. 2024-06-21 22:38:49 +04:00
John Preston
c3ed5224c2 Use tripple-enter to jump out of a block. 2024-06-21 22:38:49 +04:00
John Preston
acee7c7cfc More delay-load libraries on Windows with Qt 6. 2024-06-21 13:25:48 +04:00
John Preston
002fe9a72a Fix build. 2024-06-21 11:55:25 +04:00
John Preston
93b7c47cda Support building on Windows with Qt 6. 2024-06-21 11:36:18 +04:00
Ilya Fedin
053f8ad1c0 Ensure media viewer has native window handle before using it 2024-06-21 08:19:44 +04:00
Ilya Fedin
60ca6895db Update submodules 2024-06-19 10:33:33 +04:00
Ilya Fedin
fc5e9414b7 Subscribe to QEvent::WindowStateChange instead of QWindow::windowStateChanged 2024-06-19 10:33:33 +04:00
Ilya Fedin
f768e405fa Use RpWidget::shownValue instead of QWindow::visibleChanged 2024-06-19 10:33:33 +04:00
Ilya Fedin
a22cf8e303 Use RpWidget::windowActiveValue 2024-06-19 10:33:33 +04:00
Ilya Fedin
8a5797e1bd Re-create QSystemTrayIcon on SNI watcher owner change 2024-06-19 10:31:59 +04:00
Ilya Fedin
750ad600be Store media viewer geometry the same way as main window 2024-06-19 10:08:14 +04:00
Ilya Fedin
eaf4575eb8 Fix IV window geometry restoration 2024-06-19 10:08:14 +04:00
Ilya Fedin
b9677fe1db Update Qt to 6.7.2 on Linux 2024-06-18 22:01:23 +04:00
Ilya Fedin
4047f1733d Update submodules 2024-06-16 20:59:32 +04:00
John Preston
3d114131e0 Fix premium gifting recipient choosing. 2024-06-16 10:27:38 +04:00
John Preston
5810149a77 Improve chats search loading indication. 2024-06-16 10:27:38 +04:00
Ilya Fedin
032fe3e0fc Remove std::optional indrection for nullable XCB types 2024-06-16 09:54:04 +04:00
John Preston
81d7fcba7e Beta version 5.1.8: Fix build with GCC. 2024-06-15 23:03:55 +04:00
John Preston
4e9b5b0d33 Beta version 5.1.8: Fix build. 2024-06-15 22:45:21 +04:00
John Preston
90068f6261 Beta version 5.1.8: Update tg_owt on Linux. 2024-06-15 21:16:55 +04:00
John Preston
f37d056c14 Beta version 5.1.8.
- Support nice blockquotes and code blocks edition when composing messages.
- Support collapsing blockquotes and specifying syntax highlight language.
- Support nice spoiler animation in the message composing input field.
2024-06-15 21:06:23 +04:00
John Preston
f748988ae3 Update Qt patches. 2024-06-15 20:59:19 +04:00
John Preston
9a25d2c413 Simplify correct unicode characters counting. 2024-06-15 20:57:48 +04:00
John Preston
ec40292cbf Allow editing of collapsed quotes. 2024-06-15 20:57:30 +04:00
John Preston
5e8c3fb146 Allow editing syntax highlighting language. 2024-06-15 20:57:00 +04:00
John Preston
fa8ed186d8 Improve field fade conditions. 2024-06-15 20:56:45 +04:00
John Preston
c1f36d43d0 Support modern blockquote/pre display. 2024-06-15 20:56:44 +04:00
John Preston
501cae2200 Change InputField::font to InputField::style in styles. 2024-06-15 20:56:24 +04:00
John Preston
8ad5117495 Update lib_ui. 2024-06-15 20:55:09 +04:00
Ilya Fedin
d79da3d884 Remove old notification descturction workaround for old X11 systems
There seem to be no need in it anymore
2024-06-15 11:08:06 +04:00
Ilya Fedin
e4d88f829c Remove old window activation workaround for X11 systems
There seem to be no need in it anymore
2024-06-15 11:08:06 +04:00
Ilya Fedin
2673e1df53 Fix IV window on Linux 2024-06-15 11:04:45 +04:00
John Preston
99e88d74bc Version 5.1.7: Fix build with Qt 6. 2024-06-14 19:06:19 +04:00
John Preston
43ffc9d67c Version 5.1.7.
- Fix recently searched hashtags in chats search.
- Fix formatting shortcuts on macOS.
- Fix non-Telegram-Stars-invoice bot buttons with star emoji.
2024-06-14 18:36:28 +04:00
John Preston
053c462dc0 Fix recent hashtags in chats search. 2024-06-14 18:34:59 +04:00
John Preston
174b627a78 Fix markdown shortcuts on macOS / some Linux. 2024-06-14 17:39:16 +04:00
23rd
bb33d0b997 Replaced credits currency with icon only in buttons with Buy type. 2024-06-14 15:32:02 +03:00
pandaninjas
6f6fb3d1b6 Add xlsb to list of executable extensions 2024-06-14 13:49:15 +04:00
Ilya Fedin
3f216ad946 Enable parallelism for more dependencies 2024-06-13 21:35:34 +04:00
John Preston
c49eb7041f Version 5.1.6: Fix sticker effect filtering. 2024-06-13 20:55:49 +04:00
John Preston
a1d8202644 Version 5.1.6.
- Fix search in archived chats in single-column layout.
- Improve chat previews for topics, Saved Messages and groups.
- Fix formatting shortcuts on Linux.
- Fix options for Telegram Stars buying in case of large amounts.
2024-06-13 18:48:35 +04:00
23rd
82428aef28 Added support for quoted-printable encoding to contact media. 2024-06-13 18:44:33 +04:00
23rd
10f7b985c7 Added decimal separators to count of members in shared similar channels. 2024-06-13 18:44:33 +04:00
23rd
06075411a5 Fixed cases when list of top-up credit options is empty. 2024-06-13 18:44:33 +04:00
23rd
7e01b12825 Replaced credits currency with icon in buttons of reply keyboard. 2024-06-13 18:44:33 +04:00
John Preston
273119fc55 Fix preview messages load in migrated groups. 2024-06-13 18:43:58 +04:00
John Preston
e47e4ba338 Update submodules. 2024-06-13 18:08:43 +04:00
John Preston
cbcdeae200 Don't show topic buttons in topic preview. 2024-06-13 18:08:36 +04:00
John Preston
c585112e37 Fix jump to archive from search in chat. 2024-06-13 16:33:58 +04:00
John Preston
392df8b56f Fix search in archived chats and return back. 2024-06-13 16:24:41 +04:00
John Preston
0e6470a087 Don't restrict Saved Messages by premium-only privacy. 2024-06-13 15:47:40 +04:00
John Preston
6c0ea0eb9f Version 5.1.5.
- Return WebView on Windows.
2024-06-07 06:57:27 +04:00
John Preston
9229de2658 Return webview on Windows. 2024-06-07 06:57:06 +04:00
John Preston
2935721cd0 Version 5.1.4.
- Improve design of search in chat.
- Show vCard information for shared contacts.
- Allow scheduling media in topic groups.
- Several minor bugfixes.
2024-06-06 22:19:53 +04:00
John Preston
a48cd5f15a Don't show IV buttons on old Windows. 2024-06-06 22:17:30 +04:00
John Preston
9e77e80f92 Moderation on context menu album delete.
Fixes #28012.
2024-06-06 22:16:57 +04:00
John Preston
deb50ee528 Fix video full-window toggle in windowed mode. 2024-06-06 22:16:53 +04:00
John Preston
14909ae913 Fix empty space to the right of photo media. 2024-06-06 22:16:48 +04:00
John Preston
d5d9da7d0a Allow scheduling media in topic groups. 2024-06-06 22:16:43 +04:00
John Preston
86a048a021 Update libvpx to 1.14.1. 2024-06-06 22:16:38 +04:00
23rd
aafa8631e0 Moved out url for credits terms to lang pack. 2024-06-06 22:16:38 +04:00
Ilya Fedin
9176bf2e47 Update lib_webview 2024-06-06 21:08:54 +04:00
John Preston
72c667b153 Redesign search scope selection. 2024-06-06 09:12:23 +04:00
23rd
fe6f65b3ab Fixed text elision of peer name in section of chat preview. 2024-06-06 09:12:23 +04:00
23rd
5db2821f8c Removed unused refund api support for credits. 2024-06-06 09:12:23 +04:00
23rd
9e3e7265d2 Improved display of cached message preview in profile sections. 2024-06-06 09:12:23 +04:00
23rd
749b2e0e95 Added ability to see vcard if available to all types if contacts media. 2024-06-06 09:12:23 +04:00
Ilya Fedin
5b45397383 Update lib_webview 2024-06-06 09:12:03 +04:00
Ilya Fedin
61c17c0a93 libasound2 -> libasound2t64 2024-06-04 15:48:18 +04:00
John Preston
93e592472c Version 5.1.3.
- Rebuild version for macOS to fix the phrases.
2024-06-04 14:38:05 +04:00
John Preston
379a94db42 Version 5.1.2.
- Several bugs fixed including a couple of crashes.
2024-06-04 00:00:12 +04:00
23rd
4f4d216987 Fixed display of button in channel earn section when balance is low. 2024-06-03 23:00:48 +04:00
23rd
6400875d55 Replaced text drawing in menu from phone handler with Text::String. 2024-06-03 23:00:47 +04:00
John Preston
06d0e78b00 Fix a crash in forwarded sender avatars. 2024-06-03 22:59:14 +04:00
John Preston
9043c18725 Don't drop search on non-empty backspace. 2024-06-03 22:27:15 +04:00
Ilya Fedin
88e742927f File descriptor fixes for XDPOpenWithDialog
- Open it with O_CLOEXEC
- Remove unneseccary std::array complication
- Rely on Gio::UnixFDList to close it
2024-06-03 17:49:16 +04:00
Ilya Fedin
a6fcc6d51d Rely on media viewer code to close itself before ShowInFolder 2024-06-03 17:49:16 +04:00
John Preston
23a13ab54e Close chats search when selecting a folder. 2024-06-03 17:13:14 +04:00
John Preston
e8a929bdbd Fix bottom info display in media. 2024-06-03 15:03:41 +04:00
John Preston
eafc01e02b Fix small photo display in wide enough chat.
Fixes #28004.
2024-06-03 14:14:42 +04:00
John Preston
f817504d67 Fix formatting drop on zero cursor position. 2024-06-03 13:52:00 +04:00
John Preston
f91eb65239 Fix channel reactions editing. 2024-06-03 13:40:04 +04:00
John Preston
e978770fbd Fix crash in theme IV opening. 2024-06-03 12:48:11 +04:00
23rd
9c83b8bac5 Fixed emoji display in reply markup button from bar for pinned messages. 2024-06-02 23:11:09 +03:00
23rd
47ce34e987 Added initial support of vcard from media contacts. 2024-06-02 22:06:49 +03:00
John Preston
1656a9c3e2 Fix bot about title display. 2024-06-02 10:55:13 +04:00
John Preston
47e06cf385 Fix dropping invertCaption on reschedule. 2024-06-02 10:55:13 +04:00
John Preston
f61f649a7e Add a power saving setting for effects. 2024-06-02 10:55:13 +04:00
John Preston
a7bffe7abd Version 5.1.1: Fix misspelled attribute. 2024-06-01 23:58:31 +04:00
John Preston
51b866293f Version 5.1.1.
- Fix caption display on some media.
- Fix collapsed blockquotes rendering.
- Fully close search in chat by "Cancel" click.
- Allow editing caption placement and spoiler in topics.
- Disable effects on forwarded messages and inline results.
2024-06-01 23:40:20 +04:00
John Preston
bd20a3cfe4 Fix filtered premium sticker effects selection. 2024-06-01 23:35:04 +04:00
John Preston
86778aa4d9 Fix cancel search glitch with the new search. 2024-06-01 23:26:02 +04:00
John Preston
12eecec501 Disable effects for inline results sending. 2024-06-01 23:21:48 +04:00
John Preston
26345208a9 Fix caption disappearance on album sending. 2024-06-01 23:02:29 +04:00
John Preston
ee680ac1f1 Don't try adding effects to forwarded messages. 2024-06-01 22:49:51 +04:00
John Preston
bb79a07262 Move SendMenu additional actions to bottom. 2024-06-01 22:43:19 +04:00
John Preston
70fe649743 Hide media viewer on macOS when showing IV. 2024-06-01 22:31:43 +04:00
John Preston
400f0f8785 Empty line between description and ID. 2024-06-01 22:09:01 +04:00
John Preston
eac7bf1c48 Show "View as Messages" preview on forum preview. 2024-06-01 22:02:17 +04:00
John Preston
f4abe37dff Display peer IDs with delimeters. 2024-06-01 21:53:41 +04:00
John Preston
b7f165a259 Fix albums with wide captions. 2024-06-01 21:53:26 +04:00
John Preston
c1b95afd88 Fix media spoiler/caption-above edit in topics/scheduled. 2024-06-01 21:17:09 +04:00
John Preston
36766e7546 Fix collapsed blockquotes in the end of the text. 2024-06-01 21:16:31 +04:00
John Preston
59c016e4ce Fix search input not in the end of the query. 2024-06-01 20:39:31 +04:00
John Preston
e9e347fa6c Fix crash in stories privacy handling. 2024-06-01 20:34:16 +04:00
23rd
7aef0b0a83 Fixed frame size of video userpic in short info boxes on Retina. 2024-06-01 16:55:01 +03:00
23rd
d9572949f6 Replaced confirmation box for proxy links with generic box. 2024-06-01 16:02:59 +03:00
23rd
233e80d22d Fixed display of confirmation box for proxy links in correspond window. 2024-06-01 16:02:59 +03:00
John Preston
5c83858a50 Remove empty space below video without caption. 2024-06-01 10:58:48 +04:00
John Preston
c681569349 Fix info display in video with caption above. 2024-06-01 10:53:00 +04:00
John Preston
bb43afdd93 Fix search in chat close by "Cancel" link. 2024-06-01 10:52:48 +04:00
John Preston
3ba1941808 Version 5.1: Fix build on macOS. 2024-05-31 23:03:06 +04:00
John Preston
72d1b43453 Version 5.1.
- Send messages with effects.
- Move photo or video captions above the media.
- Chat preview on chat photo long press or Alt+Click.
2024-05-31 21:30:18 +04:00
John Preston
0c1b487956 Fix dragging of non-leader media. 2024-05-31 21:30:18 +04:00
23rd
ba611d0f2d Added initial api support of text phone entity in messages. 2024-05-31 18:58:21 +03:00
23rd
50ce847b31 Fixed display of info in media from chat preview. 2024-05-31 19:52:36 +04:00
23rd
dd0d88ccd3 Fixed userpic views in headers of forwarded messages with via bots. 2024-05-31 19:52:36 +04:00
John Preston
a1049ec7ce Add touchscreen preview to recent / channels. 2024-05-31 19:52:36 +04:00
John Preston
0fffeac8da Fix drag-n-drop forward of selected album. 2024-05-31 19:52:36 +04:00
John Preston
1f0acae151 Show frequent/recent selected when preview. 2024-05-31 19:52:36 +04:00
John Preston
521c17b76c Show chat previews in suggestions. 2024-05-31 19:52:36 +04:00
John Preston
f9f51b4e41 Show preview in Frequent Contacts. 2024-05-31 19:52:32 +04:00
John Preston
4e8895ddd9 Show "View as Messages" preview by Alt+Click. 2024-05-31 19:52:32 +04:00
John Preston
ad342a5324 Extract chat preview as a SessionController part. 2024-05-31 19:52:25 +04:00
John Preston
5cfd86b829 Use Ui::Text::String to show topic names.
Fixes #27956.
2024-05-31 19:52:22 +04:00
John Preston
27eb3e45be Allow only t.me links in factchecks. 2024-05-31 19:52:22 +04:00
John Preston
4953246c5d Support touchscreen pinned chats reordering. 2024-05-31 19:52:18 +04:00
John Preston
4df5372dab Support chat preview on touchscreens. 2024-05-31 19:52:12 +04:00
John Preston
40fbd415ef Support collapsible blockquotes in Ui::Text::String. 2024-05-30 21:35:10 +04:00
John Preston
974bf99921 Allow editing spoiler/caption-above in EditCaptionBox. 2024-05-30 21:35:10 +04:00
John Preston
8c0351be4e Allow editing caption above/below media. 2024-05-30 21:35:10 +04:00
John Preston
67f7816088 Allow sending photo/video captions above media. 2024-05-30 21:35:10 +04:00
John Preston
924d80ecba Use message text rendering for media captions. 2024-05-30 21:35:10 +04:00
23rd
d219bccf2b Fixed position of via bot header above reply in message view. 2024-05-30 21:35:10 +04:00
23rd
02bd2bca64 Removed display of credits button in settings when user has no credits. 2024-05-30 21:35:10 +04:00
23rd
57ecc2be1d Improved style of list of credits history entries for refunded entry. 2024-05-30 21:35:10 +04:00
23rd
d3a01b6235 Improved style of list of credits history entries for entry photo. 2024-05-30 21:35:10 +04:00
23rd
58c060c59d Improved style of box for credits history entries for refunded entry. 2024-05-30 21:35:10 +04:00
23rd
cd7507fb23 Respected accessibility of premium for credits purchasing. 2024-05-30 21:35:10 +04:00
23rd
9a5923676a Added posting of payment event to webview bot after credits sending. 2024-05-30 21:35:09 +04:00
John Preston
c0f3d263a3 Remove webpage length limit for factcheck. 2024-05-30 21:35:08 +04:00
John Preston
056ba644ed Fix empty search placeholder. 2024-05-30 21:35:08 +04:00
23rd
ebaffc333e Added initial api support of refund flag to credits history entries. 2024-05-30 21:35:08 +04:00
23rd
be099880d8 Added initial ability to claim refund credits from history entries list. 2024-05-30 21:35:08 +04:00
John Preston
885dcf0b28 Update API scheme on layer 181. 2024-05-30 21:35:08 +04:00
John Preston
a0d97f03cb Add factcheck footer support. 2024-05-30 21:35:08 +04:00
23rd
c942034ca4 Added link to terms to box of credits history entries. 2024-05-30 21:35:08 +04:00
23rd
0bd780b20f Added fireworks effect on success credit sending. 2024-05-30 21:35:08 +04:00
23rd
7d75c25214 Added box for small balance of credits. 2024-05-30 21:35:08 +04:00
23rd
5defb9fb17 Fixed display of credit spending. 2024-05-30 21:35:08 +04:00
23rd
0549c8f037 Moved out list of top-up options to single place. 2024-05-30 21:35:08 +04:00
23rd
3c246e1e92 Split functions for credits settings. 2024-05-30 21:35:08 +04:00
23rd
58da617e3f Added description and optional photo to credits receipts. 2024-05-30 21:35:08 +04:00
23rd
1edf0ed70b Moved out widget of photo for credits history entries to single place. 2024-05-30 21:35:08 +04:00
23rd
c27c567225 Added initial support for non-panel credits receipts. 2024-05-30 21:35:08 +04:00
23rd
93eff78cd6 Replaced all credits currency name at least with simple star. 2024-05-30 21:35:08 +04:00
23rd
a2a27e115c Moved out box for credits history entries to single place. 2024-05-30 21:35:08 +04:00
23rd
e9fb580ba4 Moved out credits currency to single place. 2024-05-30 21:35:08 +04:00
23rd
d73313479b Partly reverted "Processed payments form with API scheme on layer 181.". 2024-05-30 21:35:08 +04:00
23rd
e4e343b871 Removed unused Ui::IsCreditsInvoice. 2024-05-30 21:35:08 +04:00
23rd
dda6b92bec Added initial ability to process non-panel payment forms. 2024-05-30 21:35:07 +04:00
23rd
3dd894ad30 Improved SendCreditsBox for data from credits payment form. 2024-05-30 21:35:07 +04:00
23rd
f08ff92470 Added initial ability to provide data for non-panel payment forms. 2024-05-30 21:35:07 +04:00
23rd
923aaec085 Returned media to messages with credits invoice. 2024-05-30 21:35:07 +04:00
John Preston
1d3110228d Fix phrase in factcheck toast. 2024-05-30 21:35:07 +04:00
23rd
7194781bb8 Added api support for premium bot peer type for credits history entries. 2024-05-30 21:35:07 +04:00
John Preston
97a5e0c6ea Support limited formatting input in factcheck. 2024-05-30 21:35:07 +04:00
John Preston
a3ef36f9f7 Fix build on Windows. 2024-05-30 21:35:07 +04:00
John Preston
d13bf19b79 Show length limit when editing a factcheck. 2024-05-30 21:35:07 +04:00
John Preston
493f0450b4 Implement factcheck edition. 2024-05-30 21:35:07 +04:00
John Preston
74861a334d Show expand/collapse icon in factcheck. 2024-05-30 21:35:07 +04:00
John Preston
a87a221f26 Force red for factcheck. 2024-05-30 21:35:07 +04:00
John Preston
923a9ec6a8 Show toggle-able factcheck footer. 2024-05-30 21:35:07 +04:00
John Preston
b299881bf8 Track factcheck text and create media. 2024-05-30 21:35:07 +04:00
John Preston
5ee2bca616 Update API scheme on layer 181. 2024-05-30 21:35:07 +04:00
23rd
d1e914fb30 Added initial implementation of box for credits history entries. 2024-05-30 21:35:07 +04:00
23rd
43cb315f47 Replaced PeerId with BareId in credits history entries. 2024-05-30 21:35:07 +04:00
23rd
dcc52a7333 Moved out painting of userpic for credits entries to single place. 2024-05-30 21:35:07 +04:00
23rd
84cde1354d Slightly improved invoice view in messages for credits. 2024-05-30 21:35:07 +04:00
23rd
3d81414c71 Added initial implementation of box for sending credits. 2024-05-30 21:35:07 +04:00
23rd
69c48e2b5b Moved out credits balance widget to single place. 2024-05-30 21:35:07 +04:00
23rd
5ca9b74142 Fixed effect for successful payments in credits settings. 2024-05-30 21:35:07 +04:00
23rd
e11755af46 Added credits balance to main session. 2024-05-30 21:35:07 +04:00
23rd
174fb62c32 Fixed purchases of credits. 2024-05-30 21:35:07 +04:00
23rd
0e30e306ff Added second type of stars to animation of mini stars. 2024-05-30 21:35:07 +04:00
23rd
5e29f382cd Fixed build with Xcode. 2024-05-30 21:35:07 +04:00
John Preston
8eb24f620d Update API scheme on layer 181. 2024-05-30 21:35:07 +04:00
John Preston
5adde6c93a Fix build on Windows. 2024-05-30 21:35:07 +04:00
23rd
42d6d0d58a Added tooltip to balance label in credits settings for high values. 2024-05-30 21:35:07 +04:00
23rd
6336df2bd6 Slightly improved code style for decimal counts. 2024-05-30 21:35:07 +04:00
23rd
030d35ea7e Added initial implementation of balance in credits settings. 2024-05-30 21:35:07 +04:00
23rd
d81c3554cc Added multiple icons to credits topup options. 2024-05-30 21:35:07 +04:00
23rd
ca37ffa086 Added list of credit history entries to credits settings. 2024-05-30 21:35:07 +04:00
23rd
154fe63b43 Implemented list of credit history entries. 2024-05-30 21:35:06 +04:00
23rd
65384d54f1 Added random debug data to credits history. 2024-05-30 21:35:06 +04:00
23rd
2bf8cb84d0 Added api support of credits status and credits history. 2024-05-30 21:35:06 +04:00
23rd
f0a82de784 Fixed editing of last message with uploading media. 2024-05-30 21:35:06 +04:00
23rd
1a393ddebb Added star icons with gradient to main settings for premium buttons. 2024-05-30 21:35:06 +04:00
23rd
9b11b95c5b Added api support of invoice payments for credits. 2024-05-30 21:35:06 +04:00
23rd
d0bfee6963 Added initial list for topup options in settings section for credits. 2024-05-30 21:35:06 +04:00
23rd
f1636de572 Added initial api support for credits topup options. 2024-05-30 21:35:06 +04:00
23rd
b5eb195f43 Added initial dummy settings section for credits. 2024-05-30 21:35:06 +04:00
23rd
4a0bffe618 Added ability to provide custom gradient to star in premium top bar. 2024-05-30 21:35:06 +04:00
23rd
53d97b4146 Added ability to provide custom gradient to colored premium stars. 2024-05-30 21:35:06 +04:00
23rd
2a224c839e Added initial phrases for settings section for credits. 2024-05-30 21:35:06 +04:00
23rd
bc7aa91fbb Removed redundant constructor from Ui::Premium::TopBar. 2024-05-30 21:35:06 +04:00
23rd
ac2f35f12b Processed payments form with API scheme on layer 181. 2024-05-30 21:35:06 +04:00
John Preston
39e03c3ca7 Update API scheme to layer181. 2024-05-30 21:35:06 +04:00
John Preston
1ce49df123 Fix saved / replies userpics in chats search. 2024-05-30 21:35:06 +04:00
John Preston
1865fd382c Show loading placeholders in chats list. 2024-05-30 21:35:06 +04:00
John Preston
e00c6ecfb8 Show empty / placeholder in chats search. 2024-05-30 21:35:06 +04:00
John Preston
279db771cf Support dynamic search tabs with emoji. 2024-05-30 21:35:06 +04:00
John Preston
7b7438cd7b Make chats list tabs closer to each other. 2024-05-30 21:35:06 +04:00
John Preston
42d53e5543 Fix saved messages tags search. 2024-05-30 21:35:06 +04:00
John Preston
fce520c9c0 Clear saved messages tags on cancel search. 2024-05-30 21:35:06 +04:00
John Preston
b21bcb86cc Fix search from user in forums. 2024-05-30 21:35:06 +04:00
John Preston
7d61ab9412 Improve forum search support. 2024-05-30 21:35:06 +04:00
John Preston
701bf0d553 Fix searching with "from:" prefix. 2024-05-30 21:35:06 +04:00
John Preston
583bcca6a9 Fix forum search open by Ctrl+F. 2024-05-30 21:35:06 +04:00
John Preston
6a8edefc87 Fix some bugs in new chats search. 2024-05-30 21:35:06 +04:00
John Preston
dd5643ac67 Start chats search rewrite. 2024-05-30 21:35:06 +04:00
John Preston
787cf7853e Implement simple chats search bar. 2024-05-30 21:35:06 +04:00
John Preston
5bfbae3afc Update API scheme on layer 180. 2024-05-30 21:35:06 +04:00
John Preston
363b700f1f Fix chat preview and new emoji interactions. 2024-05-30 21:35:05 +04:00
John Preston
cde70b9807 Play effects in a separate layer over MainWidget. 2024-05-30 21:35:05 +04:00
John Preston
f7ab8a2174 Fix Chat / Effect previews in custom themes. 2024-05-30 21:35:05 +04:00
John Preston
a011a7c316 Fix sending scheduled effects. 2024-05-30 21:35:05 +04:00
John Preston
487fa9728a Fade in/out effect preview. 2024-05-30 21:35:05 +04:00
John Preston
8a58ded582 Show effect loading animation. 2024-05-30 21:35:05 +04:00
John Preston
ec5d8b7373 More robust effect icon loading. 2024-05-30 21:35:05 +04:00
John Preston
732b67ca04 Implement effects paywalls. 2024-05-30 21:35:05 +04:00
John Preston
d102d256a9 Implement effects search. 2024-05-30 21:35:05 +04:00
John Preston
bbb3a51b74 Fix effect selector for !_useTransparency case. 2024-05-30 21:35:05 +04:00
John Preston
d0d1ef9e66 Fix effect panel jump on expand. 2024-05-30 21:35:05 +04:00
John Preston
b01244fc42 Show correct sticker effects title. 2024-05-30 21:35:05 +04:00
John Preston
b92a05011f Show sticker effects in a StickerListWidget. 2024-05-30 21:35:05 +04:00
John Preston
5fb7992b04 Improve effect initial auto-play. 2024-05-30 21:35:05 +04:00
John Preston
f371cd1af2 Use nice fake message for effect preview. 2024-05-30 21:35:05 +04:00
John Preston
144109db05 Show effect preview before sending. 2024-05-30 21:35:05 +04:00
John Preston
e120ae6ae6 Pass effect to API for sending. 2024-05-30 21:35:05 +04:00
John Preston
d1106e5ae6 Check effects availability in all SendMenu-s. 2024-05-30 21:35:05 +04:00
John Preston
396ba9a984 Initial code of attaching effect selector. 2024-05-30 21:35:05 +04:00
John Preston
92133e7f50 Show effect animation with correct geometry. 2024-05-30 21:35:05 +04:00
John Preston
a19e71324b Implement basic effect animation. 2024-05-30 21:35:05 +04:00
John Preston
f762634036 Support effects API, show icon in info. 2024-05-30 21:35:05 +04:00
John Preston
ee4f83ffde Disable bottom-info reactions view. 2024-05-30 21:35:05 +04:00
John Preston
f8188f360a Update API scheme to layer 180. 2024-05-30 21:35:05 +04:00
John Preston
2bbc7406da Beta version 5.0.6.
- Fix chat preview with non-default themes.
- Fix chat preview crash when scrolling up.
- Jump to chat from preview only by Double-Click.
- Show chat preview with Force Touch on macOS.
2024-05-30 19:06:51 +04:00
John Preston
a9dd9aeb90 Use InnoSetup SignTool for setup signing.
Fixes #27583.
2024-05-30 19:03:12 +04:00
John Preston
aa4156d1e7 Ignore shortcuts when preview is shown. 2024-05-30 19:03:08 +04:00
John Preston
4f5594c8cc ChatNext jumps to first chat if no chat opened.
Fixes #27963.
2024-05-30 19:03:04 +04:00
John Preston
0527e9a0f7 Fix adding bot as admin to channel. 2024-05-30 17:02:28 +04:00
John Preston
28cbb02b20 Jump to chat only by Double-Click on preview. 2024-05-30 17:02:26 +04:00
John Preston
7d636820ac Show last updated topic preview on Alt+Click. 2024-05-30 17:02:23 +04:00
John Preston
e2b78b673b Fix unintentional search focus. 2024-05-30 17:02:19 +04:00
John Preston
a9a0fe7cf5 Fix RTL chat names in preview. 2024-05-30 17:02:13 +04:00
John Preston
2b9e7a6b25 Show preview on Force-Click on macOS. 2024-05-30 17:02:09 +04:00
John Preston
d6e827e982 Fix loading of chat preview messages. 2024-05-30 17:02:02 +04:00
John Preston
d2e6003521 Ignore right click on preview. 2024-05-30 17:01:59 +04:00
John Preston
465fc42718 Fix chat preview in non-default themes. 2024-05-29 09:43:40 +04:00
John Preston
0dd6ff9d9b Beta version 5.0.5.
- Long press on chat userpic to show quick preview.
- Alt+Click on chat to show quick preview.
- Show author userpics in forwarded messages.
2024-05-29 00:03:45 +04:00
23rd
8a6b1677f4 Added userpic views to headers of forwarded messages. 2024-05-28 21:42:00 +04:00
John Preston
470b3a2cbd Fix preview showing on fast userpic click. 2024-05-28 21:42:00 +04:00
John Preston
a60783eae3 Implement preview top and bottom. 2024-05-28 21:42:00 +04:00
John Preston
de73d8766c Open chat on exact clicked message from preview. 2024-05-28 21:42:00 +04:00
John Preston
cd7cfcdf2f Show chat preview on Alt+Click. 2024-05-28 21:42:00 +04:00
John Preston
aee62c7591 Fix migrated history in chat preview. 2024-05-28 21:42:00 +04:00
John Preston
0f524ac67d Don't stick to bottom while loading down. 2024-05-28 21:42:00 +04:00
John Preston
f223ae7eee Implement chats preview, show from unread. 2024-05-28 21:42:00 +04:00
John Preston
68df8448a2 Use arc_angles.h from lib_ui. 2024-05-28 21:42:00 +04:00
John Preston
da31fef1ae Show long-press preview of topics. 2024-05-28 21:41:59 +04:00
John Preston
4427ae4306 Empty preview widget on long userpic press. 2024-05-28 21:41:59 +04:00
John Preston
ef2aa05197 Allow HistoryView::ListWidget without SessionController. 2024-05-28 21:41:59 +04:00
John Preston
e5132e3fe8 Version 5.0.4
- Fix reply to last message by Ctrl+Up in topics.
- Some other bug fixes.
2024-05-28 20:32:48 +04:00
23rd
3b6870396c Added ability to hide every sponsored message to premium users. 2024-05-28 20:30:40 +04:00
23rd
f6b849e4f7 Added ability to add proxy from clipboard. 2024-05-28 20:30:40 +04:00
23rd
48e3802565 Improved labels for channel and group types with restricted content. 2024-05-28 20:30:40 +04:00
23rd
26ba7e57ce Fixed color of radial animation in audio files from shared media. 2024-05-28 20:30:40 +04:00
23rd
2605e754ff Added back button to cloud password step in intro. 2024-05-28 20:30:40 +04:00
23rd
9e85b1aa23 Fixed fake ability to hide webpage media with spoiler. 2024-05-28 20:30:40 +04:00
Ilya Fedin
88cd886ec8 Update lib_webview 2024-05-28 17:50:39 +04:00
John Preston
adc536b81d Fix Ctrl+Up reply in topics / comments. 2024-05-28 15:01:01 +04:00
John Preston
275327c789 Version 5.0.3.
- Ctrl+Click on Reply in menu to Reply in another chat.
- Allow Zero-Width-Space character in text rendering.
- Fix creating custom links in the message field.
- Fix jump to the topic with last unread message.
- Fix newline entering via Shift+Enter on Linux.
- Fix forum search open by Ctrl+F.
2024-05-28 11:53:51 +04:00
John Preston
72471c74d0 Limit symbols that allow diacritics after them. 2024-05-28 11:45:21 +04:00
John Preston
b9f63f80f1 Reply-in-another-chat by Ctrl+Click on Reply. 2024-05-28 10:59:46 +04:00
John Preston
32cd2120ac Allow zero width space in the middle of text.
Fixes #6959.
2024-05-28 10:54:20 +04:00
John Preston
7db9abf725 Fix forum search open by Ctrl+F. 2024-05-28 10:04:57 +04:00
John Preston
f09a939a7c Improve fix for markup. 2024-05-27 22:24:19 +04:00
John Preston
f1c1c900bf Fix newline regression on Linux. 2024-05-27 22:08:20 +04:00
John Preston
a43143d01c Separate ForceDisable from LastCheckCrashed. 2024-05-27 17:54:23 +04:00
John Preston
7357b40ba1 Fix build with updated lib_ui. 2024-05-27 17:54:23 +04:00
Ilya Fedin
ad6e34f3a4 Update lib_webview 2024-05-27 14:00:26 +04:00
John Preston
daf30dcab8 Fix jump to last topic in case of unread topic click. 2024-05-27 13:33:25 +04:00
Ilya Fedin
0033ad749f Update lib_webview 2024-05-27 08:06:25 +04:00
Ilya Fedin
62c249015d Update lib_webview 2024-05-26 14:20:43 +04:00
John Preston
31fcca245f Version 5.0.2: Fix IME-to-search on macOS. 2024-05-24 20:54:10 +04:00
John Preston
f4864cddc9 Fix possible crash in Settings of crashed web-app.
Fixes #27943.
2024-05-24 20:54:10 +04:00
John Preston
36db1105a2 Fix build with Xcode. 2024-05-24 16:09:01 +04:00
John Preston
364f62660c Version 5.0.2: Update the version number. 2024-05-24 15:26:18 +04:00
John Preston
b67a1bca49 Version 5.0.2.
- Toggle chats search focus by Tab key.
- Unfocus empty search by Backspace key.
- Add a spoiler to already sent media when editing.
- Forward by drag-n-drop to frequent contacts / recent searches.
- Allow wide chats list in empty window
with narrow list when a chat is opened.
- Improve custom font support in the input fields.
- Fix input method typing from unfocused search.
- Fix possible media reordering on batch send.
- Fix crash in group emoji set saving.
- Fix possible hang on quit on macOS.
2024-05-24 15:13:04 +04:00
John Preston
000911546b Fix usernames drop on min user being received. 2024-05-24 14:50:00 +04:00
John Preston
e26b8e7ebc Fix passcode lock glitch with new search. 2024-05-24 14:14:29 +04:00
John Preston
f03935ad9a Kill hang processes in case of app quitting. 2024-05-24 14:08:14 +04:00
John Preston
d91b75b8f8 Allow wide chats in empty window. 2024-05-24 12:55:48 +04:00
John Preston
4d4cf472c8 Fix crash in group emoji set saving. 2024-05-24 12:55:48 +04:00
John Preston
685c7a865e Use 64 iterations (like OpenSSL 3 for 2048 primes). 2024-05-24 12:55:48 +04:00
John Preston
0551550e61 Don't always open last topic in forums. 2024-05-24 12:55:48 +04:00
John Preston
c3fab28e1c Improve scroll style for limited reaction selector. 2024-05-24 12:55:48 +04:00
John Preston
74db2167f9 Allow copy custom emoji from panel. 2024-05-24 12:55:48 +04:00
John Preston
cedd8fc546 Fix incorrect replace media button show in reply. 2024-05-24 12:55:48 +04:00
John Preston
db486e957c Fix group/channel Appearance button style. 2024-05-24 12:55:48 +04:00
John Preston
1c6f45d8d3 Fix drag-n-drop to frequent/recent contacts. 2024-05-24 12:55:48 +04:00
John Preston
ba8bb2d50f Add .vscode to .gitignore. 2024-05-24 12:55:48 +04:00
John Preston
ec6d6a78cf Tab toggles search focus, Backspace doesn't focus. 2024-05-24 12:55:48 +04:00
John Preston
f10f3c08de Attempt to fix sending messages to broken topics. 2024-05-24 12:55:48 +04:00
John Preston
39c1da6642 Attempt to fix jump to unread in some cases. 2024-05-24 12:55:48 +04:00
John Preston
84ec2a5f74 Possibly fix wrong requests order. 2024-05-22 21:21:03 +04:00
Ilya Fedin
5e3e9ba824 Ensure Qt doesn't prevent quit due to ignored widget close events 2024-05-22 16:47:08 +04:00
Ilya Fedin
198528f79f Remove code needed for a removed patch 2024-05-21 14:20:43 +04:00
Ilya Fedin
8a5ad581b8 Update Qt to 6.7.1 on Linux 2024-05-21 14:20:43 +04:00
Ilya Fedin
7dbf8ca1f4 Remove unneeded Qt::WA_InputMethodEnabled
The widget already had it
2024-05-21 14:10:47 +04:00
dependabot[bot]
df808df8d3 Bump actions/upload-artifact from 2 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 09:16:03 +04:00
Ilya Fedin
4fddaef112 Update lib_webview 2024-05-20 14:25:23 +04:00
John Preston
2bdc204c47 Fix geometry applying in webview windows. 2024-05-20 14:25:23 +04:00
Ilya Fedin
6734f99ba8 Update lib_ui & patches on Linux 2024-05-19 20:30:13 +04:00
Ilya Fedin
af4e0178d0 Ensure window flags are set before calling SeparatePanel::setInnerSize
Setting window flags may lead to native window being re-created
2024-05-19 20:30:13 +04:00
Ilya Fedin
65b62485be Forward input method event from Dialogs::Widget to search field 2024-05-19 11:47:16 +04:00
Ilya Fedin
98b58c1168 Add missing binds for OpenGL shaders and buffers 2024-05-19 09:55:34 +04:00
Ilya Fedin
ad13048cdc Update submodules 2024-05-16 22:20:08 +04:00
Ilya Fedin
a753c1515b Remove unneeded wayland-client dependency from telegram part in snap 2024-05-16 22:20:08 +04:00
Ilya Fedin
bd48e2fff2 Fix more package names in snap 2024-05-16 22:20:08 +04:00
John Preston
88ad1be4c3 Try to fix custom fonts in the input field. 2024-05-14 19:36:52 +04:00
John Preston
1f31d8032f Bring chosen font to the top of the box. 2024-05-14 19:36:52 +04:00
John Preston
b5f5aed119 Fix search focus in a hidden window on launch.
Fixes #27853.
2024-05-14 19:36:52 +04:00
John Preston
213326a212 Update submodules. 2024-05-14 19:36:52 +04:00
23rd
264e35a6a8 Fixed rare crash in photo editor when editing media in message. 2024-05-14 17:19:39 +03:00
23rd
76137ca1cf Fixed link to premium section in box about sponsored messages. 2024-05-14 17:19:39 +03:00
23rd
e4323ecd26 Slightly improved code style in processing of api text entities. 2024-05-14 17:19:39 +03:00
23rd
b406e2b99b Fixed sender name for voices in overview layout when sender is hidden. 2024-05-14 17:19:39 +03:00
23rd
c1c49e8ddc Added captions to voice messages in overview layout. 2024-05-14 17:19:39 +03:00
23rd
41e414af37 Removed transcribe buttons from scheduled messages. 2024-05-14 17:19:39 +03:00
23rd
2afb69e787 Fixed text state of reply bubble for messages with unwrapped media. 2024-05-14 17:19:39 +03:00
23rd
3e7d4af4a0 Fixed reply bubble width for short quotes. 2024-05-14 17:19:39 +03:00
23rd
bc11c66777 Added ability to hide single sponsored message to premium users. 2024-05-14 17:19:39 +03:00
23rd
7a95b38d3c Fixed refreshing of file reference in api media spoiler editing module. 2024-05-14 17:19:39 +03:00
23rd
334fd4e951 Added ability to edit media with spoiled one without resending. 2024-05-14 17:19:39 +03:00
GoodDok
923e3ee808 Fix 25202: surrounding $PWD with double quotes
Added double quotes to work correctly with spaces in current directory's name
2024-05-14 14:43:38 +04:00
Robert-André Mauchin
3358673ba4 Add compatibility with FFMPEG 7.0
avio: Constify data pointees of write callbacks

avutil: remove deprecated FF_API_PKT_DURATION

Ref: 2a68d945cd
     02aea61d69
     b8fef7e9c5
2024-05-14 14:39:29 +04:00
dependabot[bot]
d28b9f10b4 Bump jlumbroso/free-disk-space from 1.3.0 to 1.3.1
Bumps [jlumbroso/free-disk-space](https://github.com/jlumbroso/free-disk-space) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/jlumbroso/free-disk-space/releases)
- [Commits](f68fdb76e2...54081f1387)

---
updated-dependencies:
- dependency-name: jlumbroso/free-disk-space
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-14 14:38:48 +04:00
Ilya Fedin
6ebbca58e8 Track major version for official GitHub helpers in actions 2024-05-14 09:54:25 +04:00
Ilya Fedin
15697f4f2b Fix libpng package name in snap 2024-05-08 12:10:37 +04:00
John Preston
2cb0651b04 Redirect IME to search on Windows. 2024-05-07 22:17:34 +04:00
John Preston
1f3a3ec04b Don't focus search when forum is opened. 2024-05-07 22:17:34 +04:00
John Preston
c1a0172822 De-focus empty search by backspace. 2024-05-07 22:17:33 +04:00
GkvJwa
593e76479c Use jom build openssl on windows 2024-05-07 09:52:32 +04:00
dependabot[bot]
5d622b906e Bump ilammy/msvc-dev-cmd from 1.12.0 to 1.13.0
Bumps [ilammy/msvc-dev-cmd](https://github.com/ilammy/msvc-dev-cmd) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/ilammy/msvc-dev-cmd/releases)
- [Commits](https://github.com/ilammy/msvc-dev-cmd/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: ilammy/msvc-dev-cmd
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-07 09:02:31 +04:00
dependabot[bot]
7e253314ec Bump jinja2 from 3.1.3 to 3.1.4 in /Telegram/build/docker/centos_env
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 23:29:00 +04:00
dependabot[bot]
78a05768d8 Bump dessant/lock-threads from 3 to 5
Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 3 to 5.
- [Release notes](https://github.com/dessant/lock-threads/releases)
- [Changelog](https://github.com/dessant/lock-threads/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dessant/lock-threads/compare/v3...v5)

---
updated-dependencies:
- dependency-name: dessant/lock-threads
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 23:28:48 +04:00
dependabot[bot]
ddf6514a90 Bump actions/stale from 5 to 9
Bumps [actions/stale](https://github.com/actions/stale) from 5 to 9.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5...v9)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 20:40:31 +04:00
dependabot[bot]
3847b97f80 Bump actions/cache from 3.0.11 to 4.0.2
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.11 to 4.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.11...v4.0.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 20:40:18 +04:00
dependabot[bot]
046bc03037 Bump actions/checkout from 3.1.0 to 4.1.4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 4.1.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.1.0...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 20:40:02 +04:00
Ilya Fedin
7ff5f81b88 Try automatic actions update 2024-05-06 09:46:18 +04:00
John Preston
fb444e7dd4 Version 5.0.1.
- Fix several crashes in new interfaces.
- Fix monospace font size.
- Fix possible problem with underline font size.
2024-05-04 19:08:30 +04:00
23rd
c4f0db5bc5 Fixed possible crash on slow resolving message from personal channel. 2024-05-04 18:13:30 +04:00
23rd
a866ba8cdd Fixed crash on restricting users from moderation box. 2024-05-04 18:13:28 +04:00
John Preston
129d356909 Fix scrolling expanded frequent contacts. 2024-05-04 18:13:04 +04:00
Ilya Fedin
7289292f02 Update lib_ui & patches on Linux 2024-05-04 14:05:09 +04:00
Ilya Fedin
638e88ec79 Revert "Use latest mesa in snap"
This reverts commit b246328dcf.
2024-05-04 14:05:09 +04:00
John Preston
19ead551d9 Fix a typo bug in replies section scrolling. 2024-05-03 21:04:06 +04:00
John Preston
fccaa587e1 Fix adjustment of size for modified fonts. 2024-05-03 21:04:06 +04:00
23rd
1709fcd0df Guarded personal channel info from possible crash on deleting message. 2024-05-03 21:04:06 +04:00
23rd
de1f222bac Fixed rescheduling of selected and grouped scheduled messages. 2024-05-03 21:04:06 +04:00
Ilya Fedin
5e1f0e9f7f Move waiting for answer action 30 minutes later than lock threads 2024-05-03 19:59:24 +04:00
Alan Pope
e3a14d432b Be consistent with libgtk-3-0t64
The reason it worked without explicitly updating this one is because the deb of libgtk-3-0t64 has a 'replaces' line for libgtk-3-0 - which nullifies this entry, as both were specified. But, you're right, looks better to have the right package in there.
2024-05-03 19:59:07 +04:00
Alan Pope
2b013c108f Fixes for unable to find gtk-query-immodules-3.0
The package has been updated for 2038 t64 update. This fixes that. 

Successfully build telegram 5.0.0 in arm64 after the fixes in this PR.
2024-05-03 19:59:07 +04:00
Alan Pope
0194687181 fix: Incorrect package name
Noble has libvpx9, not vpx8.

https://packages.ubuntu.com/search?keywords=libvpx9
2024-05-03 19:59:07 +04:00
John Preston
bb47f4659d Don't adjust monospace font size. 2024-05-02 19:36:59 +04:00
John Preston
2b580d29ae Add .qoi to list of image extensions. 2024-05-02 17:17:40 +04:00
John Preston
b7e52119bc Add .jxl to the list of image extensions. 2024-05-02 16:35:29 +04:00
John Preston
fd633ecb49 Version 5.0.
- Choose custom font family in Settings > Chat settings > Font family.
- Show "Frequent contacts" when you focus the search field.
- Show "Recent chats" when you focus the search field.
- Show "Channels" list and similar channels.
- Premium users can use animated emoji in polls.
- Group admins can mass-moderate many messages.
- Fix frequent crashes on some Linux systems.
2024-05-02 14:11:20 +04:00
John Preston
9c77346f36 Fix build with Xcode and GCC. 2024-05-02 14:11:20 +04:00
John Preston
641e74763f Revert non-production-ready prepare.py changes.
Accidentally commited in b9b7d9e337.
2024-05-02 12:17:57 +04:00
John Preston
2e71427427 Improve font size edge cases. 2024-05-02 12:05:46 +04:00
John Preston
95ec0633ed Use custom-adjusted font metrics for custom fonts.
Fixes #27814.
2024-05-02 11:33:47 +04:00
23rd
14e8b8fb91 Fixed spam reporting in moderation box. 2024-05-02 04:09:25 +03:00
23rd
d40951f068 Added ability to moderate non-users to moderation box. 2024-05-02 04:09:25 +03:00
23rd
ab85d18cc8 Added support of personal channel with message. 2024-05-02 04:09:25 +03:00
23rd
6becaaa953 Slightly improved view style of giveaway results in dialogs list. 2024-05-02 04:09:25 +03:00
23rd
26e8c29f40 Moved formatting of dialog last date to td_ui. 2024-05-02 04:09:25 +03:00
John Preston
47800ee02d Improve font size selection a bit. 2024-05-01 19:09:54 +04:00
John Preston
12a24dd473 Fix possible crash in common groups list.
Currently Data::Session::processChat() may change adminRights(),
that may change Data::CanSendAnyOf(peer, ...), that may lead to
Window::SessionController::updateThirdColumnToCurrentChat() call,
that destroys current third column to replace it with another one.

If common groups list was opened in the third column this will crash.

Fixes #27640.
2024-05-01 17:52:40 +04:00
23rd
ad6321d3ae Fixed possible crash in moderate box. 2024-05-01 14:10:37 +03:00
John Preston
7e071c770f Fix possible crash with custom wallpapered peers. 2024-05-01 14:38:06 +04:00
John Preston
a62d1dfa63 Focus chats search by Ctrl[Cmd]+F. 2024-05-01 14:38:05 +04:00
John Preston
b3eb1dbc14 Revert "Toggle search focus by escape."
This reverts commit 72d5a9b3e0.
2024-05-01 14:38:05 +04:00
Ilya Fedin
3170a45158 Increase snapcraft verbosity 2024-05-01 14:06:23 +04:00
John Preston
32483fa13b Just focus the search field on Space. 2024-05-01 12:57:47 +04:00
John Preston
9166a1c3a6 Update Linux Qt patches. Hope fixes crashes. 2024-05-01 12:57:07 +04:00
GitHub Action
6fa0afff37 Update User-Agent for DNS to Chrome 124.0.0.0. 2024-05-01 12:47:51 +04:00
Ilya Fedin
bc649af941 Schedule no-response action runs at different times
To avoid rate limits
2024-05-01 12:47:42 +04:00
John Preston
16ce5ef046 Greeting category first in ChatIntro setup. 2024-05-01 12:47:20 +04:00
John Preston
bb6fd4bc4d Update scheme, new sticker categories. 2024-05-01 12:47:20 +04:00
John Preston
63e1731d7c Fix premium preview bullet-dots.
Regression was introduced in 88751896af.
2024-05-01 12:47:20 +04:00
John Preston
b9b7d9e337 Implement live location view. 2024-05-01 12:47:20 +04:00
23rd
ef8c07e6eb Added ability to translate selected text in profile section. 2024-04-30 17:35:34 +03:00
23rd
20a13663a6 Slightly improved style of rpl text mapping. 2024-04-30 17:35:04 +03:00
23rd
2f0aa6ef05 Removed state sending of low level of battery to call participant. 2024-04-30 16:49:17 +03:00
23rd
62bd1354dc Replaced box for leaving or deleting chat with generic box. 2024-04-28 20:14:26 +03:00
23rd
be255f1d09 Added to moderate box number of all messages that will be deleted. 2024-04-28 20:14:26 +03:00
23rd
b8b02b2285 Replaced list of history items for sending now with sorted by date. 2024-04-28 13:33:04 +03:00
23rd
e0db0642bd Fixed crash when deleting message from non-user. 2024-04-27 16:39:13 +03:00
23rd
e81465a54e Added Enter shortcut to moderation box for confirmation. 2024-04-27 13:31:00 +03:00
23rd
6e67cfc7be Fixed possible crash in moderation box. 2024-04-27 12:59:36 +03:00
John Preston
c0db5ee98a Beta version 4.16.10: Fix GCC build. 2024-04-26 23:41:28 +04:00
John Preston
372b3da09c Beta version 4.16.10.
- Group admins can mass-moderate many messages.
- Premium users can use animated emoji in polls.
- Revert the default "Open Sans" font to 1.10.
- Several crash fixes and small improvements.
2024-04-26 20:55:06 +04:00
John Preston
79532954dc Allow a bit more font size adjusting. 2024-04-26 20:18:30 +04:00
23rd
aff2be605e Removed item for poll creation from menu when it is impossible. 2024-04-26 19:15:03 +03:00
John Preston
363c191a6e Skip media bottom skip in IV. 2024-04-26 20:12:30 +04:00
John Preston
2949cdab61 Don't request IV two times in a row. 2024-04-26 20:12:29 +04:00
John Preston
7addcf2d25 Add IV footer. 2024-04-26 20:12:29 +04:00
John Preston
a272807a99 Remove "Create poll" button in Replies chat.
Fixes #27817.
2024-04-26 20:12:29 +04:00
23rd
c803603de4 Added ability to insert custom emoji to polls. 2024-04-26 20:12:29 +04:00
23rd
e6c22ec1ca Added api support for custom emoji in polls. 2024-04-26 20:12:29 +04:00
John Preston
b3ae843f0e Update API scheme to layer 179. 2024-04-26 20:12:29 +04:00
John Preston
12a78c1f45 Allow pasting text to the unfocused search. 2024-04-26 20:12:29 +04:00
23rd
612b81ee87 Fixed allowed reactions for channel posts in linked chats. 2024-04-26 20:12:29 +04:00
23rd
e5b91d2f3d Added entry points for moderation box. 2024-04-26 20:12:29 +04:00
23rd
82293c98eb Added arrow icon to divider link in moderation box. 2024-04-26 20:12:29 +04:00
23rd
629da68cfc Added api support to moderation box. 2024-04-26 20:12:29 +04:00
23rd
643ecd2c2c Implemented initial ui of moderation box. 2024-04-26 20:12:29 +04:00
Ilya Fedin
dd1cb00c62 Update snap to core24 2024-04-26 18:39:56 +04:00
23rd
2c4d8418c1 Removed unused code for sponsored messages. 2024-04-26 11:21:41 +04:00
23rd
9fcb5d6f31 Added emoji button to input field for peer title edit. 2024-04-26 11:21:41 +04:00
23rd
38fc6bfbb9 Added special mode to emoji list widget to exclude non-unicode emoji. 2024-04-26 11:21:41 +04:00
23rd
804991a69c Added universal duration to styles. 2024-04-26 11:21:41 +04:00
23rd
7388f46adf Fixed display of subscribers count in dialogs suggestions. 2024-04-26 11:21:41 +04:00
John Preston
10c427127e Fix accidental search focusing. 2024-04-26 11:10:12 +04:00
John Preston
c6d034174b Support separate webview storages. 2024-04-26 08:58:42 +04:00
Ilya Fedin
471831bcd6 Revert "Remove not really needed notification capability checks"
This reverts commit abdfa4f785.
2024-04-25 15:07:51 +04:00
Ilya Fedin
b1e64419a5 Fix setting application icon in Linux notifications 2024-04-25 11:31:43 +04:00
Ilya Fedin
e2f17f1131 Remove unneeded includes from notifications_manager_linux 2024-04-25 11:31:43 +04:00
John Preston
ae4a73a15b Rollback OpenSans to 1.10. 2024-04-24 22:20:22 +04:00
Kolya
a84ca00270 fix typo 2024-04-24 19:18:33 +04:00
John Preston
c16d820b88 Move OpenSSL probing before crash reporter. 2024-04-24 19:12:46 +04:00
John Preston
ef614150d5 Remove dead code in lib_ui. 2024-04-24 17:44:51 +04:00
John Preston
b46ca1ec17 Use different font fallback algo on Windows. 2024-04-24 17:44:40 +04:00
John Preston
d5a347ede7 Try cancelling the new search by mouse back button. 2024-04-24 17:41:12 +04:00
John Preston
72d5a9b3e0 Toggle search focus by escape. 2024-04-24 16:56:20 +04:00
John Preston
e6d72b4861 Un-focus chats search on empty history click. 2024-04-24 16:54:10 +04:00
John Preston
3da51b1bc9 Fix crash on quit in sponsored messages. 2024-04-24 16:37:27 +04:00
John Preston
17b7db6219 Request 64 frequent contacts instead of 32. 2024-04-24 16:37:27 +04:00
John Preston
8353180161 Fix phrase cut-off in QR login. 2024-04-24 16:37:27 +04:00
John Preston
f675a8dcf7 Attempt to fix a couple of crashes. 2024-04-24 16:37:27 +04:00
John Preston
493f1d69e2 Fix cancel search button overlap. 2024-04-24 16:37:27 +04:00
John Preston
331e8c3ec6 Beta version 4.16.9.
- Show "Frequent contacts" when you focus the search field.
- Show "Recent chats" when you focus the search field.
- Show "Channels" and channel recommendations.
- Allow changing font in Settings > Chat settings > Font family.
2024-04-23 23:14:19 +04:00
John Preston
56bce70558 Fix "long time ago" for users who blocked me. 2024-04-23 21:47:57 +04:00
John Preston
d82e48f8e4 Improve ChooseFontBox navigation. 2024-04-23 19:17:42 +04:00
John Preston
97ecc57be8 Add choose font settings. 2024-04-23 19:17:42 +04:00
John Preston
25bd2b145b Update submodules. 2024-04-23 19:17:42 +04:00
John Preston
7111c92ae7 Fix keyboard navigation in top peers. 2024-04-23 19:17:42 +04:00
John Preston
e066cf1589 Add "Show all" for top peers. 2024-04-23 19:17:41 +04:00
John Preston
6f328b2ef8 Fix inline query draft applying. 2024-04-23 19:17:41 +04:00
23rd
7a6c55bd8a Fixed color of icon for replies with media story. 2024-04-23 19:17:41 +04:00
23rd
b35d3f57fe Slightly improved style of sub-button in sponsored messages. 2024-04-23 19:17:41 +04:00
23rd
eef65af173 Slightly simplified meson usage on macOS in prepare.py. 2024-04-23 19:17:41 +04:00
23rd
bea715b41c Added ICCv4 with Little CMS on macOS. 2024-04-23 19:17:41 +04:00
23rd
7be68ca82c Updated Qt to 6.2.8 on macOS. 2024-04-23 19:17:41 +04:00
John Preston
287d5a7413 Fix shadow below Chats/Channels. 2024-04-23 19:17:41 +04:00
John Preston
1448cea01c Fix ripple in active recommendation row. 2024-04-23 19:17:41 +04:00
John Preston
768e8b457b Improve second-time choose of toppeers. 2024-04-23 19:17:41 +04:00
John Preston
05474f4a3f Improve filter switching with toppeers. 2024-04-23 19:17:41 +04:00
John Preston
8acada9b0f Fix toppeers animation with expanded stories. 2024-04-23 19:17:41 +04:00
23rd
a86e7f035f Slightly improved style of inner box for channel earn history entries. 2024-04-23 19:17:41 +04:00
John Preston
9caff93c35 Fix build for Xcode. 2024-04-23 19:13:48 +04:00
John Preston
e6ba85e112 Keyboard navigation in channels/recommendations. 2024-04-23 19:13:48 +04:00
John Preston
046803dbed Fix rotation reading in FFmpeg. 2024-04-23 19:13:48 +04:00
John Preston
615f4b1d1c Ignore pageBlockUnsupported blocks. 2024-04-23 19:13:48 +04:00
John Preston
a11535806d Always show cancel search when focused. 2024-04-23 19:13:48 +04:00
John Preston
34a7169b4f Make unread badges on top peers nicer. 2024-04-23 19:13:47 +04:00
John Preston
4f365c73ad Support active selection in recommendations. 2024-04-23 19:13:47 +04:00
John Preston
705bd9693d Load recommendations on demand. 2024-04-23 19:13:47 +04:00
John Preston
a88770a8ec Don't close recommendations. 2024-04-23 19:13:47 +04:00
John Preston
da423b5bd2 Add a general FastShareLink method. 2024-04-23 19:13:47 +04:00
John Preston
56080bd0e4 Fix boost group link handling for forums. 2024-04-23 19:13:47 +04:00
John Preston
63f66a1369 Show "Boost" button in boost group links. 2024-04-23 19:13:47 +04:00
John Preston
ca1a30196e Fix LinkButton resizing. 2024-04-23 19:13:47 +04:00
John Preston
b2d8e2a1e6 Initial version of channels/recommendations. 2024-04-23 19:13:47 +04:00
John Preston
2ab8bb13c5 Fix links preview. 2024-04-23 19:13:47 +04:00
23rd
3a2c5c6d0a Increased size of stickerset preview in webpages. 2024-04-23 19:13:47 +04:00
23rd
ed13a325e9 Added stickerset preview to webpages. 2024-04-23 19:13:47 +04:00
23rd
f43f99cff2 Added initial api support of stickerset attribute in web pages. 2024-04-23 19:13:47 +04:00
John Preston
a3b8397361 Close chat/media if thrown out by admin. 2024-04-23 19:13:47 +04:00
John Preston
4fb03e532c Optimize stories list generation. 2024-04-23 19:13:47 +04:00
John Preston
645ad5e1bd Update pinned icon in stories list. 2024-04-23 19:13:47 +04:00
John Preston
9036e9e8e3 Show pinned icon in stories. 2024-04-23 19:13:47 +04:00
John Preston
468d8b04d6 Implement stories pin-to-top. 2024-04-23 19:13:47 +04:00
John Preston
4b98ab1246 Fix build with simplified ads. 2024-04-23 19:13:46 +04:00
John Preston
d33e3dc13a Rename Story::pinned to Story::inProfile. 2024-04-23 19:13:46 +04:00
23rd
df16e7c00b Added ability to change reactions limit in channels. 2024-04-23 19:13:46 +04:00
23rd
225c0e0af3 Added initial api support of reactions limit in channels and groups. 2024-04-23 19:13:46 +04:00
23rd
5543927042 Added ability to enable sponsored messages for premium self. 2024-04-23 19:13:46 +04:00
23rd
72b274a2bf Added support of simplified constructor for MTP sponsored message. 2024-04-23 19:13:46 +04:00
John Preston
ac15990b48 Update API scheme to layer178, ads broke build. 2024-04-23 19:13:46 +04:00
John Preston
7387dfdd9c Don't create top/recent peers unnecessary. 2024-04-23 19:13:46 +04:00
John Preston
74a7e7d1b4 Fix non-intentional chats list search focus. 2024-04-23 19:13:46 +04:00
John Preston
a0a9de1d18 Cancel search on switching folders. 2024-04-23 19:13:46 +04:00
John Preston
360366ba9e Fix opening forums from recent peers. 2024-04-23 19:13:46 +04:00
John Preston
0180fe9468 Animate search suggestions. 2024-04-23 19:13:46 +04:00
John Preston
19f5d95a3c Implement keyboard navigation for recent peers. 2024-04-23 19:13:46 +04:00
John Preston
051ca51d3b Allow clearing search results. 2024-04-23 19:13:46 +04:00
John Preston
2a6ff9203b Implement basic recent search results. 2024-04-23 19:13:46 +04:00
John Preston
2e0529bd9a Add data component for RecentPeers. 2024-04-23 19:13:46 +04:00
John Preston
e24ab4f1ab Allow saving emoji to files in debug builds. 2024-04-23 19:13:46 +04:00
John Preston
3dbadeb232 Allow opening top peers in a new window. 2024-04-23 19:13:46 +04:00
John Preston
4cdd939028 Cache topPeers locally. 2024-04-23 19:13:46 +04:00
John Preston
c11f4efc5c Support disabling top peers completely. 2024-04-23 19:13:46 +04:00
John Preston
e1c21b908c Add keyboard navigation to top peers. 2024-04-23 19:13:46 +04:00
John Preston
a6c1def6fe Add ripples to top peers. 2024-04-23 19:13:46 +04:00
John Preston
19ae76d8de Top peers context menu. 2024-04-23 19:13:46 +04:00
John Preston
56e28feb00 Top peer realtime badges. 2024-04-23 19:13:45 +04:00
John Preston
b259c566b7 Top peer unread badges and online indicators. 2024-04-23 19:13:45 +04:00
John Preston
18598f8dca Initial version of top peers. 2024-04-23 19:13:45 +04:00
John Preston
11e4c45969 Don't collapse chats list on window unfocus. 2024-04-23 19:13:45 +04:00
John Preston
39658ffe52 Allow narrow chats width without main section. 2024-04-23 19:13:45 +04:00
John Preston
2f03b9aa29 Make dialogs filter onfocused by default. 2024-04-23 19:13:45 +04:00
John Preston
dc438cff23 Always export file_name in json. 2024-04-23 19:13:45 +04:00
John Preston
18f5521be5 Don't look for SDL when building on macOS. 2024-04-23 19:13:45 +04:00
Ilya Fedin
bae9af1076 Switch crash reporter to system fonts
This should prevent nested crashes when loading custom fonts
2024-04-23 11:01:19 +04:00
Ilya Fedin
8d2805f226 Set font weight in crash reporter 2024-04-23 10:10:43 +04:00
Ilya Fedin
0ad18c8182 Get rid of direct Wayland usage
This should get rid of a very nasty vector of misbehaving and quite a lot of code which is boilerplate over Wayland protocols at the price of losing support of niche features

Most of things served by xcb code on X11 is served by portal code on Wayland, hopefully this tendention will continue and we will be fine just with glib which provides D-Bus and other basic APIs
2024-04-22 11:04:02 +04:00
Ilya Fedin
9046b2cafb Stop using the plasma-shell protocol
Looks like this isn't really correct in combination with xdg-shell
2024-04-22 10:59:16 +04:00
Ilya Fedin
3d994b58a0 ShowXDPOpenWithDialog -> UnsafeShowOpenWith 2024-04-21 03:14:34 +04:00
Ilya Fedin
4310c4978e Fix macOS packaged action 2024-04-19 17:41:07 +04:00
23rd
01bfa46729 Fixed display of default box for message schedule in correspond window. 2024-04-18 11:57:25 +04:00
Kolya
3510ca7184 Don't use/link libsharpyuv in libavif 2024-04-18 09:23:15 +04:00
Ilya Fedin
8d7845daa1 Use --shallow-submodules in Docker 2024-04-18 09:13:37 +04:00
Ilya Fedin
cb5fdac0da Replace mozjpeg with jpegli on Linux 2024-04-17 23:45:15 +04:00
John Preston
78c8d0562b Version 4.16.8: Fix build on Linux. 2024-04-16 23:23:11 +04:00
John Preston
bb0280f096 Revert "Replace mozjpeg with jpegli in snap"
This reverts commit f57e2edf2a.
2024-04-16 23:22:55 +04:00
John Preston
566b53ce9f Revert "Clean remainings of mozjpeg in snapcraft.yml"
This reverts commit da1909cc1d.
2024-04-16 23:22:43 +04:00
John Preston
ec95db0945 Revert "Replace mozjpeg with jpegli in Docker"
This reverts commit a1e2e3d011.
2024-04-16 23:00:08 +04:00
John Preston
a0d7d07543 Version 4.16.8.
- Fix in-app playing of some video and audio files.
- Fix crash on Linux opening chats with custom backgrounds.
- Fix crash on quit after using scheduled messages.
2024-04-16 20:15:32 +04:00
John Preston
fe73bf9053 Fix ripples in channel comments buttons. 2024-04-16 20:14:04 +04:00
John Preston
49c9e08b6c Enforce video/audio extension by mime type. 2024-04-16 20:14:01 +04:00
John Preston
abcf55c498 Check chat background read result. 2024-04-16 20:13:55 +04:00
John Preston
849ce310c4 Jump by keyboard between time input fields. 2024-04-16 20:13:02 +04:00
John Preston
a3e593b747 Fix crash in scheduled messages tear-down. 2024-04-16 20:12:03 +04:00
23rd
5433f95eda Simplified creation of label with custom emoji. 2024-04-16 03:44:00 +03:00
23rd
0459196982 Moved out level meter widget to td_ui. 2024-04-16 03:43:39 +03:00
23rd
6f1457d30d Fixed phrase of placeholder for message edition mode. 2024-04-15 23:56:37 +03:00
23rd
ce596e29c4 Fixed opening message from media player widget in corresponding window. 2024-04-15 23:41:00 +03:00
23rd
86b9d16747 Added additional note for macOS keys to json of custom shortcuts. 2024-04-15 23:30:57 +03:00
John Preston
06911ae42a Version 4.16.7.
- Reimplement file open confirmations.
2024-04-15 17:56:45 +04:00
John Preston
af2cb9b757 Fix possible unhandled exception in highlighting. 2024-04-15 17:56:45 +04:00
John Preston
6a28cd1a35 Reimplement file open confirmations. 2024-04-15 12:07:27 +04:00
23rd
f4a09a9ca0 Fixed display of growth rate in statistics info for huge values. 2024-04-15 11:20:30 +04:00
23rd
a35f020f56 Moved out ScheduledMessages module to components submodule. 2024-04-15 11:20:30 +04:00
23rd
3d48111368 Moved out SponsoredMessages module to components submodule. 2024-04-15 11:20:30 +04:00
23rd
39ed7d7f4c Increased clickable area for each item in EditPeerHistoryVisibilityBox. 2024-04-15 11:20:30 +04:00
23rd
abe83ccb8f Moved inaccessible groups in box for user's own groups to sub-list.
Fixed #27729.
2024-04-15 11:20:30 +04:00
23rd
d1be7c1ff7 Simplified management of PasscodeBox within customCheckCallback. 2024-04-15 11:20:30 +04:00
23rd
1c223e570a Slightly improved code style for long equality expressions. 2024-04-15 11:20:30 +04:00
23rd
a37cbd7d05 Initially refactored statistics module to simplify value types changing. 2024-04-15 11:20:30 +04:00
23rd
7ffa9844e2 Fixed currency formatting for channel earn info section. 2024-04-15 11:20:30 +04:00
23rd
bdf5872f04 Fixed opening channel earn info section for admins. 2024-04-15 11:20:30 +04:00
Ilya Fedin
da1909cc1d Clean remainings of mozjpeg in snapcraft.yml 2024-04-15 10:11:54 +04:00
Ilya Fedin
a503197352 Remove XCBSetDesktopFileName
This is done by Qt nowadays
2024-04-15 10:11:30 +04:00
Nyan
d9d9a8f49d Update data_document_resolver.cpp
Added the LEXE and WLUA extensions to the IsExecutableName function for Windows. Those are registered by default on Windows devices with LUA installed
2024-04-13 23:45:03 +04:00
Ilya Fedin
f57e2edf2a Replace mozjpeg with jpegli in snap 2024-04-11 12:35:47 +04:00
Ilya Fedin
a1e2e3d011 Replace mozjpeg with jpegli in Docker 2024-04-11 12:35:47 +04:00
Ilya Fedin
5e546d1198 Update libjxl in Docker & snap 2024-04-11 12:35:47 +04:00
Ilya Fedin
90405f3ebc Install protobuf in Docker 2024-04-11 12:15:55 +04:00
Nyan
11b57ff7d3 Update data_document_resolver.cpp
The correct python zipapp extension on windows is pyzw, this typo could lead to executing code in the client device without proper warning
2024-04-11 11:24:15 +04:00
Ilya Fedin
fe06cd63ac Lock event loop 2024-04-09 20:48:47 +04:00
John Preston
6c9d5e1499 Improve clipboard QR code image logo quality. 2024-04-09 19:05:02 +04:00
John Preston
6ed910de9f Version 4.16.6.
- Show custom emoji preview on long press.
- Fix resume chat bot button disappearance.
- Fix GIF files playback. (regression in 4.16.3.beta)
2024-04-09 15:20:16 +04:00
John Preston
a506b8b25c Support t.me/username?text=.. links. 2024-04-09 15:20:10 +04:00
John Preston
170ebb57c6 Preview custom emoji on long press from the panel. 2024-04-09 12:11:07 +04:00
John Preston
29dd574e22 Fix toggling chatbot replying, fix saving. 2024-04-09 11:55:52 +04:00
John Preston
72770aa76d Add GIF parser to FFmpeg build.
Fixes #27722.
2024-04-09 11:29:19 +04:00
John Preston
7f1c319aee Add interactive mode to prepare script. 2024-04-09 11:29:16 +04:00
John Preston
60805bd916 Version 4.16.5.
- Fix editing privacy for groups and channels invitations.
- Possible fix for the network unresponsiveness after sleep.
- Possible fix for wide range of memory allocator crashes on Linux.
2024-04-08 22:31:07 +04:00
Ilya Fedin
10272ee0cf Revert "Replace jemalloc with scudo"
This reverts commit 960761ef37.
2024-04-08 21:57:25 +04:00
John Preston
7c44cda76e Fix premium users deselection in multi-select field. 2024-04-08 21:56:56 +04:00
John Preston
0152d2c48e Fix possible temp auth key bind freeze. 2024-04-08 21:56:56 +04:00
23rd
c5febce548 Moved out some functions for main menu to separated files. 2024-04-08 17:34:58 +03:00
23rd
129b07c2c0 Improved style of box for all of user's own groups and channels. 2024-04-08 17:02:52 +03:00
23rd
47bf099b88 Fixed updating of field placeholder in compose controls while editing. 2024-04-08 06:55:44 +03:00
23rd
94f1d23788 Fixed behavior to open section with scheduled messages at top. 2024-04-08 04:12:14 +03:00
Ilya Fedin
84ce72ec7a Fix a crash due to half-hidden media viewer 2024-04-07 14:28:51 +04:00
Ilya Fedin
3da8351522 Let Wayland to use QGuiApplication::screenAt (forgotten place) 2024-04-07 14:08:40 +04:00
Ilya Fedin
542153d950 Use nasm from repository 2024-04-07 11:20:46 +04:00
Ilya Fedin
090fdfb458 Add asan libraries to Docker image 2024-04-07 11:20:46 +04:00
John Preston
77835a43a5 Version 4.16.4: Update patches on Linux. 2024-04-07 11:19:23 +04:00
John Preston
1a2a1f1c17 Version 4.16.4.
- Bug fixes and other minor improvements.
2024-04-06 22:59:03 +04:00
John Preston
eaaa704fa4 Check the URL in IV like in attach bots. 2024-04-06 22:59:03 +04:00
John Preston
7803f8e670 Simplify escaping when parsing IV. 2024-04-06 22:59:03 +04:00
Sergey A. Osokin
f36e3c213e Fix build on FreeBSD 13.3 / llvm 17.0.6 / qt 5.15.13 2024-04-06 20:30:08 +04:00
John Preston
6fb1e23ed5 Fix file dialog filter for videos from attach menu. 2024-04-06 13:05:12 +04:00
John Preston
86d0c49e44 Add "Boost Group/Channel" button to chat menu. 2024-04-06 13:05:12 +04:00
John Preston
9251e6faba Use better title in boost box. 2024-04-06 13:05:12 +04:00
John Preston
8f8725e1af Beta version 4.16.3: Fix dav1d in FFmpeg on macOS. 2024-04-05 21:25:20 +04:00
John Preston
0ce6a4cbdb Beta version 4.16.3: Re-enable system proxy (Linux).
This reverts commit 1e6fb202f0.
2024-04-05 20:48:06 +04:00
John Preston
ad3f705f50 Beta version 4.16.3.
- Improve media upload speed.
- Update FFmpeg to 6.1.1.
2024-04-05 15:35:01 +04:00
John Preston
c5847caa91 Update FFmpeg to 6.1.1: Fix AV1 videos. 2024-04-05 14:42:29 +04:00
John Preston
8df6d9db7e Don't update server-time too frequently. 2024-04-05 09:51:20 +04:00
John Preston
a9c1970f41 Send up to 1MB of parts to a single session. 2024-04-05 09:51:20 +04:00
John Preston
c3f0d2ef31 Adaptive upload up to 8 sessions. 2024-04-05 09:51:20 +04:00
John Preston
0dcc439dda Allow upload requests for several files at once. 2024-04-05 09:51:20 +04:00
John Preston
5b0cac47ad Reapply "Use plain vector for prepared upload parts."
This reverts commit f6f8eefaa0.
2024-04-05 09:51:20 +04:00
John Preston
b39e78a4a9 Reapply "Remove SendMediaReady legacy helper."
This reverts commit 09f07a7a9d.
2024-04-05 09:51:20 +04:00
898 changed files with 44979 additions and 32469 deletions

6
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View File

@@ -1,32 +1,11 @@
name: No Response
name: Can't reproduce.
# Both `issue_comment` and `scheduled` event types are required for this Action
# to work properly.
on:
issue_comment:
types: [created]
schedule:
- cron: '0 0 * * *'
- cron: '0 3 * * *'
jobs:
waiting-for-answer:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/no-response@v0.5.0
with:
token: ${{ github.token }}
responseRequiredLabel: waiting for answer
needs-user-action:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/no-response@v0.5.0
with:
token: ${{ github.token }}
responseRequiredLabel: needs user action
cant-reproduce:
if: github.event_name != 'issue_comment'
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/no-response@v0.5.0

View File

@@ -20,7 +20,7 @@ jobs:
steps:
- name: Clone.
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4
with:
submodules: recursive
@@ -31,7 +31,7 @@ jobs:
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Free up some disk space.
uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
- name: Docker image build.
run: |

View File

@@ -49,7 +49,6 @@ jobs:
defines:
- ""
- "DESKTOP_APP_DISABLE_X11_INTEGRATION"
- "DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION"
env:
UPLOAD_ARTIFACT: "true"
@@ -59,7 +58,7 @@ jobs:
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Clone.
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
@@ -117,7 +116,7 @@ jobs:
cd $REPO_NAME/out/Debug
sudo mkdir artifact
sudo mv {Telegram,Updater} artifact/
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:

View File

@@ -8,7 +8,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
issue-inactive-days: 45

View File

@@ -56,7 +56,7 @@ jobs:
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Clone.
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
@@ -76,7 +76,7 @@ jobs:
- name: ThirdParty cache.
id: cache-third-party
uses: actions/cache@v3.0.11
uses: actions/cache@v4
with:
path: ThirdParty
key: ${{ runner.OS }}-third-party-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
@@ -84,7 +84,7 @@ jobs:
- name: Libraries cache.
id: cache-libs
uses: actions/cache@v3.0.11
uses: actions/cache@v4
with:
path: Libraries
key: ${{ runner.OS }}-libs-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
@@ -134,7 +134,7 @@ jobs:
mkdir artifact
mv Telegram.app artifact/
mv Updater artifact/
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:

View File

@@ -49,7 +49,7 @@ jobs:
env:
GIT: "https://github.com"
OPENALDIR: "/usr/local/opt/openal-soft"
CMAKE_PREFIX_PATH: "/usr/local/opt/ffmpeg@6:/usr/local/opt/openal-soft"
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
MANUAL_CACHING: "1"
@@ -60,7 +60,7 @@ jobs:
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Clone.
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
@@ -69,7 +69,7 @@ jobs:
run: |
brew update
brew upgrade || true
brew install autoconf automake boost cmake ffmpeg openal-soft openssl opus ninja pkg-config python qt yasm xz
brew install autoconf automake boost cmake ffmpeg@6 openal-soft openh264 openssl opus ninja pkg-config python qt yasm xz
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
xcodebuild -version > CACHE_KEY.txt
@@ -99,7 +99,7 @@ jobs:
- name: WebRTC cache.
id: cache-webrtc
uses: actions/cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.LibrariesPath }}/tg_owt
key: ${{ runner.OS }}-webrtc-${{ env.CACHE_KEY }}-${{ hashFiles('**/tg_owt-version.json') }}
@@ -108,7 +108,7 @@ jobs:
run: |
cd $LibrariesPath
git clone --recursive --depth=1 $GIT/desktop-app/tg_owt.git
git clone --depth=1 --recursive --shallow-submodules $GIT/desktop-app/tg_owt.git
cd tg_owt
cmake -B build . -GNinja -DCMAKE_BUILD_TYPE=Debug
@@ -153,7 +153,7 @@ jobs:
cd $REPO_NAME/build
mkdir artifact
mv Telegram.dmg artifact/
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:

View File

@@ -11,7 +11,7 @@ jobs:
SKIP: "0"
to_branch: "master"
steps:
- uses: actions/checkout@v4.1.0
- uses: actions/checkout@v4
with:
fetch-depth: 0
if: env.SKIP == '0'

16
.github/workflows/needs-user-action.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Needs user action.
on:
issue_comment:
types: [created]
schedule:
- cron: '0 2 * * *'
jobs:
needs-user-action:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/no-response@v0.5.0
with:
token: ${{ github.token }}
responseRequiredLabel: needs user action

View File

@@ -47,7 +47,7 @@ jobs:
steps:
- name: Clone.
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
@@ -61,10 +61,10 @@ jobs:
sudo snap run lxd waitready
- name: Free up some disk space.
uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
- name: Telegram Desktop snap build.
run: sg lxd -c 'snap run snapcraft -v'
run: sg lxd -c 'snap run snapcraft --verbosity=debug'
- name: Move artifact.
if: env.UPLOAD_ARTIFACT == 'true'
@@ -75,7 +75,7 @@ jobs:
mkdir artifact
mv $artifact_name artifact
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:

View File

@@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
- uses: actions/stale@v9
with:
stale-issue-message: |
Hey there!

View File

@@ -0,0 +1,16 @@
name: Waiting for answer.
on:
issue_comment:
types: [created]
schedule:
- cron: '30 0 * * *'
jobs:
waiting-for-answer:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/no-response@v0.5.0
with:
token: ${{ github.token }}
responseRequiredLabel: waiting for answer

View File

@@ -69,13 +69,13 @@ jobs:
shell: bash
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- uses: ilammy/msvc-dev-cmd@v1.12.0
- uses: ilammy/msvc-dev-cmd@v1.13.0
name: Native Tools Command Prompt.
with:
arch: ${{ matrix.arch }}
- name: Clone.
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ env.TBUILD }}\${{ env.REPO_NAME }}
@@ -96,7 +96,7 @@ jobs:
- name: Libraries cache.
id: cache-libs
uses: actions/cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.TBUILD }}\Libraries
key: ${{ runner.OS }}-${{ matrix.arch }}-libs-${{ env.CACHE_KEY }}
@@ -169,6 +169,8 @@ jobs:
%TDESKTOP_BUILD_GENERATOR% ^
%TDESKTOP_BUILD_ARCH% ^
%TDESKTOP_BUILD_API% ^
-D CMAKE_C_FLAGS="/WX" ^
-D CMAKE_CXX_FLAGS="/WX" ^
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF ^
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF ^
-D DESKTOP_APP_NO_PDB=ON ^
@@ -183,7 +185,7 @@ jobs:
mkdir artifact
move %OUT%\Telegram.exe artifact/
move %OUT%\Updater.exe artifact/
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
name: Upload artifact.
if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly')
with:

1
.gitignore vendored
View File

@@ -18,6 +18,7 @@ Release/
*.xcodeproj
ipch/
.vs/
.vscode/
/Telegram/log.txt
/Telegram/data

12
.gitmodules vendored
View File

@@ -76,15 +76,12 @@
[submodule "Telegram/lib_webview"]
path = Telegram/lib_webview
url = https://github.com/desktop-app/lib_webview.git
[submodule "Telegram/ThirdParty/jemalloc"]
path = Telegram/ThirdParty/jemalloc
url = https://github.com/jemalloc/jemalloc
[submodule "Telegram/ThirdParty/dispatch"]
path = Telegram/ThirdParty/dispatch
url = https://github.com/apple/swift-corelibs-libdispatch
[submodule "Telegram/ThirdParty/plasma-wayland-protocols"]
path = Telegram/ThirdParty/plasma-wayland-protocols
url = https://github.com/KDE/plasma-wayland-protocols.git
[submodule "Telegram/ThirdParty/wayland-protocols"]
path = Telegram/ThirdParty/wayland-protocols
url = https://github.com/gitlab-freedesktop-mirrors/wayland-protocols.git
[submodule "Telegram/ThirdParty/kimageformats"]
path = Telegram/ThirdParty/kimageformats
url = https://github.com/KDE/kimageformats.git
@@ -94,9 +91,6 @@
[submodule "Telegram/ThirdParty/cld3"]
path = Telegram/ThirdParty/cld3
url = https://github.com/google/cld3.git
[submodule "Telegram/ThirdParty/wayland"]
path = Telegram/ThirdParty/wayland
url = https://github.com/gitlab-freedesktop-mirrors/wayland.git
[submodule "Telegram/ThirdParty/libprisma"]
path = Telegram/ThirdParty/libprisma
url = https://github.com/desktop-app/libprisma.git

View File

@@ -57,14 +57,6 @@ include(cmake/validate_d3d_compiler.cmake)
include(cmake/target_prepare_qrc.cmake)
include(cmake/options.cmake)
if (NOT DESKTOP_APP_USE_PACKAGED)
if (WIN32)
set(qt_version 5.15.13)
elseif (APPLE)
set(qt_version 6.2.7)
endif()
endif()
include(cmake/external/qt/package.cmake)
set(desktop_app_skip_libs

View File

@@ -120,10 +120,13 @@ PRIVATE
api/api_common.h
api/api_confirm_phone.cpp
api/api_confirm_phone.h
api/api_credits.cpp
api/api_credits.h
api/api_earn.cpp
api/api_earn.h
api/api_editing.cpp
api/api_editing.h
api/api_filter_updates.h
api/api_global_privacy.cpp
api/api_global_privacy.h
api/api_hash.cpp
@@ -162,6 +165,10 @@ PRIVATE
api/api_single_message_search.h
api/api_statistics.cpp
api/api_statistics.h
api/api_statistics_data_deserialize.cpp
api/api_statistics_data_deserialize.h
api/api_statistics_sender.cpp
api/api_statistics_sender.h
api/api_text_entities.cpp
api/api_text_entities.h
api/api_toggling_media.cpp
@@ -265,6 +272,8 @@ PRIVATE
boxes/edit_caption_box.h
boxes/edit_privacy_box.cpp
boxes/edit_privacy_box.h
boxes/gift_credits_box.cpp
boxes/gift_credits_box.h
boxes/gift_premium_box.cpp
boxes/gift_premium_box.h
boxes/language_box.cpp
@@ -273,6 +282,8 @@ PRIVATE
boxes/local_storage_box.h
boxes/max_invite_box.cpp
boxes/max_invite_box.h
boxes/moderate_messages_box.cpp
boxes/moderate_messages_box.h
boxes/peer_list_box.cpp
boxes/peer_list_box.h
boxes/peer_list_controllers.cpp
@@ -297,6 +308,8 @@ PRIVATE
boxes/ringtones_box.h
boxes/self_destruction_box.cpp
boxes/self_destruction_box.h
boxes/send_credits_box.cpp
boxes/send_credits_box.h
boxes/send_files_box.cpp
boxes/send_files_box.h
boxes/sessions_box.cpp
@@ -439,6 +452,8 @@ PRIVATE
core/launcher.h
core/local_url_handlers.cpp
core/local_url_handlers.h
core/phone_click_handler.cpp
core/phone_click_handler.h
core/sandbox.cpp
core/sandbox.h
core/shortcuts.cpp
@@ -460,6 +475,18 @@ PRIVATE
data/business/data_business_info.h
data/business/data_shortcut_messages.cpp
data/business/data_shortcut_messages.h
data/components/factchecks.cpp
data/components/factchecks.h
data/components/location_pickers.cpp
data/components/location_pickers.h
data/components/recent_peers.cpp
data/components/recent_peers.h
data/components/scheduled_messages.cpp
data/components/scheduled_messages.h
data/components/sponsored_messages.cpp
data/components/sponsored_messages.h
data/components/top_peers.cpp
data/components/top_peers.h
data/notify/data_notify_settings.cpp
data/notify/data_notify_settings.h
data/notify/data_peer_notify_settings.cpp
@@ -529,6 +556,8 @@ PRIVATE
data/data_groups.h
data/data_histories.cpp
data/data_histories.h
data/data_history_messages.cpp
data/data_history_messages.h
data/data_lastseen_status.h
data/data_location.cpp
data/data_location.h
@@ -577,14 +606,10 @@ PRIVATE
data/data_send_action.h
data/data_session.cpp
data/data_session.h
data/data_scheduled_messages.cpp
data/data_scheduled_messages.h
data/data_shared_media.cpp
data/data_shared_media.h
data/data_sparse_ids.cpp
data/data_sparse_ids.h
data/data_sponsored_messages.cpp
data/data_sponsored_messages.h
data/data_statistics.h
data/data_stories.cpp
data/data_stories.h
@@ -608,6 +633,18 @@ PRIVATE
data/data_wall_paper.h
data/data_web_page.cpp
data/data_web_page.h
dialogs/ui/dialogs_layout.cpp
dialogs/ui/dialogs_layout.h
dialogs/ui/dialogs_message_view.cpp
dialogs/ui/dialogs_message_view.h
dialogs/ui/dialogs_stories_content.cpp
dialogs/ui/dialogs_stories_content.h
dialogs/ui/dialogs_suggestions.cpp
dialogs/ui/dialogs_suggestions.h
dialogs/ui/dialogs_topics_view.cpp
dialogs/ui/dialogs_topics_view.h
dialogs/ui/dialogs_video_userpic.cpp
dialogs/ui/dialogs_video_userpic.h
dialogs/dialogs_entry.cpp
dialogs/dialogs_entry.h
dialogs/dialogs_indexed_list.cpp
@@ -630,16 +667,6 @@ PRIVATE
dialogs/dialogs_search_tags.h
dialogs/dialogs_widget.cpp
dialogs/dialogs_widget.h
dialogs/ui/dialogs_layout.cpp
dialogs/ui/dialogs_layout.h
dialogs/ui/dialogs_message_view.cpp
dialogs/ui/dialogs_message_view.h
dialogs/ui/dialogs_stories_content.cpp
dialogs/ui/dialogs_stories_content.h
dialogs/ui/dialogs_topics_view.cpp
dialogs/ui/dialogs_topics_view.h
dialogs/ui/dialogs_video_userpic.cpp
dialogs/ui/dialogs_video_userpic.h
editor/color_picker.cpp
editor/color_picker.h
editor/controllers/controllers.h
@@ -680,6 +707,8 @@ PRIVATE
history/view/controls/compose_controls_common.h
history/view/controls/history_view_compose_controls.cpp
history/view/controls/history_view_compose_controls.h
history/view/controls/history_view_compose_media_edit_manager.cpp
history/view/controls/history_view_compose_media_edit_manager.h
history/view/controls/history_view_compose_search.cpp
history/view/controls/history_view_compose_search.h
history/view/controls/history_view_draft_options.cpp
@@ -702,8 +731,6 @@ PRIVATE
history/view/media/history_view_dice.h
history/view/media/history_view_document.cpp
history/view/media/history_view_document.h
history/view/media/history_view_extended_preview.cpp
history/view/media/history_view_extended_preview.h
history/view/media/history_view_file.cpp
history/view/media/history_view_file.h
history/view/media/history_view_game.cpp
@@ -771,6 +798,8 @@ PRIVATE
history/view/history_view_about_view.h
history/view/history_view_bottom_info.cpp
history/view/history_view_bottom_info.h
history/view/history_view_chat_preview.cpp
history/view/history_view_chat_preview.h
history/view/history_view_contact_status.cpp
history/view/history_view_contact_status.h
history/view/history_view_context_menu.cpp
@@ -785,6 +814,8 @@ PRIVATE
history/view/history_view_emoji_interactions.h
history/view/history_view_empty_list_bubble.cpp
history/view/history_view_empty_list_bubble.h
history/view/history_view_fake_items.cpp
history/view/history_view_fake_items.h
history/view/history_view_group_call_bar.cpp
history/view/history_view_group_call_bar.h
history/view/history_view_item_preview.h
@@ -815,14 +846,14 @@ PRIVATE
history/view/history_view_send_action.h
history/view/history_view_service_message.cpp
history/view/history_view_service_message.h
history/view/history_view_spoiler_click_handler.cpp
history/view/history_view_spoiler_click_handler.h
history/view/history_view_sponsored_click_handler.cpp
history/view/history_view_sponsored_click_handler.h
history/view/history_view_sticker_toast.cpp
history/view/history_view_sticker_toast.h
history/view/history_view_sublist_section.cpp
history/view/history_view_sublist_section.h
history/view/history_view_text_helper.cpp
history/view/history_view_text_helper.h
history/view/history_view_transcribe_button.cpp
history/view/history_view_transcribe_button.h
history/view/history_view_translate_bar.cpp
@@ -863,6 +894,10 @@ PRIVATE
history/history_view_highlight_manager.h
history/history_widget.cpp
history/history_widget.h
info/bot/earn/info_bot_earn_list.cpp
info/bot/earn/info_bot_earn_list.h
info/bot/earn/info_bot_earn_widget.cpp
info/bot/earn/info_bot_earn_widget.h
info/channel_statistics/boosts/create_giveaway_box.cpp
info/channel_statistics/boosts/create_giveaway_box.h
info/channel_statistics/boosts/giveaway/giveaway_list_controllers.cpp
@@ -871,10 +906,10 @@ PRIVATE
info/channel_statistics/boosts/info_boosts_inner_widget.h
info/channel_statistics/boosts/info_boosts_widget.cpp
info/channel_statistics/boosts/info_boosts_widget.h
info/channel_statistics/earn/info_earn_inner_widget.cpp
info/channel_statistics/earn/info_earn_inner_widget.h
info/channel_statistics/earn/info_earn_widget.cpp
info/channel_statistics/earn/info_earn_widget.h
info/channel_statistics/earn/info_channel_earn_list.cpp
info/channel_statistics/earn/info_channel_earn_list.h
info/channel_statistics/earn/info_channel_earn_widget.cpp
info/channel_statistics/earn/info_channel_earn_widget.h
info/common_groups/info_common_groups_inner_widget.cpp
info/common_groups/info_common_groups_inner_widget.h
info/common_groups/info_common_groups_widget.cpp
@@ -1199,11 +1234,8 @@ PRIVATE
payments/payments_checkout_process.h
payments/payments_form.cpp
payments/payments_form.h
platform/linux/linux_wayland_integration_dummy.cpp
platform/linux/linux_wayland_integration.cpp
platform/linux/linux_wayland_integration.h
platform/linux/linux_xdp_open_with_dialog.cpp
platform/linux/linux_xdp_open_with_dialog.h
payments/payments_non_panel_process.cpp
payments/payments_non_panel_process.h
platform/linux/file_utilities_linux.cpp
platform/linux/file_utilities_linux.h
platform/linux/launcher_linux.cpp
@@ -1349,6 +1381,10 @@ PRIVATE
settings/settings_codes.h
settings/settings_common_session.cpp
settings/settings_common_session.h
settings/settings_credits.cpp
settings/settings_credits.h
settings/settings_credits_graphics.cpp
settings/settings_credits_graphics.h
settings/settings_experimental.cpp
settings/settings_experimental.h
settings/settings_folders.cpp
@@ -1440,10 +1476,14 @@ PRIVATE
ui/chat/choose_send_as.h
ui/chat/choose_theme_controller.cpp
ui/chat/choose_theme_controller.h
ui/controls/location_picker.cpp
ui/controls/location_picker.h
ui/controls/silent_toggle.cpp
ui/controls/silent_toggle.h
ui/controls/userpic_button.cpp
ui/controls/userpic_button.h
ui/effects/credits_graphics.cpp
ui/effects/credits_graphics.h
ui/effects/emoji_fly_animation.cpp
ui/effects/emoji_fly_animation.h
ui/effects/message_sending_animation_common.h
@@ -1459,8 +1499,10 @@ PRIVATE
ui/image/image_location.h
ui/image/image_location_factory.cpp
ui/image/image_location_factory.h
ui/widgets/level_meter.cpp
ui/widgets/level_meter.h
ui/text/format_song_document_name.cpp
ui/text/format_song_document_name.h
ui/widgets/label_with_custom_emoji.cpp
ui/widgets/label_with_custom_emoji.h
ui/countryinput.cpp
ui/countryinput.h
ui/dynamic_thumbnails.cpp
@@ -1474,8 +1516,6 @@ PRIVATE
ui/resize_area.h
ui/search_field_controller.cpp
ui/search_field_controller.h
ui/text/format_song_document_name.cpp
ui/text/format_song_document_name.h
ui/unread_badge.cpp
ui/unread_badge.h
window/main_window.cpp
@@ -1491,6 +1531,8 @@ PRIVATE
window/section_widget.h
window/window_adaptive.cpp
window/window_adaptive.h
window/window_chat_preview.cpp
window/window_chat_preview.h
window/window_connecting_widget.cpp
window/window_connecting_widget.h
window/window_controller.cpp
@@ -1503,11 +1545,15 @@ PRIVATE
window/window_lock_widgets.h
window/window_main_menu.cpp
window/window_main_menu.h
window/window_main_menu_helpers.cpp
window/window_main_menu_helpers.h
window/window_media_preview.cpp
window/window_media_preview.h
window/window_peer_menu.cpp
window/window_peer_menu.h
window/window_section_common.h
window/window_separate_id.cpp
window/window_separate_id.h
window/window_session_controller.cpp
window/window_session_controller.h
window/window_session_controller_link_info.h
@@ -1554,16 +1600,6 @@ if (NOT build_winstore)
)
endif()
if (DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
remove_target_sources(Telegram ${src_loc}
platform/linux/linux_wayland_integration.cpp
)
else()
remove_target_sources(Telegram ${src_loc}
platform/linux/linux_wayland_integration_dummy.cpp
)
endif()
if (DESKTOP_APP_USE_PACKAGED)
remove_target_sources(Telegram ${src_loc}
platform/mac/mac_iconv_helper.c
@@ -1584,6 +1620,7 @@ PRIVATE
qrc/telegram/animations.qrc
qrc/telegram/export.qrc
qrc/telegram/iv.qrc
qrc/telegram/picker.qrc
qrc/telegram/telegram.qrc
qrc/telegram/sounds.qrc
winrc/Telegram.rc
@@ -1701,19 +1738,6 @@ else()
desktop-app::external_xcb
)
endif()
if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
qt_generate_wayland_protocol_client_sources(Telegram
FILES
${third_party_loc}/wayland/protocol/wayland.xml
${third_party_loc}/plasma-wayland-protocols/src/protocols/plasma-shell.xml
)
target_link_libraries(Telegram
PRIVATE
desktop-app::external_wayland_client
)
endif()
endif()
if (build_macstore)
@@ -1820,12 +1844,49 @@ if (WIN32)
/DELAYLOAD:uxtheme.dll
/DELAYLOAD:crypt32.dll
/DELAYLOAD:bcrypt.dll
/DELAYLOAD:imm32.dll
/DELAYLOAD:netapi32.dll
/DELAYLOAD:imm32.dll
/DELAYLOAD:userenv.dll
/DELAYLOAD:wtsapi32.dll
/DELAYLOAD:propsys.dll
)
if (QT_VERSION GREATER 6)
if (NOT build_winarm)
target_link_options(Telegram PRIVATE
/DELAYLOAD:API-MS-Win-EventLog-Legacy-l1-1-0.dll
)
endif()
target_link_options(Telegram
PRIVATE
/DELAYLOAD:API-MS-Win-Core-Console-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Core-Fibers-l2-1-0.dll
/DELAYLOAD:API-MS-Win-Core-Fibers-l2-1-1.dll
/DELAYLOAD:API-MS-Win-Core-File-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Core-LibraryLoader-l1-2-0.dll
/DELAYLOAD:API-MS-Win-Core-Localization-l1-2-0.dll
/DELAYLOAD:API-MS-Win-Core-Memory-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Core-Memory-l1-1-1.dll
/DELAYLOAD:API-MS-Win-Core-ProcessThreads-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Core-Synch-l1-2-0.dll # Synchronization.lib
/DELAYLOAD:API-MS-Win-Core-SysInfo-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Core-Timezone-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Core-WinRT-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Core-WinRT-Error-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Core-WinRT-String-l1-1-0.dll
/DELAYLOAD:API-MS-Win-Security-CryptoAPI-l1-1-0.dll
# /DELAYLOAD:API-MS-Win-Shcore-Scaling-l1-1-1.dll # We shadowed GetDpiForMonitor
/DELAYLOAD:authz.dll # Authz.lib
/DELAYLOAD:comdlg32.dll
/DELAYLOAD:dwrite.dll # DWrite.lib
/DELAYLOAD:dxgi.dll # DXGI.lib
/DELAYLOAD:d3d9.dll # D3D9.lib
/DELAYLOAD:d3d11.dll # D3D11.lib
/DELAYLOAD:d3d12.dll # D3D12.lib
/DELAYLOAD:setupapi.dll # SetupAPI.lib
/DELAYLOAD:winhttp.dll
)
endif()
endif()
target_prepare_qrc(Telegram)

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -134,9 +134,32 @@ html.custom_scroll ::-webkit-scrollbar-thumb:hover {
.page-slide {
position: relative;
width: 100%;
min-height: 100%;
margin-left: 0%;
transition: margin 240ms ease-in-out;
}
.page-footer {
height: 32px;
margin-top: -32px;
background: var(--td-window-bg-over);
}
.page-footer .content {
padding: 3px 18px;
font-size: 15px;
color: var(--td-window-sub-text-fg);
text-align: center;
}
.page-footer .wrong {
position: relative;
padding: 5px;
margin: -5px;
color: var(--td-window-sub-text-fg);
text-decoration: none;
cursor: pointer;
}
.page-footer .wrong:hover {
text-decoration: underline;
}
.hidden-left,
.hidden-right {
pointer-events: none;
@@ -148,7 +171,7 @@ html.custom_scroll ::-webkit-scrollbar-thumb:hover {
margin-left: 100%;
}
article {
padding-bottom: 12px;
padding-bottom: 40px;
overflow-y: hidden;
overflow-x: auto;
white-space: pre-wrap;
@@ -893,6 +916,9 @@ section.related a.related-link:after {
right: 0;
bottom: 0;
}
section.related a.related-link:last-child:after {
border-bottom: 0px;
}
section.related .related-link-url {
display: block;
font-size: 15px;
@@ -1027,6 +1053,9 @@ section.channel > a > h4 {
display: block;
margin: 0 auto;
}
.media-outer {
margin-bottom: 16px;
}
.photo-wrap,
.video-wrap {
width: 100%;

View File

@@ -26,7 +26,7 @@ var IV = {
}
target = target.parentNode;
}
if (!target || !target.hasAttribute('href')) {
if (!target || (context === '' && !target.hasAttribute('href'))) {
return;
}
var base = document.createElement('A');
@@ -413,9 +413,12 @@ var IV = {
var article = function (el) {
return el.getElementsByTagName('article')[0];
};
var from = article(IV.findPageScroll());
var to = article(IV.makeScrolledContent(data.html));
morphdom(from, to, {
var footer = function (el) {
return el.getElementsByClassName('page-footer')[0];
};
var from = IV.findPageScroll();
var to = IV.makeScrolledContent(data.html);
morphdom(article(from), article(to), {
onBeforeElUpdated: function (fromEl, toEl) {
if (fromEl.classList.contains('video')
&& toEl.classList.contains('video')
@@ -439,6 +442,7 @@ var IV = {
return !fromEl.isEqualNode(toEl);
}
});
morphdom(footer(from), footer(to));
IV.initMedia();
eval(data.js);
},
@@ -477,9 +481,7 @@ var IV = {
var result = document.createElement('div');
result.className = 'page-scroll';
result.tabIndex = '-1';
result.innerHTML = '<div class="page-slide"><article>'
+ html
+ '</article></div>';
result.innerHTML = html.trim();
result.onscroll = IV.frameScrolled;
return result;
},
@@ -616,9 +618,6 @@ var IV = {
element.getAnimations().forEach(
(animation) => animation.finish());
},
back: function () {
window.history.back();
},
menuShown: function (shown) {
var already = document.getElementById('menu_page_blocker');
if (already && shown) {

View File

@@ -251,6 +251,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_caption_limit2#other" = "Make the caption shorter or subscribe to **Telegram Premium** to double the limit to **{count}** characters.";
"lng_caption_limit_reached#one" = "You've reached the media caption limit. Please make the caption shorter by {count} character.";
"lng_caption_limit_reached#other" = "You've reached the media caption limit. Please make the caption shorter by {count} characters.";
"lng_caption_move_up" = "Move Caption Up";
"lng_caption_move_down" = "Move Caption Down";
"lng_file_size_limit_title" = "File Too Large";
"lng_file_size_limit#one" = "{count} Gb";
@@ -302,6 +304,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_sure_ban_admin" = "This user is an admin. Are you sure you want to go ahead and restrict them?";
"lng_sure_enable_socks" = "Are you sure you want to enable this proxy?\n\nServer: {server}\nPort: {port}\n\nYou can change your proxy server later in the Settings (Connection Type).";
"lng_sure_enable" = "Enable";
"lng_proxy_box_title" = "Enable proxy";
"lng_proxy_box_server" = "Server";
"lng_proxy_box_port" = "Port";
"lng_proxy_box_secret" = "Secret";
"lng_proxy_box_status" = "Status";
"lng_proxy_box_username" = "Username";
"lng_proxy_box_password" = "Password";
"lng_proxy_invalid" = "The proxy link is invalid.";
"lng_proxy_unsupported" = "Your Telegram Desktop version doesn't support this proxy type or the proxy link is invalid. Please update Telegram Desktop to the latest version.";
@@ -309,7 +318,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_edit_limit_reached#one" = "You've reached the message text limit. Please make the text shorter by {count} character.";
"lng_edit_limit_reached#other" = "You've reached the message text limit. Please make the text shorter by {count} characters.";
"lng_edit_message" = "Edit message";
"lng_edit_message_text" = "New message text...";
"lng_edit_message_text" = "Caption";
"lng_deleted" = "Deleted Account";
"lng_deleted_message" = "Deleted message";
"lng_deleted_story" = "Deleted story";
@@ -561,6 +570,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_reaction_invoice" = "{reaction} to your invoice";
"lng_reaction_gif" = "{reaction} to your GIF";
"lng_effect_add_title" = "Add an animated effect";
"lng_effect_stickers_title" = "Effects from stickers";
"lng_effect_send" = "Send with Effect";
"lng_effect_none" = "No effects found.";
"lng_effect_premium" = "Subscribe to {link} to add this animated effect.";
"lng_effect_premium_link" = "Telegram Premium";
"lng_languages" = "Languages";
"lng_languages_none" = "No languages found.";
"lng_languages_count#one" = "{count} language";
@@ -667,6 +683,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_privacy_premium_link" = "Telegram Premium";
"lng_settings_passcode_disable" = "Disable Passcode";
"lng_settings_passcode_disable_sure" = "Are you sure you want to disable passcode?";
"lng_settings_use_winhello" = "Unlock with Windows Hello";
"lng_settings_use_winhello_about" = "You need to enter your passcode once before unlocking Telegram with Windows Hello.";
"lng_settings_use_touchid" = "Unlock with Touch ID";
"lng_settings_use_touchid_about" = "You need to enter your passcode once before unlocking Telegram with Touch ID.";
"lng_settings_use_applewatch" = "Unlock with Apple Watch";
"lng_settings_use_applewatch_about" = "You need to enter your passcode once before unlocking Telegram with Apple Watch.";
"lng_settings_use_systempwd" = "Unlock with System Password";
"lng_settings_use_systempwd_about" = "You need to enter your passcode once before unlocking Telegram with System Password.";
"lng_settings_password_disable" = "Disable Cloud Password";
"lng_settings_password_abort" = "Abort two-step verification setup";
"lng_settings_about_bio" = "Any details such as age, occupation or city.\nExample: 23 y.o. designer from San Francisco";
@@ -730,10 +754,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_angle_backend_d3d11on12" = "D3D11on12";
"lng_settings_angle_backend_opengl" = "OpenGL";
"lng_settings_angle_backend_disabled" = "Disabled";
"lng_settings_top_peers_title" = "Frequent contacts";
"lng_settings_top_peers_suggest" = "Suggest frequent contacts";
"lng_settings_top_peers_about" = "Display people you message frequently at the top of the search section for quick access.";
"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_security_bots" = "Bots and websites";
"lng_settings_file_confirmations" = "File open confirmations";
"lng_settings_edit_extensions" = "Extensions whitelist";
"lng_settings_edit_extensions_about" = "Open files with the following extensions without additional confirmation.";
"lng_settings_edit_ip_confirm" = "IP reveal warning";
"lng_settings_edit_ip_confirm_about" = "Show confirmation when opening files that may reveal your IP address.";
"lng_settings_clear_payment_info" = "Clear Payment and Shipping Info";
"lng_settings_logged_in" = "Connected websites";
"lng_settings_logged_in_title" = "Logged in with Telegram";
@@ -761,6 +793,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_power_chat" = "Animations in Chats";
"lng_settings_power_chat_background" = "Background rotation";
"lng_settings_power_chat_spoiler" = "Animated spoiler effect";
"lng_settings_power_chat_effects" = "Effects in messages";
"lng_settings_power_calls" = "Animations in Calls";
"lng_settings_power_ui" = "Interface animations";
"lng_settings_power_auto" = "Save Power on Low Battery";
@@ -835,6 +868,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_auto_night_mode_on" = "System";
"lng_settings_auto_night_warning" = "You have enabled auto-night mode. If you want to change the dark mode settings, you'll need to disable it first.";
"lng_settings_auto_night_disable" = "Disable";
"lng_settings_font_family" = "Font family";
"lng_settings_color_title" = "Color preview";
"lng_settings_color_reply" = "Reply to your message";
@@ -871,6 +905,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_gift_premium_users_confirm" = "Proceed";
"lng_settings_gift_premium_users_error#one" = "You can select maximum {count} user.";
"lng_settings_gift_premium_users_error#other" = "You can select maximum {count} users.";
"lng_settings_gift_premium_choose" = "Please choose at least one recipient.";
"lng_backgrounds_header" = "Choose Wallpaper";
"lng_theme_sure_keep" = "Keep this theme?";
@@ -965,6 +1000,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_passcode_ph" = "Your passcode";
"lng_passcode_submit" = "Submit";
"lng_passcode_logout" = "Log out";
"lng_passcode_winhello" = "You need to enter your passcode\nbefore you can use Windows Hello.";
"lng_passcode_touchid" = "You need to enter your passcode\nbefore you can use Touch ID.";
"lng_passcode_applewatch" = "You need to enter your passcode\nbefore you can use Watch to unlock.";
"lng_passcode_systempwd" = "You need to enter your passcode\nbefore you can use system password.";
"lng_passcode_winhello_unlock" = "Telegram wants to unlock with Windows Hello.";
"lng_passcode_touchid_unlock" = "unlock";
"lng_passcode_create_button" = "Save Passcode";
"lng_passcode_check_button" = "Submit";
"lng_passcode_change_button" = "Save Passcode";
@@ -1044,6 +1085,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_proxy_sponsor" = "Proxy sponsor";
"lng_proxy_sponsor_about" = "This channel is shown by your proxy server.\nTo remove this channel from your chats list,\ndisable the proxy in Telegram Settings.";
"lng_proxy_sponsor_warning" = "This proxy may display a sponsored channel in your chat list. This doesn't reveal any of your Telegram traffic.";
"lng_proxy_add_from_clipboard" = "Add proxy from clipboard";
"lng_proxy_add_from_clipboard_good_toast" = "Proxy was added from clipboard.";
"lng_proxy_add_from_clipboard_failed_toast" = "This is not a proxy link.";
"lng_proxy_add_from_clipboard_existing_toast" = "This proxy is already in the list.";
"lng_badge_psa_default" = "PSA";
"lng_about_psa_default" = "This message provides you with a public service announcement. To remove it from your chats list, right click it and select **Hide**.";
"lng_tooltip_psa_default" = "This message provides you with a public service announcement.";
@@ -1070,6 +1115,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_faq" = "Telegram FAQ";
"lng_settings_faq_link" = "https://telegram.org/faq#general-questions";
"lng_settings_features" = "Telegram Features";
"lng_settings_credits" = "Your Stars";
"lng_settings_logout" = "Log Out";
"lng_sure_logout" = "Are you sure you want to log out?";
@@ -1402,6 +1448,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_info_topic_title" = "Topic Info";
"lng_profile_enable_notifications" = "Notifications";
"lng_profile_send_message" = "Send Message";
"lng_profile_open_app" = "Open App";
"lng_profile_open_app_about" = "By launching this mini app, you agree to the {terms}.";
"lng_profile_open_app_terms" = "Terms of Service for Mini Apps";
"lng_info_add_as_contact" = "Add to contacts";
"lng_profile_shared_media" = "Shared media";
"lng_profile_suggest_photo" = "Suggest Profile Photo";
@@ -1487,6 +1536,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_manage_peer_reactions_none_about" = "Members of the group can't add any reactions to messages.";
"lng_manage_peer_reactions_some_title" = "Only allow these reactions";
"lng_manage_peer_reactions_available" = "Available reactions";
"lng_manage_peer_reactions_available_ph" = "Add reactions...";
"lng_manage_peer_reactions_own" = "You can also {link} emoji packs and use them as reactions.";
"lng_manage_peer_reactions_own_link" = "create your own";
"lng_manage_peer_reactions_level#one" = "Your channel needs to reach level **{count}** to use **{same_count}** custom reaction.";
@@ -1495,6 +1545,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_manage_peer_reactions_boost_link" = "here";
"lng_manage_peer_reactions_limit" = "Channels can't have more custom reactions.";
"lng_manage_peer_reactions_max_title" = "Maximum number of reactions";
"lng_manage_peer_reactions_max_slider#one" = "{count} reaction per post";
"lng_manage_peer_reactions_max_slider#other" = "{count} reactions per post";
"lng_manage_peer_reactions_max_about" = "Limit the number of different reactions that can be added to a post, including already published ones.";
"lng_manage_peer_antispam" = "Aggressive Anti-Spam";
"lng_manage_peer_antispam_about" = "Telegram will filter more spam but may occasionally affect ordinary messages. You can report False Positives in Recent Actions.";
"lng_manage_peer_antispam_not_enough#one" = "Aggressive filtering can be enabled only in groups with more than **{count} member**.";
@@ -1507,8 +1562,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_manage_peer_link_invite" = "Invite link";
"lng_manage_peer_link_expired" = "Expired link";
"lng_manage_private_group_title" = "Private";
"lng_manage_private_group_noforwards_title" = "Private restricted";
"lng_manage_public_group_title" = "Public";
"lng_manage_private_peer_title" = "Private";
"lng_manage_private_peer_noforwards_title" = "Private restricted";
"lng_manage_public_peer_title" = "Public";
"lng_manage_peer_send_title" = "Who can send new messages?";
"lng_manage_peer_send_only_members" = "Only members";
@@ -1522,6 +1579,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_manage_peer_bot_public_link" = "Public Link";
"lng_manage_peer_bot_public_links" = "Public Links";
"lng_manage_peer_bot_balance" = "Balance";
"lng_manage_peer_bot_edit_intro" = "Edit Intro";
"lng_manage_peer_bot_edit_commands" = "Edit Commands";
"lng_manage_peer_bot_edit_settings" = "Change Bot Settings";
@@ -1790,6 +1848,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_action_webview_data_done" = "You have just successfully transferred data from the «{text}» button to the bot.";
"lng_action_gift_received" = "{user} sent you a gift for {cost}";
"lng_action_gift_received_me" = "You sent to {user} a gift for {cost}";
"lng_action_gift_received_anonymous" = "Unknown user sent you a gift for {cost}";
"lng_action_suggested_photo_me" = "You suggested {user} to use this profile photo.";
"lng_action_suggested_photo" = "{user} suggests you to use this profile photo.";
"lng_action_suggested_photo_button" = "View Photo";
@@ -1834,6 +1893,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_action_boost_apply#one" = "{from} boosted the group";
"lng_action_boost_apply#other" = "{from} boosted the group {count} times";
"lng_action_set_chat_intro" = "{from} added the message below for all empty chats. How?";
"lng_action_payment_refunded" = "{peer} refunded back {amount}";
"lng_similar_channels_title" = "Similar channels";
"lng_similar_channels_view_all" = "View all";
@@ -2147,6 +2207,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_premium_summary_about_translation" = "Real-time translation of channels and chats into other languages.";
"lng_premium_summary_subtitle_business" = "Telegram Business";
"lng_premium_summary_about_business" = "Upgrade your account with business features such as location, opening hours and quick replies.";
"lng_premium_summary_subtitle_effects" = "Message Effects";
"lng_premium_summary_about_effects" = "Add over 500 animated effects to private messages.";
"lng_premium_summary_bottom_subtitle" = "About Telegram Premium";
"lng_premium_summary_bottom_about" = "While the free version of Telegram already gives its users more than any other messaging application, **Telegram Premium** pushes its capabilities even further.\n\n**Telegram Premium** is a paid option, because most Premium Features require additional expenses from Telegram to third parties such as data center providers and server manufacturers. Contributions from **Telegram Premium** users allow us to cover such costs and also help Telegram stay free for everyone.";
"lng_premium_summary_button" = "Subscribe for {cost} per month";
@@ -2264,10 +2326,83 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_business_about_chat_intro" = "Customize the message people see before they start a chat with you.";
"lng_business_subtitle_chat_links" = "Links to Chat";
"lng_business_about_chat_links" = "Create links that start a chat with you, suggesting the first message.";
"lng_business_subtitle_sponsored" = "Ads in Channels";
"lng_business_button_sponsored" = "Do Not Hide Ads";
"lng_business_about_sponsored" = "As a Premium subscriber, you dont see any ads on Telegram, but you can turn them on, for example, to view your own ads that you launched on the {link}";
"lng_business_about_sponsored_link" = "Telegram Ad Platform {emoji}";
"lng_business_about_sponsored_url" = "https://ads.telegram.org";
"lng_credits_summary_title" = "Telegram Stars";
"lng_credits_summary_about" = "Buy Stars to unlock content and services in miniapps on Telegram.";
"lng_credits_summary_options_subtitle" = "Choose package";
"lng_credits_summary_options_credits#one" = "{count} Star";
"lng_credits_summary_options_credits#other" = "{count} Stars";
"lng_credits_summary_options_more" = "More Options";
"lng_credits_summary_options_about" = "By proceeding and purchasing Stars, you agree with the {link}.";
"lng_credits_summary_options_about_link" = "Terms and Conditions";
"lng_credits_summary_options_about_url" = "https://telegram.org/tos/stars";
"lng_credits_summary_history_tab_full" = "All Transactions";
"lng_credits_summary_history_tab_in" = "Incoming";
"lng_credits_summary_history_tab_out" = "Outgoing";
"lng_credits_summary_history_entry_inner_in" = "In-App Purchase";
"lng_credits_summary_balance" = "Balance";
"lng_credits_gift_button" = "Gift Stars to Friends";
"lng_credits_box_out_title" = "Confirm Your Purchase";
"lng_credits_box_out_sure#one" = "Do you want to buy **\"{text}\"** in **{bot}** for **{count} Star**?";
"lng_credits_box_out_sure#other" = "Do you want to buy **\"{text}\"** in **{bot}** for **{count} Stars**?";
"lng_credits_box_out_media#one" = "Do you want to unlock {media} in {chat} for **{count} Star**?";
"lng_credits_box_out_media#other" = "Do you want to unlock {media} in {chat} for **{count} Stars**?";
"lng_credits_box_out_photo" = "a photo";
"lng_credits_box_out_photos#one" = "{count} photo";
"lng_credits_box_out_photos#other" = "{count} photos";
"lng_credits_box_out_video" = "a video";
"lng_credits_box_out_videos#one" = "{count} video";
"lng_credits_box_out_videos#other" = "{count} videos";
"lng_credits_box_out_both" = "{photo} and {video}";
"lng_credits_box_out_confirm#one" = "Confirm and Pay {emoji} {count} Star";
"lng_credits_box_out_confirm#other" = "Confirm and Pay {emoji} {count} Stars";
"lng_credits_box_out_about" = "Review the {link} for Stars.";
"lng_credits_box_out_about_link" = "https://telegram.org/tos/stars";
"lng_credits_media_done_title" = "Media Unlocked";
"lng_credits_media_done_text#one" = "**{count} Star** transferred to {chat}.";
"lng_credits_media_done_text#other" = "**{count} Stars** transferred to {chat}.";
"lng_credits_summary_in_toast_title" = "Stars Acquired";
"lng_credits_summary_in_toast_about#one" = "**{count}** Star added to your balance.";
"lng_credits_summary_in_toast_about#other" = "**{count}** Stars added to your balance.";
"lng_credits_box_history_entry_peer" = "Recipient";
"lng_credits_box_history_entry_peer_in" = "From";
"lng_credits_box_history_entry_via" = "Via";
"lng_credits_box_history_entry_play_market" = "Play Market";
"lng_credits_box_history_entry_app_store" = "App Store";
"lng_credits_box_history_entry_fragment" = "Fragment";
"lng_credits_box_history_entry_anonymous" = "Unknown User";
"lng_credits_box_history_entry_gift_name" = "Received Gift";
"lng_credits_box_history_entry_gift_sent" = "Sent Gift";
"lng_credits_box_history_entry_gift_out_about" = "With Stars, **{user}** will be able to unlock content and services on Telegram.\n{link}";
"lng_credits_box_history_entry_gift_in_about" = "Use Stars to unlock content and services on Telegram. {link}";
"lng_credits_box_history_entry_gift_about_link" = "See Examples {emoji}";
"lng_credits_box_history_entry_gift_about_url" = "https://telegram.org/blog/telegram-stars";
"lng_credits_box_history_entry_ads" = "Ads Platform";
"lng_credits_box_history_entry_premium_bot" = "Stars Top-Up";
"lng_credits_box_history_entry_via_premium_bot" = "Premium Bot";
"lng_credits_box_history_entry_id" = "Transaction ID";
"lng_credits_box_history_entry_id_copied" = "Transaction ID copied to clipboard.";
"lng_credits_box_history_entry_success_date" = "Transaction date";
"lng_credits_box_history_entry_success_url" = "Transaction link";
"lng_credits_box_history_entry_media" = "Media";
"lng_credits_box_history_entry_about" = "You can dispute this transaction {link}.";
"lng_credits_box_history_entry_about_link" = "here";
"lng_credits_small_balance_title#one" = "{count} Star Needed";
"lng_credits_small_balance_title#other" = "{count} Stars Needed";
"lng_credits_small_balance_about" = "Buy **Stars** and use them on **{bot}** and other miniapps.";
"lng_credits_purchase_blocked" = "Sorry, you can't purchase this item with Telegram Stars.";
"lng_credits_gift_title" = "Gift Telegram Stars";
"lng_location_title" = "Location";
"lng_location_about" = "Display the location of your business on your account.";
"lng_location_address" = "Enter Address";
"lng_location_set_map" = "Set Location on Map";
"lng_location_fallback" = "You can set your location on the map from your mobile device.";
"lng_hours_title" = "Business Hours";
@@ -2696,12 +2831,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_prizes_badge" = "x{amount}";
"lng_prizes_results_title" = "Winners Selected!";
"lng_prizes_results_title_one" = "Winner Selected!";
"lng_prizes_results_about#one" = "**{count}** winner of the {link} was randomly selected by Telegram.";
"lng_prizes_results_about#other" = "**{count}** winners of the {link} were randomly selected by Telegram.";
"lng_prizes_results_link" = "Giveaway";
"lng_prizes_results_winner" = "Winner";
"lng_prizes_results_winners" = "Winners";
"lng_prizes_results_more#one" = "and {count} more!";
"lng_prizes_results_more#other" = "and {count} more!";
"lng_prizes_results_one" = "The winner received their gift link in a private message.";
"lng_prizes_results_all" = "All winners received gift links in private messages.";
"lng_prizes_results_some" = "Some winners couldn't be selected.";
@@ -2731,6 +2869,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_gift_link_pending_toast" = "Only the recipient can see the link.";
"lng_gift_link_pending_footer" = "This link hasn't been activated yet.";
"lng_gift_stars_title#one" = "{count} Star";
"lng_gift_stars_title#other" = "{count} Stars";
"lng_gift_stars_outgoing" = "With Stars, {user} will be able to unlock content and services on Telegram.";
"lng_gift_stars_incoming" = "Use Stars to unlock content and services on Telegram.";
"lng_accounts_limit_title" = "Limit Reached";
"lng_accounts_limit1#one" = "You have reached the limit of **{count}** connected accounts.";
"lng_accounts_limit1#other" = "You have reached the limit of **{count}** connected accounts.";
@@ -2806,6 +2949,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_masks_has_been_archived" = "Mask pack has been archived.";
"lng_masks_installed" = "Mask pack has been installed.";
"lng_emoji_nothing_found" = "No emoji found";
"lng_stickers_context_reorder" = "Reorder";
"lng_stickers_context_edit_name" = "Edit name";
"lng_stickers_context_delete" = "Delete sticker";
"lng_stickers_context_delete_sure" = "Are you sure you want to delete the sticker from your sticker set?";
"lng_stickers_box_edit_name_title" = "Edit Sticker Set Name";
"lng_stickers_box_edit_name_about" = "Choose a name for your set.";
"lng_stickers_creator_badge" = "edit";
"lng_in_dlg_photo" = "Photo";
"lng_in_dlg_album" = "Album";
@@ -2834,7 +2984,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_in_dlg_audio_count#other" = "{count} audio";
"lng_ban_user" = "Ban User";
"lng_ban_users" = "Ban users";
"lng_restrict_users" = "Restrict users";
"lng_delete_all_from_user" = "Delete all from {user}";
"lng_delete_all_from_users" = "Delete all from users";
"lng_restrict_user_part" = "Partially restrict this user {emoji}";
"lng_restrict_users_part" = "Partially restrict users {emoji}";
"lng_restrict_user_full" = "Fully ban this user {emoji}";
"lng_restrict_users_full" = "Fully ban users {emoji}";
"lng_restrict_users_part_single_header" = "What can this user do?";
"lng_restrict_users_part_header#one" = "What can {count} selected user do?";
"lng_restrict_users_part_header#other" = "What can {count} selected users do?";
"lng_report_spam" = "Report Spam";
"lng_report_spam_and_leave" = "Report spam and leave";
"lng_report_spam_done" = "Thank you for your report.";
@@ -3027,6 +3187,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_bot_close_warning_sure" = "Close anyway";
"lng_bot_add_to_side_menu" = "{bot} asks your permission to be added as an option to your main menu so you can access it any time.";
"lng_bot_add_to_side_menu_done" = "Bot added to the main menu.";
"lng_bot_no_scan_qr" = "QR Codes for bots are not supported on Desktop. Please use one of Telegram's mobile apps.";
"lng_bot_click_to_start" = "Click here to use this bot.";
"lng_bot_status_users#one" = "{count} user";
"lng_bot_status_users#other" = "{count} users";
"lng_typing" = "typing";
"lng_user_typing" = "{user} is typing";
@@ -3062,6 +3226,23 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_unread_bar_some" = "Unread messages";
"lng_maps_point" = "Location";
"lng_maps_select_on_map" = "Select on the Map";
"lng_maps_point_send" = "Send This Location";
"lng_maps_point_set" = "Set This Location";
"lng_maps_or_choose" = "Or choose a venue";
"lng_maps_places_in_area" = "Places in this area";
"lng_maps_no_places" = "No places found";
"lng_maps_choose_to_search" = "Choose location to see places nearby.";
"lng_maps_venues_source" = "Powered by Foursquare";
"lng_live_location" = "Live Location";
"lng_live_location_now" = "updated just now";
"lng_live_location_minutes#one" = "updated {count} minute ago";
"lng_live_location_minutes#other" = "updated {count} minutes ago";
"lng_live_location_hours#one" = "updated {count} hour ago";
"lng_live_location_hours#other" = "updated {count} hours ago";
"lng_live_location_today" = "updated today at {time}";
"lng_live_location_yesterday" = "updated yesterday at {time}";
"lng_live_location_date_time" = "updated {date} at {time}";
"lng_save_photo" = "Save image";
"lng_save_video" = "Save video";
"lng_save_audio_file" = "Save audio file";
@@ -3138,6 +3319,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_context_reply_msg" = "Reply";
"lng_context_quote_and_reply" = "Quote & Reply";
"lng_context_edit_msg" = "Edit";
"lng_context_add_factcheck" = "Add Fact Check";
"lng_context_edit_factcheck" = "Edit Fact Check";
"lng_context_forward_msg" = "Forward Message";
"lng_context_send_now_msg" = "Send now";
"lng_context_reschedule" = "Reschedule";
@@ -3208,6 +3391,26 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_context_spoiler_effect" = "Hide with Spoiler";
"lng_context_disable_spoiler" = "Remove Spoiler";
"lng_context_make_paid" = "Make This Content Paid";
"lng_context_change_price" = "Change Price";
"lng_factcheck_title" = "Fact Check";
"lng_factcheck_placeholder" = "Add Facts or Context";
"lng_factcheck_whats_this" = "what's this?";
"lng_factcheck_about" = "This clarification was provided by a fact checking agency assigned by the department of the government of your country ({country}) responsible for combatting misinformation.";
"lng_factcheck_add_done" = "Fact check added.";
"lng_factcheck_edit_done" = "Fact check edited.";
"lng_factcheck_remove_done" = "Fact check removed.";
"lng_factcheck_bottom" = "This clarification was provided by a fact checking agency assigned by the department of the government of your country ({country}) responsible for combatting misinformation.";
"lng_factcheck_links" = "Only **t.me/** links are allowed.";
"lng_paid_title" = "Paid Content";
"lng_paid_enter_cost" = "Enter Unlock Cost";
"lng_paid_cost_placeholder" = "Stars to Unlock";
"lng_paid_about" = "Users will have to transfer this amount of Stars to your channel in order to view this media. {link}";
"lng_paid_about_link" = "More about stars >";
"lng_paid_about_link_url" = "https://telegram.org/blog/telegram-stars";
"lng_paid_price" = "Unlock for {price}";
"lng_translate_show_original" = "Show Original";
"lng_translate_bar_to" = "Translate to {name}";
@@ -3329,6 +3532,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_add_contact" = "Create";
"lng_add_contact_button" = "New contact";
"lng_contacts_header" = "Contacts";
"lng_menu_not_contact" = "This number is not on Telegram";
"lng_contacts_hidden_stories" = "Hidden Stories";
"lng_contacts_stories_status#one" = "{count} story";
"lng_contacts_stories_status#other" = "{count} stories";
@@ -3405,6 +3609,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_mediaview_forward" = "Forward";
"lng_mediaview_delete" = "Delete";
"lng_mediaview_save_to_profile" = "Save to Profile";
"lng_mediaview_pin_story_done" = "Story pinned";
"lng_mediaview_pin_story_about" = "Now it will be always shown on the top.";
"lng_mediaview_pin_stories_done#one" = "{count} story pinned";
"lng_mediaview_pin_stories_done#other" = "{count} stories pinned";
"lng_mediaview_pin_stories_about#one" = "Now it will be always shown on the top.";
"lng_mediaview_pin_stories_about#other" = "Now they will be always shown on the top.";
"lng_mediaview_unpin_story_done" = "Story unpinned.";
"lng_mediaview_unpin_stories_done#one" = "{count} story unpinned";
"lng_mediaview_unpin_stories_done#other" = "{count} stories unpinned";
"lng_mediaview_pin_limit#one" = "You can't pin more than {count} story.";
"lng_mediaview_pin_limit#other" = "You can't pin more than {count} stories.";
"lng_mediaview_archive_story" = "Archive Story";
"lng_mediaview_photos_all" = "View all photos";
"lng_mediaview_files_all" = "View all files";
@@ -3463,6 +3678,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_formatting_link_text" = "Text";
"lng_formatting_link_url" = "URL";
"lng_formatting_link_create" = "Create";
"lng_formatting_code_title" = "Code Language";
"lng_formatting_code_language" = "Language for syntax highlighting.";
"lng_formatting_code_auto" = "Auto-Detect";
"lng_text_copied" = "Text copied to clipboard.";
"lng_code_copied" = "Block copied to clipboard.";
@@ -3570,6 +3788,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_payments_card_declined" = "Your card was declined.";
"lng_payments_payment_failed" = "Payment failed. Your card has not been billed.";
"lng_payments_precheckout_failed" = "The bot couldn't process your payment. Your card has not been billed.";
"lng_payments_precheckout_timeout" = "The bot didn't respond in time. Your card has not been billed.";
"lng_payments_precheckout_stars_failed" = "The bot couldn't process your payment.";
"lng_payments_precheckout_stars_timeout" = "The bot didn't respond in time.";
"lng_payments_already_paid" = "You have already paid for this item.";
"lng_payments_terms_title" = "Terms of Service";
@@ -4013,6 +4234,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"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_restricted_send_paid_media" = "Sorry, paid media can't be sent to this channel.";
"lng_restricted_send_voice_messages" = "{user} restricted sending of voice messages to them.";
"lng_restricted_send_video_messages" = "{user} restricted sending of video messages to them.";
@@ -4480,10 +4702,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_translate_settings_about" = "The 'Translate' button will appear when you open a context menu on a text message.";
"lng_translate_settings_one" = "Please choose at least one language so that it can be used as the \"Translate to\" language.";
"lng_launch_exe_warning" = "This file has a {extension} extension.\nAre you sure you want to run it?";
"lng_launch_exe_warning" = "This file has {extension} extension.\nAre you sure you want to run it?";
"lng_launch_other_warning" = "This file has {extension} extension.\nAre you sure you want to open it?";
"lng_launch_svg_warning" = "Opening this file can potentially expose your IP address to its sender. Continue?";
"lng_launch_exe_sure" = "Run";
"lng_launch_other_sure" = "Open";
"lng_launch_exe_dont_ask" = "Don't ask me again";
"lng_launch_dont_ask" = "Remember for this file type";
"lng_launch_dont_ask_settings" = "You can later edit trusted file types in Settings > Privacy and Security > File open confirmations.";
"lng_polls_anonymous" = "Anonymous Poll";
"lng_polls_public" = "Poll";
@@ -4695,6 +4921,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_view_button_boost" = "Boost";
"lng_view_button_giftcode" = "Open";
"lng_view_button_iv" = "Instant View";
"lng_view_button_stickerset" = "View stickers";
"lng_view_button_emojipack" = "View emoji";
"lng_sponsored_hide_ads" = "Hide";
"lng_sponsored_title" = "What are sponsored messages?";
@@ -5034,6 +5262,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_channel_earn_history_return" = "Refund";
"lng_channel_earn_history_return_about" = "Refunded back";
"lng_channel_earn_history_pending" = "Pending";
"lng_channel_earn_history_failed" = "Failed";
"lng_channel_earn_history_show_more#one" = "Show {count} More Transaction";
"lng_channel_earn_history_show_more#other" = "Show {count} More Transactions";
"lng_channel_earn_off" = "Switch Off Ads";
@@ -5056,6 +5285,30 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_channel_earn_chart_revenue" = "Ad revenue";
"lng_channel_earn_chart_overriden_detail_currency" = "Revenue in TON";
"lng_channel_earn_chart_overriden_detail_usd" = "Revenue in USD";
"lng_channel_earn_currency_history" = "TON Transactions";
"lng_channel_earn_credits_history" = "Stars Transactions";
"lng_channel_earn_out_check_password_about" = "You can withdraw only if you have:";
"lng_bot_earn_title" = "Stars Balance";
"lng_bot_earn_chart_revenue" = "Revenue";
"lng_bot_earn_overview_title" = "Proceeds overview";
"lng_bot_earn_available" = "Available balance";
"lng_bot_earn_total" = "Total lifetime proceeds";
"lng_bot_earn_balance_title" = "Available balance";
"lng_bot_earn_balance_about" = "Stars from your total balance become available for spending on ads and rewards 21 days after they are earned.";
"lng_bot_earn_balance_about_url" = "https://telegram.org/tos/stars";
"lng_bot_earn_balance_button#one" = "Withdraw {emoji} {count}";
"lng_bot_earn_balance_button#other" = "Withdraw {emoji} {count}";
"lng_bot_earn_balance_button_all" = "Withdraw all stars";
"lng_bot_earn_balance_button_locked" = "Withdraw";
"lng_bot_earn_balance_button_buy_ads" = "Buy Ads";
"lng_bot_earn_learn_credits_out_about" = "You can withdraw Stars using Fragment, or use Stars to advertise your bot. {link}";
"lng_bot_earn_out_ph" = "Enter amount to withdraw";
"lng_bot_earn_balance_password_title" = "Two-step verification";
"lng_bot_earn_balance_password_description" = "Please enter your password to collect.";
"lng_bot_earn_credits_out_minimal" = "You cannot withdraw less then {link}.";
"lng_bot_earn_credits_out_minimal_link#one" = "{count} star";
"lng_bot_earn_credits_out_minimal_link#other" = "{count} stars";
"lng_contact_add" = "Add";
"lng_contact_send_message" = "message";
@@ -5064,6 +5317,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_iv_share" = "Share";
"lng_iv_join_channel" = "Join";
"lng_iv_window_title" = "Instant View";
"lng_iv_wrong_layout" = "Wrong layout?";
"lng_limit_download_title" = "Download speed limited";
"lng_limit_download_subscribe" = "Subscribe to {link} and increase download speed {increase}.";
@@ -5078,6 +5332,61 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_limit_upload_increase_speed" = "by **{percent}**";
"lng_limit_upload_subscribe_link" = "Telegram Premium";
"lng_recent_frequent" = "Frequent contacts";
"lng_recent_frequent_all" = "Show all";
"lng_recent_frequent_collapse" = "Collapse";
"lng_recent_title" = "Recent";
"lng_recent_clear" = "Clear";
"lng_recent_clear_sure" = "Do you want to clear your search history?";
"lng_recent_remove" = "Remove from Recent";
"lng_recent_clear_all" = "Clear all";
"lng_recent_hide_top" = "Remove all & Disable";
"lng_recent_hide_sure" = "Are you sure you want to clear and disable frequent contacts list?\n\nYou can always turn this feature back on in Settings > Privacy > Suggest Frequent Contacts.";
"lng_recent_hide_button" = "Hide";
"lng_recent_none" = "Recent search results\nwill appear here.";
"lng_recent_chats" = "Chats";
"lng_recent_channels" = "Channels";
"lng_recent_apps" = "Apps";
"lng_channels_none_title" = "No channels yet...";
"lng_channels_none_about" = "You are not currently subscribed to any channels.";
"lng_channels_your_title" = "Channels you joined";
"lng_channels_your_more" = "Show more";
"lng_channels_your_less" = "Show less";
"lng_channels_recommended" = "Recommended channels";
"lng_bot_apps_your" = "Apps you use";
"lng_bot_apps_popular" = "Popular apps";
"lng_font_box_title" = "Choose font family";
"lng_font_default" = "Default";
"lng_font_system" = "System font";
"lng_font_not_found" = "Font not found.";
"lng_search_tab_my_messages" = "My Messages";
"lng_search_tab_this_topic" = "This Topic";
"lng_search_tab_this_chat" = "This Chat";
"lng_search_tab_this_channel" = "This Channel";
"lng_search_tab_this_group" = "This Group";
"lng_search_tab_public_posts" = "Public Posts";
"lng_search_tab_no_results" = "No Results";
"lng_search_tab_no_results_text" = "There were no results for \"{query}\".";
"lng_search_tab_no_results_retry" = "Try another hashtag.";
"lng_search_tab_by_hashtag" = "Enter a hashtag to find messages containing it.";
"lng_contact_details_button" = "View Contact";
"lng_contact_details_title" = "Contact details";
"lng_contact_details_phone" = "Phone";
"lng_contact_details_phone_main" = "Main Phone";
"lng_contact_details_phone_home" = "Home Phone";
"lng_contact_details_phone_mobile" = "Mobile Phone";
"lng_contact_details_phone_work" = "Work Phone";
"lng_contact_details_phone_other" = "Other Phone";
"lng_contact_details_email" = "Email";
"lng_contact_details_address" = "Address";
"lng_contact_details_url" = "URL";
"lng_contact_details_note" = "Note";
"lng_contact_details_birthday" = "Birthday";
"lng_contact_details_organization" = "Organization";
// Wnd specific
"lng_wnd_choose_program_menu" = "Choose Default Program...";

View File

@@ -0,0 +1,120 @@
:root {
--font-sans: -apple-system, BlinkMacSystemFont, avenir next, avenir, Segoe UI Variable Text, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, tahoma, arial, sans-serif;
}
html {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
body {
font-family: var(--font-sans);
width: 100%;
height: 100%;
padding: 0;
margin: 0;
background-color: var(--td-window-bg);
color: var(--td-window-fg);
}
html.custom_scroll ::-webkit-scrollbar {
border-radius: 5px !important;
border: 3px solid transparent !important;
background-color: var(--td-scroll-bg) !important;
background-clip: content-box !important;
width: 10px !important;
}
html.custom_scroll ::-webkit-scrollbar:hover {
background-color: var(--td-scroll-bg-over) !important;
}
html.custom_scroll ::-webkit-scrollbar-thumb {
border-radius: 5px !important;
border: 3px solid transparent !important;
background-color: var(--td-scroll-bar-bg) !important;
background-clip: content-box !important;
}
html.custom_scroll ::-webkit-scrollbar-thumb:hover {
background-color: var(--td-scroll-bar-bg-over) !important;
}
#map {
position: relative;
width: 100%;
height: 100%;
}
#marker {
pointer-events: none;
display: none;
z-index: 2;
position: absolute;
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
}
#marker_drop {
margin-bottom: 0px;
transition: margin 160ms ease-in-out;
}
#marker_drop.moving {
margin-bottom: 24px;
}
#marker_shadow {
position: absolute;
}
#search_venues {
position: absolute;
left: 50%;
transform: translateX(-50%);
z-index: 2;
top: -30px;
transition: top 200ms ease-in-out;
}
#search_venues.shown {
top: 6px;
}
#search_venues_inner {
position: relative;
overflow: hidden;
font-size: 13px;
font-weight: 500;
background: var(--td-window-bg);
color: var(--td-window-active-text-fg);
cursor: pointer;
border-radius: 14px;
padding: 5px 12px 6px;
box-shadow: 0 0 3px 0px var(--td-history-to-down-shadow);
}
#search_venues_inner:hover {
background: var(--td-window-bg-over);
}
#search_venues_content {
position: relative;
z-index: 2;
}
#search_venues_content:before {
content: var(--td-lng-maps-places-in-area);
}
#search_venues_inner .ripple .inner {
position: absolute;
border-radius: 50%;
transform: scale(0);
opacity: 1;
animation: ripple 650ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
background-color: var(--td-window-bg-ripple);
}
#search_venues_inner .ripple.hiding {
animation: fadeOut 200ms linear forwards;
}
@keyframes ripple {
to {
transform: scale(2);
}
}
@keyframes fadeOut {
to {
opacity: 0;
}
}

View File

@@ -0,0 +1,199 @@
var LocationPicker = {
startZoom: 14,
flySpeed: 2.4,
notify: function(message) {
if (window.external && window.external.invoke) {
window.external.invoke(JSON.stringify(message));
}
},
frameKeyDown: function (e) {
const keyW = (e.key === 'w')
|| (e.code === 'KeyW')
|| (e.keyCode === 87);
const keyQ = (e.key === 'q')
|| (e.code === 'KeyQ')
|| (e.keyCode === 81);
const keyM = (e.key === 'm')
|| (e.code === 'KeyM')
|| (e.keyCode === 77);
if ((e.metaKey || e.ctrlKey) && (keyW || keyQ || keyM)) {
e.preventDefault();
LocationPicker.notify({
event: 'keydown',
modifier: e.ctrlKey ? 'ctrl' : 'cmd',
key: keyW ? 'w' : keyQ ? 'q' : 'm',
});
} else if (e.key === 'Escape' || e.keyCode === 27) {
e.preventDefault();
LocationPicker.notify({
event: 'keydown',
key: 'escape',
});
}
},
isNight: function() {
var html = document.getElementsByTagName('html')[0];
return html.style.getPropertyValue('--td-night') == '1';
},
lightPreset: function() {
return LocationPicker.isNight() ? 'night' : 'day';
},
updateStyles: function (styles) {
if (LocationPicker.styles !== styles) {
LocationPicker.styles = styles;
document.getElementsByTagName('html')[0].style = styles;
LocationPicker.map.setConfigProperty(
'basemap',
'lightPreset',
LocationPicker.lightPreset());
}
},
init: function (params) {
mapboxgl.accessToken = params.token;
if (params.protocol) {
mapboxgl.config.API_URL = params.protocol + '://domain/api.mapbox.com';
}
var options = { container: 'map', config: {
basemap: { lightPreset: LocationPicker.lightPreset() }
} };
var center = params.center;
if (center) {
center = [center[1], center[0]];
options.center = center;
options.zoom = LocationPicker.startZoom;
} else if (params.bounds) {
options.bounds = params.bounds;
center = new mapboxgl.LngLatBounds(params.bounds).getCenter();
} else {
center = [0, 0];
}
LocationPicker.map = new mapboxgl.Map(options);
LocationPicker.createMarker(center);
LocationPicker.trackMovement();
LocationPicker.initSearchVenueRipple();
},
marker: function() {
return document.getElementById('marker_drop');
},
createMarker: function(center) {
document.getElementById('marker').style.display = 'flex';
},
clearMovingTimer: function() {
if (LocationPicker.clearMovingTimeoutId) {
clearTimeout(LocationPicker.clearMovingTimeoutId);
LocationPicker.clearMovingTimeoutId = 0;
}
},
startMovingTimer: function(done) {
LocationPicker.clearMovingTimer();
LocationPicker.clearMovingTimeoutId = setTimeout(done, 500);
},
trackMovement: function() {
LocationPicker.map.on('movestart', function() {
LocationPicker.marker().classList.add('moving');
LocationPicker.clearMovingTimer();
LocationPicker.toggleSearchVenues(false);
LocationPicker.notify({ event: 'move_start' });
});
LocationPicker.map.on('moveend', function() {
LocationPicker.startMovingTimer(function() {
LocationPicker.marker().classList.remove('moving');
LocationPicker.notify({
event: 'move_end',
latitude: LocationPicker.map.getCenter().lat,
longitude: LocationPicker.map.getCenter().lng
});
});
});
},
narrowTo: function (point) {
LocationPicker.map.flyTo({
center: [point[1], point[0]],
zoom: LocationPicker.startZoom,
speed: LocationPicker.flySpeed,
});
},
send: function () {
LocationPicker.notify({
event: 'send',
latitude: LocationPicker.map.getCenter().lat,
longitude: LocationPicker.map.getCenter().lng
});
},
addRipple: function (button, x, y) {
const ripple = document.createElement('span');
ripple.classList.add('ripple');
const inner = document.createElement('span');
inner.classList.add('inner');
var rect = button.getBoundingClientRect();
x -= rect.x;
y -= rect.y;
const mx = button.clientWidth - x;
const my = button.clientHeight - y;
const sq1 = x * x + y * y;
const sq2 = mx * mx + y * y;
const sq3 = x * x + my * my;
const sq4 = mx * mx + my * my;
const radius = Math.sqrt(Math.max(sq1, sq2, sq3, sq4));
inner.style.width = inner.style.height = `${2 * radius}px`;
inner.style.left = `${x - radius}px`;
inner.style.top = `${y - radius}px`;
inner.classList.add('inner');
ripple.addEventListener('animationend', function (e) {
if (e.animationName === 'fadeOut') {
ripple.remove();
}
});
ripple.appendChild(inner);
button.appendChild(ripple);
},
stopRipples: function (button) {
const id = button.id ? button.id : button;
button = document.getElementById(id);
const ripples = button.getElementsByClassName('ripple');
for (var i = 0; i < ripples.length; ++i) {
const ripple = ripples[i];
if (!ripple.classList.contains('hiding')) {
ripple.classList.add('hiding');
}
}
},
initSearchVenueRipple: function() {
var button = document.getElementById('search_venues_inner');
button.addEventListener('mousedown', function (e) {
LocationPicker.addRipple(e.currentTarget, e.clientX, e.clientY);
LocationPicker.searchVenuesPressed = true;
});
button.addEventListener('mouseup', function (e) {
const id = e.currentTarget.id;
setTimeout(function () {
LocationPicker.stopRipples(id);
}, 0);
if (LocationPicker.searchVenuesPressed) {
LocationPicker.searchVenuesPressed = false;
LocationPicker.toggleSearchVenues(false);
LocationPicker.notify({
event: 'search_venues',
latitude: LocationPicker.map.getCenter().lat,
longitude: LocationPicker.map.getCenter().lng
});
}
});
button.addEventListener('mouseleave', function (e) {
LocationPicker.stopRipples(e.currentTarget);
LocationPicker.searchVenuesPressed = false;
});
},
toggleSearchVenues: function(shown) {
var button = document.getElementById('search_venues');
button.classList.toggle('shown', shown);
},
};

View File

@@ -24,5 +24,7 @@
<file alias="chat_link.tgs">../../animations/chat_link.tgs</file>
<file alias="collectible_username.tgs">../../animations/collectible_username.tgs</file>
<file alias="collectible_phone.tgs">../../animations/collectible_phone.tgs</file>
<file alias="search.tgs">../../animations/search.tgs</file>
<file alias="noresults.tgs">../../animations/noresults.tgs</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/picker">
<file alias="picker.css">../../picker_html/picker.css</file>
<file alias="picker.js">../../picker_html/picker.js</file>
</qresource>
</RCC>

View File

@@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="4.16.2.0" />
Version="5.3.0.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
@@ -37,6 +37,9 @@
<Extensions>
<uap3:Extension Category="windows.protocol">
<uap3:Protocol Name="tg" Parameters="-- &quot;%1&quot;" />
<uap3:Extension Category="windows.protocol">
</uap3:Extension>
<uap3:Protocol Name="tonsite" Parameters="-- &quot;%1&quot;" />
</uap3:Extension>
<desktop:Extension
Category="windows.startupTask"

View File

@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,16,2,0
PRODUCTVERSION 4,16,2,0
FILEVERSION 5,3,0,0
PRODUCTVERSION 5,3,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "4.16.2.0"
VALUE "FileVersion", "5.3.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.16.2.0"
VALUE "ProductVersion", "5.3.0.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,16,2,0
PRODUCTVERSION 4,16,2,0
FILEVERSION 5,3,0,0
PRODUCTVERSION 5,3,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "4.16.2.0"
VALUE "FileVersion", "5.3.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.16.2.0"
VALUE "ProductVersion", "5.3.0.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -155,6 +155,7 @@ int main(int argc, char *argv[])
QString remove;
int version = 0;
[[maybe_unused]] bool targetwin64 = false;
[[maybe_unused]] bool targetwinarm = false;
[[maybe_unused]] bool targetarmac = false;
QFileInfoList files;
for (int i = 0; i < argc; ++i) {
@@ -165,6 +166,7 @@ int main(int argc, char *argv[])
if (remove.isEmpty()) remove = info.canonicalPath() + "/";
} else if (string("-target") == argv[i] && i + 1 < argc) {
targetwin64 = (string("win64") == argv[i + 1]);
targetwinarm = (string("winarm") == argv[i + 1]);
} else if (string("-arch") == argv[i] && i + 1 < argc) {
targetarmac = (string("arm64") == argv[i + 1]);
if (!targetarmac && string("x86_64") != argv[i + 1]) {
@@ -493,7 +495,7 @@ int main(int argc, char *argv[])
cout << "Signature verified!\n";
RSA_free(pbKey);
#ifdef Q_OS_WIN
QString outName((targetwin64 ? QString("tx64upd%1") : QString("tupdate%1")).arg(AlphaVersion ? AlphaVersion : version));
QString outName((targetwinarm ? QString("tarm64upd%1") : targetwin64 ? QString("tx64upd%1") : QString("tupdate%1")).arg(AlphaVersion ? AlphaVersion : version));
#elif defined Q_OS_MAC
QString outName((targetarmac ? QString("tarmacupd%1") : QString("tmacupd%1")).arg(AlphaVersion ? AlphaVersion : version));
#else

View File

@@ -571,8 +571,8 @@ void _generateDump(EXCEPTION_POINTERS* pExceptionPointers) {
}
if (!hDumpFile || hDumpFile == INVALID_HANDLE_VALUE) {
WCHAR wstrPath[maxFileLen];
DWORD wstrPathLen;
if (wstrPathLen = GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) {
DWORD wstrPathLen = GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen);
if (wstrPathLen) {
wsprintf(wstrPath + wstrPathLen, L"\\%s\\", _programName);
hDumpFile = _generateDumpFileAtPath(wstrPath);
}

View File

@@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_item_components.h"
#include "inline_bots/bot_attach_web_view.h"
#include "payments/payments_checkout_process.h"
#include "payments/payments_non_panel_process.h"
#include "main/main_session.h"
#include "mainwidget.h"
#include "mainwindow.h"
@@ -126,11 +127,7 @@ void SendBotCallbackData(
UrlClickHandler::Open(link);
return;
}
const auto scoreLink = AppendShareGameScoreUrl(
session,
link,
item->fullId());
BotGameUrlClickHandler(bot, scoreLink).onClick({
BotGameUrlClickHandler(bot, link).onClick({
Qt::LeftButton,
QVariant::fromValue(ClickHandlerContext{
.itemId = item->fullId(),
@@ -236,14 +233,14 @@ void SendBotCallbackDataWithPassword(
} else {
return;
}
const auto box = std::make_shared<QPointer<PasscodeBox>>();
auto fields = PasscodeBox::CloudFields::From(state);
fields.customTitle = tr::lng_bots_password_confirm_title();
fields.customDescription
= tr::lng_bots_password_confirm_description(tr::now);
fields.customSubmitButton = tr::lng_passcode_submit();
fields.customCheckCallback = [=](
const Core::CloudPasswordResult &result) {
const Core::CloudPasswordResult &result,
QPointer<PasscodeBox> box) {
if (const auto button = getButton()) {
if (button->requestId) {
return;
@@ -257,18 +254,17 @@ void SendBotCallbackDataWithPassword(
return;
}
SendBotCallbackData(strongController, item, row, column, result, [=] {
if (*box) {
(*box)->closeBox();
if (box) {
box->closeBox();
}
}, [=](const QString &error) {
if (*box) {
(*box)->handleCustomCheckError(error);
if (box) {
box->handleCustomCheckError(error);
}
});
}
};
auto object = Box<PasscodeBox>(session, fields);
*box = Ui::MakeWeak(object.data());
show->showBox(std::move(object), Ui::LayerOption::CloseOther);
}, *lifetime);
}
@@ -336,7 +332,8 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
Payments::Mode::Payment,
crl::guard(controller, [=](auto) {
controller->widget()->activate();
}));
}),
Payments::ProcessNonPanelPaymentFormFactory(controller, item));
} break;
case ButtonType::Url: {
@@ -491,20 +488,23 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
case ButtonType::WebView: {
if (const auto bot = item->getMessageBot()) {
bot->session().attachWebView().request(
controller,
Api::SendAction(bot->owner().history(bot)),
bot,
{ .text = button->text, .url = button->data });
bot->session().attachWebView().open({
.bot = bot,
.context = { .controller = controller },
.button = { .text = button->text, .url = button->data },
.source = InlineBots::WebViewSourceButton{ .simple = false },
});
}
} break;
case ButtonType::SimpleWebView: {
if (const auto bot = item->getMessageBot()) {
bot->session().attachWebView().requestSimple(
controller,
bot,
{ .text = button->text, .url = button->data });
bot->session().attachWebView().open({
.bot = bot,
.context = { .controller = controller },
.button = {.text = button->text, .url = button->data },
.source = InlineBots::WebViewSourceButton{ .simple = true },
});
}
} break;
}

View File

@@ -112,8 +112,8 @@ void ApplyLastList(
channel->mgInfo->lastAdmins.clear();
channel->mgInfo->lastRestricted.clear();
channel->mgInfo->lastParticipants.clear();
channel->mgInfo->lastParticipantsStatus =
MegagroupInfo::LastParticipantsUpToDate
channel->mgInfo->lastParticipantsStatus
= MegagroupInfo::LastParticipantsUpToDate
| MegagroupInfo::LastParticipantsOnceReceived;
auto botStatus = channel->mgInfo->botStatus;
@@ -212,7 +212,7 @@ void ApplyBotsList(
}
[[nodiscard]] ChatParticipants::Channels ParseSimilar(
not_null<ChannelData*> channel,
not_null<Main::Session*> session,
const MTPmessages_Chats &chats) {
auto result = ChatParticipants::Channels();
std::vector<not_null<ChannelData*>>();
@@ -220,13 +220,13 @@ void ApplyBotsList(
const auto &list = data.vchats().v;
result.list.reserve(list.size());
for (const auto &chat : list) {
const auto peer = channel->owner().processChat(chat);
const auto peer = session->data().processChat(chat);
if (const auto channel = peer->asChannel()) {
result.list.push_back(channel);
}
}
if constexpr (MTPDmessages_chatsSlice::Is<decltype(data)>()) {
if (channel->session().premiumPossible()) {
if (session->premiumPossible()) {
result.more = data.vcount().v - data.vchats().v.size();
}
}
@@ -234,6 +234,12 @@ void ApplyBotsList(
return result;
}
[[nodiscard]] ChatParticipants::Channels ParseSimilar(
not_null<ChannelData*> channel,
const MTPmessages_Chats &chats) {
return ParseSimilar(&channel->session(), chats);
}
} // namespace
ChatParticipant::ChatParticipant(
@@ -351,7 +357,8 @@ QString ChatParticipant::rank() const {
}
ChatParticipants::ChatParticipants(not_null<ApiWrap*> api)
: _api(&api->instance()) {
: _session(&api->session())
, _api(&api->instance()) {
}
void ChatParticipants::requestForAdd(
@@ -585,6 +592,33 @@ ChatParticipants::Parsed ChatParticipants::ParseRecent(
return result;
}
void ChatParticipants::Restrict(
not_null<ChannelData*> channel,
not_null<PeerData*> participant,
ChatRestrictionsInfo oldRights,
ChatRestrictionsInfo newRights,
Fn<void()> onDone,
Fn<void()> onFail) {
channel->session().api().request(MTPchannels_EditBanned(
channel->inputChannel,
participant->input,
MTP_chatBannedRights(
MTP_flags(MTPDchatBannedRights::Flags::from_raw(
uint32(newRights.flags))),
MTP_int(newRights.until))
)).done([=](const MTPUpdates &result) {
channel->session().api().applyUpdates(result);
channel->applyEditBanned(participant, oldRights, newRights);
if (onDone) {
onDone();
}
}).fail([=] {
if (onFail) {
onFail();
}
}).send();
}
void ChatParticipants::requestSelf(not_null<ChannelData*> channel) {
if (_selfParticipantRequests.contains(channel)) {
return;
@@ -730,8 +764,11 @@ void ChatParticipants::loadSimilarChannels(not_null<ChannelData*> channel) {
return;
}
}
using Flag = MTPchannels_GetChannelRecommendations::Flag;
_similar[channel].requestId = _api.request(
MTPchannels_GetChannelRecommendations(channel->inputChannel)
MTPchannels_GetChannelRecommendations(
MTP_flags(Flag::f_channel),
channel->inputChannel)
).done([=](const MTPmessages_Chats &result) {
auto &similar = _similar[channel];
similar.requestId = 0;
@@ -766,4 +803,29 @@ auto ChatParticipants::similarLoaded() const
return _similarLoaded.events();
}
void ChatParticipants::loadRecommendations() {
if (_recommendationsLoaded.current() || _recommendations.requestId) {
return;
}
_recommendations.requestId = _api.request(
MTPchannels_GetChannelRecommendations(
MTP_flags(0),
MTP_inputChannelEmpty())
).done([=](const MTPmessages_Chats &result) {
_recommendations.requestId = 0;
auto parsed = ParseSimilar(_session, result);
_recommendations.channels = std::move(parsed);
_recommendations.channels.more = 0;
_recommendationsLoaded = true;
}).send();
}
const ChatParticipants::Channels &ChatParticipants::recommendations() const {
return _recommendations.channels;
}
rpl::producer<> ChatParticipants::recommendationsLoaded() const {
return _recommendationsLoaded.changes() | rpl::to_empty;
}
} // namespace Api

View File

@@ -14,6 +14,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
class ApiWrap;
class ChannelData;
namespace Main {
class Session;
} // namespace Main
namespace Ui {
class Show;
} // namespace Ui
@@ -96,6 +100,13 @@ public:
static Parsed ParseRecent(
not_null<ChannelData*> channel,
const TLMembers &data);
static void Restrict(
not_null<ChannelData*> channel,
not_null<PeerData*> participant,
ChatRestrictionsInfo oldRights,
ChatRestrictionsInfo newRights,
Fn<void()> onDone,
Fn<void()> onFail);
void add(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer,
@@ -134,12 +145,18 @@ public:
[[nodiscard]] auto similarLoaded() const
-> rpl::producer<not_null<ChannelData*>>;
void loadRecommendations();
[[nodiscard]] const Channels &recommendations() const;
[[nodiscard]] rpl::producer<> recommendationsLoaded() const;
private:
struct SimilarChannels {
Channels channels;
mtpRequestId requestId = 0;
};
const not_null<Main::Session*> _session;
MTP::Sender _api;
using PeerRequests = base::flat_map<PeerData*, mtpRequestId>;
@@ -165,6 +182,9 @@ private:
base::flat_map<not_null<ChannelData*>, SimilarChannels> _similar;
rpl::event_stream<not_null<ChannelData*>> _similarLoaded;
SimilarChannels _recommendations;
rpl::variable<bool> _recommendationsLoaded = false;
};
} // namespace Api

View File

@@ -20,13 +20,20 @@ namespace Api {
inline constexpr auto kScheduledUntilOnlineTimestamp = TimeId(0x7FFFFFFE);
struct SendOptions {
uint64 price = 0;
PeerData *sendAs = nullptr;
TimeId scheduled = 0;
BusinessShortcutId shortcutId = 0;
EffectId effectId = 0;
bool silent = false;
bool handleSupportSwitch = false;
bool invertCaption = false;
bool hideViaBot = false;
crl::time ttlSeconds = 0;
friend inline bool operator==(
const SendOptions &,
const SendOptions &) = default;
};
[[nodiscard]] SendOptions DefaultSendWhenOnlineOptions();
@@ -49,6 +56,10 @@ struct SendAction {
MsgId replaceMediaOf = 0;
[[nodiscard]] MTPInputReplyTo mtpReplyTo() const;
friend inline bool operator==(
const SendAction &,
const SendAction &) = default;
};
struct MessageToSend {

View File

@@ -62,6 +62,10 @@ void ConfirmPhone::resolve(
return bad("FirebaseSms");
}, [&](const MTPDauth_sentCodeTypeEmailCode &) {
return bad("EmailCode");
}, [&](const MTPDauth_sentCodeTypeSmsWord &) {
return bad("SmsWord");
}, [&](const MTPDauth_sentCodeTypeSmsPhrase &) {
return bad("SmsPhrase");
}, [&](const MTPDauth_sentCodeTypeSetUpEmailRequired &) {
return bad("SetUpEmailRequired");
});
@@ -93,8 +97,10 @@ void ConfirmPhone::resolve(
box->resendRequests(
) | rpl::start_with_next([=] {
_api.request(MTPauth_ResendCode(
MTP_flags(0),
MTP_string(phone),
MTP_string(phoneHash)
MTP_string(phoneHash),
MTPstring() // reason
)).done([=] {
if (boxWeak) {
boxWeak->callDone();

View File

@@ -0,0 +1,326 @@
/*
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_credits.h"
#include "api/api_statistics_data_deserialize.h"
#include "api/api_updates.h"
#include "apiwrap.h"
#include "base/unixtime.h"
#include "data/data_channel.h"
#include "data/data_document.h"
#include "data/data_peer.h"
#include "data/data_photo.h"
#include "data/data_session.h"
#include "data/data_user.h"
#include "main/main_app_config.h"
#include "main/main_session.h"
namespace Api {
namespace {
constexpr auto kTransactionsLimit = 100;
[[nodiscard]] Data::CreditsHistoryEntry HistoryFromTL(
const MTPStarsTransaction &tl,
not_null<PeerData*> peer) {
using HistoryPeerTL = MTPDstarsTransactionPeer;
using namespace Data;
const auto owner = &peer->owner();
const auto photo = tl.data().vphoto()
? owner->photoFromWeb(*tl.data().vphoto(), ImageLocation())
: nullptr;
auto extended = std::vector<CreditsHistoryMedia>();
if (const auto list = tl.data().vextended_media()) {
extended.reserve(list->v.size());
for (const auto &media : list->v) {
media.match([&](const MTPDmessageMediaPhoto &photo) {
if (const auto inner = photo.vphoto()) {
const auto photo = owner->processPhoto(*inner);
if (!photo->isNull()) {
extended.push_back(CreditsHistoryMedia{
.type = CreditsHistoryMediaType::Photo,
.id = photo->id,
});
}
}
}, [&](const MTPDmessageMediaDocument &document) {
if (const auto inner = document.vdocument()) {
const auto document = owner->processDocument(*inner);
if (document->isAnimation()
|| document->isVideoFile()
|| document->isGifv()) {
extended.push_back(CreditsHistoryMedia{
.type = CreditsHistoryMediaType::Video,
.id = document->id,
});
}
}
}, [&](const auto &) {});
}
}
const auto barePeerId = tl.data().vpeer().match([](
const HistoryPeerTL &p) {
return peerFromMTP(p.vpeer());
}, [](const auto &) {
return PeerId(0);
}).value;
return Data::CreditsHistoryEntry{
.id = qs(tl.data().vid()),
.title = qs(tl.data().vtitle().value_or_empty()),
.description = qs(tl.data().vdescription().value_or_empty()),
.date = base::unixtime::parse(tl.data().vdate().v),
.photoId = photo ? photo->id : 0,
.extended = std::move(extended),
.credits = tl.data().vstars().v,
.bareMsgId = uint64(tl.data().vmsg_id().value_or_empty()),
.barePeerId = barePeerId,
.peerType = tl.data().vpeer().match([](const HistoryPeerTL &) {
return Data::CreditsHistoryEntry::PeerType::Peer;
}, [](const MTPDstarsTransactionPeerPlayMarket &) {
return Data::CreditsHistoryEntry::PeerType::PlayMarket;
}, [](const MTPDstarsTransactionPeerFragment &) {
return Data::CreditsHistoryEntry::PeerType::Fragment;
}, [](const MTPDstarsTransactionPeerAppStore &) {
return Data::CreditsHistoryEntry::PeerType::AppStore;
}, [](const MTPDstarsTransactionPeerUnsupported &) {
return Data::CreditsHistoryEntry::PeerType::Unsupported;
}, [](const MTPDstarsTransactionPeerPremiumBot &) {
return Data::CreditsHistoryEntry::PeerType::PremiumBot;
}, [](const MTPDstarsTransactionPeerAds &) {
return Data::CreditsHistoryEntry::PeerType::Ads;
}),
.refunded = tl.data().is_refund(),
.pending = tl.data().is_pending(),
.failed = tl.data().is_failed(),
.successDate = tl.data().vtransaction_date()
? base::unixtime::parse(tl.data().vtransaction_date()->v)
: QDateTime(),
.successLink = qs(tl.data().vtransaction_url().value_or_empty()),
.in = (int64(tl.data().vstars().v) >= 0),
.gift = tl.data().is_gift(),
};
}
[[nodiscard]] Data::CreditsStatusSlice StatusFromTL(
const MTPpayments_StarsStatus &status,
not_null<PeerData*> peer) {
peer->owner().processUsers(status.data().vusers());
peer->owner().processChats(status.data().vchats());
return Data::CreditsStatusSlice{
.list = ranges::views::all(
status.data().vhistory().v
) | ranges::views::transform([&](const MTPStarsTransaction &tl) {
return HistoryFromTL(tl, peer);
}) | ranges::to_vector,
.balance = status.data().vbalance().v,
.allLoaded = !status.data().vnext_offset().has_value(),
.token = qs(status.data().vnext_offset().value_or_empty()),
};
}
} // namespace
CreditsTopupOptions::CreditsTopupOptions(not_null<PeerData*> peer)
: _peer(peer)
, _api(&peer->session().api().instance()) {
}
rpl::producer<rpl::no_value, QString> CreditsTopupOptions::request() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
const auto giftBarePeerId = !_peer->isSelf() ? _peer->id.value : 0;
const auto optionsFromTL = [giftBarePeerId](const auto &options) {
return ranges::views::all(
options
) | ranges::views::transform([=](const auto &option) {
return Data::CreditTopupOption{
.credits = option.data().vstars().v,
.product = qs(
option.data().vstore_product().value_or_empty()),
.currency = qs(option.data().vcurrency()),
.amount = option.data().vamount().v,
.extended = option.data().is_extended(),
.giftBarePeerId = giftBarePeerId,
};
}) | ranges::to_vector;
};
const auto fail = [=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
};
if (_peer->isSelf()) {
using TLOption = MTPStarsTopupOption;
_api.request(MTPpayments_GetStarsTopupOptions(
)).done([=](const MTPVector<TLOption> &result) {
_options = optionsFromTL(result.v);
consumer.put_done();
}).fail(fail).send();
} else if (const auto user = _peer->asUser()) {
using TLOption = MTPStarsGiftOption;
_api.request(MTPpayments_GetStarsGiftOptions(
MTP_flags(MTPpayments_GetStarsGiftOptions::Flag::f_user_id),
user->inputUser
)).done([=](const MTPVector<TLOption> &result) {
_options = optionsFromTL(result.v);
consumer.put_done();
}).fail(fail).send();
}
return lifetime;
};
}
CreditsStatus::CreditsStatus(not_null<PeerData*> peer)
: _peer(peer)
, _api(&peer->session().api().instance()) {
}
void CreditsStatus::request(
const Data::CreditsStatusSlice::OffsetToken &token,
Fn<void(Data::CreditsStatusSlice)> done) {
if (_requestId) {
return;
}
using TLResult = MTPpayments_StarsStatus;
_requestId = _api.request(MTPpayments_GetStarsStatus(
_peer->isSelf() ? MTP_inputPeerSelf() : _peer->input
)).done([=](const TLResult &result) {
_requestId = 0;
done(StatusFromTL(result, _peer));
}).fail([=] {
_requestId = 0;
done({});
}).send();
}
CreditsHistory::CreditsHistory(not_null<PeerData*> peer, bool in, bool out)
: _peer(peer)
, _flags((in == out)
? HistoryTL::Flags(0)
: HistoryTL::Flags(0)
| (in ? HistoryTL::Flag::f_inbound : HistoryTL::Flags(0))
| (out ? HistoryTL::Flag::f_outbound : HistoryTL::Flags(0)))
, _api(&peer->session().api().instance()) {
}
void CreditsHistory::request(
const Data::CreditsStatusSlice::OffsetToken &token,
Fn<void(Data::CreditsStatusSlice)> done) {
if (_requestId) {
return;
}
_requestId = _api.request(MTPpayments_GetStarsTransactions(
MTP_flags(_flags),
_peer->isSelf() ? MTP_inputPeerSelf() : _peer->input,
MTP_string(token),
MTP_int(kTransactionsLimit)
)).done([=](const MTPpayments_StarsStatus &result) {
_requestId = 0;
done(StatusFromTL(result, _peer));
}).fail([=] {
_requestId = 0;
done({});
}).send();
}
Data::CreditTopupOptions CreditsTopupOptions::options() const {
return _options;
}
rpl::producer<not_null<PeerData*>> PremiumPeerBot(
not_null<Main::Session*> session) {
const auto username = session->appConfig().get<QString>(
u"premium_bot_username"_q,
QString());
if (username.isEmpty()) {
return rpl::never<not_null<PeerData*>>();
}
if (const auto p = session->data().peerByUsername(username)) {
return rpl::single<not_null<PeerData*>>(p);
}
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
const auto api = lifetime.make_state<MTP::Sender>(&session->mtp());
api->request(MTPcontacts_ResolveUsername(
MTP_string(username)
)).done([=](const MTPcontacts_ResolvedPeer &result) {
session->data().processUsers(result.data().vusers());
session->data().processChats(result.data().vchats());
const auto botPeer = session->data().peerLoaded(
peerFromMTP(result.data().vpeer()));
if (!botPeer) {
return consumer.put_done();
}
consumer.put_next(not_null{ botPeer });
}).send();
return lifetime;
};
}
CreditsEarnStatistics::CreditsEarnStatistics(not_null<PeerData*> peer)
: StatisticsRequestSender(peer)
, _isUser(peer->isUser()) {
}
rpl::producer<rpl::no_value, QString> CreditsEarnStatistics::request() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
const auto finish = [=](const QString &url) {
makeRequest(MTPpayments_GetStarsRevenueStats(
MTP_flags(0),
(_isUser ? user()->input : channel()->input)
)).done([=](const MTPpayments_StarsRevenueStats &result) {
const auto &data = result.data();
const auto &status = data.vstatus().data();
_data = Data::CreditsEarnStatistics{
.revenueGraph = StatisticalGraphFromTL(
data.vrevenue_graph()),
.currentBalance = status.vcurrent_balance().v,
.availableBalance = status.vavailable_balance().v,
.overallRevenue = status.voverall_revenue().v,
.usdRate = data.vusd_rate().v,
.isWithdrawalEnabled = status.is_withdrawal_enabled(),
.nextWithdrawalAt = status.vnext_withdrawal_at()
? base::unixtime::parse(
status.vnext_withdrawal_at()->v)
: QDateTime(),
.buyAdsUrl = url,
};
consumer.put_done();
}).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
}).send();
};
makeRequest(
MTPpayments_GetStarsRevenueAdsAccountUrl(
(_isUser ? user()->input : channel()->input))
).done([=](const MTPpayments_StarsRevenueAdsAccountUrl &result) {
finish(qs(result.data().vurl()));
}).fail([=](const MTP::Error &error) {
finish({});
}).send();
return lifetime;
};
}
Data::CreditsEarnStatistics CreditsEarnStatistics::data() const {
return _data;
}
} // namespace Api

View File

@@ -0,0 +1,93 @@
/*
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 "api/api_statistics_sender.h"
#include "data/data_credits.h"
#include "data/data_credits_earn.h"
#include "mtproto/sender.h"
namespace Main {
class Session;
} // namespace Main
class UserData;
namespace Api {
class CreditsTopupOptions final {
public:
CreditsTopupOptions(not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<rpl::no_value, QString> request();
[[nodiscard]] Data::CreditTopupOptions options() const;
private:
const not_null<PeerData*> _peer;
Data::CreditTopupOptions _options;
MTP::Sender _api;
};
class CreditsStatus final {
public:
CreditsStatus(not_null<PeerData*> peer);
void request(
const Data::CreditsStatusSlice::OffsetToken &token,
Fn<void(Data::CreditsStatusSlice)> done);
private:
const not_null<PeerData*> _peer;
mtpRequestId _requestId = 0;
MTP::Sender _api;
};
class CreditsHistory final {
public:
CreditsHistory(not_null<PeerData*> peer, bool in, bool out);
void request(
const Data::CreditsStatusSlice::OffsetToken &token,
Fn<void(Data::CreditsStatusSlice)> done);
private:
using HistoryTL = MTPpayments_GetStarsTransactions;
const not_null<PeerData*> _peer;
const HistoryTL::Flags _flags;
mtpRequestId _requestId = 0;
MTP::Sender _api;
};
class CreditsEarnStatistics final : public StatisticsRequestSender {
public:
explicit CreditsEarnStatistics(not_null<PeerData*>);
[[nodiscard]] rpl::producer<rpl::no_value, QString> request();
[[nodiscard]] Data::CreditsEarnStatistics data() const;
private:
Data::CreditsEarnStatistics _data;
bool _isUser = false;
mtpRequestId _requestId = 0;
};
[[nodiscard]] rpl::producer<not_null<PeerData*>> PremiumPeerBot(
not_null<Main::Session*> session);
} // namespace Api

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_cloud_password.h"
#include "apiwrap.h"
#include "ui/layers/generic_box.h"
#include "boxes/passcode_box.h"
#include "data/data_channel.h"
#include "data/data_session.h"
@@ -34,22 +35,33 @@ void RestrictSponsored(
}
void HandleWithdrawalButton(
not_null<ChannelData*> channel,
RewardReceiver receiver,
not_null<Ui::RippleButton*> button,
std::shared_ptr<Ui::Show> show) {
Expects(receiver.currencyReceiver
|| (receiver.creditsReceiver && receiver.creditsAmount));
struct State {
rpl::lifetime lifetime;
bool loading = false;
};
const auto channel = receiver.currencyReceiver;
const auto peer = receiver.creditsReceiver;
const auto state = button->lifetime().make_state<State>();
const auto session = &channel->session();
const auto session = (channel ? &channel->session() : &peer->session());
using ChannelOutUrl = MTPstats_BroadcastRevenueWithdrawalUrl;
using CreditsOutUrl = MTPpayments_StarsRevenueWithdrawalUrl;
session->api().cloudPassword().reload();
button->setClickedCallback([=] {
const auto processOut = [=] {
if (state->loading) {
return;
}
if (peer && !receiver.creditsAmount()) {
return;
}
state->loading = true;
state->lifetime = session->api().cloudPassword().state(
) | rpl::take(
@@ -58,30 +70,81 @@ void HandleWithdrawalButton(
state->loading = false;
auto fields = PasscodeBox::CloudFields::From(pass);
fields.customTitle =
tr::lng_channel_earn_balance_password_title();
fields.customDescription =
tr::lng_channel_earn_balance_password_description(tr::now);
fields.customTitle = channel
? tr::lng_channel_earn_balance_password_title()
: tr::lng_bot_earn_balance_password_title();
fields.customDescription = channel
? tr::lng_channel_earn_balance_password_description(tr::now)
: tr::lng_bot_earn_balance_password_description(tr::now);
fields.customSubmitButton = tr::lng_passcode_submit();
fields.customCheckCallback = crl::guard(button, [=](
const Core::CloudPasswordResult &result) {
session->api().request(
MTPstats_GetBroadcastRevenueWithdrawalUrl(
channel->inputChannel,
result.result
)).done([=](const MTPstats_BroadcastRevenueWithdrawalUrl &r) {
const auto url = qs(r.data().vurl());
if (!url.isEmpty()) {
UrlClickHandler::Open(url);
const Core::CloudPasswordResult &result,
QPointer<PasscodeBox> box) {
const auto done = [=](const QString &result) {
if (!result.isEmpty()) {
UrlClickHandler::Open(result);
if (box) {
box->closeBox();
}
}
}).fail([=](const MTP::Error &error) {
};
const auto fail = [=](const MTP::Error &error) {
show->showToast(error.type());
}).send();
};
if (channel) {
session->api().request(
MTPstats_GetBroadcastRevenueWithdrawalUrl(
channel->inputChannel,
result.result
)).done([=](const ChannelOutUrl &r) {
done(qs(r.data().vurl()));
}).fail(fail).send();
} else if (peer) {
session->api().request(
MTPpayments_GetStarsRevenueWithdrawalUrl(
peer->input,
MTP_long(receiver.creditsAmount()),
result.result
)).done([=](const CreditsOutUrl &r) {
done(qs(r.data().vurl()));
}).fail(fail).send();
}
});
show->show(Box<PasscodeBox>(session, fields));
});
};
button->setClickedCallback([=] {
if (state->loading) {
return;
}
const auto fail = [=](const MTP::Error &error) {
auto box = PrePasswordErrorBox(
error.type(),
session,
TextWithEntities{
tr::lng_channel_earn_out_check_password_about(tr::now),
});
if (box) {
show->show(std::move(box));
state->loading = false;
} else {
processOut();
}
};
if (channel) {
session->api().request(
MTPstats_GetBroadcastRevenueWithdrawalUrl(
channel->inputChannel,
MTP_inputCheckPasswordEmpty()
)).fail(fail).send();
} else if (peer) {
session->api().request(
MTPpayments_GetStarsRevenueWithdrawalUrl(
peer->input,
MTP_long(std::numeric_limits<int64_t>::max()),
MTP_inputCheckPasswordEmpty()
)).fail(fail).send();
}
});
}

View File

@@ -21,8 +21,14 @@ void RestrictSponsored(
bool restricted,
Fn<void(QString)> failed);
struct RewardReceiver final {
ChannelData *currencyReceiver = nullptr;
PeerData *creditsReceiver = nullptr;
Fn<uint64()> creditsAmount;
};
void HandleWithdrawalButton(
not_null<ChannelData*> channel,
RewardReceiver receiver,
not_null<Ui::RippleButton*> button,
std::shared_ptr<Ui::Show> show);

View File

@@ -12,12 +12,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_text_entities.h"
#include "ui/boxes/confirm_box.h"
#include "data/business/data_shortcut_messages.h"
#include "data/components/scheduled_messages.h"
#include "data/data_file_origin.h"
#include "data/data_histories.h"
#include "data/data_scheduled_messages.h"
#include "data/data_session.h"
#include "data/data_web_page.h"
#include "history/view/controls/history_view_compose_media_edit_manager.h"
#include "history/history.h"
#include "history/history_item.h"
#include "lang/lang_keys.h"
#include "main/main_session.h"
#include "mtproto/mtproto_response.h"
@@ -29,20 +30,20 @@ namespace {
using namespace rpl::details;
template <typename T>
constexpr auto WithId =
is_callable_plain_v<T, Fn<void()>, mtpRequestId>;
constexpr auto WithId
= is_callable_plain_v<T, Fn<void()>, mtpRequestId>;
template <typename T>
constexpr auto WithoutId =
is_callable_plain_v<T, Fn<void()>>;
constexpr auto WithoutId
= is_callable_plain_v<T, Fn<void()>>;
template <typename T>
constexpr auto WithoutCallback =
is_callable_plain_v<T>;
constexpr auto WithoutCallback
= is_callable_plain_v<T>;
template <typename T>
constexpr auto ErrorWithId =
is_callable_plain_v<T, QString, mtpRequestId>;
constexpr auto ErrorWithId
= is_callable_plain_v<T, QString, mtpRequestId>;
template <typename T>
constexpr auto ErrorWithoutId =
is_callable_plain_v<T, QString>;
constexpr auto ErrorWithoutId
= is_callable_plain_v<T, QString>;
template <typename DoneCallback, typename FailCallback>
mtpRequestId EditMessage(
@@ -81,7 +82,8 @@ mtpRequestId EditMessage(
| ((!webpage.removed && !webpage.url.isEmpty())
? MTPmessages_EditMessage::Flag::f_media
: emptyFlag)
| ((!webpage.removed && !webpage.url.isEmpty() && webpage.invert)
| (((!webpage.removed && !webpage.url.isEmpty() && webpage.invert)
|| options.invertCaption)
? MTPmessages_EditMessage::Flag::f_invert_media
: emptyFlag)
| (!sentEntities.v.isEmpty()
@@ -95,7 +97,7 @@ mtpRequestId EditMessage(
: emptyFlag);
const auto id = item->isScheduled()
? session->data().scheduledMessages().lookupId(item)
? session->scheduledMessages().lookupId(item)
: item->isBusinessShortcut()
? session->data().shortcutMessages().lookupId(item)
: item->id;
@@ -126,7 +128,7 @@ mtpRequestId EditMessage(
}
if (updateRecentStickers) {
api->requestRecentStickersForce(true);
api->requestSpecialStickersForce(false, false, true);
}
}).fail([=](const MTP::Error &error, mtpRequestId requestId) {
if constexpr (ErrorWithId<FailCallback>) {
@@ -151,9 +153,7 @@ mtpRequestId EditMessage(
const auto &text = item->originalText();
const auto webpage = (!item->media() || !item->media()->webpage())
? Data::WebPageDraft{ .removed = true }
: Data::WebPageDraft{
.id = item->media()->webpage()->id,
};
: Data::WebPageDraft::FromItem(item);
return EditMessage(
item,
text,
@@ -203,6 +203,7 @@ void RescheduleMessage(
not_null<HistoryItem*> item,
SendOptions options) {
const auto empty = [] {};
options.invertCaption = item->invertMedia();
EditMessage(item, options, empty, empty);
}
@@ -253,12 +254,100 @@ mtpRequestId EditTextMessage(
Data::WebPageDraft webpage,
SendOptions options,
Fn<void(mtpRequestId requestId)> done,
Fn<void(const QString &, mtpRequestId requestId)> fail) {
Fn<void(const QString &error, mtpRequestId requestId)> fail,
bool spoilered) {
const auto media = item->media();
if (media
&& HistoryView::MediaEditManager::CanBeSpoilered(item)
&& spoilered != media->hasSpoiler()) {
auto takeInputMedia = Fn<std::optional<MTPInputMedia>()>(nullptr);
auto takeFileReference = Fn<QByteArray()>(nullptr);
if (const auto photo = media->photo()) {
using Flag = MTPDinputMediaPhoto::Flag;
const auto flags = Flag()
| (media->ttlSeconds() ? Flag::f_ttl_seconds : Flag())
| (spoilered ? Flag::f_spoiler : Flag());
takeInputMedia = [=] {
return MTP_inputMediaPhoto(
MTP_flags(flags),
photo->mtpInput(),
MTP_int(media->ttlSeconds()));
};
takeFileReference = [=] { return photo->fileReference(); };
} else if (const auto document = media->document()) {
using Flag = MTPDinputMediaDocument::Flag;
const auto flags = Flag()
| (media->ttlSeconds() ? Flag::f_ttl_seconds : Flag())
| (spoilered ? Flag::f_spoiler : Flag());
takeInputMedia = [=] {
return MTP_inputMediaDocument(
MTP_flags(flags),
document->mtpInput(),
MTP_int(media->ttlSeconds()),
MTPstring()); // query
};
takeFileReference = [=] { return document->fileReference(); };
}
const auto usedFileReference = takeFileReference
? takeFileReference()
: QByteArray();
const auto origin = item->fullId();
const auto api = &item->history()->session().api();
const auto performRequest = [=](
const auto &repeatRequest,
mtpRequestId originalRequestId) -> mtpRequestId {
const auto handleReference = [=](
const QString &error,
mtpRequestId requestId) {
if (error.startsWith(u"FILE_REFERENCE_"_q)) {
api->refreshFileReference(origin, [=](const auto &) {
if (takeFileReference &&
(takeFileReference() != usedFileReference)) {
repeatRequest(
repeatRequest,
originalRequestId
? originalRequestId
: requestId);
} else {
fail(error, requestId);
}
});
} else {
fail(error, requestId);
}
};
const auto callback = [=](
Fn<void()> applyUpdates,
mtpRequestId requestId) {
applyUpdates();
done(originalRequestId ? originalRequestId : requestId);
};
const auto requestId = EditMessage(
item,
caption,
webpage,
options,
callback,
handleReference,
takeInputMedia ? takeInputMedia() : std::nullopt);
return originalRequestId ? originalRequestId : requestId;
};
return performRequest(performRequest, 0);
}
const auto callback = [=](Fn<void()> applyUpdates, mtpRequestId id) {
applyUpdates();
done(id);
};
return EditMessage(item, caption, webpage, options, callback, fail);
return EditMessage(
item,
caption,
webpage,
options,
callback,
fail,
std::nullopt);
}
} // namespace Api

View File

@@ -55,6 +55,7 @@ mtpRequestId EditTextMessage(
Data::WebPageDraft webpage,
SendOptions options,
Fn<void(mtpRequestId requestId)> done,
Fn<void(const QString &error, mtpRequestId requestId)> fail);
Fn<void(const QString &error, mtpRequestId requestId)> fail,
bool spoilered);
} // namespace Api

View File

@@ -0,0 +1,27 @@
/*
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
namespace Api {
template <typename Type>
void PerformForUpdate(
const MTPUpdates &updates,
Fn<void(const Type &)> callback) {
updates.match([&](const MTPDupdates &updates) {
for (const auto &update : updates.vupdates().v) {
update.match([&](const Type &d) {
callback(d);
}, [](const auto &) {
});
}
}, [](const auto &) {
});
}
} // namespace Api

View File

@@ -36,7 +36,8 @@ MTPVector<MTPDocumentAttribute> ComposeSendingDocumentAttributes(
MTP_double(document->duration() / 1000.),
MTP_int(dimensions.width()),
MTP_int(dimensions.height()),
MTPint())); // preload_prefix_size
MTPint(), // preload_prefix_size
MTPdouble())); // video_start_ts
} else {
attributes.push_back(MTP_documentAttributeImageSize(
MTP_int(dimensions.width()),

View File

@@ -34,7 +34,7 @@ namespace {
constexpr auto kSharedMediaLimit = 100;
[[nodiscard]] SendMediaReady PreparePeerPhoto(
[[nodiscard]] std::shared_ptr<FilePrepareResult> PreparePeerPhoto(
MTP::DcId dcId,
PeerId peerId,
QImage &&image) {
@@ -80,24 +80,17 @@ constexpr auto kSharedMediaLimit = 100;
MTPVector<MTPVideoSize>(),
MTP_int(dcId));
QString file, filename;
int64 filesize = 0;
QByteArray data;
return SendMediaReady(
SendMediaType::Photo,
file,
filename,
filesize,
data,
id,
id,
u"jpg"_q,
peerId,
photo,
photoThumbs,
MTP_documentEmpty(MTP_long(0)),
jpeg);
auto result = MakePreparedFile({
.id = id,
.type = SendMediaType::Photo,
});
result->type = SendMediaType::Photo;
result->setFileData(jpeg);
result->thumbId = id;
result->thumbname = "thumb.jpg";
result->photo = photo;
result->photoThumbs = photoThumbs;
return result;
}
[[nodiscard]] std::optional<MTPVideoSize> PrepareMtpMarkup(
@@ -239,7 +232,7 @@ void PeerPhoto::upload(
_api.instance().mainDcId(),
peer->id,
base::take(photo.image));
_session->uploader().uploadMedia(fakeId, ready);
_session->uploader().upload(fakeId, ready);
}
}

View File

@@ -68,6 +68,9 @@ void Polls::create(
if (action.options.shortcutId) {
sendFlags |= MTPmessages_SendMedia::Flag::f_quick_reply_shortcut;
}
if (action.options.effectId) {
sendFlags |= MTPmessages_SendMedia::Flag::f_effect;
}
const auto sendAs = action.options.sendAs;
if (sendAs) {
sendFlags |= MTPmessages_SendMedia::Flag::f_send_as;
@@ -89,7 +92,8 @@ void Polls::create(
MTPVector<MTPMessageEntity>(),
MTP_int(action.options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, action.options.shortcutId)
Data::ShortcutIdToMTP(_session, action.options.shortcutId),
MTP_long(action.options.effectId)
), [=](const MTPUpdates &result, const MTP::Response &response) {
if (clearCloudDraft) {
history->finishSavingCloudDraft(

View File

@@ -602,6 +602,41 @@ bool PremiumGiftCodeOptions::giveawayGiftsPurchaseAvailable() const {
false);
}
SponsoredToggle::SponsoredToggle(not_null<Main::Session*> session)
: _api(&session->api().instance()) {
}
rpl::producer<bool> SponsoredToggle::toggled() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
_api.request(MTPusers_GetFullUser(
MTP_inputUserSelf()
)).done([=](const MTPusers_UserFull &result) {
consumer.put_next_copy(
result.data().vfull_user().data().is_sponsored_enabled());
}).fail([=] { consumer.put_next(false); }).send();
return lifetime;
};
}
rpl::producer<rpl::no_value, QString> SponsoredToggle::setToggled(bool v) {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
_api.request(MTPaccount_ToggleSponsoredMessages(
MTP_bool(v)
)).done([=] {
consumer.put_done();
}).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
}).send();
return lifetime;
};
}
RequirePremiumState ResolveRequiresPremiumToWrite(
not_null<PeerData*> peer,
History *maybeHistory) {

View File

@@ -216,6 +216,18 @@ private:
};
class SponsoredToggle final {
public:
explicit SponsoredToggle(not_null<Main::Session*> session);
[[nodiscard]] rpl::producer<bool> toggled();
[[nodiscard]] rpl::producer<rpl::no_value, QString> setToggled(bool);
private:
MTP::Sender _api;
};
enum class RequirePremiumState {
Unknown,
Yes,

View File

@@ -24,16 +24,25 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Api {
namespace {
SendMediaReady PrepareRingtoneDocument(
std::shared_ptr<FilePrepareResult> PrepareRingtoneDocument(
MTP::DcId dcId,
const QString &filename,
const QString &filemime,
const QByteArray &content) {
const auto id = base::RandomValue<DocumentId>();
auto attributes = QVector<MTPDocumentAttribute>(
1,
MTP_documentAttributeFilename(MTP_string(filename)));
const auto id = base::RandomValue<DocumentId>();
const auto document = MTP_document(
auto result = MakePreparedFile({
.id = id,
.type = SendMediaType::File,
});
result->filename = filename;
result->content = content;
result->filesize = content.size();
result->setFileData(content);
result->document = MTP_document(
MTP_flags(0),
MTP_long(id),
MTP_long(0),
@@ -45,21 +54,7 @@ SendMediaReady PrepareRingtoneDocument(
MTPVector<MTPVideoSize>(),
MTP_int(dcId),
MTP_vector<MTPDocumentAttribute>(std::move(attributes)));
return SendMediaReady(
SendMediaType::File,
QString(), // filepath
filename,
content.size(),
content,
id,
0,
QString(),
PeerId(),
MTP_photoEmpty(MTP_long(0)),
PreparedPhotoThumbs(),
document,
QByteArray());
return result;
}
} // namespace
@@ -102,7 +97,7 @@ void Ringtones::upload(
_uploads.erase(already);
}
_uploads.emplace(fakeId, uploadedData);
_session->uploader().uploadMedia(fakeId, ready);
_session->uploader().upload(fakeId, ready);
}
void Ringtones::ready(const FullMsgId &msgId, const MTPInputFile &file) {

View File

@@ -62,6 +62,79 @@ void InnerFillMessagePostFlags(
}
}
void SendSimpleMedia(SendAction action, MTPInputMedia inputMedia) {
const auto history = action.history;
const auto peer = history->peer;
const auto session = &history->session();
const auto api = &session->api();
action.clearDraft = false;
action.generateLocal = false;
api->sendAction(action);
const auto randomId = base::RandomValue<uint64>();
auto flags = NewMessageFlags(peer);
auto sendFlags = MTPmessages_SendMedia::Flags(0);
if (action.replyTo) {
flags |= MessageFlag::HasReplyInfo;
sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to;
}
const auto silentPost = ShouldSendSilent(peer, action.options);
InnerFillMessagePostFlags(action.options, peer, flags);
if (silentPost) {
sendFlags |= MTPmessages_SendMedia::Flag::f_silent;
}
const auto sendAs = action.options.sendAs;
if (sendAs) {
sendFlags |= MTPmessages_SendMedia::Flag::f_send_as;
}
const auto messagePostAuthor = peer->isBroadcast()
? session->user()->name()
: QString();
if (action.options.scheduled) {
flags |= MessageFlag::IsOrWasScheduled;
sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_date;
}
if (action.options.shortcutId) {
flags |= MessageFlag::ShortcutMessage;
sendFlags |= MTPmessages_SendMedia::Flag::f_quick_reply_shortcut;
}
if (action.options.effectId) {
sendFlags |= MTPmessages_SendMedia::Flag::f_effect;
}
if (action.options.invertCaption) {
flags |= MessageFlag::InvertMedia;
sendFlags |= MTPmessages_SendMedia::Flag::f_invert_media;
}
auto &histories = history->owner().histories();
histories.sendPreparedMessage(
history,
action.replyTo,
randomId,
Data::Histories::PrepareMessage<MTPmessages_SendMedia>(
MTP_flags(sendFlags),
peer->input,
Data::Histories::ReplyToPlaceholder(),
std::move(inputMedia),
MTPstring(),
MTP_long(randomId),
MTPReplyMarkup(),
MTPvector<MTPMessageEntity>(),
MTP_int(action.options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(session, action.options.shortcutId),
MTP_long(action.options.effectId)
), [=](const MTPUpdates &result, const MTP::Response &response) {
}, [=](const MTP::Error &error, const MTP::Response &response) {
api->sendMessageFail(error, peer, randomId);
});
api->finishForwarding(action);
}
template <typename MediaData>
void SendExistingMedia(
MessageToSend &&message,
@@ -133,6 +206,13 @@ void SendExistingMedia(
flags |= MessageFlag::ShortcutMessage;
sendFlags |= MTPmessages_SendMedia::Flag::f_quick_reply_shortcut;
}
if (action.options.effectId) {
sendFlags |= MTPmessages_SendMedia::Flag::f_effect;
}
if (action.options.invertCaption) {
flags |= MessageFlag::InvertMedia;
sendFlags |= MTPmessages_SendMedia::Flag::f_invert_media;
}
session->data().registerMessageRandomId(randomId, newId);
@@ -144,6 +224,7 @@ void SendExistingMedia(
.date = HistoryItem::NewMessageDate(action.options),
.shortcutId = action.options.shortcutId,
.postAuthor = messagePostAuthor,
.effectId = action.options.effectId,
}, media, caption);
const auto performRequest = [=](const auto &repeatRequest) -> void {
@@ -165,7 +246,8 @@ void SendExistingMedia(
sentEntities,
MTP_int(action.options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(session, action.options.shortcutId)
Data::ShortcutIdToMTP(session, action.options.shortcutId),
MTP_long(action.options.effectId)
), [=](const MTPUpdates &result, const MTP::Response &response) {
}, [=](const MTP::Error &error, const MTP::Response &response) {
if (error.code() == 400
@@ -306,6 +388,13 @@ bool SendDice(MessageToSend &message) {
flags |= MessageFlag::ShortcutMessage;
sendFlags |= MTPmessages_SendMedia::Flag::f_quick_reply_shortcut;
}
if (action.options.effectId) {
sendFlags |= MTPmessages_SendMedia::Flag::f_effect;
}
if (action.options.invertCaption) {
flags |= MessageFlag::InvertMedia;
sendFlags |= MTPmessages_SendMedia::Flag::f_invert_media;
}
session->data().registerMessageRandomId(randomId, newId);
@@ -317,6 +406,7 @@ bool SendDice(MessageToSend &message) {
.date = HistoryItem::NewMessageDate(action.options),
.shortcutId = action.options.shortcutId,
.postAuthor = messagePostAuthor,
.effectId = action.options.effectId,
}, TextWithEntities(), MTP_messageMediaDice(
MTP_int(0),
MTP_string(emoji)));
@@ -335,7 +425,8 @@ bool SendDice(MessageToSend &message) {
MTP_vector<MTPMessageEntity>(),
MTP_int(action.options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(session, action.options.shortcutId)
Data::ShortcutIdToMTP(session, action.options.shortcutId),
MTP_long(action.options.effectId)
), [=](const MTPUpdates &result, const MTP::Response &response) {
}, [=](const MTP::Error &error, const MTP::Response &response) {
api->sendMessageFail(error, peer, randomId, newId);
@@ -344,6 +435,33 @@ bool SendDice(MessageToSend &message) {
return true;
}
void SendLocation(SendAction action, float64 lat, float64 lon) {
SendSimpleMedia(
action,
MTP_inputMediaGeoPoint(
MTP_inputGeoPoint(
MTP_flags(0),
MTP_double(lat),
MTP_double(lon),
MTPint()))); // accuracy_radius
}
void SendVenue(SendAction action, Data::InputVenue venue) {
SendSimpleMedia(
action,
MTP_inputMediaVenue(
MTP_inputGeoPoint(
MTP_flags(0),
MTP_double(venue.lat),
MTP_double(venue.lon),
MTPint()), // accuracy_radius
MTP_string(venue.title),
MTP_string(venue.address),
MTP_string(venue.provider),
MTP_string(venue.id),
MTP_string(venue.venueType)));
}
void FillMessagePostFlags(
const SendAction &action,
not_null<PeerData*> peer,
@@ -353,7 +471,7 @@ void FillMessagePostFlags(
void SendConfirmedFile(
not_null<Main::Session*> session,
const std::shared_ptr<FileLoadResult> &file) {
const std::shared_ptr<FilePrepareResult> &file) {
const auto isEditing = (file->type != SendMediaType::Audio)
&& (file->to.replaceMediaOf != 0);
const auto newId = FullMsgId(
@@ -430,6 +548,9 @@ void SendConfirmedFile(
flags |= MessageFlag::MediaIsUnread;
}
}
if (file->to.options.invertCaption) {
flags |= MessageFlag::InvertMedia;
}
const auto messageFromId = file->to.options.sendAs
? file->to.options.sendAs->id
@@ -493,6 +614,7 @@ void SendConfirmedFile(
edition.ttl = 0;
edition.mtpMedia = &media;
edition.textWithEntities = caption;
edition.invertMedia = file->to.options.invertCaption;
edition.useSameViews = true;
edition.useSameForwards = true;
edition.useSameMarkup = true;
@@ -510,6 +632,7 @@ void SendConfirmedFile(
.shortcutId = file->to.options.shortcutId,
.postAuthor = messagePostAuthor,
.groupedId = groupId,
.effectId = file->to.options.effectId,
}, caption, media);
}

View File

@@ -7,14 +7,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace Main {
class Session;
} // namespace Main
class History;
class PhotoData;
class DocumentData;
struct FileLoadResult;
struct FilePrepareResult;
namespace Data {
struct InputVenue;
} // namespace Data
namespace Main {
class Session;
} // namespace Main
namespace Api {
@@ -33,6 +37,13 @@ void SendExistingPhoto(
bool SendDice(MessageToSend &message);
// We can't create Data::LocationPoint() and use it
// for a local sending message, because we can't request
// map thumbnail in messages history without access hash.
void SendLocation(SendAction action, float64 lat, float64 lon);
void SendVenue(SendAction action, Data::InputVenue venue);
void FillMessagePostFlags(
const SendAction &action,
not_null<PeerData*> peer,
@@ -40,6 +51,6 @@ void FillMessagePostFlags(
void SendConfirmedFile(
not_null<Main::Session*> session,
const std::shared_ptr<FileLoadResult> &file);
const std::shared_ptr<FilePrepareResult> &file);
} // namespace Api

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_statistics.h"
#include "api/api_statistics_data_deserialize.h"
#include "apiwrap.h"
#include "base/unixtime.h"
#include "data/data_channel.h"
@@ -15,33 +16,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_story.h"
#include "history/history.h"
#include "main/main_session.h"
#include "statistics/statistics_data_deserialize.h"
namespace Api {
namespace {
constexpr auto kCheckRequestsTimer = 10 * crl::time(1000);
[[nodiscard]] Data::StatisticalGraph StatisticalGraphFromTL(
const MTPStatsGraph &tl) {
return tl.match([&](const MTPDstatsGraph &d) {
using namespace Statistic;
const auto zoomToken = d.vzoom_token().has_value()
? qs(*d.vzoom_token()).toUtf8()
: QByteArray();
return Data::StatisticalGraph{
StatisticalChartFromJSON(qs(d.vjson().data().vdata()).toUtf8()),
zoomToken,
};
}, [&](const MTPDstatsGraphAsync &data) {
return Data::StatisticalGraph{
.zoomToken = qs(data.vtoken()).toUtf8(),
};
}, [&](const MTPDstatsGraphError &data) {
return Data::StatisticalGraph{ .error = qs(data.verror()) };
});
}
[[nodiscard]] Data::StatisticalValue StatisticalValueFromTL(
const MTPStatsAbsValueAndPrev &tl) {
const auto current = tl.data().vcurrent().v;
@@ -223,61 +201,6 @@ Statistics::Statistics(not_null<ChannelData*> channel)
: StatisticsRequestSender(channel) {
}
StatisticsRequestSender::StatisticsRequestSender(not_null<ChannelData *> channel)
: _channel(channel)
, _api(&_channel->session().api().instance())
, _timer([=] { checkRequests(); }) {
}
StatisticsRequestSender::~StatisticsRequestSender() {
for (const auto &[dcId, ids] : _requests) {
for (const auto id : ids) {
_channel->session().api().unregisterStatsRequest(dcId, id);
}
}
}
void StatisticsRequestSender::checkRequests() {
for (auto i = begin(_requests); i != end(_requests);) {
for (auto j = begin(i->second); j != end(i->second);) {
if (_api.pending(*j)) {
++j;
} else {
_channel->session().api().unregisterStatsRequest(
i->first,
*j);
j = i->second.erase(j);
}
}
if (i->second.empty()) {
i = _requests.erase(i);
} else {
++i;
}
}
if (_requests.empty()) {
_timer.cancel();
}
}
template <typename Request, typename, typename>
auto StatisticsRequestSender::makeRequest(Request &&request) {
const auto id = _api.allocateRequestId();
const auto dcId = _channel->owner().statsDcId(_channel);
if (dcId) {
_channel->session().api().registerStatsRequest(dcId, id);
_requests[dcId].emplace(id);
if (!_timer.isActive()) {
_timer.callEach(kCheckRequestsTimer);
}
}
return std::move(_api.request(
std::forward<Request>(request)
).toDC(
dcId ? MTP::ShiftDcId(dcId, MTP::kStatsDcShift) : 0
).overrideId(id));
}
rpl::producer<rpl::no_value, QString> Statistics::request() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
@@ -747,11 +670,11 @@ Data::BoostStatus Boosts::boostStatus() const {
return _boostStatus;
}
EarnStatistics::EarnStatistics(not_null<ChannelData*> channel)
ChannelEarnStatistics::ChannelEarnStatistics(not_null<ChannelData*> channel)
: StatisticsRequestSender(channel) {
}
rpl::producer<rpl::no_value, QString> EarnStatistics::request() {
rpl::producer<rpl::no_value, QString> ChannelEarnStatistics::request() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
@@ -760,14 +683,14 @@ rpl::producer<rpl::no_value, QString> EarnStatistics::request() {
channel()->inputChannel
)).done([=](const MTPstats_BroadcastRevenueStats &result) {
const auto &data = result.data();
const auto &balances = data.vbalances().data();
_data = Data::EarnStatistics{
.topHoursGraph = StatisticalGraphFromTL(
data.vtop_hours_graph()),
.revenueGraph = StatisticalGraphFromTL(data.vrevenue_graph()),
.currentBalance = data.vcurrent_balance().v,
.availableBalance = data.vavailable_balance().v,
.overallRevenue = data.voverall_revenue().v,
.currentBalance = balances.vcurrent_balance().v,
.availableBalance = balances.vavailable_balance().v,
.overallRevenue = balances.voverall_revenue().v,
.usdRate = data.vusd_rate().v,
};
@@ -795,7 +718,7 @@ rpl::producer<rpl::no_value, QString> EarnStatistics::request() {
};
}
void EarnStatistics::requestHistory(
void ChannelEarnStatistics::requestHistory(
const Data::EarnHistorySlice::OffsetToken &token,
Fn<void(Data::EarnHistorySlice)> done) {
if (_requestId) {
@@ -860,11 +783,12 @@ void EarnStatistics::requestHistory(
.token = Data::EarnHistorySlice::OffsetToken(nextToken),
});
}).fail([=] {
done({});
_requestId = 0;
}).send();
}
Data::EarnStatistics EarnStatistics::data() const {
Data::EarnStatistics ChannelEarnStatistics::data() const {
return _data;
}

View File

@@ -7,45 +7,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/timer.h"
#include "api/api_statistics_sender.h"
#include "data/data_boosts.h"
#include "data/data_channel_earn.h"
#include "data/data_statistics.h"
#include "mtproto/sender.h"
class ChannelData;
class PeerData;
namespace Api {
class StatisticsRequestSender {
protected:
explicit StatisticsRequestSender(not_null<ChannelData*> channel);
~StatisticsRequestSender();
template <
typename Request,
typename = std::enable_if_t<!std::is_reference_v<Request>>,
typename = typename Request::Unboxed>
[[nodiscard]] auto makeRequest(Request &&request);
[[nodiscard]] MTP::Sender &api() {
return _api;
}
[[nodiscard]] not_null<ChannelData*> channel() {
return _channel;
}
private:
void checkRequests();
const not_null<ChannelData*> _channel;
MTP::Sender _api;
base::Timer _timer;
base::flat_map<MTP::DcId, base::flat_set<mtpRequestId>> _requests;
};
class Statistics final : public StatisticsRequestSender {
public:
explicit Statistics(not_null<ChannelData*> channel);
@@ -108,9 +79,9 @@ private:
};
class EarnStatistics final : public StatisticsRequestSender {
class ChannelEarnStatistics final : public StatisticsRequestSender {
public:
explicit EarnStatistics(not_null<ChannelData*> channel);
explicit ChannelEarnStatistics(not_null<ChannelData*> channel);
[[nodiscard]] rpl::producer<rpl::no_value, QString> request();
void requestHistory(

View File

@@ -0,0 +1,35 @@
/*
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_statistics_data_deserialize.h"
#include "data/data_statistics_chart.h"
#include "statistics/statistics_data_deserialize.h"
namespace Api {
Data::StatisticalGraph StatisticalGraphFromTL(const MTPStatsGraph &tl) {
return tl.match([&](const MTPDstatsGraph &d) {
using namespace Statistic;
const auto zoomToken = d.vzoom_token().has_value()
? qs(*d.vzoom_token()).toUtf8()
: QByteArray();
return Data::StatisticalGraph{
StatisticalChartFromJSON(qs(d.vjson().data().vdata()).toUtf8()),
zoomToken,
};
}, [&](const MTPDstatsGraphAsync &data) {
return Data::StatisticalGraph{
.zoomToken = qs(data.vtoken()).toUtf8(),
};
}, [&](const MTPDstatsGraphError &data) {
return Data::StatisticalGraph{ .error = qs(data.verror()) };
});
}
} // namespace Api

View File

@@ -0,0 +1,19 @@
/*
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
namespace Data {
struct StatisticalGraph;
} // namespace Data
namespace Api {
[[nodiscard]] Data::StatisticalGraph StatisticalGraphFromTL(
const MTPStatsGraph &tl);
} // namespace Api

View File

@@ -0,0 +1,86 @@
/*
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_statistics_sender.h"
#include "apiwrap.h"
#include "data/data_peer.h"
#include "data/data_session.h"
#include "main/main_session.h"
namespace Api {
StatisticsRequestSender::StatisticsRequestSender(
not_null<PeerData*> peer)
: _peer(peer)
, _channel(peer->asChannel())
, _user(peer->asUser())
, _api(&_peer->session().api().instance())
, _timer([=] { checkRequests(); }) {
}
MTP::Sender &StatisticsRequestSender::api() {
return _api;
}
not_null<ChannelData*> StatisticsRequestSender::channel() {
Expects(_channel);
return _channel;
}
not_null<UserData*> StatisticsRequestSender::user() {
Expects(_user);
return _user;
}
void StatisticsRequestSender::checkRequests() {
for (auto i = begin(_requests); i != end(_requests);) {
for (auto j = begin(i->second); j != end(i->second);) {
if (_api.pending(*j)) {
++j;
} else {
_peer->session().api().unregisterStatsRequest(
i->first,
*j);
j = i->second.erase(j);
}
}
if (i->second.empty()) {
i = _requests.erase(i);
} else {
++i;
}
}
if (_requests.empty()) {
_timer.cancel();
}
}
auto StatisticsRequestSender::ensureRequestIsRegistered()
-> StatisticsRequestSender::Registered {
const auto id = _api.allocateRequestId();
const auto dcId = _peer->owner().statsDcId(_peer);
if (dcId) {
_peer->session().api().registerStatsRequest(dcId, id);
_requests[dcId].emplace(id);
if (!_timer.isActive()) {
constexpr auto kCheckRequestsTimer = 10 * crl::time(1000);
_timer.callEach(kCheckRequestsTimer);
}
}
return StatisticsRequestSender::Registered{ id, dcId };
}
StatisticsRequestSender::~StatisticsRequestSender() {
for (const auto &[dcId, ids] : _requests) {
for (const auto id : ids) {
_peer->session().api().unregisterStatsRequest(dcId, id);
}
}
}
} // namespace Api

View File

@@ -0,0 +1,58 @@
/*
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 "base/timer.h"
#include "mtproto/sender.h"
class ChannelData;
class PeerData;
class UserData;
namespace Api {
class StatisticsRequestSender {
protected:
explicit StatisticsRequestSender(not_null<PeerData*> peer);
~StatisticsRequestSender();
template <
typename Request,
typename = std::enable_if_t<!std::is_reference_v<Request>>,
typename = typename Request::Unboxed>
[[nodiscard]] auto makeRequest(Request &&request) {
const auto [id, dcId] = ensureRequestIsRegistered();
return std::move(_api.request(
std::forward<Request>(request)
).toDC(
dcId ? MTP::ShiftDcId(dcId, MTP::kStatsDcShift) : 0
).overrideId(id));
}
[[nodiscard]] MTP::Sender &api();
[[nodiscard]] not_null<ChannelData*> channel();
[[nodiscard]] not_null<UserData*> user();
private:
struct Registered final {
mtpRequestId id;
MTP::DcId dcId;
};
[[nodiscard]] Registered ensureRequestIsRegistered();
void checkRequests();
const not_null<PeerData*> _peer;
ChannelData * const _channel;
UserData * const _user;
MTP::Sender _api;
base::Timer _timer;
base::flat_map<MTP::DcId, base::flat_set<mtpRequestId>> _requests;
};
} // namespace Api

View File

@@ -7,12 +7,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_text_entities.h"
#include "main/main_session.h"
#include "data/data_document.h"
#include "data/data_session.h"
#include "data/data_user.h"
#include "data/stickers/data_custom_emoji.h"
#include "data/stickers/data_stickers_set.h"
#include "data/data_session.h"
#include "data/data_document.h"
#include "data/data_user.h"
#include "main/main_session.h"
namespace Api {
namespace {
@@ -62,67 +62,168 @@ using namespace TextUtilities;
EntitiesInText EntitiesFromMTP(
Main::Session *session,
const QVector<MTPMessageEntity> &entities) {
if (entities.isEmpty()) {
return {};
}
auto result = EntitiesInText();
if (!entities.isEmpty()) {
result.reserve(entities.size());
for (const auto &entity : entities) {
switch (entity.type()) {
case mtpc_messageEntityUrl: { auto &d = entity.c_messageEntityUrl(); result.push_back({ EntityType::Url, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityTextUrl: { auto &d = entity.c_messageEntityTextUrl(); result.push_back({ EntityType::CustomUrl, d.voffset().v, d.vlength().v, qs(d.vurl()) }); } break;
case mtpc_messageEntityEmail: { auto &d = entity.c_messageEntityEmail(); result.push_back({ EntityType::Email, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityHashtag: { auto &d = entity.c_messageEntityHashtag(); result.push_back({ EntityType::Hashtag, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityCashtag: { auto &d = entity.c_messageEntityCashtag(); result.push_back({ EntityType::Cashtag, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityPhone: break; // Skipping phones.
case mtpc_messageEntityMention: { auto &d = entity.c_messageEntityMention(); result.push_back({ EntityType::Mention, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityMentionName: if (session) {
const auto &d = entity.c_messageEntityMentionName();
const auto userId = UserId(d.vuser_id());
const auto user = session->data().userLoaded(userId);
const auto data = MentionNameDataFromFields({
.selfId = session->userId().bare,
.userId = userId.bare,
.accessHash = user ? user->accessHash() : 0,
});
result.push_back({ EntityType::MentionName, d.voffset().v, d.vlength().v, data });
} break;
case mtpc_inputMessageEntityMentionName: if (session) {
const auto &d = entity.c_inputMessageEntityMentionName();
const auto data = d.vuser_id().match([&](
const MTPDinputUserSelf &) {
return MentionNameDataFromFields({
.selfId = session->userId().bare,
.userId = session->userId().bare,
.accessHash = session->user()->accessHash(),
});
}, [&](const MTPDinputUser &data) {
return MentionNameDataFromFields({
.selfId = session->userId().bare,
.userId = UserId(data.vuser_id()).bare,
.accessHash = data.vaccess_hash().v,
});
}, [&](const auto &) {
return QString();
});
if (!data.isEmpty()) {
result.push_back({ EntityType::MentionName, d.voffset().v, d.vlength().v, data });
}
} break;
case mtpc_messageEntityBotCommand: { auto &d = entity.c_messageEntityBotCommand(); result.push_back({ EntityType::BotCommand, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityBold: { auto &d = entity.c_messageEntityBold(); result.push_back({ EntityType::Bold, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityItalic: { auto &d = entity.c_messageEntityItalic(); result.push_back({ EntityType::Italic, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityUnderline: { auto &d = entity.c_messageEntityUnderline(); result.push_back({ EntityType::Underline, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityStrike: { auto &d = entity.c_messageEntityStrike(); result.push_back({ EntityType::StrikeOut, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityCode: { auto &d = entity.c_messageEntityCode(); result.push_back({ EntityType::Code, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityPre: { auto &d = entity.c_messageEntityPre(); result.push_back({ EntityType::Pre, d.voffset().v, d.vlength().v, qs(d.vlanguage()) }); } break;
case mtpc_messageEntityBlockquote: { auto &d = entity.c_messageEntityBlockquote(); result.push_back({ EntityType::Blockquote, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityBankCard: break; // Skipping cards. // #TODO entities
case mtpc_messageEntitySpoiler: { auto &d = entity.c_messageEntitySpoiler(); result.push_back({ EntityType::Spoiler, d.voffset().v, d.vlength().v }); } break;
case mtpc_messageEntityCustomEmoji: {
const auto &d = entity.c_messageEntityCustomEmoji();
result.push_back({ EntityType::CustomEmoji, d.voffset().v, d.vlength().v, CustomEmojiEntityData(d) });
} break;
result.reserve(entities.size());
for (const auto &entity : entities) {
entity.match([&](const MTPDmessageEntityUnknown &d) {
}, [&](const MTPDmessageEntityMention &d) {
result.push_back({
EntityType::Mention,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityHashtag &d) {
result.push_back({
EntityType::Hashtag,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityBotCommand &d) {
result.push_back({
EntityType::BotCommand,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityUrl &d) {
result.push_back({
EntityType::Url,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityEmail &d) {
result.push_back({
EntityType::Email,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityBold &d) {
result.push_back({
EntityType::Bold,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityItalic &d) {
result.push_back({
EntityType::Italic,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityCode &d) {
result.push_back({
EntityType::Code,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityPre &d) {
result.push_back({
EntityType::Pre,
d.voffset().v,
d.vlength().v,
qs(d.vlanguage()),
});
}, [&](const MTPDmessageEntityTextUrl &d) {
result.push_back({
EntityType::CustomUrl,
d.voffset().v,
d.vlength().v,
qs(d.vurl()),
});
}, [&](const MTPDmessageEntityMentionName &d) {
if (!session) {
return;
}
}
const auto userId = UserId(d.vuser_id());
const auto user = session->data().userLoaded(userId);
const auto data = MentionNameDataFromFields({
.selfId = session->userId().bare,
.userId = userId.bare,
.accessHash = user ? user->accessHash() : 0,
});
result.push_back({
EntityType::MentionName,
d.voffset().v,
d.vlength().v,
data,
});
}, [&](const MTPDinputMessageEntityMentionName &d) {
if (!session) {
return;
}
const auto data = d.vuser_id().match([&](
const MTPDinputUserSelf &) {
return MentionNameDataFromFields({
.selfId = session->userId().bare,
.userId = session->userId().bare,
.accessHash = session->user()->accessHash(),
});
}, [&](const MTPDinputUser &data) {
return MentionNameDataFromFields({
.selfId = session->userId().bare,
.userId = UserId(data.vuser_id()).bare,
.accessHash = data.vaccess_hash().v,
});
}, [](const auto &) {
return QString();
});
if (!data.isEmpty()) {
result.push_back({
EntityType::MentionName,
d.voffset().v,
d.vlength().v,
data,
});
}
}, [&](const MTPDmessageEntityPhone &d) {
result.push_back({
EntityType::Phone,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityCashtag &d) {
result.push_back({
EntityType::Cashtag,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityUnderline &d) {
result.push_back({
EntityType::Underline,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityStrike &d) {
result.push_back({
EntityType::StrikeOut,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityBankCard &d) {
// Skipping cards. // #TODO entities
}, [&](const MTPDmessageEntitySpoiler &d) {
result.push_back({
EntityType::Spoiler,
d.voffset().v,
d.vlength().v,
});
}, [&](const MTPDmessageEntityCustomEmoji &d) {
result.push_back({
EntityType::CustomEmoji,
d.voffset().v,
d.vlength().v,
CustomEmojiEntityData(d),
});
}, [&](const MTPDmessageEntityBlockquote &d) {
result.push_back({
EntityType::Blockquote,
d.voffset().v,
d.vlength().v,
d.is_collapsed() ? u"1"_q : QString(),
});
});
}
return result;
}
@@ -134,7 +235,9 @@ MTPVector<MTPMessageEntity> EntitiesToMTP(
auto v = QVector<MTPMessageEntity>();
v.reserve(entities.size());
for (const auto &entity : entities) {
if (entity.length() <= 0) continue;
if (entity.length() <= 0) {
continue;
}
if (option == ConvertOption::SkipLocal
&& entity.type() != EntityType::Bold
//&& entity.type() != EntityType::Semibold // Not in API.
@@ -154,28 +257,85 @@ MTPVector<MTPMessageEntity> EntitiesToMTP(
auto offset = MTP_int(entity.offset());
auto length = MTP_int(entity.length());
switch (entity.type()) {
case EntityType::Url: v.push_back(MTP_messageEntityUrl(offset, length)); break;
case EntityType::CustomUrl: v.push_back(MTP_messageEntityTextUrl(offset, length, MTP_string(entity.data()))); break;
case EntityType::Email: v.push_back(MTP_messageEntityEmail(offset, length)); break;
case EntityType::Hashtag: v.push_back(MTP_messageEntityHashtag(offset, length)); break;
case EntityType::Cashtag: v.push_back(MTP_messageEntityCashtag(offset, length)); break;
case EntityType::Mention: v.push_back(MTP_messageEntityMention(offset, length)); break;
case EntityType::Url: {
v.push_back(MTP_messageEntityUrl(offset, length));
} break;
case EntityType::CustomUrl: {
v.push_back(
MTP_messageEntityTextUrl(
offset,
length,
MTP_string(entity.data())));
} break;
case EntityType::Email: {
v.push_back(MTP_messageEntityEmail(offset, length));
} break;
case EntityType::Phone: {
v.push_back(MTP_messageEntityPhone(offset, length));
} break;
case EntityType::Hashtag: {
v.push_back(MTP_messageEntityHashtag(offset, length));
} break;
case EntityType::Cashtag: {
v.push_back(MTP_messageEntityCashtag(offset, length));
} break;
case EntityType::Mention: {
v.push_back(MTP_messageEntityMention(offset, length));
} break;
case EntityType::MentionName: {
if (const auto valid = MentionNameEntity(session, offset, length, entity.data())) {
const auto valid = MentionNameEntity(
session,
offset,
length,
entity.data());
if (valid) {
v.push_back(*valid);
}
} break;
case EntityType::BotCommand: v.push_back(MTP_messageEntityBotCommand(offset, length)); break;
case EntityType::Bold: v.push_back(MTP_messageEntityBold(offset, length)); break;
case EntityType::Italic: v.push_back(MTP_messageEntityItalic(offset, length)); break;
case EntityType::Underline: v.push_back(MTP_messageEntityUnderline(offset, length)); break;
case EntityType::StrikeOut: v.push_back(MTP_messageEntityStrike(offset, length)); break;
case EntityType::Code: v.push_back(MTP_messageEntityCode(offset, length)); break; // #TODO entities
case EntityType::Pre: v.push_back(MTP_messageEntityPre(offset, length, MTP_string(entity.data()))); break;
case EntityType::Blockquote: v.push_back(MTP_messageEntityBlockquote(offset, length)); break;
case EntityType::Spoiler: v.push_back(MTP_messageEntitySpoiler(offset, length)); break;
case EntityType::BotCommand: {
v.push_back(MTP_messageEntityBotCommand(offset, length));
} break;
case EntityType::Bold: {
v.push_back(MTP_messageEntityBold(offset, length));
} break;
case EntityType::Italic: {
v.push_back(MTP_messageEntityItalic(offset, length));
} break;
case EntityType::Underline: {
v.push_back(MTP_messageEntityUnderline(offset, length));
} break;
case EntityType::StrikeOut: {
v.push_back(MTP_messageEntityStrike(offset, length));
} break;
case EntityType::Code: {
// #TODO entities.
v.push_back(MTP_messageEntityCode(offset, length));
} break;
case EntityType::Pre: {
v.push_back(
MTP_messageEntityPre(
offset,
length,
MTP_string(entity.data())));
} break;
case EntityType::Blockquote: {
using Flag = MTPDmessageEntityBlockquote::Flag;
const auto collapsed = !entity.data().isEmpty();
v.push_back(
MTP_messageEntityBlockquote(
MTP_flags(collapsed ? Flag::f_collapsed : Flag()),
offset,
length));
} break;
case EntityType::Spoiler: {
v.push_back(MTP_messageEntitySpoiler(offset, length));
} break;
case EntityType::CustomEmoji: {
if (const auto valid = CustomEmojiEntity(offset, length, entity.data())) {
const auto valid = CustomEmojiEntity(
offset,
length,
entity.data());
if (valid) {
v.push_back(*valid);
}
} break;

View File

@@ -21,6 +21,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mtproto/mtproto_config.h"
#include "mtproto/mtproto_dc_options.h"
#include "data/business/data_shortcut_messages.h"
#include "data/components/scheduled_messages.h"
#include "data/components/top_peers.h"
#include "data/notify/data_notify_settings.h"
#include "data/stickers/data_stickers.h"
#include "data/data_saved_messages.h"
@@ -37,7 +39,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_histories.h"
#include "data/data_folder.h"
#include "data/data_forum.h"
#include "data/data_scheduled_messages.h"
#include "data/data_send_action.h"
#include "data/data_stories.h"
#include "data/data_message_reactions.h"
@@ -94,7 +95,7 @@ void ProcessScheduledMessageWithElapsedTime(
// 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);
session->scheduledMessages().checkEntitiesAndUpdate(data);
}
}
@@ -1136,7 +1137,9 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) {
MTPMessageReactions(),
MTPVector<MTPRestrictionReason>(),
MTP_int(d.vttl_period().value_or_empty()),
MTPint()), // quick_reply_shortcut_id
MTPint(), // quick_reply_shortcut_id
MTPlong(), // effect
MTPFactCheck()),
MessageFlags(),
NewMessageType::Unread);
} break;
@@ -1171,7 +1174,9 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) {
MTPMessageReactions(),
MTPVector<MTPRestrictionReason>(),
MTP_int(d.vttl_period().value_or_empty()),
MTPint()), // quick_reply_shortcut_id
MTPint(), // quick_reply_shortcut_id
MTPlong(), // effect
MTPFactCheck()),
MessageFlags(),
NewMessageType::Unread);
} break;
@@ -1464,7 +1469,9 @@ void Updates::applyUpdates(
if (const auto id = owner.messageIdByRandomId(randomId)) {
const auto local = owner.message(id);
if (local && local->isScheduled()) {
owner.scheduledMessages().sendNowSimpleMessage(d, local);
session().scheduledMessages().sendNowSimpleMessage(
d,
local);
}
}
const auto wasAlready = (lookupMessage() != nullptr);
@@ -1561,7 +1568,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
auto &owner = session().data();
if (const auto local = owner.message(id)) {
if (local->isScheduled()) {
session().data().scheduledMessages().apply(d, local);
session().scheduledMessages().apply(d, local);
} else if (local->isBusinessShortcut()) {
session().data().shortcutMessages().apply(d, local);
} else {
@@ -1575,6 +1582,11 @@ void Updates::feedUpdate(const MTPUpdate &update) {
} else {
if (existing) {
existing->destroy();
} else {
// Not the server-side date, but close enough.
session().topPeers().increment(
local->history()->peer,
local->date());
}
local->setRealId(d.vid().v);
}
@@ -1684,7 +1696,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
const auto peerId = peerFromMTP(d.vpeer());
const auto msgId = d.vmsg_id().v;
if (const auto item = session().data().message(peerId, msgId)) {
item->applyEdition(d.vextended_media());
item->applyEdition(d.vextended_media().v);
}
} break;
@@ -1771,12 +1783,12 @@ void Updates::feedUpdate(const MTPUpdate &update) {
case mtpc_updateNewScheduledMessage: {
const auto &d = update.c_updateNewScheduledMessage();
session().data().scheduledMessages().apply(d);
session().scheduledMessages().apply(d);
} break;
case mtpc_updateDeleteScheduledMessages: {
const auto &d = update.c_updateDeleteScheduledMessages();
session().data().scheduledMessages().apply(d);
session().scheduledMessages().apply(d);
} break;
case mtpc_updateQuickReplies: {
@@ -2109,6 +2121,8 @@ void Updates::feedUpdate(const MTPUpdate &update) {
};
if (IsForceLogoutNotification(d)) {
Core::App().forceLogOut(&session().account(), text);
} else if (IsWithdrawalNotification(d)) {
return;
} else if (d.is_popup()) {
const auto &windows = session().windows();
if (!windows.empty()) {
@@ -2602,7 +2616,16 @@ void Updates::feedUpdate(const MTPUpdate &update) {
_session->data().stories().apply(data.vstealth_mode());
} break;
case mtpc_updateStarsBalance: {
const auto &data = update.c_updateStarsBalance();
_session->setCredits(data.vbalance().v);
} break;
}
}
bool IsWithdrawalNotification(const MTPDupdateServiceNotification &data) {
return qs(data.vtype()).startsWith(u"API_WITHDRAWAL_FEATURE_DISABLED_"_q);
}
} // namespace Api

View File

@@ -211,4 +211,7 @@ private:
};
[[nodiscard]] bool IsWithdrawalNotification(
const MTPDupdateServiceNotification &);
} // namespace Api

View File

@@ -307,8 +307,8 @@ void UserPrivacy::reload(Key key) {
}
void UserPrivacy::pushPrivacy(Key key, const TLRules &rules) {
const auto &saved = (_privacyValues[key] =
TLToRules(rules, _session->data()));
const auto &saved
= (_privacyValues[key] = TLToRules(rules, _session->data()));
const auto i = _privacyChanges.find(key);
if (i != end(_privacyChanges)) {
i->second.fire_copy(saved);

View File

@@ -55,7 +55,9 @@ void ViewsManager::removeIncremented(not_null<PeerData*> peer) {
_incremented.remove(peer);
}
void ViewsManager::pollExtendedMedia(not_null<HistoryItem*> item) {
void ViewsManager::pollExtendedMedia(
not_null<HistoryItem*> item,
bool force) {
if (!item->isRegular()) {
return;
}
@@ -63,14 +65,20 @@ void ViewsManager::pollExtendedMedia(not_null<HistoryItem*> item) {
const auto peer = item->history()->peer;
auto &request = _pollRequests[peer];
if (request.ids.contains(id) || request.sent.contains(id)) {
return;
if (!force || request.forced) {
return;
}
}
request.ids.emplace(id);
if (!request.id && !request.when) {
request.when = crl::now() + kPollExtendedMediaPeriod;
if (force) {
request.forced = true;
}
if (!_pollTimer.isActive()) {
_pollTimer.callOnce(kPollExtendedMediaPeriod);
const auto delay = force ? 1 : kPollExtendedMediaPeriod;
if (!request.id && (!request.when || force)) {
request.when = crl::now() + delay;
}
if (!_pollTimer.isActive() || force) {
_pollTimer.callOnce(delay);
}
}
@@ -160,9 +168,12 @@ void ViewsManager::sendPollRequests(
if (i->second.ids.empty()) {
i = _pollRequests.erase(i);
} else {
i->second.when = now + kPollExtendedMediaPeriod;
if (!_pollTimer.isActive()) {
_pollTimer.callOnce(kPollExtendedMediaPeriod);
const auto delay = i->second.forced
? 1
: kPollExtendedMediaPeriod;
i->second.when = now + delay;
if (!_pollTimer.isActive() || i->second.forced) {
_pollTimer.callOnce(delay);
}
++i;
}

View File

@@ -26,7 +26,7 @@ public:
void scheduleIncrement(not_null<HistoryItem*> item);
void removeIncremented(not_null<PeerData*> peer);
void pollExtendedMedia(not_null<HistoryItem*> item);
void pollExtendedMedia(not_null<HistoryItem*> item, bool force = false);
private:
struct PollExtendedMediaRequest {
@@ -34,6 +34,7 @@ private:
mtpRequestId id = 0;
base::flat_set<MsgId> ids;
base::flat_set<MsgId> sent;
bool forced = false;
};
void viewsIncrement();

View File

@@ -35,6 +35,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_user_names.h"
#include "api/api_websites.h"
#include "data/business/data_shortcut_messages.h"
#include "data/components/scheduled_messages.h"
#include "data/notify/data_notify_settings.h"
#include "data/data_changes.h"
#include "data/data_web_page.h"
@@ -43,13 +44,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_forum.h"
#include "data/data_saved_sublist.h"
#include "data/data_search_controller.h"
#include "data/data_scheduled_messages.h"
#include "data/data_session.h"
#include "data/data_channel.h"
#include "data/data_chat.h"
#include "data/data_user.h"
#include "data/data_chat_filters.h"
#include "data/data_histories.h"
#include "data/data_history_messages.h"
#include "core/core_cloud_password.h"
#include "core/application.h"
#include "base/unixtime.h"
@@ -542,7 +543,7 @@ void ApiWrap::sendMessageFail(
}
}
} else if (error == u"SCHEDULE_STATUS_PRIVATE"_q) {
auto &scheduled = _session->data().scheduledMessages();
auto &scheduled = _session->scheduledMessages();
Assert(peer->isUser());
if (const auto item = scheduled.lookupItem(peer->id, itemId.msg)) {
scheduled.removeSending(item);
@@ -1544,8 +1545,8 @@ void ApiWrap::saveStickerSets(
writeRecent = true;
}
const auto isAttached =
(removedSetId == Data::Stickers::CloudRecentAttachedSetId);
const auto isAttached
= (removedSetId == Data::Stickers::CloudRecentAttachedSetId);
const auto flags = isAttached
? MTPmessages_ClearRecentStickers::Flag::f_attached
: MTPmessages_ClearRecentStickers::Flags(0);
@@ -2164,7 +2165,8 @@ void ApiWrap::saveDraftsToCloud() {
entities,
Data::WebPageForMTP(
cloudDraft->webpage,
textWithTags.text.isEmpty())
textWithTags.text.isEmpty()),
MTP_long(0) // effect
)).done([=](const MTPBool &result, const MTP::Response &response) {
const auto requestId = response.requestId;
history->finishSavingCloudDraft(
@@ -2447,8 +2449,8 @@ void ApiWrap::refreshFileReference(
_session->data().peer(storyId.peer)->input,
MTP_vector<MTPint>(1, MTP_int(storyId.story))));
} else if (item->isScheduled()) {
const auto &scheduled = _session->data().scheduledMessages();
const auto realId = scheduled.lookupId(item);
const auto realId = _session->scheduledMessages().lookupId(
item);
request(MTPmessages_GetScheduledMessages(
item->history()->peer->input,
MTP_vector<MTPint>(1, MTP_int(realId))));
@@ -2494,8 +2496,8 @@ void ApiWrap::refreshFileReference(
}, [&](Data::FileOriginPeerPhoto data) {
fail();
}, [&](Data::FileOriginStickerSet data) {
const auto isRecentAttached =
(data.setId == Data::Stickers::CloudRecentAttachedSetId);
const auto isRecentAttached
= (data.setId == Data::Stickers::CloudRecentAttachedSetId);
if (data.setId == Data::Stickers::CloudRecentSetId
|| data.setId == Data::Stickers::RecentSetId
|| isRecentAttached) {
@@ -2583,7 +2585,7 @@ void ApiWrap::gotWebPages(ChannelData *channel, const MTPmessages_Messages &resu
void ApiWrap::updateStickers() {
const auto now = crl::now();
requestStickers(now);
requestRecentStickers(now);
requestRecentStickers(now, false);
requestFavedStickers(now);
requestFeaturedStickers(now);
}
@@ -2605,8 +2607,15 @@ void ApiWrap::updateCustomEmoji() {
requestFeaturedEmoji(now);
}
void ApiWrap::requestRecentStickersForce(bool attached) {
requestRecentStickersWithHash(0, attached);
void ApiWrap::requestSpecialStickersForce(
bool faved,
bool recent,
bool attached) {
if (faved) {
requestFavedStickers(std::nullopt);
} else if (recent || attached) {
requestRecentStickers(std::nullopt, attached);
}
}
void ApiWrap::setGroupStickerSet(
@@ -2759,18 +2768,17 @@ void ApiWrap::requestCustomEmoji(TimeId now) {
}).send();
}
void ApiWrap::requestRecentStickers(TimeId now, bool attached) {
const auto needed = attached
? _session->data().stickers().recentAttachedUpdateNeeded(now)
: _session->data().stickers().recentUpdateNeeded(now);
void ApiWrap::requestRecentStickers(
std::optional<TimeId> now,
bool attached) {
const auto needed = !now
? true
: attached
? _session->data().stickers().recentAttachedUpdateNeeded(*now)
: _session->data().stickers().recentUpdateNeeded(*now);
if (!needed) {
return;
}
requestRecentStickersWithHash(
Api::CountRecentStickersHash(_session, attached), attached);
}
void ApiWrap::requestRecentStickersWithHash(uint64 hash, bool attached) {
const auto requestId = [=]() -> mtpRequestId & {
return attached
? _recentAttachedStickersUpdateRequest
@@ -2793,7 +2801,7 @@ void ApiWrap::requestRecentStickersWithHash(uint64 hash, bool attached) {
: MTPmessages_getRecentStickers::Flags(0);
requestId() = request(MTPmessages_GetRecentStickers(
MTP_flags(flags),
MTP_long(hash)
MTP_long(now ? Api::CountRecentStickersHash(_session, attached) : 0)
)).done([=](const MTPmessages_RecentStickers &result) {
finish();
@@ -2820,13 +2828,15 @@ void ApiWrap::requestRecentStickersWithHash(uint64 hash, bool attached) {
}).send();
}
void ApiWrap::requestFavedStickers(TimeId now) {
if (!_session->data().stickers().favedUpdateNeeded(now)
|| _favedStickersUpdateRequest) {
return;
void ApiWrap::requestFavedStickers(std::optional<TimeId> now) {
if (now) {
if (!_session->data().stickers().favedUpdateNeeded(*now)
|| _favedStickersUpdateRequest) {
return;
}
}
_favedStickersUpdateRequest = request(MTPmessages_GetFavedStickers(
MTP_long(Api::CountFavedStickersHash(_session))
MTP_long(now ? Api::CountFavedStickersHash(_session) : 0)
)).done([=](const MTPmessages_FavedStickers &result) {
_session->data().stickers().setLastFavedUpdate(crl::now());
_favedStickersUpdateRequest = 0;
@@ -3078,6 +3088,46 @@ void ApiWrap::resolveJumpToHistoryDate(
}
}
void ApiWrap::requestHistory(
not_null<History*> history,
MsgId messageId,
SliceType slice) {
const auto peer = history->peer;
const auto key = HistoryRequest{
peer,
messageId,
slice,
};
if (_historyRequests.contains(key)) {
return;
}
const auto prepared = Api::PrepareHistoryRequest(peer, messageId, slice);
auto &histories = history->owner().histories();
const auto requestType = Data::Histories::RequestType::History;
histories.sendRequest(history, requestType, [=](Fn<void()> finish) {
return request(
std::move(prepared)
).done([=](const Api::HistoryRequestResult &result) {
_historyRequests.remove(key);
auto parsed = Api::ParseHistoryResult(
peer,
messageId,
slice,
result);
history->messages().addSlice(
std::move(parsed.messageIds),
parsed.noSkipRange,
parsed.fullCount);
finish();
}).fail([=] {
_historyRequests.remove(key);
finish();
}).send();
});
_historyRequests.emplace(key);
}
void ApiWrap::requestSharedMedia(
not_null<PeerData*> peer,
MsgId topicRootId,
@@ -3342,6 +3392,9 @@ void ApiWrap::forwardMessages(
.date = HistoryItem::NewMessageDate(action.options),
.shortcutId = action.options.shortcutId,
.postAuthor = messagePostAuthor,
// forwarded messages don't have effects
//.effectId = action.options.effectId,
}, item);
_session->data().registerMessageRandomId(randomId, newId);
if (!localIds) {
@@ -3442,6 +3495,7 @@ void ApiWrap::sendSharedContact(
.date = HistoryItem::NewMessageDate(action.options),
.shortcutId = action.options.shortcutId,
.postAuthor = messagePostAuthor,
.effectId = action.options.effectId,
}, TextWithEntities(), MTP_messageMediaContact(
MTP_string(phone),
MTP_string(firstName),
@@ -3729,7 +3783,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
const auto anonymousPost = peer->amAnonymous();
const auto silentPost = ShouldSendSilent(peer, action.options);
FillMessagePostFlags(action, peer, flags);
if (exactWebPage && !ignoreWebPage && message.webPage.invert) {
if ((exactWebPage && !ignoreWebPage && message.webPage.invert)
|| action.options.invertCaption) {
flags |= MessageFlag::InvertMedia;
sendFlags |= MTPmessages_SendMessage::Flag::f_invert_media;
mediaFlags |= MTPmessages_SendMedia::Flag::f_invert_media;
@@ -3775,6 +3830,10 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
sendFlags |= MTPmessages_SendMessage::Flag::f_quick_reply_shortcut;
mediaFlags |= MTPmessages_SendMedia::Flag::f_quick_reply_shortcut;
}
if (action.options.effectId) {
sendFlags |= MTPmessages_SendMessage::Flag::f_effect;
mediaFlags |= MTPmessages_SendMedia::Flag::f_effect;
}
lastMessage = history->addNewLocalMessage({
.id = newId.msg,
.flags = flags,
@@ -3783,6 +3842,7 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
.date = HistoryItem::NewMessageDate(action.options),
.shortcutId = action.options.shortcutId,
.postAuthor = messagePostAuthor,
.effectId = action.options.effectId,
}, sending, media);
const auto done = [=](
const MTPUpdates &result,
@@ -3828,7 +3888,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
sentEntities,
MTP_int(action.options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
mtpShortcut
mtpShortcut,
MTP_long(action.options.effectId)
), done, fail);
} else {
histories.sendPreparedMessage(
@@ -3845,7 +3906,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
sentEntities,
MTP_int(action.options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
mtpShortcut
mtpShortcut,
MTP_long(action.options.effectId)
), done, fail);
}
isFirst = false;
@@ -4119,7 +4181,9 @@ void ApiWrap::sendMediaWithRandomId(
| (!sentEntities.v.isEmpty() ? Flag::f_entities : Flag(0))
| (options.scheduled ? Flag::f_schedule_date : Flag(0))
| (options.sendAs ? Flag::f_send_as : Flag(0))
| (options.shortcutId ? Flag::f_quick_reply_shortcut : Flag(0));
| (options.shortcutId ? Flag::f_quick_reply_shortcut : Flag(0))
| (options.effectId ? Flag::f_effect : Flag(0))
| (options.invertCaption ? Flag::f_invert_media : Flag(0));
auto &histories = history->owner().histories();
const auto peer = history->peer;
@@ -4132,18 +4196,23 @@ void ApiWrap::sendMediaWithRandomId(
MTP_flags(flags),
peer->input,
Data::Histories::ReplyToPlaceholder(),
media,
(options.price
? MTPInputMedia(MTP_inputMediaPaidMedia(
MTP_long(options.price),
MTP_vector<MTPInputMedia>(1, media)))
: media),
MTP_string(caption.text),
MTP_long(randomId),
MTPReplyMarkup(),
sentEntities,
MTP_int(options.scheduled),
(options.sendAs ? options.sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, options.shortcutId)
Data::ShortcutIdToMTP(_session, options.shortcutId),
MTP_long(options.effectId)
), [=](const MTPUpdates &result, const MTP::Response &response) {
if (done) done(true);
if (updateRecentStickers) {
requestRecentStickersForce(true);
requestRecentStickers(std::nullopt, true);
}
}, [=](const MTP::Error &error, const MTP::Response &response) {
if (done) done(false);
@@ -4151,6 +4220,82 @@ void ApiWrap::sendMediaWithRandomId(
});
}
void ApiWrap::sendMultiPaidMedia(
not_null<HistoryItem*> item,
not_null<SendingAlbum*> album,
Fn<void(bool)> done) {
Expects(album->options.price > 0);
const auto groupId = album->groupId;
const auto &options = album->options;
const auto randomId = album->items.front().randomId;
auto medias = album->items | ranges::view::transform([](
const SendingAlbum::Item &part) {
Assert(part.media.has_value());
return MTPInputMedia(part.media->data().vmedia());
}) | ranges::to<QVector<MTPInputMedia>>();
const auto history = item->history();
const auto replyTo = item->replyTo();
auto caption = item->originalText();
TextUtilities::Trim(caption);
auto sentEntities = Api::EntitiesToMTP(
_session,
caption.entities,
Api::ConvertOption::SkipLocal);
using Flag = MTPmessages_SendMedia::Flag;
const auto flags = Flag(0)
| (replyTo ? Flag::f_reply_to : Flag(0))
| (ShouldSendSilent(history->peer, options)
? Flag::f_silent
: Flag(0))
| (!sentEntities.v.isEmpty() ? Flag::f_entities : Flag(0))
| (options.scheduled ? Flag::f_schedule_date : Flag(0))
| (options.sendAs ? Flag::f_send_as : Flag(0))
| (options.shortcutId ? Flag::f_quick_reply_shortcut : Flag(0))
| (options.effectId ? Flag::f_effect : Flag(0))
| (options.invertCaption ? Flag::f_invert_media : Flag(0));
auto &histories = history->owner().histories();
const auto peer = history->peer;
const auto itemId = item->fullId();
histories.sendPreparedMessage(
history,
replyTo,
randomId,
Data::Histories::PrepareMessage<MTPmessages_SendMedia>(
MTP_flags(flags),
peer->input,
Data::Histories::ReplyToPlaceholder(),
MTP_inputMediaPaidMedia(
MTP_long(options.price),
MTP_vector<MTPInputMedia>(std::move(medias))),
MTP_string(caption.text),
MTP_long(randomId),
MTPReplyMarkup(),
sentEntities,
MTP_int(options.scheduled),
(options.sendAs ? options.sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, options.shortcutId),
MTP_long(options.effectId)
), [=](const MTPUpdates &result, const MTP::Response &response) {
if (const auto album = _sendingAlbums.take(groupId)) {
const auto copy = (*album)->items;
for (const auto &part : copy) {
if (const auto item = history->owner().message(part.msgId)) {
item->destroy();
}
}
}
if (done) done(true);
}, [=](const MTP::Error &error, const MTP::Response &response) {
if (done) done(false);
sendMessageFail(error, peer, randomId, itemId);
});
}
void ApiWrap::sendAlbumWithUploaded(
not_null<HistoryItem*> item,
const MessageGroupId &groupId,
@@ -4204,8 +4349,11 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
if (!sample) {
_sendingAlbums.remove(groupId);
return;
} else if (album->options.price > 0) {
sendMultiPaidMedia(sample, album);
return;
} else if (medias.size() < 2) {
const auto &single = medias.front().c_inputSingleMedia();
const auto &single = medias.front().data();
sendMediaWithRandomId(
sample,
single.vmedia(),
@@ -4227,7 +4375,9 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
| (sendAs ? Flag::f_send_as : Flag(0))
| (album->options.shortcutId
? Flag::f_quick_reply_shortcut
: Flag(0));
: Flag(0))
| (album->options.effectId ? Flag::f_effect : Flag(0))
| (album->options.invertCaption ? Flag::f_invert_media : Flag(0));
auto &histories = history->owner().histories();
const auto peer = history->peer;
histories.sendPreparedMessage(
@@ -4241,7 +4391,8 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
MTP_vector<MTPInputSingleMedia>(medias),
MTP_int(album->options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, album->options.shortcutId)
Data::ShortcutIdToMTP(_session, album->options.shortcutId),
MTP_long(album->options.effectId)
), [=](const MTPUpdates &result, const MTP::Response &response) {
_sendingAlbums.remove(groupId);
}, [=](const MTP::Error &error, const MTP::Response &response) {

Some files were not shown because too many files have changed in this diff Show More