Compare commits

...

654 Commits

Author SHA1 Message Date
John Preston
c04f68f25c Version 5.8.2.
- Improve bottom label color in mini apps.
- Fix some fullscreen issues in mini apps.
- Fix miss-order of archived chats in forward box.
- Fix file dialog for Windows on ARM.
- Fix emoji status pack view from profile regression.
2024-11-19 14:32:15 +04:00
John Preston
e4902efefc Improve fullscreen miniapps on Linux. 2024-11-19 14:24:25 +04:00
John Preston
1267bcd255 Use separate window buttons only with QWindowContainer. 2024-11-19 13:16:54 +04:00
John Preston
0659ccc3f0 Fix user-driven fullscreen change on macOS. 2024-11-19 12:25:27 +04:00
23rd
bd2ae03ab4 Fixed display of long text for open button in web page views. 2024-11-19 10:39:40 +04:00
23rd
244696ae24 Fixed miss-order of archived dialogs in forward box. 2024-11-19 10:39:39 +04:00
John Preston
1438046dd4 Improve bottom label color in mini apps. 2024-11-19 10:37:47 +04:00
John Preston
5c62ba0835 Don't reopen forum on opening a link. 2024-11-18 16:37:22 +04:00
John Preston
20fadfef7f Fix file dialog for Windows on ARM. 2024-11-18 16:01:15 +04:00
John Preston
eed9541f9f Fix Withdraw button text. 2024-11-18 14:25:24 +04:00
John Preston
1594afa389 Fix emoji status pack view regression. 2024-11-18 14:17:01 +04:00
John Preston
9d74d93ed7 Fix some warnings from PVS-Studio.
Fixes #28667.

Some warnings fixed detailed in this post:
https://pvs-studio.com/en/blog/posts/cpp/1186/
2024-11-18 12:50:36 +04:00
John Preston
e4e2f47f8e Adjust build script for Windows Store ARM version. 2024-11-18 01:28:36 +04:00
John Preston
be53bec9b7 Version 5.8.1.
- Fix several possible crashes.
2024-11-17 23:33:45 +04:00
John Preston
bb32c546d4 Fix possible crash in swipe to reply. 2024-11-17 23:24:08 +04:00
John Preston
ecb4ceec7b Fix possible crash in phone click handler. 2024-11-17 23:21:16 +04:00
John Preston
c080bd4c4d Don't resubscribe on folder strip rebuild. 2024-11-17 23:09:42 +04:00
John Preston
39780f49bf Fix folder context menu Remove text color. 2024-11-17 23:00:46 +04:00
John Preston
73349c3c89 Fix crash in chats strip reorder. 2024-11-17 22:52:52 +04:00
John Preston
42a70ff7d0 Fix crash with inline results sending. 2024-11-17 22:41:52 +04:00
John Preston
fa8262cbe9 Version 5.8.
- Updates in Mini Apps platform.
- Chat folders in forward and share boxes.
- Horizontal strip mode for chat folders.
2024-11-17 16:05:22 +04:00
John Preston
7552328cdd Multi-select in mini app send prepared. 2024-11-17 15:08:17 +04:00
John Preston
60f4587d95 Sort birthday gifts to the front. 2024-11-17 15:08:17 +04:00
John Preston
572c074c42 Add gifts-to-profile privacy. 2024-11-17 15:08:17 +04:00
John Preston
3cfbd6a93b Support non-convertible star gifts from bots. 2024-11-17 15:08:16 +04:00
John Preston
d0911b6a45 Send to buy premium from miniapps emoji status. 2024-11-17 15:08:16 +04:00
John Preston
06b85442f8 Fix miniapp downloads in fullscreen. 2024-11-17 15:08:16 +04:00
John Preston
762592daff Allow RTMP for manage call admins. 2024-11-17 15:08:16 +04:00
John Preston
338122793c Implement bot downloads list UI. 2024-11-17 15:08:16 +04:00
John Preston
ef521624a0 Check file by server before downloading. 2024-11-17 15:08:16 +04:00
John Preston
341ab781b2 Implement download of files in miniapps. 2024-11-17 15:08:16 +04:00
John Preston
2fed657940 Make nice share message from miniapp. 2024-11-17 15:08:16 +04:00
John Preston
7bf78b3317 Use initial bot web app header/body colors. 2024-11-17 15:08:16 +04:00
John Preston
2d1fb0562d Prepared messages sharing from miniapp. 2024-11-17 15:08:16 +04:00
John Preston
3d77bff0c9 Support bot emoji status access. 2024-11-17 15:08:15 +04:00
John Preston
4198203a7f Implement emoji status set from miniapps. 2024-11-17 15:08:15 +04:00
John Preston
21487641c1 Support miniapp fullscreen API. 2024-11-17 15:08:15 +04:00
John Preston
c987872be8 Start fullscreen support in SeparatePanel. 2024-11-17 15:08:15 +04:00
John Preston
07e367e1a0 Update API scheme to layer 193. 2024-11-17 15:08:15 +04:00
23rd
db2e45c56e Added ability to go to top of chats list by clicking on selected filter. 2024-11-17 13:43:19 +03:00
23rd
67bbdbfc70 Added ability to change userpic with image from clipboard. 2024-11-17 13:27:57 +03:00
23rd
83df3cba66 Added debug logs for changing chats filters from context menu. 2024-11-17 13:27:57 +03:00
John Preston
f4e2b4bcbd Don't drop the old state of "systemDarkModeEnabled". 2024-11-17 14:07:22 +04:00
Ilya Fedin
6c64c22f83 Don't expand minimum window size for folders
Turn them into horizontal automatically instead
2024-11-17 14:04:27 +04:00
John Preston
702aa944dd Move read/reacted list to a layer. 2024-11-17 14:03:29 +04:00
John Preston
df45edd816 Move channel requests to a layer. 2024-11-17 14:03:29 +04:00
23rd
3f3143514e Added attention style to menu item to delete chats filter. 2024-11-17 11:20:02 +03:00
23rd
3e89910749 Replaced user info with short box for admins in section of kicked users. 2024-11-17 10:46:12 +03:00
23rd
721a642a2f Added date to info who promoted or restricted participants in menu. 2024-11-17 10:40:35 +03:00
23rd
d16ccc9dc5 Fixed display of chats filters strip on removing last chats filter. 2024-11-17 01:52:12 +03:00
23rd
77e7796b3f Fit transactions id from credits history entries to table cell. 2024-11-16 14:43:34 +03:00
23rd
983c949e8c Added ability to provide preloaded credits topup options to list. 2024-11-16 11:39:47 +03:00
23rd
e3f4f60e2d Replaced list of credits topup options with big label in settings. 2024-11-16 11:39:47 +03:00
23rd
33aa904cb7 Added shortcuts to flip photos in media viewer. 2024-11-16 11:39:40 +03:00
23rd
0248be5543 Removed from display extended credits topup options by default. 2024-11-16 07:34:08 +03:00
23rd
f7ca8212aa Moved out down arrow icon of "Show More" button to single place. 2024-11-16 07:34:02 +03:00
23rd
5eb59a1a43 Improved style of tabs for boost gifts in boosts section. 2024-11-16 06:27:07 +03:00
John Preston
7dd1e9bfbe Beta version 5.7.4: Revert accident submodules. 2024-11-16 00:04:20 +04:00
John Preston
067fd25a34 Beta version 5.7.4.
- Enable auto night mode by default.
- Use muted chats folder badge in horizontal strip.
- Fix custom userpic context menu in comments and topics.
- Fix scrolling of chats folders together with the list.
- Fix chats folders list disappearing in some cases.
- Fix topic groups in share box with chats folders.
- Fix bot commands list in some groups.
- Fix crash in channel short info box display.
- Fix crash in bot monetization section opening.
- Fix crash in bot sponsored messages destruction.
2024-11-15 23:59:52 +04:00
John Preston
7cb26ba104 Fix crash in possible ads teardown. 2024-11-15 23:53:59 +04:00
John Preston
a4212cc865 Fix point state detection on media messages. 2024-11-15 23:53:59 +04:00
John Preston
0445f7d6e8 Enable auto-night-mode by default. 2024-11-15 23:53:59 +04:00
John Preston
efe99b3f62 Fix special userpic menu in topics. 2024-11-15 23:53:59 +04:00
23rd
7f2c98f17a Fixed mouse events in chats filters strip with inner padding. 2024-11-15 22:47:39 +03:00
23rd
8f1d215851 Fixed rebuild of chats filters in strip when premium status is changed. 2024-11-15 22:47:39 +03:00
23rd
013b58f6f6 Fixed display of forums in share box with applied chats filter. 2024-11-15 20:04:42 +03:00
23rd
9d3b3476c2 Fixed display of chats filters strip in new windows. 2024-11-15 11:00:35 +03:00
23rd
715874a98f Slightly improved phrase for no results in forward box. 2024-11-15 11:00:30 +03:00
23rd
d2109dd2cb Replaced outer padding for chats filters strip with inner padding. 2024-11-15 11:00:26 +03:00
23rd
ddaf11ed6a Improved style of sponsored messages with media with max width. 2024-11-15 11:00:14 +03:00
23rd
2b5f68003d Fixed pagination of subscriptions in list. 2024-11-15 11:00:07 +03:00
23rd
1a759cc4e7 Fixed crash from short info box for non-users. 2024-11-15 10:59:40 +03:00
23rd
9e83562bf4 Fixed display of pinned chats from main list in forward box. 2024-11-15 10:57:08 +03:00
23rd
c03c19d26f Slightly improved style of chats lists strip in boxes. 2024-11-15 10:57:08 +03:00
23rd
ad9ebdf8e6 Fixed propagation scroll from chats filters strip to chats list. 2024-11-15 10:57:08 +03:00
23rd
9c1701c62a Added support of muted chats filters to chats filters strip. 2024-11-15 10:57:08 +03:00
23rd
edf6c42e9d Added short variant of unfiltered chats list to chats filters strip. 2024-11-15 10:57:08 +03:00
23rd
f0f2a71a87 Fixed disappearing of chats filters strip in forward box after search. 2024-11-15 10:57:08 +03:00
23rd
cf270bd9ce Removed chats filters strip from forum layout. 2024-11-15 10:57:08 +03:00
23rd
49223a4688 Fixed possible crash for bot owners in earn section for bots. 2024-11-15 10:57:08 +03:00
ziplantil
074bb1e66e Fix bug in ChatBotCommands::update when commands empty (#28631) 2024-11-14 11:35:57 +04:00
John Preston
7e2e510d8a Beta version 5.7.3: Fix build with Xcode. 2024-11-13 00:51:35 +04:00
John Preston
1ed34c6fa0 Beta version 5.7.3.
- Option to show folders above the chats list.
- Folders on top of recipients list box.
2024-11-13 00:19:58 +04:00
John Preston
78a0fa55b5 Send correct round video upload actions. 2024-11-12 22:58:05 +04:00
23rd
d37c040b36 Improved style of button for earn out when it is disabled. 2024-11-11 19:32:21 +03:00
23rd
e56bbf557d Added ability to open filters list in context menu from share boxes. 2024-11-11 10:18:00 +03:00
23rd
5abecec478 Fixed display of sponsored messages at bottom for bots. 2024-11-11 10:18:00 +03:00
23rd
ccb41f778e Removed selection marks from unselectable messages. 2024-11-11 10:18:00 +03:00
23rd
059a4cf0d8 Fixed ripple animation for sponsored messages.
Regression was introduced in 3f6d184435.
2024-11-11 10:18:00 +03:00
23rd
7a535a4554 Fixed display of sponsored messages with long descriptions and media. 2024-11-11 10:18:00 +03:00
23rd
f89167ef94 Fixed display of chats filters strip from dialogs widget in search mode. 2024-11-11 10:18:00 +03:00
23rd
a77777f509 Fixed display of chats filters strip from share box in search mode. 2024-11-11 10:18:00 +03:00
23rd
4a327ba584 Fixed display of chats filters strip from forward box in search mode. 2024-11-11 10:18:00 +03:00
23rd
a41e9bf67e Added preview of chats filters strip to filter link box. 2024-11-11 10:18:00 +03:00
23rd
6716973ce0 Added ability to reorder tabs of chats filters strip. 2024-11-11 10:18:00 +03:00
23rd
7cc81393d6 Adapted chats filters tabs slider for reorder feature. 2024-11-11 10:18:00 +03:00
23rd
3e413a036f Added initial implementation of class for reorder of tabs slider. 2024-11-11 10:18:00 +03:00
23rd
63a8fe7ee8 Added direct access to sections of discrete slider to derived classes. 2024-11-11 10:18:00 +03:00
23rd
146409844d Simplified geometry management of chats filters strip. 2024-11-11 10:18:00 +03:00
23rd
ba0da9f59e Slightly improved process of switching between chats filters view types. 2024-11-11 10:18:00 +03:00
23rd
81aef519d4 Added support of setting for chats filters view type to filters menu. 2024-11-11 10:18:00 +03:00
23rd
bcd84518d1 Added tracking of active chats filter to chats filters strip. 2024-11-11 10:18:00 +03:00
23rd
f205952ff2 Added chats filters strip to dialogs widget. 2024-11-11 10:18:00 +03:00
23rd
1d7622e0b5 Added condition to hide chats filters strip. 2024-11-11 10:18:00 +03:00
23rd
4d9112283d Added support of locked sections to chats filters tabs slider. 2024-11-11 10:18:00 +03:00
23rd
dc49c788a8 Added setting for chat filters view type to filters settings. 2024-11-11 10:18:00 +03:00
23rd
36741ab780 Reused setting for legacy iv zoom for chat filters view type. 2024-11-11 10:18:00 +03:00
23rd
53dffc5e88 Added context menu to chats filters strip. 2024-11-11 10:18:00 +03:00
23rd
607c7e7777 Added context menu process to chats filters tabs slider. 2024-11-11 10:18:00 +03:00
23rd
6f09e1699f Moved out display of remove filter box from chats filters menu. 2024-11-11 10:18:00 +03:00
23rd
8c35de48f3 Added process of unread states to chats filters strip. 2024-11-11 10:18:00 +03:00
23rd
b83d943841 Moved out value notification settings for filters to separated file. 2024-11-11 10:18:00 +03:00
23rd
b11b5caeb3 Moved out unread state values of main list to separated file. 2024-11-11 10:18:00 +03:00
23rd
36924da59a Replaced inner slider in chats filters strip. 2024-11-11 10:18:00 +03:00
23rd
f0a2c47613 Added initial implementation of chats filters tabs slider to td_ui. 2024-11-11 10:18:00 +03:00
23rd
5a4449f1a2 Added ability to set custom width of section to DiscreteSlider. 2024-11-11 10:18:00 +03:00
23rd
de3d7a7774 Removed redundant templates from DiscreteSlider. 2024-11-11 10:18:00 +03:00
23rd
b06dbd1c00 Added support of pinned chats from filters to forward box. 2024-11-11 10:18:00 +03:00
23rd
1fa5e424e9 Added chats filters tabs strip to share box. 2024-11-11 10:18:00 +03:00
23rd
d81c7abf1a Added chats filters strip to forward box. 2024-11-11 10:18:00 +03:00
23rd
932215c91d Added initial implementation of tabs strip for chats filters. 2024-11-11 10:18:00 +03:00
23rd
7aa1141ba5 Added ability to ignore hidden rows while searching to PeerListContent. 2024-11-11 10:18:00 +03:00
23rd
3699439506 Added ability to count sections widths of slider from derived class. 2024-11-11 10:18:00 +03:00
23rd
76b1288f77 Added access to height of multi select from peer list box. 2024-11-11 10:18:00 +03:00
xmdn
8fd9ae4e59 Replace deprecated x64 architecture identifier 2024-11-11 11:16:08 +04:00
John Preston
53abd2fe38 Follow show-panel-on-click for attach menu. 2024-11-06 17:53:09 +04:00
xiota
da8a4ba8ab Fix some ffmpeg 7.x related errors 2024-11-06 16:42:18 +04:00
John Preston
9c3990c0c1 Fix deploy scripts for Windows on ARM. 2024-11-06 16:41:56 +04:00
John Preston
1eeb46d5fc Fix build on VS 17.12 Preview 4 on ARM. 2024-11-06 12:26:12 +04:00
John Preston
02c01e258c Version 5.7.2.
- Fix recompressed video playback cutoff.
- Fix video message recroding on macOS.
2024-11-05 12:45:43 +04:00
John Preston
b2f912868d Fix record availability check on macOS. 2024-11-05 11:38:04 +04:00
John Preston
ecf0eba0a5 Open forum with topic by topic message link. 2024-11-05 11:37:15 +04:00
John Preston
8e5fec2fa8 Open forum from common groups. 2024-11-05 11:37:00 +04:00
John Preston
89c35e8512 Show copy-to-clipboard button tooltip. 2024-11-05 11:36:10 +04:00
John Preston
3fa88fad79 Correctly highlight label links in RTL. 2024-11-05 11:32:59 +04:00
John Preston
5f037462ed Implement a special context menu for sender userpic. 2024-11-04 16:54:01 +04:00
John Preston
93c01e5f1e Show "Hide My View" only for user stories. 2024-11-04 16:53:37 +04:00
John Preston
52953626a7 Allow ctrl/cmd+click copy private post link. 2024-11-04 15:22:13 +04:00
John Preston
f77fdc799d Show special phone number context number. 2024-11-04 14:52:58 +04:00
John Preston
7bf1f9bd71 Put manage chat above stories archive. 2024-11-04 14:41:25 +04:00
John Preston
363ffc1c04 Remove unused null option in SendReport(). 2024-11-04 14:05:37 +04:00
John Preston
4001899bdf Add personal channel to ShortInfoBox. 2024-11-04 14:00:51 +04:00
John Preston
fabdd89c4a Use original duration for video qualities. 2024-11-04 13:11:10 +04:00
John Preston
70f1675085 Improve diff/patch/git highlighting. 2024-11-04 12:18:00 +04:00
John Preston
07e1e2d9d6 Allow opening username in specific indexed account. 2024-11-04 12:03:37 +04:00
John Preston
ebff6c6370 Show exact reactions count in channels. 2024-11-04 11:20:29 +04:00
John Preston
233eb6d916 Version 5.7.1.
- Fix occasional redundant newlines before message timestamp.
- Remove playback speed change on settings button click.
- Fix video playback settings button on hidpi screens.
- Fix return from Picture-in-Picture to media viewer.
- Fix video quality auto-switching in Picture-in-Picture.
- Add message link to channel stars transaction information.
- Fix GIF playback in media viewer.
- Fix several possible crashes.
2024-11-01 22:25:07 +04:00
John Preston
d568cab2fc Fix initial IV zoom level.
Fixes #28600.
2024-11-01 22:25:07 +04:00
John Preston
8447b95c50 Fix GIF playback in media viewer. 2024-11-01 20:00:04 +04:00
John Preston
e959d1e1b0 Improve playback speed toggle logic. 2024-11-01 18:25:40 +04:00
John Preston
ead5dbe368 Strict validity check for local lastseen. 2024-11-01 18:22:57 +04:00
John Preston
f091f2b344 Fix album sending with video processing. 2024-11-01 17:52:05 +04:00
John Preston
267a51e800 Fix possible crash in scheduled sent toast. 2024-11-01 17:27:06 +04:00
John Preston
939f6095ba Fix possible crash in Recent Actions. 2024-11-01 17:18:59 +04:00
John Preston
a333615e53 Add message link to channel star transaction info. 2024-11-01 16:43:36 +04:00
John Preston
e1b33fbc40 Remove unneeded separator from context menu. 2024-11-01 14:35:33 +04:00
John Preston
99c5d994b5 Add special string for bot revenue. 2024-11-01 14:16:43 +04:00
John Preston
0971485367 Support quality change in PiP. 2024-11-01 14:15:28 +04:00
23rd
3cfa963f69 Added start date to subscription entry in credits transactions history. 2024-11-01 11:26:40 +03:00
John Preston
7096a4231f Fix PiP -> viewer streaming jump. 2024-11-01 11:26:03 +04:00
John Preston
07f0c182e6 Don't change speed on settings click. 2024-11-01 10:16:09 +04:00
John Preston
535b223333 Fix video playback settings button dpr. 2024-11-01 10:10:16 +04:00
John Preston
ffa8c2be79 Fix some of newlines before skip blocks. 2024-11-01 09:56:20 +04:00
John Preston
2873e64ca2 Update cmake_helpers. 2024-11-01 09:00:59 +04:00
Ilya Fedin
8bd28bce69 Update GSL to 4.1.0 2024-11-01 08:59:44 +04:00
Ilya Fedin
b97ce43fca Revert "Use GSL from a desktop-app fork."
This reverts commit bbe4312017.
2024-11-01 08:59:44 +04:00
GitHub Action
d34c4cc2f2 Update User-Agent for DNS to Chrome 130.0.0.0. 2024-11-01 08:39:37 +04:00
John Preston
1ca1f0fa7d Revert "Always rely on __has_include(<winres.h>)"
This reverts commit e0e4a7bec6.

Didn't work for me, gave errors when building.
2024-10-31 23:19:19 +04:00
John Preston
8c3c8f888d Version 5.7: Fix build with Xcode. 2024-10-31 21:35:51 +04:00
John Preston
a75d7f0381 Version 5.7.
- Sending video messages.
- New video quality selection in channels.
- Adding media to sent text messages via Edit.
- Ads in bots with revenue sharing with bot developers.
- Chat-specific hashtags.
2024-10-31 21:02:22 +04:00
John Preston
7684466acf Fix crash in quality auto-toggle. 2024-10-31 20:33:16 +04:00
John Preston
0067245739 Send more viewport_changed, just in case. 2024-10-31 20:33:15 +04:00
John Preston
4a5d8aa217 Fix build with MSVC. 2024-10-31 20:33:15 +04:00
John Preston
2d786aa02c Fix a typo in phrases. 2024-10-31 20:33:15 +04:00
Ilya Fedin
b0933b96ef Add error message for webview unsupported display server 2024-10-31 19:22:37 +04:00
Ilya Fedin
20fb73b626 Add error message for webview without OpenGL 2024-10-31 19:22:37 +04:00
Ilya Fedin
ae7bd7112b Stop recommending webkitgtk-6.0 2024-10-31 19:22:37 +04:00
Ilya Fedin
2365363dcc webkitgtk-6.0 -> webkit2gtk-4.1 in snap 2024-10-31 19:22:37 +04:00
Ilya Fedin
e0e4a7bec6 Always rely on __has_include(<winres.h>) 2024-10-31 19:22:37 +04:00
Ilya Fedin
ebd0c3696a Remove #ifndef __MINGW32__ from Windows notifications
It uses C++/WinRT nowadays just like all other code so there's no point in #ifndef'ing only it
2024-10-31 19:22:37 +04:00
Ilya Fedin
e0a0d9c039 Remove outdated ifdef
The file doesn't have __in anymore
2024-10-31 19:22:37 +04:00
Ilya Fedin
dae9f2ab2b Replace CMAKE_CXX_COMPILER_FRONTEND_VARIANT check with MSVC variable 2024-10-31 19:22:37 +04:00
Ilya Fedin
7168a00ee4 Update submodules 2024-10-31 19:22:37 +04:00
John Preston
1e2d0ced20 Update submodules. 2024-10-31 19:22:23 +04:00
John Preston
d6ac883efa Implement adaptive quality selection. 2024-10-31 18:04:17 +04:00
John Preston
a386d70ae4 Track qualities availability correctly. 2024-10-31 18:04:17 +04:00
John Preston
bc8bf672b4 Don't use shared video cover in viewer. 2024-10-31 18:04:17 +04:00
John Preston
e38998214f Disable reschedule/edit-media for processing. 2024-10-31 18:04:17 +04:00
John Preston
472a2fe802 Position ttl button correctly on record finish. 2024-10-31 18:04:17 +04:00
John Preston
2d6d89b1cf Fix recording single-listen tooltip text. 2024-10-31 18:04:17 +04:00
John Preston
66be2ac6ca Show toast/tooltip info on video processing. 2024-10-31 18:04:17 +04:00
John Preston
3137c9f3f7 Jump-to-scheduled on video processing. 2024-10-31 18:04:17 +04:00
John Preston
b9ebb02e72 Update API scheme on layer 192. 2024-10-31 18:04:17 +04:00
John Preston
1e02c475d6 Show speed / quality badges. 2024-10-31 18:04:16 +04:00
John Preston
4d2cda0692 Fix menu in case speed isn't controlled. 2024-10-31 18:04:16 +04:00
John Preston
cbd2b8f428 Query recording availability in the background.
Fixes #28576.
2024-10-31 18:04:16 +04:00
John Preston
93605db690 Use custom toast for video-not-available state. 2024-10-31 18:04:16 +04:00
John Preston
2567096de0 Send correct action on round recording. 2024-10-31 18:04:16 +04:00
John Preston
6ed25d012f Use new settings icon in the player. 2024-10-31 18:04:16 +04:00
John Preston
c2afef2bde Improve changing of video playback quality. 2024-10-31 18:04:16 +04:00
John Preston
0991e7d8a4 Mirror recorded round message. 2024-10-31 18:04:16 +04:00
John Preston
cf52f2a743 Improve multi-line menu item items. 2024-10-31 18:04:16 +04:00
John Preston
37dddda1a0 Save preferred video quality to settings. 2024-10-31 18:04:16 +04:00
John Preston
3f2f3ebd51 Allow switching video quality. 2024-10-31 18:04:16 +04:00
John Preston
7ba78540ac Keep alternative video qualities list. 2024-10-31 18:04:16 +04:00
23rd
19afb49fce Fixed display of empty context menu in section of history widget. 2024-10-31 16:25:41 +03:00
23rd
46ab553fa5 Rounded earn values from overview to two decimal digits. 2024-10-31 16:12:31 +03:00
23rd
68cc42047e Unified context menu creation for different types of sponsored messages. 2024-10-30 11:59:11 +03:00
23rd
e25cf27ba5 Replaced dropdown menu with popup in box for revenue sponsored messages. 2024-10-30 11:58:33 +03:00
23rd
3895e6d958 Fixed empty context menu from space of sponsored messages. 2024-10-30 11:58:33 +03:00
23rd
24cf3984c8 Implemented operator<< for FullMsgId to enable qDebug output. 2024-10-30 06:47:13 +03:00
23rd
6237675744 Moved out ui callbacks of bar from data class from sponsored messages. 2024-10-30 06:47:13 +03:00
23rd
30dae049ff Fixed non-animated display of top bar for sponsored messages. 2024-10-30 06:39:33 +03:00
23rd
1dc30caee9 Added hide button to bar for sponsored messages without photo. 2024-10-29 15:07:28 +03:00
23rd
b2d340cbfb Added top button to box about sponsored messages for bots. 2024-10-29 15:07:28 +03:00
23rd
7d52787e54 Added support of sponsored messages with revenue to bar. 2024-10-29 14:55:14 +03:00
23rd
ae3f16ccbd Changed behavior to show earlier button in dialog list to jump to top. 2024-10-28 19:34:27 +03:00
23rd
057222757b Added decimal separators to count of credits in balances of owned bot. 2024-10-28 17:47:17 +03:00
23rd
119f109904 Added api support of paid credits transactions from bots. 2024-10-28 17:47:17 +03:00
23rd
23a77b1ba4 Fixed width of menu item for IV zoom. 2024-10-28 15:55:28 +03:00
23rd
c076daa91f Added ability to implement platform-dependent zoom controller for IV. 2024-10-28 15:55:28 +03:00
23rd
b7ef5325ac Improved display of sponsored message bar for preloaded messages. 2024-10-28 13:26:10 +03:00
23rd
8b535c58fa Slightly improved sponsored message bar for instant display. 2024-10-28 13:25:27 +03:00
23rd
6bc8daaeda Added earn button to section of bot settings. 2024-10-27 14:17:51 +03:00
23rd
7a2562e5bb Added icons to earn buttons in profile sections of owned bots. 2024-10-27 13:42:17 +03:00
23rd
9e0c731b32 Moved out generation of credits menu icon from svg to td_ui. 2024-10-27 13:42:01 +03:00
23rd
2e0e4006a1 Moved out generation of currency icon from svg to td_ui. 2024-10-27 13:41:14 +03:00
23rd
187139473d Added subsection title to earn buttons in profile of owned bots. 2024-10-27 13:40:37 +03:00
23rd
dbb0a5ad28 Added ability to open currency earn section for owned bots. 2024-10-27 10:04:06 +03:00
23rd
24aaed44b9 Slightly simplified constructor of Info::BotEarn::InnerWidget. 2024-10-27 09:56:41 +03:00
23rd
32b8d83c04 Moved out Info::Statistics::Tag to separated file. 2024-10-27 09:56:41 +03:00
23rd
bf55c325ce Fixed hotkey to reset IV zoom. 2024-10-27 05:01:25 +03:00
23rd
3af288c74e Added currency balance to profile section of owned bots. 2024-10-26 19:20:56 +03:00
23rd
e306d9ba35 Added loading of balances on receiving full user for owned bots. 2024-10-26 19:20:50 +03:00
23rd
b23a877d7e Added ability to cache currency balance by peer. 2024-10-26 19:20:50 +03:00
23rd
08fda055fc Renamed Api::ChannelEarnStatistics with Api::EarnStatistics. 2024-10-26 19:20:50 +03:00
23rd
84055ed74e Added context menu to top bar of sponsored messages. 2024-10-26 17:55:07 +03:00
23rd
2db30690ce Added ability to open menu for sponsored messages without history item. 2024-10-26 17:55:07 +03:00
23rd
304bcfd343 Added initial button to top bar of sponsored messages to hide it. 2024-10-26 17:55:07 +03:00
23rd
8a1cf2bb3a Added initial implementation of top bar for sponsored messages. 2024-10-26 17:55:07 +03:00
23rd
c857c24a64 Added util functions to process photo and document as dynamic images. 2024-10-26 17:55:07 +03:00
23rd
bbdcb047d0 Added ability to request sponsored messages not only for channels. 2024-10-26 17:55:07 +03:00
John Preston
78f2e70956 Update API scheme to layer 192. 2024-10-26 16:36:17 +04:00
John Preston
75a75626ce Show info about popular apps section. 2024-10-26 16:34:44 +04:00
John Preston
cec9688d58 Implement public posts hashtag search preview. 2024-10-26 16:34:44 +04:00
John Preston
81492b7d3a Add "when edited" context menu information. 2024-10-26 16:34:43 +04:00
John Preston
9166acbbb9 Improve gift convert confirmation. 2024-10-26 16:34:43 +04:00
John Preston
36de2b6ca6 Improved received star gift box. 2024-10-26 16:34:43 +04:00
John Preston
21f909dd4b Improve star gift value table row. 2024-10-26 16:34:43 +04:00
John Preston
f2a92c9122 Update API scheme to layer 191. Sold out gifts. 2024-10-26 16:34:43 +04:00
John Preston
7ee2e3d8bc Support hashtags with mentions. 2024-10-25 18:14:44 +04:00
John Preston
f89aeb6ad4 Implement text -> media message editing. 2024-10-25 18:14:44 +04:00
John Preston
0397006894 Add more logging on failed top peers reading. 2024-10-25 18:14:44 +04:00
23rd
d6863074b2 Fixed error handler of wrong cloud password for withdrawal button. 2024-10-24 19:46:35 +03:00
23rd
9c185a30e0 Slightly improved position of button for QR of username. 2024-10-24 19:15:19 +03:00
23rd
a8f492a027 Improved colors of ministars in buttons from section of peer gifts. 2024-10-24 18:34:11 +03:00
23rd
0a92b1dc68 Slightly improved subtext in overview from statistics section. 2024-10-24 18:15:33 +03:00
23rd
e6d661f8ee Fixed statistics section of stories from megagroups. 2024-10-24 17:43:04 +03:00
23rd
f48dfb5d81 Added ability to add to contacts phone from text phone entity. 2024-10-24 17:04:22 +03:00
23rd
cd041e8366 Replaced empty settings button with simple ripple button. 2024-10-24 17:04:22 +03:00
23rd
6787ea883e Replaced empty icon buttons with simple circle ripple buttons. 2024-10-24 17:04:22 +03:00
John Preston
78937d716f Beta version 5.6.4.
- Add recording of video messages in case a camera is available.
- Add "Respect the Focus settings" for custom notifications on Windows.
2024-10-24 13:40:52 +04:00
John Preston
9713abc002 Fix build with GCC. 2024-10-24 13:36:22 +04:00
John Preston
b44b45cca0 Fix docker build with openh264 in ffmpeg. 2024-10-24 13:26:46 +04:00
John Preston
9e2cf0ed73 Nice faded show/hide of round recorder. 2024-10-24 13:26:46 +04:00
John Preston
b01d7ea5b9 Show recording init errors. 2024-10-24 13:26:46 +04:00
John Preston
ae89b65a98 Fix message selection checks position. 2024-10-24 13:26:46 +04:00
John Preston
9b9c3d788d Skip some first frames. 2024-10-24 13:26:46 +04:00
John Preston
ccc6c6daa5 Save last camera image as a placeholder. 2024-10-24 13:26:46 +04:00
John Preston
9ce6636c6a Create nice camera init effect. 2024-10-24 13:26:46 +04:00
John Preston
6287d306c2 Add better discard confirmations. 2024-10-24 13:26:46 +04:00
John Preston
6cfa053328 Add recorded round video preview. 2024-10-24 13:26:45 +04:00
John Preston
9514b6eecd Show mini-thumbnails when pausing recording. 2024-10-24 13:26:45 +04:00
John Preston
c8d4818d22 Blurred frame while paused. 2024-10-24 13:26:45 +04:00
John Preston
4142ada729 Concatenate two recordings. 2024-10-24 13:26:45 +04:00
John Preston
d7ffdbd78d Prepare for round record pause/resume. 2024-10-24 13:26:45 +04:00
John Preston
e8d87d37bb Use a shorter phrase for bot policy. 2024-10-24 13:26:45 +04:00
John Preston
343ffc23eb Add some dir="auto" to IV page.
I hope this fixes #28551.
2024-10-24 13:26:45 +04:00
John Preston
95e0086eed Remov unused variable. 2024-10-24 13:26:45 +04:00
John Preston
c010ecfe38 Allow sending one-time round videos. 2024-10-24 13:26:45 +04:00
John Preston
302e9371c8 Show record init errors. 2024-10-24 13:26:45 +04:00
John Preston
7060c0e6d7 Fix crash in context menu without an item.
Fixes #28552.
2024-10-24 13:26:42 +04:00
John Preston
20a4c7f9f4 Wait for both audio and video to start. 2024-10-24 13:24:44 +04:00
John Preston
e59e4afd3e Show recording progress. 2024-10-24 13:24:44 +04:00
John Preston
f74dd3ca1e Add author to the top of Reply in Another Chat. 2024-10-24 13:24:44 +04:00
John Preston
511cfc524f Adjust bitrates for video messages. 2024-10-24 13:24:44 +04:00
John Preston
4cf6173d25 Cut video messages round with white bg. 2024-10-24 13:24:44 +04:00
John Preston
17996757fd Show round video preview. 2024-10-24 13:24:44 +04:00
John Preston
6bc1049858 Use nice icon for video message recording. 2024-10-24 13:24:43 +04:00
John Preston
ff44f626ba Allow switching between voice/video. 2024-10-24 13:24:43 +04:00
John Preston
552343fa37 PoC video messages sending. 2024-10-24 13:24:43 +04:00
John Preston
4dc7fd8cd1 Add AAC/H264 encoders, MP4 muxer. 2024-10-24 13:24:43 +04:00
John Preston
285c96fd2e Add "Respect the Focus settings" on Windows. 2024-10-24 13:24:43 +04:00
John Preston
e6af33367e Accept bot username in chatbot setup. 2024-10-24 13:24:43 +04:00
23rd
7092fe2242 Added default ripple animation style with windowBgOver color. 2024-10-24 09:05:27 +04:00
23rd
a32ff46579 Added special hotkeys to change IV zoom more gradually. 2024-10-24 09:05:27 +04:00
23rd
7f20cf59d1 Added ministars to button in service messages for gifts. 2024-10-24 09:05:27 +04:00
23rd
a8a1b08127 Added ministars to buttons in section of peer gifts. 2024-10-24 09:05:27 +04:00
23rd
1a1e777b87 Fixed display of generic media with small width. 2024-10-24 09:05:27 +04:00
23rd
9e76e64064 Improved parts alignments of round video messages. 2024-10-24 09:05:27 +04:00
23rd
975ae17ef9 Moved selection marks to bottom of message bubbles. 2024-10-24 09:05:27 +04:00
23rd
ed9dcef66f Fixed display of selection marks for messages with huge code blocks. 2024-10-24 09:05:27 +04:00
23rd
b1e537e54e Added subscription icon to channel photo in ReceiptCreditsBox. 2024-10-24 09:05:27 +04:00
23rd
e5886862c3 Changed behavior to copy phone number from profile sections as trimmed. 2024-10-24 09:05:27 +04:00
Ilya Fedin
d85b668d4f Fix lambda execution for portal dark mode getter 2024-10-24 07:04:52 +02:00
Grigory
b363d8bfb5 fix(ui/webview_helpers): append 0 if color channel value is 1 char long 2024-10-19 18:43:11 +02:00
John Preston
754d467440 Version 5.6.3: Fix build with Xcode. 2024-10-15 22:13:06 +04:00
John Preston
598f08d6c7 Version 5.6.3.
- Add ability to change page scale in Instant View pages.
- Fix unnecessary timestamp jump to a new line.
- Fix secondary button positioning in miniapps.
- Fix a crash in QR code copy for a chat without a photo.
- Fix a crash in share options menu showing.
- Fix a crash on monitor disconnect.
2024-10-15 21:01:27 +04:00
23rd
224fdc1864 Returned back freedom to copy links even in non-forwardable histories.
This reverts commits b64c610abb
and 9cd194e60e.
2024-10-15 13:04:57 +03:00
23rd
e646b4dc9a Slightly improved position of selection marks for wide chats. 2024-10-15 12:59:15 +03:00
23rd
9077db2e97 Added verified mark of web view bots to box of confirmation to open. 2024-10-15 12:46:13 +03:00
23rd
7e14277ead Added ability to change zoom in IV. 2024-10-15 12:46:13 +03:00
John Preston
d351a7d697 Fix crash on monitor arrangement change. 2024-10-15 12:13:53 +04:00
John Preston
70ed43b811 Fix crash on send options menu show.
Fixes #28532.
2024-10-15 12:13:53 +04:00
John Preston
913083ebc6 Fix miniapp buttons positioning. 2024-10-15 12:13:52 +04:00
John Preston
588a95a7ae Fix time jumping to a new line. 2024-10-15 12:13:52 +04:00
23rd
c0a0ad4ec5 Added info to context menu for non-forwardable history. 2024-10-15 01:15:04 +03:00
23rd
5eafe96525 Fixed crash in share QR box on copy without profile photo. 2024-10-15 01:15:00 +03:00
John Preston
b41ac0fc2a Version 5.6.2: Fix build with GCC. 2024-10-14 16:34:45 +04:00
John Preston
cfe93530b8 Version 5.6.2.
- Message selection marks.
- Better copy username / public link / ID menu in profiles.
- Keyboard navigation (Up/Down/PageUp/PageDown) in chat preview.
- Improved QR options for profile links.
- Fix calls color problems on Windows.
- Fix scroll problems on Linux.
2024-10-14 13:58:27 +04:00
John Preston
4492e72ffa Fix web app window resize on macOS. 2024-10-14 13:55:29 +04:00
John Preston
1a0fd35f36 Check gift sold out error on sending. 2024-10-14 12:49:55 +04:00
John Preston
db475ef0b4 Update API scheme to layer 190.
Support adding messages to gifts of Premium subscriptions.
2024-10-14 12:49:55 +04:00
John Preston
b3dddc1dfe Fix indent of RTL text with as skip block.
Fixes #27748.
2024-10-14 12:49:54 +04:00
23rd
b64c610abb Fixed ability to copy shared links for channels with select restriction.
Fixed #28492.
2024-10-14 12:49:33 +04:00
23rd
c5add2fca9 Revert "Added experimental option to disable floating reactions strip."
This reverts commit a32a9aa3fc.
2024-10-14 12:49:33 +04:00
23rd
9ea78f7d28 Fixed display of message highlights in selection mode. 2024-10-14 12:49:33 +04:00
23rd
54b0d965ae Slightly eased conditions for selection mode to avoid shaky animations. 2024-10-14 12:49:33 +04:00
23rd
7b4bd5696b Added check views to selection mode of messages. 2024-10-14 12:49:33 +04:00
23rd
9064f3ba4b Fixed behavior of checkbox to remove background from QR in share QR box. 2024-10-14 12:49:33 +04:00
23rd
e00e562b5f Fixed update of width for usernames label in profile section as well. 2024-10-14 12:49:32 +04:00
John Preston
73f38c896f Use new phrase for miniapp launch confirmation. 2024-10-14 12:49:32 +04:00
John Preston
5767cbd0e3 Fix send menus with additional items. 2024-10-14 12:49:32 +04:00
John Preston
ba31756bf9 Fix build with MSVC. 2024-10-14 12:49:32 +04:00
Ilya Fedin
a88f48cd93 Fallback to portal on Linux if QStyleHints::colorScheme is unknown 2024-10-14 12:39:41 +04:00
K900
f2e0e481de Update for lib_ui API change 2024-10-12 19:54:34 +04:00
K900
566f279137 Fix build without QT_IMPLICIT_QCHAR_CONSTRUCTION 2024-10-12 19:54:34 +04:00
John Preston
394ef13955 Fix code block language change.
Fixes #28513.
2024-10-11 09:32:21 +04:00
John Preston
6812e17d07 Improve star gift size in the box. 2024-10-11 09:31:45 +04:00
John Preston
fdf826b686 Improve gifts layout a bit. 2024-10-11 09:31:45 +04:00
John Preston
e57742e7de Don't show non-working wallpaper button. 2024-10-11 09:31:45 +04:00
23rd
73b63aa414 Fixed update of width for username label in profile section. 2024-10-10 18:56:20 +03:00
23rd
44aa2aec5d Added ability to change font size in share QR box. 2024-10-10 18:56:20 +03:00
23rd
8d9d7c4cea Added ability to remove background from QR in share QR box. 2024-10-10 18:56:20 +03:00
23rd
9557f0c844 Improved quality of profile photo in share QR box. 2024-10-10 18:56:20 +03:00
23rd
a32a9aa3fc Added experimental option to disable floating reactions strip. 2024-10-10 18:56:20 +03:00
23rd
86fa98dfbb Fixed position of mini stars in header if gift box. 2024-10-10 18:56:20 +03:00
23rd
6a69447d90 Fixed non focused window when process credits payment from web view bot. 2024-10-10 18:56:20 +03:00
John Preston
2d20e7a9e2 Add keyboard navigation to chat preview. 2024-10-10 14:16:43 +04:00
John Preston
ac7b2e0da0 Keyboard navigation in closed topics.
Fixes #27319.
Fixes #28288.
2024-10-10 14:16:34 +04:00
John Preston
388325a496 Set dpi awareness in the manifest. 2024-10-10 13:53:06 +04:00
John Preston
af728e82fc Unify channel links and usernames clicks. 2024-10-10 13:53:06 +04:00
John Preston
3cb33f0825 Custom "Copy ID" for peer ID context menu. 2024-10-10 13:53:06 +04:00
John Preston
1038baf467 Allow timestamp links under spoilers. 2024-10-10 13:53:05 +04:00
John Preston
828ecabc78 Don't show user badge in star stats rows. 2024-10-10 13:53:05 +04:00
Ilya Fedin
88703ba1eb Toggle fullscreen by double click in media viewe title area 2024-10-10 09:21:29 +02:00
Ilya Fedin
b0ecb2c535 Update patches and lib_ui 2024-10-09 11:34:24 +02:00
Ilya Fedin
c70482dbc4 Qt 6.8.0-rc1 -> 6.8.0 2024-10-09 11:34:24 +02:00
John Preston
51f1999412 Version 5.6.1: Fix build with Xcode. 2024-10-07 15:03:59 +04:00
John Preston
dd4fbc256c Version 5.6.1: Support sold out gifts better. 2024-10-07 14:50:18 +04:00
John Preston
cc2265583f Remove assert in GL init. 2024-10-07 14:49:00 +04:00
John Preston
1e7a4db57f Version 5.6.1.
- Fix media viewer sometimes blocking the app after launch.
2024-10-07 13:43:01 +04:00
John Preston
9a9e30c88b Fix commands list show after scheduled visit. 2024-10-07 13:42:36 +04:00
John Preston
3d98ebff42 Hide layer when showing topics list. 2024-10-07 13:23:10 +04:00
John Preston
a6f4b1ae8e Fix build with Qt 6. 2024-10-07 12:50:20 +04:00
Ilya Fedin
3e6ea8109c Don't treat window controls as continuous 2024-10-07 10:48:56 +02:00
Ilya Fedin
ec407d57a5 Use one side controls in group call 2024-10-07 10:48:56 +02:00
John Preston
838ad66166 Improve hidpi/window geometry init. 2024-10-07 12:48:06 +04:00
23rd
c6bf905253 Slightly improved style of button to install update from dialogs list. 2024-10-06 12:21:23 +03:00
John Preston
8310230582 Version 5.6: Fix builds. 2024-10-05 21:41:22 +04:00
John Preston
1f21af0bdb Version 5.6.
- Gifts for Telegram Stars.
- Mention / hashtag autocomplete in media caption field.
- Resizing the window used for web apps and games.
- "Include muted chats in folder counters" notifications setting.
- Emoji from Unicode 15.1.
2024-10-05 20:46:11 +04:00
John Preston
127e4a5086 Attempt to fix screen dpi changes on Windows. 2024-10-05 20:36:33 +04:00
John Preston
6a30967f23 Attempt to fix media viewer with OpenGL. 2024-10-05 20:33:51 +04:00
John Preston
df2b020b42 Add debug logs for recent/top peers resetting. 2024-10-05 20:32:09 +04:00
23rd
a74c5a89a6 Added manage channel button to profile section of owned channels. 2024-10-05 18:50:03 +03:00
23rd
3cb0be5be5 Added administrators button to profile section of owned channels. 2024-10-05 18:50:03 +03:00
23rd
d56f3cfecf Added credits balance to profile section of owned bots. 2024-10-05 18:50:03 +03:00
23rd
9716a901d1 Added ability to cache credits balance by peer. 2024-10-05 18:50:03 +03:00
23rd
649d242e9a Added userpic of web view bots to box of confirmation to open. 2024-10-05 18:50:03 +03:00
23rd
8ac3c2157f Removed redundant code from swipe-to-reply for macOS. 2024-10-05 18:50:03 +03:00
23rd
7ca4ca21fa Fixed middle elision in filenames from document views. 2024-10-05 18:50:03 +03:00
23rd
e565acba91 Added api support for stories reports with server options. 2024-10-05 18:49:21 +03:00
John Preston
ede771e51b Focus gift message field. 2024-10-04 10:06:21 +04:00
John Preston
0282786b4c Generalize gift sending. 2024-10-04 10:06:21 +04:00
John Preston
42dd08ace5 Use a separate title for star gift recipient box. 2024-10-04 10:06:21 +04:00
John Preston
cf1d274b0d Return gift_credits_box with gifting stars. 2024-10-04 10:06:21 +04:00
John Preston
d361d5f3b2 Move gift_credits_box -> star_gift_box, strip old code. 2024-10-04 10:06:21 +04:00
John Preston
3e63b40564 Server-side star gift message length limit. 2024-10-04 10:06:21 +04:00
John Preston
c5139ed06a Fix emoji panel position in star gift box. 2024-10-04 10:06:21 +04:00
23rd
3dc93526ff Renamed report_box with report_box_graphics. 2024-10-04 10:06:21 +04:00
23rd
3edf8e10e2 Added api support for reports with server options. 2024-10-04 10:06:21 +04:00
John Preston
00215622cc Update API scheme on layer 189. Build broken. 2024-10-04 10:06:21 +04:00
John Preston
479b7c3140 Add emoji selector to star gift sending. 2024-10-04 10:06:21 +04:00
John Preston
a3ca8ddcfc Support entities in star gift message in box. 2024-10-04 10:06:21 +04:00
John Preston
9ace04d2c9 Support entities in star gift messages. 2024-10-04 10:06:21 +04:00
John Preston
8b11d2d5e7 Show nice star gift transactions in history. 2024-10-04 10:06:21 +04:00
John Preston
05fb0f81f9 Show gifts about text. 2024-10-04 10:06:21 +04:00
John Preston
da49efa1ed Simple profile page for Verification Codes. 2024-10-04 10:06:21 +04:00
John Preston
39fb0a5b66 Remove custom PeerData::isVerifyCodes() userpic. 2024-10-04 10:06:21 +04:00
John Preston
962d4d29ee Process gift updates in list. 2024-10-04 10:06:21 +04:00
John Preston
779e9b658b Update API scheme on layer 189. 2024-10-04 10:06:20 +04:00
John Preston
f9ee4dcb51 Show 'hidden from profile' icon in my gifts. 2024-10-04 10:06:20 +04:00
John Preston
1acdbb69ae Show correct gift sender. 2024-10-04 10:06:20 +04:00
John Preston
c022a1c838 Fix gifts list loading both ways. 2024-10-04 10:06:20 +04:00
John Preston
52afd3d5a8 Display gifts list in the profile. 2024-10-04 10:06:20 +04:00
John Preston
79b1c0edee Support PeerData::isVerifyCodes() peer type. 2024-10-04 10:06:20 +04:00
John Preston
4803bd4b3f Started gifts list in profile. 2024-10-04 10:06:20 +04:00
John Preston
215a262076 Allow converting gifts to stars. 2024-10-04 10:06:20 +04:00
John Preston
7a35577d3a Save/unsave gifts to the profile page. 2024-10-04 10:06:20 +04:00
John Preston
efbd3ca8fa Implement star gift view box. 2024-10-04 10:06:20 +04:00
John Preston
18904412cd Show chat and toast about sent gift. 2024-10-04 10:06:20 +04:00
John Preston
0d0d0ab994 Allow sending premium / star gifts. 2024-10-04 10:06:20 +04:00
John Preston
71deef61f5 Add support for star gifts API. 2024-10-04 10:06:20 +04:00
John Preston
46c8a55f56 Make nicer discount/limited gift badges. 2024-10-04 10:06:20 +04:00
John Preston
37f837dcb7 Add sending gift preview. 2024-10-04 10:06:20 +04:00
John Preston
a5be0a685a Extract gift button into separate widget. 2024-10-04 10:06:20 +04:00
John Preston
4cdd1fec95 Start UI of the gifts. 2024-10-04 10:06:20 +04:00
John Preston
761617c1ce Start UI of the new gift sending box. 2024-10-04 10:06:20 +04:00
John Preston
e3bc4dab85 Update API scheme to layer 189. 2024-10-04 10:06:20 +04:00
John Preston
335095a332 Beta version 5.5.8: Fix build with Xcode. 2024-10-03 12:21:06 +04:00
John Preston
15fcb73e19 Beta version 5.5.8.
- Allow drag-to-scroll in reply quote edit box.
- Add bot verified badge to web app title.
- Fix crash when opening some channels.
- Fix some visual glitches.
2024-10-03 11:59:57 +04:00
John Preston
a8b0f2934b Scroll quote selection in the draft options box. 2024-10-03 11:56:04 +04:00
John Preston
7d67b3d00a Use circle userpics in reactions from forums. 2024-10-03 11:55:57 +04:00
John Preston
b60c7e97ab Don't show full query in "nothing found" info. 2024-10-03 11:55:57 +04:00
23rd
440ebfcbf6 Removed display of userpic for sponsored messages. 2024-10-03 11:55:57 +04:00
23rd
8d93eb919b Added verified badge to title in panel for web view bots. 2024-10-03 11:55:55 +04:00
John Preston
d3df2dc1e5 Use Data::MediaPreload in sponsored messages. 2024-10-03 11:54:28 +04:00
John Preston
677314dacb Extract Data::MediaPreload. 2024-10-03 11:54:28 +04:00
John Preston
20f53c89ad Fix poll bottom ripple.
Fixes #28471.
2024-10-03 11:54:28 +04:00
John Preston
1cb92ef69a Beta version 5.5.7: Workaround MSVC bug. 2024-10-01 10:55:42 +04:00
John Preston
b518f7c4c4 Beta version 5.5.7.
- Add ability to share QR code of bots.
- Add mention/hashtag autocomplete to Saved GIF caption.
- Fixed display of working hours in profiles.
- Respect the maximum reply quote length.
2024-10-01 10:06:45 +04:00
John Preston
9fdc099c3a Update lib_webview. 2024-10-01 08:57:59 +04:00
23rd
1db8ada2aa Slightly improved code style of history widget. 2024-10-01 08:57:39 +04:00
23rd
b753448052 Changed behavior for sponsored messages to display them only when ready. 2024-10-01 08:57:38 +04:00
23rd
e29c6d2f23 Fixed infinite attempts to draw foreground in userpic builder. 2024-10-01 08:57:37 +04:00
GitHub Action
1ee53ee0c1 Update User-Agent for DNS to Chrome 129.0.0.0. 2024-10-01 08:52:46 +04:00
John Preston
57438867b6 Respect the maximum quote length. 2024-09-30 14:46:18 +04:00
John Preston
86c04424f6 Add mention/hashtag autocomplete to GIF caption. 2024-09-30 14:46:18 +04:00
John Preston
632639d581 Allow custom tab action on all autocomplete fields.
Fixes #28455.
2024-09-30 14:46:18 +04:00
23rd
99c8edb3eb Fixed display of working hours in profiles. 2024-09-30 13:29:19 +03:00
23rd
4582e61cfc Improved code style in newest code from export submodule. 2024-09-30 13:12:28 +03:00
Bohdan Tkachenko
a970fe93c1 Add reactions to export chat history (#28252)
Co-authored-by: 23rd <23rd@vivaldi.net>
2024-09-30 03:02:22 -07:00
GitHub Action
91f5c72cf0 Update User-Agent for DNS to Chrome 128.0.0.0. 2024-09-30 11:03:36 +02:00
John Preston
d2f3d04ad4 Update cmake/lib_base submodules. 2024-09-30 12:47:22 +04:00
John Preston
07b93e1e02 Fix media editing in topics. 2024-09-30 12:47:22 +04:00
23rd
ab5e7b1588 Fixed color of mini icon for drafts with reply when dialog is selected. 2024-09-30 12:47:22 +04:00
23rd
0f4aadddfc Fixed display of corner status of video in sponsored messages. 2024-09-30 12:47:22 +04:00
John Preston
a3c79feeba Always show My Stars menu. 2024-09-30 12:47:22 +04:00
John Preston
e6b76fefa1 Show correct error for discuss groups. 2024-09-30 12:47:22 +04:00
23rd
a37f512949 Fixed emoji display in filenames from document views. 2024-09-30 12:47:22 +04:00
23rd
3f34c0ce37 Slightly improved style of box for warning of web view box. 2024-09-30 12:47:22 +04:00
23rd
7cc9a0b9aa Added ability to share QR code of bots. 2024-09-30 12:47:22 +04:00
23rd
fbaa79f168 Fixed display of outline in box for share of QR code on non-retina. 2024-09-30 12:47:22 +04:00
Ilya Fedin
2b0aa8e418 Add description for external video player option 2024-09-27 14:37:51 +02:00
Vladislav Grudinin
1fa2e76c9b Updated codegen submodule. 2024-09-27 14:37:29 +02:00
Vladislav Grudinin
cb166e2591 Fix build with clang 19.1.0.
Fixes #28283.
2024-09-27 14:37:29 +02:00
xmdn
187c2dda20 Check more protocols while adding link (#28407) 2024-09-26 10:54:16 -07:00
Ilya Fedin
b962d2b550 Update Qt 6.8.0-beta4 -> 6.8.0-rc1 2024-09-26 16:15:25 +02:00
Ilya Fedin
d69bcfa138 Update lib_webview & lib_ui 2024-09-26 16:15:25 +02:00
c0re100
0960a3b21d Fix restrict user in recent actions 2024-09-19 17:48:37 +03:00
John Preston
aec220fd2c Beta version 5.5.6.
- Allow resizing the window used for web apps and games.
- Add mention / hashtag autocomplete in media caption field.
- Add "Include muted chats in folder counters" notifications setting.
- Auto-select URL suggested from clipboard when creating a custom link.
- Update emoji to Unicode 15.1.
- Fix replying with a quote from media album caption.
- Fix viewing custom emoji packs from media album caption.
2024-09-19 15:02:16 +04:00
John Preston
666dacf73b Add 'tonsite' handler information to lib/xdg/*. 2024-09-19 13:19:50 +04:00
John Preston
67ce27afaa Update patches for Qt 6.8 on Windows. 2024-09-19 12:52:18 +04:00
23rd
3f6d184435 Added api support for clicks on sponsored messages with media. 2024-09-19 12:47:54 +04:00
John Preston
a2fad84dae Update API scheme to layer 188. 2024-09-19 12:47:54 +04:00
John Preston
4a84f9fa00 Allow resizing window of web apps / games. 2024-09-19 12:47:46 +04:00
Ilya Fedin
7abc921d20 Revert "Fullscreen hack for Windows 11 native resize"
This reverts commit f7bff01793.
2024-09-19 10:46:46 +02:00
Ilya Fedin
a307e7a798 Replace fullscreen mask workaround with Qt one 2024-09-19 10:46:46 +02:00
Ilya Fedin
3a9eb8463d Try to always use QWidget::screen 2024-09-19 10:46:10 +02:00
John Preston
4befb125e3 Update emoji to Unicode 15.1. 2024-09-19 12:26:52 +04:00
John Preston
ca00a19736 Updated emoji resources to Unicode 15.1. 2024-09-19 10:26:30 +02:00
John Preston
296969bcd1 Add "Ada" library mention to README. 2024-09-19 10:43:38 +04:00
John Preston
3218c30983 Add "Include muted chats in folder counters". 2024-09-19 10:34:01 +04:00
John Preston
3658b32db5 Correctly count 'other accounts unread' in menu. 2024-09-19 10:34:01 +04:00
John Preston
592d46c8f2 Fix emoji packs from album captions. 2024-09-19 10:34:01 +04:00
John Preston
8b86f12c23 Fix quote-reply to album captions. 2024-09-19 10:34:01 +04:00
John Preston
2e2d8d2af3 Add FieldAutocomplete to EditCaptionBox. 2024-09-19 10:34:01 +04:00
John Preston
3eec43cacd Add FieldAutocomplete to SendFilesBox. 2024-09-19 10:34:01 +04:00
John Preston
ba7cd25f21 Extract FieldAutocomplete code. 2024-09-19 10:34:01 +04:00
John Preston
969152e949 Move FieldAutocomplete to ChatHelpers. 2024-09-19 10:34:01 +04:00
23rd
b78443cf2d Added mini icon to drafts with reply. 2024-09-19 10:34:01 +04:00
23rd
4288ba2449 Improved UX in box for link creation when user has link in clipboard. 2024-09-19 10:34:01 +04:00
Ilya Fedin
22a3093815 Check updater exit status on Linux 2024-09-18 08:27:18 +02:00
John Preston
98ba2c7ce4 Version 5.5.5.
- Suggest URL from clipboard when creating a custom link.
- Fix animated topic icons in topic info page.
- Fix excessive getChannelDifference requests.
2024-09-13 21:04:07 +04:00
John Preston
36962b8c62 Fix possible crash in swipe-to-reply. 2024-09-13 21:04:07 +04:00
John Preston
d0a8bd1f03 Use colored topic icons only when required. 2024-09-13 20:06:38 +04:00
John Preston
c9e0f50f0f Revert "Improved color of topic icon in TopicIconView."
This reverts commit a38dcb6ee5.
2024-09-13 20:06:32 +04:00
John Preston
1dc310586d Unregister channel from shortpoll. 2024-09-13 20:06:19 +04:00
23rd
6f71d21bb7 Slightly improved box for link creation when user has link in clipboard. 2024-09-13 17:14:48 +03:00
Ilya Fedin
c93f047056 Add run0 support 2024-09-12 23:08:06 +04:00
John Preston
ef98d4ece7 Version 5.5.4.
- Fix channel updates stopping after difference request failing.
- Add QR code generation for your username in Settings.
- Fix swipe-to-reply gestures stopping. (macOS)
2024-09-12 14:41:33 +04:00
23rd
2383bf2c71 Fit amount of available colors in box for share of QR code to 8. 2024-09-12 13:39:13 +03:00
23rd
2c8c92c2a4 Slightly increased max width for username in QR code. 2024-09-12 13:38:36 +03:00
23rd
bad2dc30c3 Added button to generate QR code for self to main section of settings. 2024-09-12 13:28:10 +03:00
Ilya Fedin
fe7f4233b9 Add missing ThirdParty cache to Windows action 2024-09-12 14:13:53 +04:00
Ilya Fedin
68454a9841 Migrate almost all actions to latest OS versions 2024-09-12 14:13:53 +04:00
John Preston
d3bcf63cf7 Fix repeated request of channel difference. 2024-09-12 14:08:09 +04:00
John Preston
a5f1209f28 Remove redundant web apps code. 2024-09-12 14:08:09 +04:00
23rd
9a44ca2769 Fixed display of message without text in section of shared links. 2024-09-11 16:31:46 +03:00
23rd
155305f0f7 Added ability to generate QR code for self from settings. 2024-09-11 15:25:05 +03:00
23rd
6abce8d976 Added attention style to menu item to delete all call logs. 2024-09-11 15:25:05 +03:00
23rd
f16d1f034f Switched swipe-to-reply processing on macOS from touch to scroll events. 2024-09-11 00:37:47 +03:00
John Preston
dab107cf90 Version 5.5.3.
- Fix custom emoji sending.
- Add mention link QR code sharing.
- Fix sending files from network drives. (Windows)
2024-09-10 15:07:14 +04:00
23rd
d1d1aa3d21 Moved premium gradient in box for share of QR code to first place. 2024-09-10 13:51:23 +03:00
23rd
d0536cc31f Replaced boxes for QR code of invite links with box for share QR code. 2024-09-10 13:51:23 +03:00
23rd
c47f5e9995 Added ability to create box for share QR code without peer. 2024-09-10 13:51:23 +03:00
23rd
0916836ff9 Added ability to provide description and custom link to FillPeerQrBox. 2024-09-10 13:51:23 +03:00
John Preston
5dd9ff1062 Accept only CF_HDROP for uri-list mime.
Additional types lead to such problem: some programs, like JetBrains
IDEs, like PyCharm, copy "file://[ip-address]/file" as an URI in
uri-list, that way you can't paste it in the messenger, because it
will make a request to that address and reveal clients IP address.
2024-09-10 14:19:37 +04:00
John Preston
d1e3b9f15d Revert "Check for local URLs more strictly."
This reverts commit c3fda41224.
2024-09-10 14:19:37 +04:00
John Preston
ca3c179b75 Use full available width for text in some places.
Fixes #28384.
2024-09-10 14:19:37 +04:00
John Preston
c2d5924508 Fix build with MSVC. 2024-09-10 14:19:37 +04:00
John Preston
016d0395c3 Fix custom emoji sending. 2024-09-10 14:17:32 +04:00
23rd
925c9239bd Added ability to share QR code from channels. 2024-09-10 11:34:55 +03:00
23rd
fdcbe3cf3a Fixed width of username label with right button in profile section. 2024-09-10 11:08:42 +03:00
23rd
f6b9cc5ce1 Improved padding in box for share QR box on different scales. 2024-09-10 10:56:02 +03:00
23rd
8c915e6dc3 Renamed FillProfileQrBox to FillPeerQrBox. 2024-09-10 03:26:15 +03:00
23rd
1db426da2e Added ability to choose quality in box for share of QR code. 2024-09-10 03:26:15 +03:00
23rd
d9be363962 Added ability to hide userpic from box for share of QR code. 2024-09-10 02:00:26 +03:00
23rd
88daa37e34 Added ability to generate QR code independently from ui scale. 2024-09-10 02:00:26 +03:00
23rd
931fa01337 Added premium gradient to box for share of QR code. 2024-09-10 02:00:26 +03:00
23rd
8e1595eb29 Adapted display of longest usernames in box for share of QR code. 2024-09-10 02:00:26 +03:00
23rd
29e97232d8 Added initial ability to share QR code from user profile. 2024-09-10 02:00:26 +03:00
John Preston
f05191e668 Version 5.5.2: Fix build. 2024-09-09 21:30:15 +04:00
John Preston
1ba189e59d Version 5.5.2.
- Support two bottom buttons in web apps.
- Fix text layout outside of the message bubble glitch.
- Don't stop video when dragging media viewer in window mode.
2024-09-09 21:12:33 +04:00
23rd
c40ca70aa6 Added date of admin promotional to EditAdminBox. 2024-09-09 17:20:52 +03:00
23rd
521f991167 Replaced float labels with text in dividers in EditAdminBox. 2024-09-09 17:20:52 +03:00
23rd
edf1417bbb Added date of restriction to EditRestrictedBox. 2024-09-09 17:20:52 +03:00
23rd
686e9643ad Replaced channel participant parsing with modern way in admin log. 2024-09-09 17:20:52 +03:00
23rd
975460d268 Added api support for dates of chat participant data. 2024-09-09 17:20:52 +03:00
23rd
6b0c606d25 Switched type of subscription date from Qt to TimeId. 2024-09-09 17:20:52 +03:00
23rd
93ff0bdcff Slightly improved style of box for sending GIF with caption. 2024-09-09 17:20:52 +03:00
23rd
bf9d90ca4e Fixed emoji display in header of link for dialog filters. 2024-09-09 17:20:52 +03:00
23rd
d6e5e1e8f7 Added handle of flood errors in request of join to chatlist. 2024-09-09 17:20:52 +03:00
23rd
d3ae2ef9ea Synced local English phrases with server. 2024-09-09 17:20:52 +03:00
John Preston
40b0854704 Don't pause video on viewer drag. 2024-09-09 17:54:16 +04:00
John Preston
9aec6b6496 Set min width for field collapsed quotes. 2024-09-09 17:24:15 +04:00
John Preston
d01f977960 Don't offer hello-sticker to user you've blocked. 2024-09-09 16:42:02 +04:00
John Preston
1444009ee2 Update submodules. 2024-09-09 14:58:40 +04:00
John Preston
14ee9bee26 Fix quotes starting with custom urls. 2024-09-09 14:58:40 +04:00
Ilya Fedin
93587ddc3c Allow scale preview in separate window on Wayland 2024-09-09 14:49:44 +04:00
John Preston
0c4d03477e Fix text layout in some cases. 2024-09-09 14:28:37 +04:00
John Preston
a35092f012 Support second button in web apps. 2024-09-09 13:29:00 +04:00
John Preston
49ee7ee52b Version 5.5.1: Update cmake_helpers. 2024-09-07 00:25:47 +04:00
John Preston
52c77a1970 Version 5.5.1.
- Fix crash in peer short info box.
2024-09-06 23:30:32 +04:00
John Preston
e4269ae7fb Fix crash in PeerShortInfoBox. 2024-09-06 23:28:43 +04:00
John Preston
bd6011c524 Version 5.5.
- Star Giveaways.
- Swipe-to-Reply.
- Audio device selection in one-on-one calls.
- Text selection in collapsed / expanded quotes.
2024-09-06 21:57:47 +04:00
23rd
46cb3ec103 Added box for boosts with credits. 2024-09-06 21:57:47 +04:00
23rd
0241129948 Added support of admin log filter for extended subscriptions. 2024-09-06 21:57:47 +04:00
23rd
e44aca06cb Added support of admin log event of extended subscriptions. 2024-09-06 21:57:47 +04:00
23rd
19d386f977 Added support of credits to giveaway info results. 2024-09-06 21:57:47 +04:00
John Preston
a67fdda913 Fix the Release build for macOS. 2024-09-06 21:57:47 +04:00
John Preston
5286c7b1c3 Allow selecting text in collapsed quotes. 2024-09-06 21:57:47 +04:00
23rd
d9d96d0a6f Fixed display of custom badge in selected messages for giveaways. 2024-09-06 21:57:47 +04:00
23rd
13353bb615 Improved phrases in service message for giveaway results with credits. 2024-09-06 21:57:47 +04:00
23rd
d78348fd16 Fixed crash in box for giveaway create when winners number is constant. 2024-09-06 21:57:46 +04:00
23rd
1e8e660133 Improved phrases in top bar from box for giveaway creation with credits. 2024-09-06 21:57:46 +04:00
23rd
5196982c98 Improved phrases in box for information of giveaway with credits. 2024-09-06 21:57:46 +04:00
23rd
99f857fbf6 Improved phrases in service message for started giveaway with credits. 2024-09-06 21:57:46 +04:00
23rd
0982aa166a Added support of prepaid giveaway with credits. 2024-09-06 21:57:46 +04:00
23rd
3ae9f86097 Slightly improved display of credits in boosts from statistics list. 2024-09-06 21:57:46 +04:00
23rd
9efd9b0d68 Slightly improved timestamp parsing in Api::Boosts. 2024-09-06 21:57:46 +04:00
John Preston
267a73f355 Update API scheme on layer 187. 2024-09-06 21:57:46 +04:00
John Preston
437d8ea890 Fix build with MSVC. 2024-09-06 21:57:46 +04:00
23rd
7ed92ec402 Added credits icon to boosts in statistics list. 2024-09-06 21:57:46 +04:00
23rd
678d9ffbf9 Added support of giveaway prize action messages to export to JSON. 2024-09-06 21:57:46 +04:00
23rd
bc4b427ed1 Added support of giveaway prize action messages to export to HTML. 2024-09-06 21:57:46 +04:00
23rd
36141a9df9 Added support of giveaway results messages to export to JSON. 2024-09-06 21:57:46 +04:00
23rd
d68ba75457 Improved process of giveaway messages for export to JSON. 2024-09-06 21:57:46 +04:00
23rd
00ad32c5f4 Added support of giveaway results messages to export to HTML. 2024-09-06 21:57:46 +04:00
23rd
064bab60ff Improved process of giveaway messages for export to HTML. 2024-09-06 21:57:46 +04:00
23rd
5b146217c0 Added support for credits in messages of prize in giveaways. 2024-09-06 21:57:46 +04:00
23rd
202c81b2e5 Added support for credits in messages for starting and ending giveaways. 2024-09-06 21:57:46 +04:00
23rd
4520480604 Added support of credits giveaway to ReceiptCreditsBox. 2024-09-06 21:57:46 +04:00
23rd
aea87bb5cb United buttons for premium giveaway and premium gifts to single button. 2024-09-06 21:57:46 +04:00
23rd
19492f7e7b Improved prize description for credits in box for giveaway creation. 2024-09-06 21:57:46 +04:00
23rd
51030e3c45 Added list of options to box for giveaway creation with credits. 2024-09-06 21:57:46 +04:00
23rd
e6b8b4be18 Added initial payment support for credits giveaway. 2024-09-06 21:36:03 +04:00
23rd
6ac13b7f80 Added button for credits giveaway to box for giveaway creation. 2024-09-06 21:36:03 +04:00
23rd
7e5e6003a9 Added initial api support for credits giveaway options. 2024-09-06 21:36:03 +04:00
23rd
f445440995 Added initial data structure for credits giveaway options. 2024-09-06 21:36:03 +04:00
John Preston
d81547f091 Support cloud-saved paid reaction privacy. 2024-09-06 21:36:03 +04:00
John Preston
2b185d491b Update API scheme to layer 187. 2024-09-06 21:36:03 +04:00
John Preston
ca47440950 Don't treat .gif as "small image". 2024-09-06 21:07:17 +04:00
John Preston
5e32602f4a Add elastic overscroll to swipe-to-reply. 2024-09-06 21:07:02 +04:00
23rd
1f4516028c Fixed desync of repaint of userpics and messages while swipe-on-reply. 2024-09-06 19:52:29 +03:00
23rd
7f29d269a3 Changed swipe-on-reply detection only when scroll has began. 2024-09-06 17:11:16 +03:00
23rd
62c3374911 Disabled swipe-to-reply for channels. 2024-09-06 12:04:42 +03:00
23rd
2116e04af5 Allowed to swipe-to-reply only with started initial of touches. 2024-09-06 11:56:21 +03:00
John Preston
a97d5e80c7 Fix custom reaction as a quick one. 2024-09-05 19:13:52 +04:00
John Preston
b5098038d0 Add two-year ttl time for account. 2024-09-05 17:05:09 +04:00
John Preston
6fce718252 Add jump-to-end button to chat preview. 2024-09-05 14:50:38 +04:00
John Preston
40cf96202d Add 1.5 years account ttl value. 2024-09-05 14:11:41 +04:00
John Preston
c18e59218e Show internal list of apps as Stars Examples. 2024-09-05 13:14:07 +04:00
John Preston
216865a20d Fix file albums with inline keyboard buttons. 2024-09-05 12:01:43 +04:00
John Preston
6c5036ee8d Fix typo in swipe-to-reply through QWheelEvent. 2024-09-05 11:52:25 +04:00
Viliansh
dc2f59ca24 Added org.telegram as developer_id in the flatpak metainfo.xml
Co-authored-by: ilya-fedin <fedin-ilja2010@ya.ru>
2024-09-05 09:47:43 +02:00
Viliansh
6f6457137e removed update_contact from flatpak metainfo.xml 2024-09-05 09:47:43 +02:00
Viliansh
bc5cb6e2a2 Changed dev name in org.telegram.desktop.metainfo.xml
In flathub, and it's front-ends like KDE's Discover or GNOME Software, Telegram shows "By John Preston", and some users were hesitant to install it afraid that was "fake", so i changed it to Telegram, this would also make it consistent with snap, thanks!
2024-09-05 09:47:43 +02:00
John Preston
16825fff41 Use QWheelEvent::inverted() in swipe gesture. 2024-09-05 11:30:37 +04:00
John Preston
5024f1db8c Beta version 5.4.6.
- Add Swipe-To-Reply for modern touchpads and touchscreens.
- Add text selection in collapsed and expanded blockquotes.
- Fix text rendering in 100% interface scale on Windows.
2024-09-04 18:39:16 +04:00
23rd
a60385fc3d Removed QGraphicsOpacityEffect usage from media view overlay widget. 2024-09-04 18:39:16 +04:00
23rd
b20e2c37c1 Fixed build on Qt6. 2024-09-04 18:39:16 +04:00
John Preston
acd40cbeb6 Apply invert_media flag on message send finish. 2024-09-04 18:32:48 +04:00
23rd
6a45a862dd Removed wheel events from scale slider in section of main settings. 2024-09-04 16:01:55 +02:00
23rd
5bd45e9a20 Fixed updating of left userpic with offset from swipe-on-reply. 2024-09-04 16:01:55 +02:00
23rd
52e42f23ab Improved animation speed on release of swipe-on-reply with various x. 2024-09-04 16:01:54 +02:00
23rd
96b7755cde Fixed updating of message on bounce animation of swipe-on-reply icon. 2024-09-04 16:01:54 +02:00
23rd
c589ee1ca5 Fixed overlap of reply icon on left swipe of message with right action. 2024-09-04 16:01:54 +02:00
23rd
18c9ee093b Fixed unwanted top offset of dialogs widget when float player opened. 2024-09-04 16:01:54 +02:00
John Preston
b82fa3112c Improve touchscreen swipt-to-reply. 2024-09-04 16:01:20 +02:00
John Preston
8d0f66d562 Fix touchscreen history scrolling. 2024-09-04 14:06:11 +02:00
John Preston
20a5e0ba73 Fix controls layout after adding a bot to a group.
Fixes https://bugs.telegram.org/c/19451
2024-09-04 14:56:50 +04:00
John Preston
5a2667c71e Fix reply previews to blockquotes / codeblocks. 2024-09-04 14:45:35 +04:00
John Preston
1f4a8d7eb6 Fix build with MSVC. 2024-09-04 14:45:07 +04:00
John Preston
4430bd0328 Improve lottie icon layout in group calls. 2024-09-04 14:14:12 +04:00
John Preston
ab2e7f4c03 Fix media viewer create on non-primary screen. 2024-09-04 14:14:12 +04:00
John Preston
54e5c06b4d Revert updated Harfbuzz-NG in Qt 5.15.15.
This fixes the regression with text rendering in 100% scale.

Fixes #28340.
2024-09-04 14:14:12 +04:00
23rd
add5a6a0be Added debug util to ensure end of life of objects. 2024-09-04 14:14:12 +04:00
23rd
89c2ba4293 Weakened gesture orientation check within swipe-to-reply. 2024-09-04 14:14:12 +04:00
23rd
dd100fb709 Fixed back gesture responsiveness for swipe-to-reply on macOS. 2024-09-04 14:14:12 +04:00
John Preston
e8dd2b9e7b Use only integer translations in reply swipe. 2024-09-04 14:14:12 +04:00
23rd
71e3cd227c Added initial swipe-to-reply to section for replies. 2024-09-04 14:14:12 +04:00
23rd
1648c31a22 Moved out swipe-to-reply setup to inner method in HistoryInner. 2024-09-04 14:14:12 +04:00
23rd
f8c820f319 Fixed swipe-to-reply on macOS. 2024-09-04 14:14:12 +04:00
John Preston
300f35e78f Implement both touch and wheel swipe-to-reply. 2024-09-04 14:14:12 +04:00
23rd
2aa5849997 Improved horizontal animation for reply icon on left swipe. 2024-09-04 14:14:12 +04:00
23rd
fb1b845211 Improved process of message repaint on swipe to reply. 2024-09-04 14:14:11 +04:00
23rd
3d2af9db8e Improved distance of reply icon on left swipe. 2024-09-04 14:14:11 +04:00
23rd
6129e5a1cf Added bounce animation on finish of replying with left swipe. 2024-09-04 14:14:11 +04:00
23rd
7f70ee1227 Added initial ability to reply with left swipe. 2024-09-04 14:14:11 +04:00
23rd
c9f7da6e82 Added ability to paint icons in center of QRectF. 2024-09-04 10:33:28 +03:00
23rd
f956c0f227 Added experimental option to disable touch bar on macOS. 2024-09-04 10:12:08 +03:00
23rd
df935e0477 Improved code style of gifMaxStatusWidth static function. 2024-09-04 10:11:57 +03:00
23rd
841f1afe1e Improved subtitle space in permissions and restrictions edit boxes. 2024-09-04 10:11:54 +03:00
23rd
fb8b88557e Added ability to kick participants from section of admin log. 2024-09-04 10:11:49 +03:00
23rd
2b502b22b9 Replaced PeerData::generateUserpicImage with static function. 2024-09-04 10:11:44 +03:00
23rd
5ac80d2655 Fixed text clipping at bottom in settings section for cloud password. 2024-09-04 10:11:41 +03:00
23rd
8aa7499e63 Fixed width of stats PointDetailsWidget for charts with currency. 2024-09-04 10:11:36 +03:00
23rd
8cd5e51982 Added missed handler of server error when try to reset cloud password. 2024-09-04 10:11:31 +03:00
23rd
e5c2133446 Disabled Qt build on Windows without successful applied patches. 2024-09-04 10:11:17 +03:00
John Preston
3dccdf2f05 Beta version 5.4.5.
- Fix possible crash in text rendering.
2024-09-01 10:19:39 +04:00
John Preston
8a708c6655 Update Qt to 5.15.15 on Windows. 2024-09-01 10:19:39 +04:00
Ilya Fedin
9e1d9eee4b Fix snap build 2024-08-31 20:09:36 +02:00
Ilya Fedin
f30aabc365 Update Qt 6.7.2 -> 6.8.0 2024-08-31 19:54:58 +02:00
John Preston
a5546d016f Fix possible crash in long-word texts. 2024-08-31 21:48:52 +04:00
John Preston
f79d70d112 Use Ui::Text::String in Ui::RoundButton. 2024-08-31 21:48:52 +04:00
John Preston
ec28f258fb Use full bubble width in message text rendering.
Fixes #28331.
2024-08-31 21:48:52 +04:00
John Preston
08f3a6fb40 Fix local group sent-as display. 2024-08-31 21:48:52 +04:00
John Preston
8823d5256f Fix indentation. 2024-08-31 21:48:52 +04:00
23rd
60e7aa90d2 Added ability to report profile photo from peer info section. 2024-08-31 12:34:50 +03:00
John Preston
71357a9546 Fix archive chats list bidi support. 2024-08-29 17:48:06 +04:00
John Preston
a5b06e9c56 Fix possible crash in text elision. 2024-08-29 17:41:15 +04:00
23rd
0f94419f6d Improved fix of crash in video messages playback.
Regression was introduced in ad3e447f08.
2024-08-29 17:37:55 +04:00
John Preston
94e7aabea5 Fix spaces after emoji in text rendering. 2024-08-29 17:19:28 +04:00
619 changed files with 31966 additions and 7703 deletions

View File

@@ -40,7 +40,7 @@ jobs:
macos:
name: MacOS
runs-on: macos-13
runs-on: macos-latest
strategy:
matrix:
@@ -49,7 +49,7 @@ jobs:
env:
GIT: "https://github.com"
CMAKE_PREFIX_PATH: "/usr/local/opt/ffmpeg@6:/usr/local/opt/openal-soft"
CMAKE_PREFIX_PATH: "/opt/homebrew/opt/ffmpeg@6:/opt/homebrew/opt/openal-soft"
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
MANUAL_CACHING: "1"
@@ -69,7 +69,7 @@ jobs:
run: |
brew update
brew upgrade || true
brew install ada-url autoconf automake boost cmake ffmpeg@6 openal-soft openh264 openssl opus ninja pkg-config python qt yasm xz
brew install ada-url autoconf automake boost cmake ffmpeg@6 libtool 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
@@ -95,7 +95,7 @@ jobs:
./autogen.sh
./configure --disable-examples --disable-doc
make -j$(sysctl -n hw.logicalcpu)
make install
sudo make install
- name: WebRTC cache.
id: cache-webrtc
@@ -111,7 +111,11 @@ jobs:
git clone --depth=1 --recursive --shallow-submodules $GIT/desktop-app/tg_owt.git
cd tg_owt
cmake -B build . -GNinja -DCMAKE_BUILD_TYPE=Debug
cmake -Bbuild -GNinja . \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS_DEBUG="" \
-DCMAKE_CXX_FLAGS_DEBUG=""
cmake --build build --parallel
- name: Telegram Desktop build.
@@ -132,6 +136,9 @@ jobs:
cmake -Bbuild -GNinja . \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS_DEBUG="" \
-DCMAKE_CXX_FLAGS_DEBUG="" \
-DCMAKE_EXE_LINKER_FLAGS="-s" \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DTDESKTOP_API_TEST=ON \
-DDESKTOP_APP_USE_PACKAGED_LAZY=ON \

View File

@@ -40,7 +40,7 @@ jobs:
snap:
name: Ubuntu
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
UPLOAD_ARTIFACT: "true"

View File

@@ -42,7 +42,7 @@ jobs:
windows:
name: Windows
runs-on: windows-2022
runs-on: windows-latest
strategy:
matrix:
@@ -94,6 +94,14 @@ jobs:
nuget sources Disable -Name "Microsoft Visual Studio Offline Packages"
nuget sources Add -Source https://api.nuget.org/v3/index.json & exit 0
- name: ThirdParty cache.
id: cache-third-party
uses: actions/cache@v4
with:
path: ${{ env.TBUILD }}\ThirdParty
key: ${{ runner.OS }}-${{ matrix.arch }}-third-party-${{ env.CACHE_KEY }}
restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-third-party-
- name: Libraries cache.
id: cache-libs
uses: actions/cache@v4

2
.gitmodules vendored
View File

@@ -3,7 +3,7 @@
url = https://github.com/telegramdesktop/libtgvoip
[submodule "Telegram/ThirdParty/GSL"]
path = Telegram/ThirdParty/GSL
url = https://github.com/desktop-app/GSL.git
url = https://github.com/Microsoft/GSL.git
[submodule "Telegram/ThirdParty/xxHash"]
path = Telegram/ThirdParty/xxHash
url = https://github.com/Cyan4973/xxHash.git

View File

@@ -64,6 +64,7 @@ Version **1.8.15** was the last that supports older systems
* QR Code generator ([MIT License](https://github.com/nayuki/QR-Code-generator#license))
* CMake ([New BSD License](https://github.com/Kitware/CMake/blob/master/Copyright.txt))
* Hunspell ([LGPL](https://github.com/hunspell/hunspell/blob/master/COPYING.LESSER))
* Ada ([Apache License 2.0](https://github.com/ada-url/ada/blob/main/LICENSE-APACHE))
## Build instructions

View File

@@ -112,6 +112,8 @@ PRIVATE
api/api_bot.h
api/api_chat_filters.cpp
api/api_chat_filters.h
api/api_chat_filters_remove_manager.cpp
api/api_chat_filters_remove_manager.h
api/api_chat_invite.cpp
api/api_chat_invite.h
api/api_chat_links.cpp
@@ -322,6 +324,8 @@ PRIVATE
boxes/sessions_box.h
boxes/share_box.cpp
boxes/share_box.h
boxes/star_gift_box.cpp
boxes/star_gift_box.h
boxes/sticker_set_box.cpp
boxes/sticker_set_box.h
boxes/stickers_box.cpp
@@ -569,6 +573,8 @@ PRIVATE
data/data_lastseen_status.h
data/data_location.cpp
data/data_location.h
data/data_media_preload.cpp
data/data_media_preload.h
data/data_media_rotation.cpp
data/data_media_rotation.h
data/data_media_types.cpp
@@ -604,6 +610,7 @@ PRIVATE
data/data_replies_list.h
data/data_reply_preview.cpp
data/data_reply_preview.h
data/data_report.h
data/data_saved_messages.cpp
data/data_saved_messages.h
data/data_saved_sublist.cpp
@@ -631,6 +638,8 @@ PRIVATE
data/data_thread.h
data/data_types.cpp
data/data_types.h
data/data_unread_value.cpp
data/data_unread_value.h
data/data_user.cpp
data/data_user.h
data/data_user_photos.cpp
@@ -947,6 +956,10 @@ PRIVATE
info/media/info_media_widget.h
info/members/info_members_widget.cpp
info/members/info_members_widget.h
info/peer_gifts/info_peer_gifts_common.cpp
info/peer_gifts/info_peer_gifts_common.h
info/peer_gifts/info_peer_gifts_widget.cpp
info/peer_gifts/info_peer_gifts_widget.h
info/polls/info_polls_results_inner_widget.cpp
info/polls/info_polls_results_inner_widget.h
info/polls/info_polls_results_widget.cpp
@@ -973,6 +986,10 @@ PRIVATE
info/profile/info_profile_values.h
info/profile/info_profile_widget.cpp
info/profile/info_profile_widget.h
info/reactions_list/info_reactions_list_widget.cpp
info/reactions_list/info_reactions_list_widget.h
info/requests_list/info_requests_list_widget.cpp
info/requests_list/info_requests_list_widget.h
info/saved/info_saved_sublists_widget.cpp
info/saved/info_saved_sublists_widget.h
info/settings/info_settings_widget.cpp
@@ -986,6 +1003,7 @@ PRIVATE
info/statistics/info_statistics_list_controllers.h
info/statistics/info_statistics_recent_message.cpp
info/statistics/info_statistics_recent_message.h
info/statistics/info_statistics_tag.h
info/statistics/info_statistics_widget.cpp
info/statistics/info_statistics_widget.h
info/stories/info_stories_inner_widget.cpp
@@ -1022,6 +1040,10 @@ PRIVATE
info/info_wrap_widget.h
inline_bots/bot_attach_web_view.cpp
inline_bots/bot_attach_web_view.h
inline_bots/inline_bot_confirm_prepared.cpp
inline_bots/inline_bot_confirm_prepared.h
inline_bots/inline_bot_downloads.cpp
inline_bots/inline_bot_downloads.h
inline_bots/inline_bot_layout_internal.cpp
inline_bots/inline_bot_layout_internal.h
inline_bots/inline_bot_layout_item.cpp
@@ -1153,6 +1175,8 @@ PRIVATE
media/streaming/media_streaming_player.h
media/streaming/media_streaming_reader.cpp
media/streaming/media_streaming_reader.h
media/streaming/media_streaming_round_preview.cpp
media/streaming/media_streaming_round_preview.h
media/streaming/media_streaming_utility.cpp
media/streaming/media_streaming_utility.h
media/streaming/media_streaming_video_track.cpp
@@ -1482,6 +1506,8 @@ PRIVATE
support/support_templates.h
ui/boxes/edit_invite_link_session.cpp
ui/boxes/edit_invite_link_session.h
ui/boxes/peer_qr_box.cpp
ui/boxes/peer_qr_box.h
ui/chat/attach/attach_item_single_file_preview.cpp
ui/chat/attach/attach_item_single_file_preview.h
ui/chat/attach/attach_item_single_media_preview.cpp
@@ -1490,6 +1516,8 @@ PRIVATE
ui/chat/choose_send_as.h
ui/chat/choose_theme_controller.cpp
ui/chat/choose_theme_controller.h
ui/chat/sponsored_message_bar.cpp
ui/chat/sponsored_message_bar.h
ui/controls/emoji_button_factory.cpp
ui/controls/emoji_button_factory.h
ui/controls/location_picker.cpp
@@ -1521,6 +1549,8 @@ PRIVATE
ui/widgets/expandable_peer_list.h
ui/widgets/label_with_custom_emoji.cpp
ui/widgets/label_with_custom_emoji.h
ui/widgets/chat_filters_tabs_strip.cpp
ui/widgets/chat_filters_tabs_strip.h
ui/countryinput.cpp
ui/countryinput.h
ui/dynamic_thumbnails.cpp
@@ -1838,7 +1868,7 @@ endif()
set_target_properties(Telegram PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder})
if (WIN32 AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
if (MSVC)
target_link_libraries(Telegram
PRIVATE
delayimp
@@ -1935,7 +1965,7 @@ if (NOT DESKTOP_APP_DISABLE_AUTOUPDATE AND NOT build_macstore AND NOT build_wins
base/platform/win/base_windows_safe_library.h
)
target_include_directories(Updater PRIVATE ${lib_base_loc})
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
if (MSVC)
target_link_libraries(Updater
PRIVATE
delayimp

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 KiB

After

Width:  |  Height:  |  Size: 935 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 234 KiB

View File

@@ -582,3 +582,55 @@ div.toast_shown {
.bot_button_column_separator {
width: 2px
}
.reactions {
margin: 5px 0;
}
.reactions .reaction {
display: inline-flex;
height: 20px;
border-radius: 15px;
background-color: #e8f5fc;
color: #168acd;
font-weight: bold;
margin-bottom: 5px;
}
.reactions .reaction.active {
background-color: #40a6e2;
color: #fff;
}
.reactions .reaction.paid {
background-color: #fdf6e1;
color: #c58523;
}
.reactions .reaction.active.paid {
background-color: #ecae0a;
color: #fdf6e1;
}
.reactions .reaction .emoji {
line-height: 20px;
margin: 0 5px;
font-size: 15px;
}
.reactions .reaction .userpic:not(:first-child) {
margin-left: -8px;
}
.reactions .reaction .userpic {
display: inline-block;
}
.reactions .reaction .userpic .initials {
font-size: 8px;
}
.reactions .reaction .count {
margin-right: 8px;
line-height: 20px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1 @@
<svg width="1000px" height="1000px" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><path d="M226.328419,494.722069 C372.088573,431.216685 469.284839,389.350049 517.917216,369.122161 C656.772535,311.36743 685.625481,301.334815 704.431427,301.003532 C708.567621,300.93067 717.815839,301.955743 723.806446,306.816707 C728.864797,310.92121 730.256552,316.46581 730.922551,320.357329 C731.588551,324.248848 732.417879,333.113828 731.758626,340.040666 C724.234007,419.102486 691.675104,610.964674 675.110982,699.515267 C668.10208,736.984342 654.301336,749.547532 640.940618,750.777006 C611.904684,753.448938 589.856115,731.588035 561.733393,713.153237 C517.726886,684.306416 492.866009,666.349181 450.150074,638.200013 C400.78442,605.66878 432.786119,587.789048 460.919462,558.568563 C468.282091,550.921423 596.21508,434.556479 598.691227,424.000355 C599.00091,422.680135 599.288312,417.758981 596.36474,415.160431 C593.441168,412.561881 589.126229,413.450484 586.012448,414.157198 C581.598758,415.158943 511.297793,461.625274 375.109553,553.556189 C355.154858,567.258623 337.080515,573.934908 320.886524,573.585046 C303.033948,573.199351 268.692754,563.490928 243.163606,555.192408 C211.851067,545.013936 186.964484,539.632504 189.131547,522.346309 C190.260287,513.342589 202.659244,504.134509 226.328419,494.722069 Z" id="Path-3" fill="#FFFFFF"></path></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 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: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -12,6 +12,7 @@ body {
margin: 0;
background-color: var(--td-window-bg);
color: var(--td-window-fg);
zoom: var(--td-zoom-percentage);
}
html.custom_scroll ::-webkit-scrollbar {

View File

@@ -72,6 +72,9 @@ var IV = {
}
},
frameKeyDown: function (e) {
const key0 = (e.key === '0')
|| (e.code === 'Key0')
|| (e.keyCode === 48);
const keyW = (e.key === 'w')
|| (e.code === 'KeyW')
|| (e.keyCode === 87);
@@ -81,12 +84,12 @@ var IV = {
const keyM = (e.key === 'm')
|| (e.code === 'KeyM')
|| (e.keyCode === 77);
if ((e.metaKey || e.ctrlKey) && (keyW || keyQ || keyM)) {
if ((e.metaKey || e.ctrlKey) && (keyW || keyQ || keyM || key0)) {
e.preventDefault();
IV.notify({
event: 'keydown',
modifier: e.ctrlKey ? 'ctrl' : 'cmd',
key: keyW ? 'w' : keyQ ? 'q' : 'm',
key: key0 ? '0' : keyW ? 'w' : keyQ ? 'q' : 'm',
});
} else if (e.key === 'Escape' || e.keyCode === 27) {
e.preventDefault();

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,7 @@
<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>
<file alias="hello_status.tgs">../../animations/hello_status.tgs</file>
<file alias="dice_idle.tgs">../../animations/dice/dice_idle.tgs</file>
<file alias="dart_idle.tgs">../../animations/dice/dart_idle.tgs</file>

View File

@@ -7,6 +7,7 @@
<file alias="art/logo_256.png">../../art/logo_256.png</file>
<file alias="art/logo_256_no_margin.png">../../art/logo_256_no_margin.png</file>
<file alias="art/themeimage.jpg">../../art/themeimage.jpg</file>
<file alias="art/round_placeholder.jpg">../../art/round_placeholder.jpg</file>
<file alias="day-blue.tdesktop-theme">../../day-blue.tdesktop-theme</file>
<file alias="night.tdesktop-theme">../../night.tdesktop-theme</file>
<file alias="night-green.tdesktop-theme">../../night-green.tdesktop-theme</file>
@@ -31,6 +32,7 @@
<file alias="topic_icons/gray.svg">../../art/topic_icons/gray.svg</file>
<file alias="topic_icons/general.svg">../../art/topic_icons/general.svg</file>
<file alias="links_subscription.svg">../../icons/info/edit/links_subscription.svg</file>
<file alias="plane_white.svg">../../icons/plane_white.svg</file>
</qresource>
<qresource prefix="/icons">
<file alias="calls/hands.lottie">../../icons/calls/hands.lottie</file>

View File

@@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="5.4.4.0" />
Version="5.8.2.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View File

@@ -16,6 +16,8 @@
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>

View File

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

View File

@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,4,4,0
PRODUCTVERSION 5,4,4,0
FILEVERSION 5,8,2,0
PRODUCTVERSION 5,8,2,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", "5.4.4.0"
VALUE "FileVersion", "5.8.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.4.4.0"
VALUE "ProductVersion", "5.8.2.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -39,6 +39,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/layers/generic_box.h"
#include "ui/text/text_utilities.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
namespace Api {
namespace {
@@ -503,11 +506,19 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
bot->session().attachWebView().open({
.bot = bot,
.context = { .controller = controller },
.button = {.text = button->text, .url = button->data },
.button = { .text = button->text, .url = button->data },
.source = InlineBots::WebViewSourceButton{ .simple = true },
});
}
} break;
case ButtonType::CopyText: {
const auto text = QString::fromUtf8(button->data);
if (!text.isEmpty()) {
QGuiApplication::clipboard()->setText(text);
controller->showToast(tr::lng_text_copied(tr::now));
}
} break;
}
}

View File

@@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/premium_limits_box.h"
#include "boxes/filters/edit_filter_links.h" // FilterChatStatusText
#include "core/application.h"
#include "core/core_settings.h"
#include "data/data_channel.h"
#include "data/data_chat.h"
#include "data/data_chat_filters.h"
@@ -152,6 +153,7 @@ void InitFilterLinkHeader(
.badge = (type == Ui::FilterLinkHeaderType::AddingChats
? std::move(count)
: rpl::single(0)),
.horizontalFilters = Core::App().settings().chatFiltersHorizontal(),
});
const auto widget = header.widget;
widget->resizeToWidth(st::boxWideWidth);
@@ -232,12 +234,12 @@ void ImportInvite(
api->request(MTPchatlists_JoinChatlistInvite(
MTP_string(slug),
MTP_vector<MTPInputPeer>(std::move(inputs))
)).done(callback).fail(error).send();
)).done(callback).fail(error).handleFloodErrors().send();
} else {
api->request(MTPchatlists_JoinChatlistUpdates(
MTP_inputChatlistDialogFilter(MTP_int(filterId)),
MTP_vector<MTPInputPeer>(std::move(inputs))
)).done(callback).fail(error).send();
)).done(callback).fail(error).handleFloodErrors().send();
}
}
@@ -517,6 +519,8 @@ void ShowImportError(
} else {
window->showToast((error == u"INVITE_SLUG_EXPIRED"_q)
? tr::lng_group_invite_bad_link(tr::now)
: error.startsWith(u"FLOOD_WAIT_"_q)
? tr::lng_flood_error(tr::now)
: error);
}
}

View File

@@ -0,0 +1,128 @@
/*
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_chat_filters_remove_manager.h"
#include "api/api_chat_filters.h"
#include "apiwrap.h"
#include "data/data_chat_filters.h"
#include "data/data_peer.h"
#include "data/data_session.h"
#include "lang/lang_keys.h"
#include "main/main_session.h"
#include "ui/boxes/confirm_box.h"
#include "ui/ui_utility.h"
#include "window/window_controller.h"
#include "window/window_session_controller.h"
#include "styles/style_layers.h"
namespace Api {
namespace {
void RemoveChatFilter(
not_null<Main::Session*> session,
FilterId filterId,
std::vector<not_null<PeerData*>> leave) {
const auto api = &session->api();
session->data().chatsFilters().apply(MTP_updateDialogFilter(
MTP_flags(MTPDupdateDialogFilter::Flag(0)),
MTP_int(filterId),
MTPDialogFilter()));
if (leave.empty()) {
api->request(MTPmessages_UpdateDialogFilter(
MTP_flags(MTPmessages_UpdateDialogFilter::Flag(0)),
MTP_int(filterId),
MTPDialogFilter()
)).send();
} else {
api->request(MTPchatlists_LeaveChatlist(
MTP_inputChatlistDialogFilter(MTP_int(filterId)),
MTP_vector<MTPInputPeer>(ranges::views::all(
leave
) | ranges::views::transform([](not_null<PeerData*> peer) {
return MTPInputPeer(peer->input);
}) | ranges::to<QVector<MTPInputPeer>>())
)).done([=](const MTPUpdates &result) {
api->applyUpdates(result);
}).send();
}
}
} // namespace
RemoveComplexChatFilter::RemoveComplexChatFilter() = default;
void RemoveComplexChatFilter::request(
QPointer<Ui::RpWidget> widget,
base::weak_ptr<Window::SessionController> weak,
FilterId id) {
const auto session = &weak->session();
const auto &list = session->data().chatsFilters().list();
const auto i = ranges::find(list, id, &Data::ChatFilter::id);
const auto filter = (i != end(list)) ? *i : Data::ChatFilter();
const auto has = filter.hasMyLinks();
const auto confirm = [=](Fn<void()> action, bool onlyWhenHas = false) {
if (!has && onlyWhenHas) {
action();
return;
}
weak->window().show(Ui::MakeConfirmBox({
.text = (has
? tr::lng_filters_delete_sure()
: tr::lng_filters_remove_sure()),
.confirmed = [=](Fn<void()> &&close) { close(); action(); },
.confirmText = (has
? tr::lng_box_delete()
: tr::lng_filters_remove_yes()),
.confirmStyle = &st::attentionBoxButton,
}));
};
const auto simple = [=] {
confirm([=] { RemoveChatFilter(session, id, {}); });
};
const auto suggestRemoving = Api::ExtractSuggestRemoving(filter);
if (suggestRemoving.empty()) {
simple();
return;
} else if (_removingRequestId) {
if (_removingId == id) {
return;
}
session->api().request(_removingRequestId).cancel();
}
_removingId = id;
_removingRequestId = session->api().request(
MTPchatlists_GetLeaveChatlistSuggestions(
MTP_inputChatlistDialogFilter(
MTP_int(id)))
).done(crl::guard(widget, [=, this](const MTPVector<MTPPeer> &result) {
_removingRequestId = 0;
const auto suggestRemovePeers = ranges::views::all(
result.v
) | ranges::views::transform([=](const MTPPeer &peer) {
return session->data().peer(peerFromMTP(peer));
}) | ranges::to_vector;
const auto chosen = crl::guard(widget, [=](
std::vector<not_null<PeerData*>> peers) {
RemoveChatFilter(session, id, std::move(peers));
});
confirm(crl::guard(widget, [=] {
Api::ProcessFilterRemove(
weak,
filter.title(),
filter.iconEmoji(),
suggestRemoving,
suggestRemovePeers,
chosen);
}), true);
})).fail(crl::guard(widget, [=, this] {
_removingRequestId = 0;
simple();
})).send();
}
} // namespace Api

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
*/
#pragma once
namespace Window {
class SessionController;
} // namespace Window
namespace Ui {
class RpWidget;
} // namespace Ui
namespace Api {
class RemoveComplexChatFilter final {
public:
RemoveComplexChatFilter();
void request(
QPointer<Ui::RpWidget> widget,
base::weak_ptr<Window::SessionController> weak,
FilterId id);
private:
FilterId _removingId = 0;
mtpRequestId _removingRequestId = 0;
};
} // namespace Api

View File

@@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "settings/settings_credits_graphics.h"
#include "ui/boxes/confirm_box.h"
#include "ui/controls/userpic_button.h"
#include "ui/effects/credits_graphics.h"
#include "ui/effects/premium_graphics.h"
#include "ui/effects/premium_stars_colored.h"
#include "ui/empty_userpic.h"
@@ -129,6 +130,7 @@ void ConfirmSubscriptionBox(
struct State final {
std::shared_ptr<Data::PhotoMedia> photoMedia;
std::unique_ptr<Ui::EmptyUserpic> photoEmpty;
QImage frame;
std::optional<MTP::Sender> api;
Ui::RpWidget* saveButton = nullptr;
@@ -146,25 +148,45 @@ void ConfirmSubscriptionBox(
const auto userpic = userpicWrap->entity();
const auto photoSize = st::confirmInvitePhotoSize;
userpic->resize(Size(photoSize));
const auto creditsIconSize = photoSize / 3;
const auto creditsIconCallback =
Ui::PaintOutlinedColoredCreditsIconCallback(
creditsIconSize,
1.5);
state->frame = QImage(
Size(photoSize * style::DevicePixelRatio()),
QImage::Format_ARGB32_Premultiplied);
state->frame.setDevicePixelRatio(style::DevicePixelRatio());
const auto options = Images::Option::RoundCircle;
userpic->paintRequest(
) | rpl::start_with_next([=, small = Data::PhotoSize::Small] {
auto p = QPainter(userpic);
if (state->photoMedia) {
if (const auto image = state->photoMedia->image(small)) {
p.drawPixmap(
state->frame.fill(Qt::transparent);
{
auto p = QPainter(&state->frame);
if (state->photoMedia) {
if (const auto image = state->photoMedia->image(small)) {
p.drawPixmap(
0,
0,
image->pix(Size(photoSize), { .options = options }));
}
} else if (state->photoEmpty) {
state->photoEmpty->paintCircle(
p,
0,
0,
image->pix(Size(photoSize), { .options = options }));
userpic->width(),
photoSize);
}
if (creditsIconCallback) {
p.translate(
photoSize - creditsIconSize,
photoSize - creditsIconSize);
creditsIconCallback(p);
}
} else if (state->photoEmpty) {
state->photoEmpty->paintCircle(
p,
0,
0,
userpic->width(),
photoSize);
}
auto p = QPainter(userpic);
p.drawImage(0, 0, state->frame);
}, userpicWrap->lifetime());
userpicWrap->setAttribute(Qt::WA_TransparentForMouseEvents);
if (photo) {
@@ -275,7 +297,6 @@ void ConfirmSubscriptionBox(
: 0;
state->api->request(
MTPpayments_SendStarsForm(
MTP_flags(0),
MTP_long(formId),
MTP_inputInvoiceChatInviteSubscription(MTP_string(hash)))
).done([=](const MTPpayments_PaymentResult &result) {

View File

@@ -264,14 +264,24 @@ ChatParticipant::ChatParticipant(
_rank = qs(data.vrank().value_or_empty());
_rights = ChatAdminRightsInfo(data.vadmin_rights());
_by = peerToUser(peerFromUser(data.vpromoted_by()));
_date = data.vdate().v;
}, [&](const MTPDchannelParticipantSelf &data) {
_type = Type::Member;
_date = data.vdate().v;
_by = peerToUser(peerFromUser(data.vinviter_id()));
if (data.vsubscription_until_date()) {
_subscriptionDate = data.vsubscription_until_date()->v;
}
}, [&](const MTPDchannelParticipant &data) {
_type = Type::Member;
_date = data.vdate().v;
if (data.vsubscription_until_date()) {
_subscriptionDate = data.vsubscription_until_date()->v;
}
}, [&](const MTPDchannelParticipantBanned &data) {
_restrictions = ChatRestrictionsInfo(data.vbanned_rights());
_by = peerToUser(peerFromUser(data.vkicked_by()));
_date = data.vdate().v;
_type = (_restrictions.flags & ChatRestriction::ViewMessages)
? Type::Banned
@@ -348,6 +358,24 @@ ChatAdminRightsInfo ChatParticipant::rights() const {
return _rights;
}
TimeId ChatParticipant::subscriptionDate() const {
return _subscriptionDate;
}
TimeId ChatParticipant::promotedSince() const {
return (_type == Type::Admin) ? _date : TimeId(0);
}
TimeId ChatParticipant::restrictedSince() const {
return (_type == Type::Restricted || _type == Type::Banned)
? _date
: TimeId(0);
}
TimeId ChatParticipant::memberSince() const {
return (_type == Type::Member) ? _date : TimeId(0);
}
ChatParticipant::Type ChatParticipant::type() const {
return _type;
}

View File

@@ -60,6 +60,11 @@ public:
ChatRestrictionsInfo restrictions() const;
ChatAdminRightsInfo rights() const;
TimeId subscriptionDate() const;
TimeId promotedSince() const;
TimeId restrictedSince() const;
TimeId memberSince() const;
Type type() const;
QString rank() const;
@@ -73,6 +78,8 @@ private:
bool _canBeEdited = false;
QString _rank;
TimeId _subscriptionDate = 0;
TimeId _date = 0;
ChatRestrictionsInfo _restrictions;
ChatAdminRightsInfo _rights;

View File

@@ -12,6 +12,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/core_cloud_password.h"
#include "passport/passport_encryption.h"
#include "base/unixtime.h"
#include "base/call_delayed.h"
namespace Api {
namespace {

View File

@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_updates.h"
#include "apiwrap.h"
#include "base/unixtime.h"
#include "data/components/credits.h"
#include "data/data_channel.h"
#include "data/data_document.h"
#include "data/data_peer.h"
@@ -38,8 +39,8 @@ constexpr auto kTransactionsLimit = 100;
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()) {
media.match([&](const MTPDmessageMediaPhoto &data) {
if (const auto inner = data.vphoto()) {
const auto photo = owner->processPhoto(*inner);
if (!photo->isNull()) {
extended.push_back(CreditsHistoryMedia{
@@ -48,9 +49,11 @@ constexpr auto kTransactionsLimit = 100;
});
}
}
}, [&](const MTPDmessageMediaDocument &document) {
if (const auto inner = document.vdocument()) {
const auto document = owner->processDocument(*inner);
}, [&](const MTPDmessageMediaDocument &data) {
if (const auto inner = data.vdocument()) {
const auto document = owner->processDocument(
*inner,
data.valt_documents());
if (document->isAnimation()
|| document->isVideoFile()
|| document->isGifv()) {
@@ -69,16 +72,26 @@ constexpr auto kTransactionsLimit = 100;
}, [](const auto &) {
return PeerId(0);
}).value;
const auto stargift = tl.data().vstargift();
const auto reaction = tl.data().is_reaction();
const auto incoming = (int64(tl.data().vstars().v) >= 0);
const auto saveActorId = (reaction || !extended.empty()) && incoming;
return Data::CreditsHistoryEntry{
.id = qs(tl.data().vid()),
.title = qs(tl.data().vtitle().value_or_empty()),
.description = qs(tl.data().vdescription().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,
.barePeerId = saveActorId ? peer->id.value : barePeerId,
.bareGiveawayMsgId = uint64(
tl.data().vgiveaway_post_id().value_or_empty()),
.bareGiftStickerId = (stargift
? owner->processDocument(stargift->data().vsticker())->id
: 0),
.bareActorId = saveActorId ? barePeerId : uint64(0),
.peerType = tl.data().vpeer().match([](const HistoryPeerTL &) {
return Data::CreditsHistoryEntry::PeerType::Peer;
}, [](const MTPDstarsTransactionPeerPlayMarket &) {
@@ -93,6 +106,8 @@ constexpr auto kTransactionsLimit = 100;
return Data::CreditsHistoryEntry::PeerType::PremiumBot;
}, [](const MTPDstarsTransactionPeerAds &) {
return Data::CreditsHistoryEntry::PeerType::Ads;
}, [](const MTPDstarsTransactionPeerAPI &) {
return Data::CreditsHistoryEntry::PeerType::API;
}),
.subscriptionUntil = tl.data().vsubscription_period()
? base::unixtime::parse(base::unixtime::now()
@@ -102,12 +117,18 @@ constexpr auto kTransactionsLimit = 100;
? base::unixtime::parse(tl.data().vtransaction_date()->v)
: QDateTime(),
.successLink = qs(tl.data().vtransaction_url().value_or_empty()),
.starsConverted = int(stargift
? stargift->data().vconvert_stars().v
: 0),
.floodSkip = int(tl.data().vfloodskip_number().value_or(0)),
.converted = stargift && incoming,
.stargift = stargift.has_value(),
.reaction = tl.data().is_reaction(),
.refunded = tl.data().is_refund(),
.pending = tl.data().is_pending(),
.failed = tl.data().is_failed(),
.in = (int64(tl.data().vstars().v) >= 0),
.gift = tl.data().is_gift(),
.in = incoming,
.gift = tl.data().is_gift() || stargift.has_value(),
};
}
@@ -154,7 +175,8 @@ constexpr auto kTransactionsLimit = 100;
.balance = status.data().vbalance().v,
.subscriptionsMissingBalance
= status.data().vsubscriptions_missing_balance().value_or_empty(),
.allLoaded = !status.data().vnext_offset().has_value(),
.allLoaded = !status.data().vnext_offset().has_value()
&& !status.data().vsubscriptions_next_offset().has_value(),
.token = qs(status.data().vnext_offset().value_or_empty()),
.tokenSubscriptions = qs(
status.data().vsubscriptions_next_offset().value_or_empty()),
@@ -215,6 +237,10 @@ rpl::producer<rpl::no_value, QString> CreditsTopupOptions::request() {
};
}
Data::CreditTopupOptions CreditsTopupOptions::options() const {
return _options;
}
CreditsStatus::CreditsStatus(not_null<PeerData*> peer)
: _peer(peer)
, _api(&peer->session().api().instance()) {
@@ -233,6 +259,8 @@ void CreditsStatus::request(
_peer->isSelf() ? MTP_inputPeerSelf() : _peer->input
)).done([=](const TLResult &result) {
_requestId = 0;
const auto balance = result.data().vbalance().v;
_peer->session().credits().apply(_peer->id, balance);
if (const auto onstack = done) {
onstack(StatusFromTL(result, _peer));
}
@@ -294,10 +322,6 @@ void CreditsHistory::requestSubscriptions(
}).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>(
@@ -385,4 +409,58 @@ Data::CreditsEarnStatistics CreditsEarnStatistics::data() const {
return _data;
}
CreditsGiveawayOptions::CreditsGiveawayOptions(not_null<PeerData*> peer)
: _peer(peer)
, _api(&peer->session().api().instance()) {
}
rpl::producer<rpl::no_value, QString> CreditsGiveawayOptions::request() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
using TLOption = MTPStarsGiveawayOption;
const auto optionsFromTL = [=](const auto &options) {
return ranges::views::all(
options
) | ranges::views::transform([=](const auto &option) {
return Data::CreditsGiveawayOption{
.winners = ranges::views::all(
option.data().vwinners().v
) | ranges::views::transform([](const auto &winner) {
return Data::CreditsGiveawayOption::Winner{
.users = winner.data().vusers().v,
.perUserStars = winner.data().vper_user_stars().v,
.isDefault = winner.data().is_default(),
};
}) | ranges::to_vector,
.storeProduct = qs(
option.data().vstore_product().value_or_empty()),
.currency = qs(option.data().vcurrency()),
.amount = option.data().vamount().v,
.credits = option.data().vstars().v,
.yearlyBoosts = option.data().vyearly_boosts().v,
.isExtended = option.data().is_extended(),
.isDefault = option.data().is_default(),
};
}) | ranges::to_vector;
};
const auto fail = [=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
};
_api.request(MTPpayments_GetStarsGiveawayOptions(
)).done([=](const MTPVector<TLOption> &result) {
_options = optionsFromTL(result.v);
consumer.put_done();
}).fail(fail).send();
return lifetime;
};
}
Data::CreditsGiveawayOptions CreditsGiveawayOptions::options() const {
return _options;
}
} // namespace Api

View File

@@ -36,6 +36,22 @@ private:
};
class CreditsGiveawayOptions final {
public:
CreditsGiveawayOptions(not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<rpl::no_value, QString> request();
[[nodiscard]] Data::CreditsGiveawayOptions options() const;
private:
const not_null<PeerData*> _peer;
Data::CreditsGiveawayOptions _options;
MTP::Sender _api;
};
class CreditsStatus final {
public:
CreditsStatus(not_null<PeerData*> peer);
@@ -83,8 +99,8 @@ public:
[[nodiscard]] Data::CreditsEarnStatistics data() const;
private:
const bool _isUser = false;
Data::CreditsEarnStatistics _data;
bool _isUser = false;
mtpRequestId _requestId = 0;

View File

@@ -40,6 +40,7 @@ void HandleWithdrawalButton(
std::shared_ptr<Ui::Show> show) {
Expects(receiver.currencyReceiver
|| (receiver.creditsReceiver && receiver.creditsAmount));
struct State {
rpl::lifetime lifetime;
bool loading = false;
@@ -58,8 +59,7 @@ void HandleWithdrawalButton(
const auto processOut = [=] {
if (state->loading) {
return;
}
if (peer && !receiver.creditsAmount()) {
} else if (peer && !receiver.creditsAmount()) {
return;
}
state->loading = true;
@@ -89,12 +89,15 @@ void HandleWithdrawalButton(
}
};
const auto fail = [=](const MTP::Error &error) {
show->showToast(error.type());
const auto message = error.type();
if (box && !box->handleCustomCheckError(message)) {
show->showToast(message);
}
};
if (channel) {
session->api().request(
MTPstats_GetBroadcastRevenueWithdrawalUrl(
channel->inputChannel,
channel->input,
result.result
)).done([=](const ChannelOutUrl &r) {
done(qs(r.data().vurl()));
@@ -134,7 +137,7 @@ void HandleWithdrawalButton(
if (channel) {
session->api().request(
MTPstats_GetBroadcastRevenueWithdrawalUrl(
channel->inputChannel,
channel->input,
MTP_inputCheckPasswordEmpty()
)).fail(fail).send();
} else if (peer) {

View File

@@ -115,6 +115,28 @@ rpl::producer<bool> GlobalPrivacy::newRequirePremium() const {
return _newRequirePremium.value();
}
void GlobalPrivacy::loadPaidReactionAnonymous() {
if (_paidReactionAnonymousLoaded) {
return;
}
_paidReactionAnonymousLoaded = true;
_api.request(MTPmessages_GetPaidReactionPrivacy(
)).done([=](const MTPUpdates &result) {
_session->api().applyUpdates(result);
}).send();
}
void GlobalPrivacy::updatePaidReactionAnonymous(bool value) {
_paidReactionAnonymous = value;
}
bool GlobalPrivacy::paidReactionAnonymousCurrent() const {
return _paidReactionAnonymous.current();
}
rpl::producer<bool> GlobalPrivacy::paidReactionAnonymous() const {
return _paidReactionAnonymous.value();
}
void GlobalPrivacy::updateArchiveAndMute(bool value) {
update(

View File

@@ -49,6 +49,11 @@ public:
[[nodiscard]] bool newRequirePremiumCurrent() const;
[[nodiscard]] rpl::producer<bool> newRequirePremium() const;
void loadPaidReactionAnonymous();
void updatePaidReactionAnonymous(bool value);
[[nodiscard]] bool paidReactionAnonymousCurrent() const;
[[nodiscard]] rpl::producer<bool> paidReactionAnonymous() const;
private:
void apply(const MTPGlobalPrivacySettings &data);
@@ -67,7 +72,9 @@ private:
rpl::variable<bool> _showArchiveAndMute = false;
rpl::variable<bool> _hideReadTime = false;
rpl::variable<bool> _newRequirePremium = false;
rpl::variable<bool> _paidReactionAnonymous = false;
std::vector<Fn<void()>> _callbacks;
bool _paidReactionAnonymousLoaded = false;
};

View File

@@ -37,7 +37,8 @@ MTPVector<MTPDocumentAttribute> ComposeSendingDocumentAttributes(
MTP_int(dimensions.width()),
MTP_int(dimensions.height()),
MTPint(), // preload_prefix_size
MTPdouble())); // video_start_ts
MTPdouble(), // video_start_ts
MTPstring())); // video_codec
} else {
attributes.push_back(MTP_documentAttributeImageSize(
MTP_int(dimensions.width()),

View File

@@ -361,9 +361,10 @@ void Premium::resolveGiveawayInfo(
? GiveawayState::Refunded
: GiveawayState::Finished;
info.giftCode = qs(data.vgift_code_slug().value_or_empty());
info.activatedCount = data.vactivated_count().v;
info.activatedCount = data.vactivated_count().value_or_empty();
info.finishDate = data.vfinish_date().v;
info.startDate = data.vstart_date().v;
info.credits = data.vstars_prize().value_or_empty();
});
_giveawayInfoDone(std::move(info));
}).fail([=] {
@@ -508,7 +509,9 @@ rpl::producer<rpl::no_value, QString> PremiumGiftCodeOptions::applyPrepaid(
_api.request(MTPpayments_LaunchPrepaidGiveaway(
_peer->input,
MTP_long(prepaidId),
Payments::InvoicePremiumGiftCodeGiveawayToTL(invoice)
invoice.creditsAmount
? Payments::InvoiceCreditsGiveawayToTL(invoice)
: Payments::InvoicePremiumGiftCodeGiveawayToTL(invoice)
)).done([=](const MTPUpdates &result) {
_peer->session().api().applyUpdates(result);
consumer.put_done();
@@ -537,16 +540,34 @@ Payments::InvoicePremiumGiftCode PremiumGiftCodeOptions::invoice(
const auto token = Token{ users, months };
const auto &store = _stores[token];
return Payments::InvoicePremiumGiftCode{
.randomId = randomId,
.currency = _optionsForOnePerson.currency,
.amount = store.amount,
.storeProduct = store.product,
.randomId = randomId,
.amount = store.amount,
.storeQuantity = store.quantity,
.users = token.users,
.months = token.months,
};
}
std::vector<GiftOptionData> PremiumGiftCodeOptions::optionsForPeer() const {
auto result = std::vector<GiftOptionData>();
if (!_optionsForOnePerson.currency.isEmpty()) {
const auto count = int(_optionsForOnePerson.months.size());
result.reserve(count);
for (auto i = 0; i != count; ++i) {
Assert(i < _optionsForOnePerson.totalCosts.size());
result.push_back({
.cost = _optionsForOnePerson.totalCosts[i],
.currency = _optionsForOnePerson.currency,
.months = _optionsForOnePerson.months[i],
});
}
}
return result;
}
Data::PremiumSubscriptionOptions PremiumGiftCodeOptions::options(int amount) {
const auto it = _subscriptionOptions.find(amount);
if (it != end(_subscriptionOptions)) {
@@ -568,6 +589,41 @@ Data::PremiumSubscriptionOptions PremiumGiftCodeOptions::options(int amount) {
}
}
auto PremiumGiftCodeOptions::requestStarGifts()
-> rpl::producer<rpl::no_value, QString> {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
_api.request(MTPpayments_GetStarGifts(
MTP_int(0)
)).done([=](const MTPpayments_StarGifts &result) {
result.match([&](const MTPDpayments_starGifts &data) {
_giftsHash = data.vhash().v;
const auto &list = data.vgifts().v;
const auto session = &_peer->session();
auto gifts = std::vector<StarGift>();
gifts.reserve(list.size());
for (const auto &gift : list) {
if (auto parsed = FromTL(session, gift)) {
gifts.push_back(std::move(*parsed));
}
}
_gifts = std::move(gifts);
}, [&](const MTPDpayments_starGiftsNotModified &) {
});
consumer.put_done();
}).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
}).send();
return lifetime;
};
}
const std::vector<StarGift> &PremiumGiftCodeOptions::starGifts() const {
return _gifts;
}
int PremiumGiftCodeOptions::giveawayBoostsPerPremium() const {
constexpr auto kFallbackCount = 4;
return _peer->session().appConfig().get<int>(
@@ -702,4 +758,59 @@ rpl::producer<DocumentData*> RandomHelloStickerValue(
}) | rpl::take(1) | rpl::map(random));
}
std::optional<StarGift> FromTL(
not_null<Main::Session*> session,
const MTPstarGift &gift) {
const auto &data = gift.data();
const auto document = session->data().processDocument(
data.vsticker());
const auto remaining = data.vavailability_remains();
const auto total = data.vavailability_total();
if (!document->sticker()) {
return {};
}
return StarGift{
.id = uint64(data.vid().v),
.stars = int64(data.vstars().v),
.starsConverted = int64(data.vconvert_stars().v),
.document = document,
.limitedLeft = remaining.value_or_empty(),
.limitedCount = total.value_or_empty(),
.firstSaleDate = data.vfirst_sale_date().value_or_empty(),
.lastSaleDate = data.vlast_sale_date().value_or_empty(),
.birthday = data.is_birthday(),
};
}
std::optional<UserStarGift> FromTL(
not_null<UserData*> to,
const MTPuserStarGift &gift) {
const auto session = &to->session();
const auto &data = gift.data();
auto parsed = FromTL(session, data.vgift());
if (!parsed) {
return {};
}
return UserStarGift{
.info = std::move(*parsed),
.message = (data.vmessage()
? TextWithEntities{
.text = qs(data.vmessage()->data().vtext()),
.entities = Api::EntitiesFromMTP(
session,
data.vmessage()->data().ventities().v),
}
: TextWithEntities()),
.starsConverted = int64(data.vconvert_stars().value_or_empty()),
.fromId = (data.vfrom_id()
? peerFromUser(data.vfrom_id()->v)
: PeerId()),
.messageId = data.vmsg_id().value_or_empty(),
.date = data.vdate().v,
.anonymous = data.is_name_hidden(),
.hidden = data.is_unsaved(),
.mine = to->isSelf(),
};
}
} // namespace Api

View File

@@ -57,6 +57,7 @@ struct GiveawayInfo {
TimeId tooEarlyDate = 0;
TimeId finishDate = 0;
TimeId startDate = 0;
uint64 credits = 0;
int winnersCount = 0;
int activatedCount = 0;
bool participating = false;
@@ -66,6 +67,40 @@ struct GiveawayInfo {
}
};
struct GiftOptionData {
int64 cost = 0;
QString currency;
int months = 0;
};
struct StarGift {
uint64 id = 0;
int64 stars = 0;
int64 starsConverted = 0;
not_null<DocumentData*> document;
int limitedLeft = 0;
int limitedCount = 0;
TimeId firstSaleDate = 0;
TimeId lastSaleDate = 0;
bool birthday = false;
friend inline bool operator==(
const StarGift &,
const StarGift &) = default;
};
struct UserStarGift {
StarGift info;
TextWithEntities message;
int64 starsConverted = 0;
PeerId fromId = 0;
MsgId messageId = 0;
TimeId date = 0;
bool anonymous = false;
bool hidden = false;
bool mine = false;
};
class Premium final {
public:
explicit Premium(not_null<ApiWrap*> api);
@@ -170,6 +205,7 @@ public:
PremiumGiftCodeOptions(not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<rpl::no_value, QString> request();
[[nodiscard]] std::vector<GiftOptionData> optionsForPeer() const;
[[nodiscard]] Data::PremiumSubscriptionOptions options(int amount);
[[nodiscard]] const std::vector<int> &availablePresets() const;
[[nodiscard]] int monthsFromPreset(int monthsIndex);
@@ -186,6 +222,9 @@ public:
[[nodiscard]] int giveawayPeriodMax() const;
[[nodiscard]] bool giveawayGiftsPurchaseAvailable() const;
[[nodiscard]] rpl::producer<rpl::no_value, QString> requestStarGifts();
[[nodiscard]] const std::vector<StarGift> &starGifts() const;
private:
struct Token final {
int users = 0;
@@ -205,7 +244,7 @@ private:
base::flat_map<Amount, PremiumSubscriptionOptions> _subscriptionOptions;
struct {
std::vector<int> months;
std::vector<float64> totalCosts;
std::vector<int64> totalCosts;
QString currency;
} _optionsForOnePerson;
@@ -213,6 +252,9 @@ private:
base::flat_map<Token, Store> _stores;
int32 _giftsHash = 0;
std::vector<StarGift> _gifts;
MTP::Sender _api;
};
@@ -241,4 +283,11 @@ enum class RequirePremiumState {
[[nodiscard]] rpl::producer<DocumentData*> RandomHelloStickerValue(
not_null<Main::Session*> session);
[[nodiscard]] std::optional<StarGift> FromTL(
not_null<Main::Session*> session,
const MTPstarGift &gift);
[[nodiscard]] std::optional<UserStarGift> FromTL(
not_null<UserData*> to,
const MTPuserStarGift &gift);
} // namespace Api

View File

@@ -10,10 +10,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h"
#include "data/data_peer.h"
#include "data/data_photo.h"
#include "data/data_report.h"
#include "data/data_user.h"
#include "lang/lang_keys.h"
#include "main/main_session.h"
#include "ui/boxes/report_box.h"
#include "ui/boxes/report_box_graphics.h"
#include "ui/layers/show.h"
namespace Api {
@@ -39,52 +40,106 @@ MTPreportReason ReasonToTL(const Ui::ReportReason &reason) {
} // namespace
void SendReport(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer,
Ui::ReportReason reason,
const QString &comment,
std::variant<
v::null_t,
MessageIdsList,
not_null<PhotoData*>,
StoryId> data) {
auto done = [=] {
void SendPhotoReport(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer,
Ui::ReportReason reason,
const QString &comment,
not_null<PhotoData*> photo) {
peer->session().api().request(MTPaccount_ReportProfilePhoto(
peer->input,
photo->mtpInput(),
ReasonToTL(reason),
MTP_string(comment)
)).done([=] {
show->showToast(tr::lng_report_thanks(tr::now));
};
v::match(data, [&](v::null_t) {
peer->session().api().request(MTPaccount_ReportPeer(
peer->input,
ReasonToTL(reason),
MTP_string(comment)
)).done(std::move(done)).send();
}, [&](const MessageIdsList &ids) {
auto apiIds = QVector<MTPint>();
apiIds.reserve(ids.size());
for (const auto &fullId : ids) {
apiIds.push_back(MTP_int(fullId.msg));
}).send();
}
auto CreateReportMessagesOrStoriesCallback(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer)
-> Fn<void(Data::ReportInput, Fn<void(ReportResult)>)> {
using TLChoose = MTPDreportResultChooseOption;
using TLAddComment = MTPDreportResultAddComment;
using TLReported = MTPDreportResultReported;
using Result = ReportResult;
struct State final {
#ifdef _DEBUG
~State() {
qDebug() << "Messages or Stories Report ~State().";
}
peer->session().api().request(MTPmessages_Report(
peer->input,
MTP_vector<MTPint>(apiIds),
ReasonToTL(reason),
MTP_string(comment)
)).done(std::move(done)).send();
}, [&](not_null<PhotoData*> photo) {
peer->session().api().request(MTPaccount_ReportProfilePhoto(
peer->input,
photo->mtpInput(),
ReasonToTL(reason),
MTP_string(comment)
)).done(std::move(done)).send();
}, [&](StoryId id) {
peer->session().api().request(MTPstories_Report(
peer->input,
MTP_vector<MTPint>(1, MTP_int(id)),
ReasonToTL(reason),
MTP_string(comment)
)).done(std::move(done)).send();
});
#endif
mtpRequestId requestId = 0;
};
const auto state = std::make_shared<State>();
return [=](
Data::ReportInput reportInput,
Fn<void(Result)> done) {
auto apiIds = QVector<MTPint>();
apiIds.reserve(reportInput.ids.size() + reportInput.stories.size());
for (const auto &id : reportInput.ids) {
apiIds.push_back(MTP_int(id));
}
for (const auto &story : reportInput.stories) {
apiIds.push_back(MTP_int(story));
}
const auto received = [=](
const MTPReportResult &result,
mtpRequestId requestId) {
if (state->requestId != requestId) {
return;
}
state->requestId = 0;
done(result.match([&](const TLChoose &data) {
const auto t = qs(data.vtitle());
auto list = Result::Options();
list.reserve(data.voptions().v.size());
for (const auto &tl : data.voptions().v) {
list.emplace_back(Result::Option{
.id = tl.data().voption().v,
.text = qs(tl.data().vtext()),
});
}
return Result{ .options = std::move(list), .title = t };
}, [&](const TLAddComment &data) -> Result {
return {
.commentOption = ReportResult::CommentOption{
.optional = data.is_optional(),
.id = data.voption().v,
}
};
}, [&](const TLReported &data) -> Result {
return { .successful = true };
}));
};
const auto fail = [=](const MTP::Error &error) {
state->requestId = 0;
done({ .error = error.type() });
};
if (!reportInput.stories.empty()) {
state->requestId = peer->session().api().request(
MTPstories_Report(
peer->input,
MTP_vector<MTPint>(apiIds),
MTP_bytes(reportInput.optionId),
MTP_string(reportInput.comment))
).done(received).fail(fail).send();
} else {
state->requestId = peer->session().api().request(
MTPmessages_Report(
peer->input,
MTP_vector<MTPint>(apiIds),
MTP_bytes(reportInput.optionId),
MTP_string(reportInput.comment))
).done(received).fail(fail).send();
}
};
}
} // namespace Api

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
class HistoryItem;
class PeerData;
class PhotoData;
@@ -15,17 +16,41 @@ class Show;
enum class ReportReason;
} // namespace Ui
namespace Data {
struct ReportInput;
} // namespace Data
namespace Api {
void SendReport(
struct ReportResult final {
using Id = QByteArray;
struct Option final {
Id id = 0;
QString text;
};
using Options = std::vector<Option>;
Options options;
QString title;
QString error;
QString comment;
struct CommentOption {
bool optional = false;
Id id = 0;
};
std::optional<CommentOption> commentOption;
bool successful = false;
};
void SendPhotoReport(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer,
Ui::ReportReason reason,
const QString &comment,
std::variant<
v::null_t,
MessageIdsList,
not_null<PhotoData*>,
StoryId> data);
not_null<PhotoData*> photo);
[[nodiscard]] auto CreateReportMessagesOrStoriesCallback(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer)
-> Fn<void(Data::ReportInput, Fn<void(ReportResult)>)>;
} // namespace Api

View File

@@ -44,7 +44,10 @@ void InnerFillMessagePostFlags(
if (ShouldSendSilent(peer, options)) {
flags |= MessageFlag::Silent;
}
if (!peer->amAnonymous()) {
if (!peer->amAnonymous()
|| (!peer->isBroadcast()
&& options.sendAs
&& options.sendAs != peer)) {
flags |= MessageFlag::HasFromId;
}
const auto channel = peer->asBroadcast();
@@ -453,6 +456,7 @@ void SendConfirmedFile(
not_null<Main::Session*> session,
const std::shared_ptr<FilePrepareResult> &file) {
const auto isEditing = (file->type != SendMediaType::Audio)
&& (file->type != SendMediaType::Round)
&& (file->to.replaceMediaOf != 0);
const auto newId = FullMsgId(
file->to.peer,
@@ -522,7 +526,8 @@ void SendConfirmedFile(
// Shortcut messages have no 'edited' badge.
flags |= MessageFlag::HideEdited;
}
if (file->type == SendMediaType::Audio) {
if (file->type == SendMediaType::Audio
|| file->type == SendMediaType::Round) {
if (!peer->isChannel() || peer->isMegagroup()) {
flags |= MessageFlag::MediaIsUnread;
}
@@ -544,32 +549,28 @@ void SendConfirmedFile(
MTP_flags(Flag::f_document
| (file->spoiler ? Flag::f_spoiler : Flag())),
file->document,
MTPDocument(), // alt_document
MTPVector<MTPDocument>(), // alt_documents
MTPint());
} else if (file->type == SendMediaType::Audio) {
const auto ttlSeconds = file->to.options.ttlSeconds;
const auto isVoice = [&] {
return file->document.match([](const MTPDdocumentEmpty &d) {
return false;
}, [](const MTPDdocument &d) {
return ranges::any_of(d.vattributes().v, [&](
const MTPDocumentAttribute &attribute) {
using Att = MTPDdocumentAttributeAudio;
return attribute.match([](const Att &data) -> bool {
return data.vflags().v & Att::Flag::f_voice;
}, [](const auto &) {
return false;
});
});
});
}();
using Flag = MTPDmessageMediaDocument::Flag;
return MTP_messageMediaDocument(
MTP_flags(Flag::f_document
| (isVoice ? Flag::f_voice : Flag())
| Flag::f_voice
| (ttlSeconds ? Flag::f_ttl_seconds : Flag())),
file->document,
MTPDocument(), // alt_document
MTPVector<MTPDocument>(), // alt_documents
MTP_int(ttlSeconds));
} else if (file->type == SendMediaType::Round) {
using Flag = MTPDmessageMediaDocument::Flag;
const auto ttlSeconds = file->to.options.ttlSeconds;
return MTP_messageMediaDocument(
MTP_flags(Flag::f_document
| Flag::f_round
| (ttlSeconds ? Flag::f_ttl_seconds : Flag())
| (file->spoiler ? Flag::f_spoiler : Flag())),
file->document,
MTPVector<MTPDocument>(), // alt_documents
MTP_int(ttlSeconds));
} else {
Unexpected("Type in sendFilesConfirmed.");

View File

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h"
#include "data/data_stories.h"
#include "data/data_story.h"
#include "data/data_user.h"
#include "history/history.h"
#include "main/main_session.h"
@@ -341,6 +342,10 @@ void PublicForwards::request(
.token = nextToken,
});
};
const auto processFail = [=] {
_requestId = 0;
done({});
};
constexpr auto kLimit = tl::make_int(100);
if (_fullId.messageId) {
@@ -349,14 +354,14 @@ void PublicForwards::request(
MTP_int(_fullId.messageId.msg),
MTP_string(token),
kLimit
)).done(processResult).fail([=] { _requestId = 0; }).send();
)).done(processResult).fail(processFail).send();
} else if (_fullId.storyId) {
_requestId = makeRequest(MTPstats_GetStoryPublicForwards(
channel->input,
MTP_int(_fullId.storyId.story),
MTP_string(token),
kLimit
)).done(processResult).fail([=] { _requestId = 0; }).send();
)).done(processResult).fail(processFail).send();
}
}
@@ -381,7 +386,7 @@ Data::PublicForwardsSlice MessageStatistics::firstSlice() const {
}
void MessageStatistics::request(Fn<void(Data::MessageStatistics)> done) {
if (channel()->isMegagroup()) {
if (channel()->isMegagroup() && !_storyId) {
return;
}
const auto requestFirstPublicForwards = [=](
@@ -571,13 +576,22 @@ rpl::producer<rpl::no_value, QString> Boosts::request() {
_boostStatus.prepaidGiveaway = ranges::views::all(
data.vprepaid_giveaways()->v
) | ranges::views::transform([](const MTPPrepaidGiveaway &r) {
return Data::BoostPrepaidGiveaway{
.months = r.data().vmonths().v,
.id = r.data().vid().v,
.quantity = r.data().vquantity().v,
.date = QDateTime::fromSecsSinceEpoch(
r.data().vdate().v),
};
return r.match([&](const MTPDprepaidGiveaway &data) {
return Data::BoostPrepaidGiveaway{
.date = base::unixtime::parse(data.vdate().v),
.id = data.vid().v,
.months = data.vmonths().v,
.quantity = data.vquantity().v,
};
}, [&](const MTPDprepaidStarsGiveaway &data) {
return Data::BoostPrepaidGiveaway{
.date = base::unixtime::parse(data.vdate().v),
.id = data.vid().v,
.credits = data.vstars().v,
.quantity = data.vquantity().v,
.boosts = data.vboosts().v,
};
});
}) | ranges::to_vector;
}
@@ -635,19 +649,21 @@ void Boosts::requestBoosts(
}
: Data::GiftCodeLink();
list.push_back({
data.is_gift(),
data.is_giveaway(),
data.is_unclaimed(),
qs(data.vid()),
data.vuser_id().value_or_empty(),
data.vgiveaway_msg_id()
.id = qs(data.vid()),
.userId = UserId(data.vuser_id().value_or_empty()),
.giveawayMessage = data.vgiveaway_msg_id()
? FullMsgId{ _peer->id, data.vgiveaway_msg_id()->v }
: FullMsgId(),
QDateTime::fromSecsSinceEpoch(data.vdate().v),
QDateTime::fromSecsSinceEpoch(data.vexpires().v),
(data.vexpires().v - data.vdate().v) / kMonthsDivider,
std::move(giftCodeLink),
data.vmultiplier().value_or_empty(),
.date = base::unixtime::parse(data.vdate().v),
.expiresAt = base::unixtime::parse(data.vexpires().v),
.expiresAfterMonths = ((data.vexpires().v - data.vdate().v)
/ kMonthsDivider),
.giftCodeLink = std::move(giftCodeLink),
.multiplier = data.vmultiplier().value_or_empty(),
.credits = data.vstars().value_or_empty(),
.isGift = data.is_gift(),
.isGiveaway = data.is_giveaway(),
.isUnclaimed = data.is_unclaimed(),
});
}
done(Data::BoostsListSlice{
@@ -670,17 +686,18 @@ Data::BoostStatus Boosts::boostStatus() const {
return _boostStatus;
}
ChannelEarnStatistics::ChannelEarnStatistics(not_null<ChannelData*> channel)
: StatisticsRequestSender(channel) {
EarnStatistics::EarnStatistics(not_null<PeerData*> peer)
: StatisticsRequestSender(peer)
, _isUser(peer->isUser()) {
}
rpl::producer<rpl::no_value, QString> ChannelEarnStatistics::request() {
rpl::producer<rpl::no_value, QString> EarnStatistics::request() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
makeRequest(MTPstats_GetBroadcastRevenueStats(
MTP_flags(0),
channel()->inputChannel
(_isUser ? user()->input : channel()->input)
)).done([=](const MTPstats_BroadcastRevenueStats &result) {
const auto &data = result.data();
const auto &balances = data.vbalances().data();
@@ -697,18 +714,22 @@ rpl::producer<rpl::no_value, QString> ChannelEarnStatistics::request() {
requestHistory({}, [=](Data::EarnHistorySlice &&slice) {
_data.firstHistorySlice = std::move(slice);
api().request(
MTPchannels_GetFullChannel(channel()->inputChannel)
).done([=](const MTPmessages_ChatFull &result) {
result.data().vfull_chat().match([&](
const MTPDchannelFull &d) {
_data.switchedOff = d.is_restricted_sponsored();
}, [](const auto &) {
});
if (!_isUser) {
api().request(
MTPchannels_GetFullChannel(channel()->inputChannel)
).done([=](const MTPmessages_ChatFull &result) {
result.data().vfull_chat().match([&](
const MTPDchannelFull &d) {
_data.switchedOff = d.is_restricted_sponsored();
}, [](const auto &) {
});
consumer.put_done();
}).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
}).send();
} else {
consumer.put_done();
}).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
}).send();
}
});
}).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
@@ -718,7 +739,7 @@ rpl::producer<rpl::no_value, QString> ChannelEarnStatistics::request() {
};
}
void ChannelEarnStatistics::requestHistory(
void EarnStatistics::requestHistory(
const Data::EarnHistorySlice::OffsetToken &token,
Fn<void(Data::EarnHistorySlice)> done) {
if (_requestId) {
@@ -727,7 +748,7 @@ void ChannelEarnStatistics::requestHistory(
constexpr auto kTlFirstSlice = tl::make_int(kFirstSlice);
constexpr auto kTlLimit = tl::make_int(kLimit);
_requestId = api().request(MTPstats_GetBroadcastRevenueTransactions(
channel()->inputChannel,
(_isUser ? user()->input : channel()->input),
MTP_int(token),
(!token) ? kTlFirstSlice : kTlLimit
)).done([=](const MTPstats_BroadcastRevenueTransactions &result) {
@@ -788,7 +809,7 @@ void ChannelEarnStatistics::requestHistory(
}).send();
}
Data::EarnStatistics ChannelEarnStatistics::data() const {
Data::EarnStatistics EarnStatistics::data() const {
return _data;
}

View File

@@ -79,9 +79,9 @@ private:
};
class ChannelEarnStatistics final : public StatisticsRequestSender {
class EarnStatistics final : public StatisticsRequestSender {
public:
explicit ChannelEarnStatistics(not_null<ChannelData*> channel);
explicit EarnStatistics(not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<rpl::no_value, QString> request();
void requestHistory(
@@ -94,6 +94,7 @@ public:
static constexpr auto kLimit = int(10);
private:
const bool _isUser = false;
Data::EarnStatistics _data;
mtpRequestId _requestId = 0;

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_authorizations.h"
#include "api/api_user_names.h"
#include "api/api_chat_participants.h"
#include "api/api_global_privacy.h"
#include "api/api_ringtones.h"
#include "api/api_text_entities.h"
#include "api/api_user_privacy.h"
@@ -315,6 +316,9 @@ void Updates::feedUpdateVector(
} else if (policy == SkipUpdatePolicy::SkipExceptGroupCallParticipants) {
return;
}
if (policy == SkipUpdatePolicy::SkipNone) {
applyConvertToScheduledOnSend(updates);
}
for (const auto &entry : std::as_const(list)) {
const auto type = entry.type();
if ((policy == SkipUpdatePolicy::SkipMessageIds
@@ -328,6 +332,15 @@ void Updates::feedUpdateVector(
session().data().sendHistoryChangeNotifications();
}
void Updates::checkForSentToScheduled(const MTPUpdates &updates) {
updates.match([&](const MTPDupdates &data) {
applyConvertToScheduledOnSend(data.vupdates(), true);
}, [&](const MTPDupdatesCombined &data) {
applyConvertToScheduledOnSend(data.vupdates(), true);
}, [](const auto &) {
});
}
void Updates::feedMessageIds(const MTPVector<MTPUpdate> &updates) {
for (const auto &update : updates.v) {
if (update.type() == mtpc_updateMessageID) {
@@ -416,13 +429,12 @@ void Updates::channelDifferenceDone(
"{ good - after not final channelDifference was received }%1"
).arg(_session->mtp().isTestMode() ? " TESTMODE" : ""));
getChannelDifference(channel);
} else if (ranges::contains(
_activeChats,
channel,
[](const auto &pair) { return pair.second.peer; })) {
channel->ptsWaitingForShortPoll(timeout
} else if (inActiveChats(channel)) {
channel->ptsSetWaitingForShortPoll(timeout
? (timeout * crl::time(1000))
: kWaitForChannelGetDifference);
} else {
channel->ptsSetWaitingForShortPoll(-1);
}
}
@@ -432,6 +444,7 @@ void Updates::feedChannelDifference(
session().data().processChats(data.vchats());
_handlingChannelDifference = true;
applyConvertToScheduledOnSend(data.vother_updates());
feedMessageIds(data.vother_updates());
session().data().processMessages(
data.vnew_messages(),
@@ -596,6 +609,7 @@ void Updates::feedDifference(
Core::App().checkAutoLock();
session().data().processUsers(users);
session().data().processChats(chats);
applyConvertToScheduledOnSend(other);
feedMessageIds(other);
session().data().processMessages(msgs, NewMessageType::Unread);
feedUpdateVector(other, SkipUpdatePolicy::SkipMessageIds);
@@ -654,6 +668,7 @@ void Updates::getDifferenceAfterFail() {
wait = wait ? std::min(wait, i->second - now) : (i->second - now);
++i;
} else {
i->first->ptsSetRequesting(false);
getChannelDifference(i->first, ChannelDifferenceRequest::AfterFail);
i = _whenGetDiffAfterFail.erase(i);
}
@@ -702,7 +717,9 @@ void Updates::getChannelDifference(
_whenGetDiffByPts.remove(channel);
}
if (!channel->ptsInited() || channel->ptsRequesting()) return;
if (!channel->ptsInited() || channel->ptsRequesting()) {
return;
}
if (from != ChannelDifferenceRequest::AfterFail) {
_whenGetDiffAfterFail.remove(channel);
@@ -739,16 +756,32 @@ void Updates::addActiveChat(rpl::producer<PeerData*> chat) {
std::move(
chat
) | rpl::start_with_next_done([=](PeerData *peer) {
_activeChats[key].peer = peer;
if (const auto channel = peer ? peer->asChannel() : nullptr) {
channel->ptsWaitingForShortPoll(
kWaitForChannelGetDifference);
auto &active = _activeChats[key];
const auto was = active.peer;
if (was != peer) {
active.peer = peer;
if (const auto channel = was ? was->asChannel() : nullptr) {
if (!inActiveChats(channel)) {
channel->ptsSetWaitingForShortPoll(-1);
}
}
if (const auto channel = peer ? peer->asChannel() : nullptr) {
channel->ptsSetWaitingForShortPoll(
kWaitForChannelGetDifference);
}
}
}, [=] {
_activeChats.erase(key);
}, _activeChats[key].lifetime);
}
bool Updates::inActiveChats(not_null<PeerData*> peer) const {
return ranges::contains(
_activeChats,
peer.get(),
[](const auto &pair) { return pair.second.peer; });
}
void Updates::requestChannelRangeDifference(not_null<History*> history) {
Expects(history->peer->isChannel());
@@ -862,6 +895,51 @@ void Updates::mtpUpdateReceived(const MTPUpdates &updates) {
}
}
void Updates::applyConvertToScheduledOnSend(
const MTPVector<MTPUpdate> &other,
bool skipScheduledCheck) {
for (const auto &update : other.v) {
update.match([&](const MTPDupdateNewScheduledMessage &data) {
const auto &message = data.vmessage();
const auto id = IdFromMessage(message);
const auto scheduledMessages = &_session->scheduledMessages();
const auto scheduledId = scheduledMessages->localMessageId(id);
for (const auto &updateId : other.v) {
updateId.match([&](const MTPDupdateMessageID &dataId) {
if (dataId.vid().v == id) {
auto &owner = session().data();
if (skipScheduledCheck) {
const auto peerId = PeerFromMessage(message);
const auto history = owner.historyLoaded(peerId);
if (history) {
_session->data().sentToScheduled({
.history = history,
.scheduledId = scheduledId,
});
}
return;
}
const auto rand = dataId.vrandom_id().v;
const auto localId = owner.messageIdByRandomId(rand);
if (const auto local = owner.message(localId)) {
if (!local->isScheduled()) {
_session->data().sentToScheduled({
.history = local->history(),
.scheduledId = scheduledId,
});
// We've sent a non-scheduled message,
// but it was converted to a scheduled.
local->destroy();
}
}
}
}, [](const auto &) {});
}
}, [](const auto &) {});
}
}
void Updates::applyGroupCallParticipantUpdates(const MTPUpdates &updates) {
updates.match([&](const MTPDupdates &data) {
session().data().processUsers(data.vusers());
@@ -1553,6 +1631,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
}
if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping new channel message because getting the difference."));
return;
}
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@@ -1645,6 +1724,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping channel message edit because getting the difference."));
return;
} else {
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@@ -1660,6 +1740,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping pinned channel messages because getting the difference."));
return;
} else {
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@@ -1774,6 +1855,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping delete channel messages because getting the difference."));
return;
}
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@@ -1837,6 +1919,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
auto channel = session().data().channelLoaded(d.vchannel_id());
if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping channel web page update because getting the difference."));
return;
} else {
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@@ -2622,6 +2705,12 @@ void Updates::feedUpdate(const MTPUpdate &update) {
_session->credits().apply(data);
} break;
case mtpc_updatePaidReactionPrivacy: {
const auto &data = update.c_updatePaidReactionPrivacy();
_session->api().globalPrivacy().updatePaidReactionAnonymous(
mtpIsTrue(data.vprivate()));
} break;
}
}

View File

@@ -40,6 +40,8 @@ public:
void applyUpdatesNoPtsCheck(const MTPUpdates &updates);
void applyUpdateNoPtsCheck(const MTPUpdate &update);
void checkForSentToScheduled(const MTPUpdates &updates);
[[nodiscard]] int32 pts() const;
void updateOnline(crl::time lastNonIdleTime = 0);
@@ -63,6 +65,7 @@ public:
void requestChannelRangeDifference(not_null<History*> history);
void addActiveChat(rpl::producer<PeerData*> chat);
[[nodiscard]] bool inActiveChats(not_null<PeerData*> peer) const;
private:
enum class ChannelDifferenceRequest {
@@ -130,6 +133,9 @@ private:
// Doesn't call sendHistoryChangeNotifications itself.
void feedUpdate(const MTPUpdate &update);
void applyConvertToScheduledOnSend(
const MTPVector<MTPUpdate> &other,
bool skipScheduledCheck = false);
void applyGroupCallParticipantUpdates(const MTPUpdates &updates);
bool whenGetDiffChanged(

View File

@@ -69,6 +69,9 @@ TLInputRules RulesToTL(const UserPrivacy::Rule &rule) {
if (rule.always.premiums && (rule.option != Option::Everyone)) {
result.push_back(MTP_inputPrivacyValueAllowPremium());
}
if (rule.always.miniapps && (rule.option != Option::Everyone)) {
result.push_back(MTP_inputPrivacyValueAllowBots());
}
}
if (!rule.ignoreNever) {
const auto users = collectInputUsers(rule.never);
@@ -83,6 +86,9 @@ TLInputRules RulesToTL(const UserPrivacy::Rule &rule) {
MTP_inputPrivacyValueDisallowChatParticipants(
MTP_vector<MTPlong>(chats)));
}
if (rule.never.miniapps && (rule.option != Option::Nobody)) {
result.push_back(MTP_inputPrivacyValueDisallowBots());
}
}
result.push_back([&] {
switch (rule.option) {
@@ -124,6 +130,10 @@ UserPrivacy::Rule TLToRules(const TLRules &rules, Data::Session &owner) {
setOption(Option::CloseFriends);
}, [&](const MTPDprivacyValueAllowPremium &) {
result.always.premiums = true;
}, [&](const MTPDprivacyValueAllowBots &) {
result.always.miniapps = true;
}, [&](const MTPDprivacyValueDisallowBots &) {
result.never.miniapps = true;
}, [&](const MTPDprivacyValueAllowUsers &data) {
const auto &users = data.vusers().v;
always.reserve(always.size() + users.size());
@@ -199,6 +209,7 @@ MTPInputPrivacyKey KeyToTL(UserPrivacy::Key key) {
case Key::Voices: return MTP_inputPrivacyKeyVoiceMessages();
case Key::About: return MTP_inputPrivacyKeyAbout();
case Key::Birthday: return MTP_inputPrivacyKeyBirthday();
case Key::GiftsAutoSave: return MTP_inputPrivacyKeyStarGiftsAutoSave();
}
Unexpected("Key in Api::UserPrivacy::KetToTL.");
}
@@ -228,6 +239,8 @@ std::optional<UserPrivacy::Key> TLToKey(mtpTypeId type) {
case mtpc_inputPrivacyKeyAbout: return Key::About;
case mtpc_privacyKeyBirthday:
case mtpc_inputPrivacyKeyBirthday: return Key::Birthday;
case mtpc_privacyKeyStarGiftsAutoSave:
case mtpc_inputPrivacyKeyStarGiftsAutoSave: return Key::GiftsAutoSave;
}
return std::nullopt;
}

View File

@@ -31,6 +31,7 @@ public:
Voices,
About,
Birthday,
GiftsAutoSave,
};
enum class Option {
Everyone,
@@ -41,6 +42,7 @@ public:
struct Exceptions {
std::vector<not_null<PeerData*>> peers;
bool premiums = false;
bool miniapps = false;
};
struct Rule {
Option option = Option::Everyone;

View File

@@ -214,7 +214,10 @@ struct State {
[[nodiscard]] QImage GenerateUserpic(Userpic &userpic, int size) {
size *= style::DevicePixelRatio();
auto result = userpic.peer->generateUserpicImage(userpic.view, size);
auto result = PeerData::GenerateUserpicImage(
userpic.peer,
userpic.view,
size);
result.setDevicePixelRatio(style::DevicePixelRatio());
return result;
}
@@ -753,5 +756,19 @@ rpl::producer<Ui::WhoReadContent> WhoReacted(
const style::WhoRead &st) {
return WhoReacted(item, reaction, context, st, nullptr);
}
rpl::producer<Ui::WhoReadContent> WhenEdited(
not_null<PeerData*> author,
TimeId date) {
return rpl::single(Ui::WhoReadContent{
.participants = { Ui::WhoReadParticipant{
.name = author->name(),
.date = FormatReadDate(date, QDateTime::currentDateTime()),
.id = author->id.value,
} },
.type = Ui::WhoReadType::Edited,
.fullReadCount = 1,
});
}
} // namespace Api

View File

@@ -61,5 +61,8 @@ struct WhoReadList {
const Data::ReactionId &reaction,
not_null<QWidget*> context, // Cache results for this lifetime.
const style::WhoRead &st);
[[nodiscard]] rpl::producer<Ui::WhoReadContent> WhenEdited(
not_null<PeerData*> author,
TimeId date);
} // namespace Api

View File

@@ -708,7 +708,8 @@ void ApiWrap::finalizeMessageDataRequest(
QString ApiWrap::exportDirectMessageLink(
not_null<HistoryItem*> item,
bool inRepliesContext) {
bool inRepliesContext,
bool forceNonPublicLink) {
Expects(item->history()->peer->isChannel());
const auto itemId = item->fullId();
@@ -731,7 +732,7 @@ QString ApiWrap::exportDirectMessageLink(
const auto sender = root
? root->discussionPostOriginalSender()
: nullptr;
if (sender && sender->hasUsername()) {
if (sender && sender->hasUsername() && !forceNonPublicLink) {
// Comment to a public channel.
const auto forwarded = root->Get<HistoryMessageForwarded>();
linkItemId = forwarded->savedFromMsgId;
@@ -747,7 +748,7 @@ QString ApiWrap::exportDirectMessageLink(
}
}
}
const auto base = linkChannel->hasUsername()
const auto base = (linkChannel->hasUsername() && !forceNonPublicLink)
? linkChannel->username()
: "c/" + QString::number(peerToChannel(linkChannel->id).bare);
const auto post = QString::number(linkItemId.bare);
@@ -761,6 +762,7 @@ QString ApiWrap::exportDirectMessageLink(
? (QString::number(linkThreadId.bare) + '/' + post)
: post);
if (linkChannel->hasUsername()
&& !forceNonPublicLink
&& !linkChannel->isMegagroup()
&& !linkCommentId
&& !linkThreadId) {
@@ -774,6 +776,9 @@ QString ApiWrap::exportDirectMessageLink(
}
return session().createInternalLinkFull(query);
};
if (forceNonPublicLink) {
return fallback();
}
const auto i = _unlikelyMessageLinks.find(itemId);
const auto current = (i != end(_unlikelyMessageLinks))
? i->second
@@ -2028,7 +2033,7 @@ void ApiWrap::deleteHistory(
}
if (const auto channel = peer->asChannel()) {
if (!justClear && !revoke) {
channel->ptsWaitingForShortPoll(-1);
channel->ptsSetWaitingForShortPoll(-1);
leaveChannel(channel);
} else {
if (const auto migrated = peer->migrateFrom()) {
@@ -3329,6 +3334,7 @@ void ApiWrap::forwardMessages(
}
const auto requestType = Data::Histories::RequestType::Send;
const auto idsCopy = localIds;
const auto scheduled = action.options.scheduled;
histories.sendRequest(history, requestType, [=](Fn<void()> finish) {
history->sendRequestId = request(MTPmessages_ForwardMessages(
MTP_flags(sendFlags),
@@ -3341,6 +3347,9 @@ void ApiWrap::forwardMessages(
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, action.options.shortcutId)
)).done([=](const MTPUpdates &result) {
if (!scheduled) {
this->updates().checkForSentToScheduled(result);
}
applyUpdates(result);
if (shared && !--shared->requestsLeft) {
shared->callback();
@@ -3502,6 +3511,7 @@ void ApiWrap::sendVoiceMessage(
QByteArray result,
VoiceWaveform waveform,
crl::time duration,
bool video,
const SendAction &action) {
const auto caption = TextWithTags();
const auto to = FileLoadTaskOptions(action);
@@ -3510,6 +3520,7 @@ void ApiWrap::sendVoiceMessage(
result,
duration,
waveform,
video,
to,
caption));
}
@@ -3936,7 +3947,8 @@ void ApiWrap::sendInlineResult(
not_null<UserData*> bot,
not_null<InlineBots::Result*> data,
const SendAction &action,
std::optional<MsgId> localMessageId) {
std::optional<MsgId> localMessageId,
Fn<void(bool)> done) {
sendAction(action);
const auto history = action.history;
@@ -4016,11 +4028,17 @@ void ApiWrap::sendInlineResult(
history->finishSavingCloudDraft(
topicRootId,
UnixtimeFromMsgId(response.outerMsgId));
if (done) {
done(true);
}
}, [=](const MTP::Error &error, const MTP::Response &response) {
sendMessageFail(error, peer, randomId, newId);
history->finishSavingCloudDraft(
topicRootId,
UnixtimeFromMsgId(response.outerMsgId));
if (done) {
done(false);
}
});
finishForwarding(action);
}
@@ -4160,8 +4178,10 @@ void ApiWrap::sendMediaWithRandomId(
Data::Histories::ReplyToPlaceholder(),
(options.price
? MTPInputMedia(MTP_inputMediaPaidMedia(
MTP_flags(0),
MTP_long(options.price),
MTP_vector<MTPInputMedia>(1, media)))
MTP_vector<MTPInputMedia>(1, media),
MTPstring()))
: media),
MTP_string(caption.text),
MTP_long(randomId),
@@ -4223,6 +4243,7 @@ void ApiWrap::sendMultiPaidMedia(
auto &histories = history->owner().histories();
const auto peer = history->peer;
const auto itemId = item->fullId();
album->sent = true;
histories.sendPreparedMessage(
history,
replyTo,
@@ -4232,8 +4253,10 @@ void ApiWrap::sendMultiPaidMedia(
peer->input,
Data::Histories::ReplyToPlaceholder(),
MTP_inputMediaPaidMedia(
MTP_flags(0),
MTP_long(options.price),
MTP_vector<MTPInputMedia>(std::move(medias))),
MTP_vector<MTPInputMedia>(std::move(medias)),
MTPstring()),
MTP_string(caption.text),
MTP_long(randomId),
MTPReplyMarkup(),
@@ -4292,6 +4315,9 @@ void ApiWrap::sendAlbumWithCancelled(
}
void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
if (album->sent) {
return;
}
const auto groupId = album->groupId;
if (album->items.empty()) {
_sendingAlbums.remove(groupId);
@@ -4316,6 +4342,7 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
return;
} else if (medias.size() < 2) {
const auto &single = medias.front().data();
album->sent = true;
sendMediaWithRandomId(
sample,
single.vmedia(),
@@ -4342,6 +4369,7 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
| (album->options.invertCaption ? Flag::f_invert_media : Flag(0));
auto &histories = history->owner().histories();
const auto peer = history->peer;
album->sent = true;
histories.sendPreparedMessage(
history,
replyTo,

View File

@@ -164,7 +164,8 @@ public:
void requestMessageData(PeerData *peer, MsgId msgId, Fn<void()> done);
QString exportDirectMessageLink(
not_null<HistoryItem*> item,
bool inRepliesContext);
bool inRepliesContext,
bool forceNonPublicLink = false);
QString exportDirectStoryLink(not_null<Data::Story*> item);
void requestContacts();
@@ -317,6 +318,7 @@ public:
QByteArray result,
VoiceWaveform waveform,
crl::time duration,
bool video,
const SendAction &action);
void sendFiles(
Ui::PreparedList &&list,
@@ -359,7 +361,8 @@ public:
not_null<UserData*> bot,
not_null<InlineBots::Result*> data,
const SendAction &action,
std::optional<MsgId> localMessageId);
std::optional<MsgId> localMessageId,
Fn<void(bool)> done = nullptr);
void sendMessageFail(
const MTP::Error &error,
not_null<PeerData*> peer,

View File

@@ -217,7 +217,9 @@ void ShowAddParticipantsError(
channel,
user,
ChatAdminRightsInfo(),
QString());
QString(),
0,
nullptr);
box->setSaveCallback(saveCallback);
*weak = box.data();
show->showBox(std::move(box));

View File

@@ -154,9 +154,7 @@ contactsSortButton: IconButton(defaultIconButton) {
iconPosition: point(10px, -1px);
rippleAreaPosition: point(1px, 6px);
rippleAreaSize: 42px;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;
}
ripple: defaultRippleAnimationBgOver;
}
contactsSortOnlineIcon: icon{{ "contacts_online", boxTitleCloseFg }};
contactsSortOnlineIconOver: icon{{ "contacts_online", boxTitleCloseFgOver }};
@@ -416,9 +414,7 @@ calendarPrevious: IconButton {
rippleAreaPosition: point(2px, 2px);
rippleAreaSize: 44px;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;
}
ripple: defaultRippleAnimationBgOver;
}
calendarPreviousDisabled: icon {{ "calendar_down-flip_vertical", menuIconFg }};
calendarNext: IconButton(calendarPrevious) {
@@ -597,8 +593,6 @@ rightsHeaderLabel: FlatLabel(boxLabel) {
}
textFg: windowActiveTextFg;
}
rightsUntilMargin: margins(0px, 8px, 0px, 20px);
rightsRankMargin: margins(0px, 7px, 0px, 20px);
groupStickersRemove: defaultMultiSelectSearchCancel;
groupStickersRemovePosition: point(6px, 6px);
@@ -618,9 +612,7 @@ proxyTryIPv6Padding: margins(22px, 8px, 22px, 5px);
proxyRowPadding: margins(22px, 8px, 8px, 8px);
proxyRowIconSkip: 32px;
proxyRowSkip: 2px;
proxyRowRipple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;
}
proxyRowRipple: defaultRippleAnimationBgOver;
proxyRowTitleFg: windowFg;
proxyRowTitlePalette: TextPalette(defaultTextPalette) {
linkFg: windowSubTextFg;
@@ -685,9 +677,7 @@ themesMenuToggle: IconButton(defaultIconButton) {
rippleAreaPosition: point(4px, 4px);
rippleAreaSize: 36px;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;
}
ripple: defaultRippleAnimationBgOver;
}
themesMenuPosition: point(-2px, 25px);
@@ -740,9 +730,7 @@ createPollOptionRemove: CrossButton {
duration: 150;
loadingPeriod: 1000;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;
}
ripple: defaultRippleAnimationBgOver;
}
createPollOptionRemovePosition: point(11px, 9px);
createPollOptionEmojiPositionSkip: 4px;
@@ -787,7 +775,7 @@ backgroundConfirmPadding: margins(24px, 16px, 24px, 16px);
backgroundConfirm: RoundButton(defaultActiveButton) {
height: 44px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
backgroundConfirmCancel: RoundButton(backgroundConfirm) {
textFg: mediaviewSaveMsgFg;
@@ -799,7 +787,7 @@ backgroundConfirmCancel: RoundButton(backgroundConfirm) {
height: 44px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
ripple: RippleAnimation(defaultRippleAnimation) {
color: shadowFg;
@@ -890,6 +878,13 @@ peerListWithInviteViaLink: PeerList(peerListBox) {
peerListSingleRow: PeerList(peerListBox) {
padding: margins(0px, 0px, 0px, 0px);
}
peerListSmallSkips: PeerList(peerListBox) {
padding: margins(
0px,
defaultVerticalListSkip,
0px,
defaultVerticalListSkip);
}
scheduleHeight: 95px;
scheduleDateTop: 38px;
@@ -951,11 +946,9 @@ sponsoredUrlButton: RoundButton(defaultActiveButton) {
textFg: historyLinkInFg;
textFgOver: historyLinkInFg;
textTop: 7px;
font: normalFont;
style: defaultTextStyle;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;
}
ripple: defaultRippleAnimationBgOver;
}
requestPeerRestriction: FlatLabel(defaultFlatLabel) {
@@ -1122,3 +1115,10 @@ moderateBoxDividerLabel: FlatLabel(boxDividerLabel) {
selectLinkFg: windowActiveTextFg;
}
}
profileQrFont: font(fsize bold);
profileQrCenterSize: 34px;
profileQrBackgroundRadius: 12px;
profileQrIcon: icon{{ "qr_mini", windowActiveTextFg }};
profileQrBackgroundMargins: margins(36px, 12px, 36px, 12px);
profileQrBackgroundPadding: margins(0px, 24px, 0px, 24px);

View File

@@ -96,6 +96,9 @@ void ChangeFilterById(
Ui::Text::WithEntities));
}
}).fail([=](const MTP::Error &error) {
LOG(("API Error: failed to %1 a dialog to a folder. %2")
.arg(add ? u"add"_q : u"remove"_q)
.arg(error.type()));
// Revert filter on fail.
history->owner().chatsFilters().set(was);
}).send();

View File

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/premium_limits_box.h"
#include "boxes/premium_preview_box.h"
#include "chat_helpers/emoji_suggestions_widget.h"
#include "chat_helpers/field_autocomplete.h"
#include "chat_helpers/message_field.h"
#include "chat_helpers/tabbed_panel.h"
#include "chat_helpers/tabbed_selector.h"
@@ -237,7 +238,7 @@ EditCaptionBox::EditCaptionBox(
Fn<void()> saved)
: _controller(controller)
, _historyItem(item)
, _isAllowedEditMedia(item->media() && item->media()->allowsEditMedia())
, _isAllowedEditMedia(item->allowsEditMedia())
, _albumType(ComputeAlbumType(item))
, _controls(base::make_unique_q<Ui::VerticalLayout>(this))
, _scroll(base::make_unique_q<Ui::ScrollArea>(this, st::boxScroll))
@@ -252,8 +253,8 @@ EditCaptionBox::EditCaptionBox(
, _initialText(std::move(text))
, _initialList(std::move(list))
, _saved(std::move(saved)) {
Expects(item->media() != nullptr);
Expects(item->media()->allowsEditCaption());
Expects(!_initialList.files.empty());
Expects(!item->media() || item->media()->allowsEditCaption());
_mediaEditManager.start(item, spoilered, invertCaption);
@@ -371,6 +372,14 @@ void EditCaptionBox::StartPhotoEdit(
});
}
void EditCaptionBox::showFinished() {
if (const auto raw = _autocomplete.get()) {
InvokeQueued(raw, [=] {
raw->raise();
});
}
}
void EditCaptionBox::prepare() {
const auto button = addButton(tr::lng_settings_save(), [=] { save(); });
addButton(tr::lng_cancel(), [=] { closeBox(); });
@@ -413,7 +422,8 @@ void EditCaptionBox::prepare() {
setInitialText();
if (!setPreparedList(std::move(_initialList))) {
rebuildPreview();
crl::on_main(this, [=] { closeBox(); });
return;
}
setupEditEventHandler();
SetupShadowsToScrollContent(this, _scroll, _contentHeight.events());
@@ -525,6 +535,7 @@ void EditCaptionBox::setupField() {
_field.get(),
Window::GifPauseReason::Layer,
allow);
setupFieldAutocomplete();
Ui::Emoji::SuggestionsController::Init(
getDelegate()->outerContainer(),
_field,
@@ -562,6 +573,55 @@ void EditCaptionBox::setupField() {
});
}
void EditCaptionBox::setupFieldAutocomplete() {
const auto parent = getDelegate()->outerContainer();
ChatHelpers::InitFieldAutocomplete(_autocomplete, {
.parent = parent,
.show = _controller->uiShow(),
.field = _field.get(),
.peer = _historyItem->history()->peer,
.features = [=] {
auto result = ChatHelpers::ComposeFeatures();
result.autocompleteCommands = false;
result.suggestStickersByEmoji = false;
return result;
},
});
const auto raw = _autocomplete.get();
const auto scheduled = std::make_shared<bool>();
const auto recountPostponed = [=] {
if (*scheduled) {
return;
}
*scheduled = true;
Ui::PostponeCall(raw, [=] {
*scheduled = false;
auto field = Ui::MapFrom(parent, this, _field->geometry());
_autocomplete->setBoundings(QRect(
field.x() - _field->x(),
st::defaultBox.margin.top(),
width(),
(field.y()
+ st::defaultComposeFiles.caption.textMargins.top()
+ st::defaultComposeFiles.caption.placeholderShift
+ st::defaultComposeFiles.caption.placeholderFont->height
- st::defaultBox.margin.top())));
});
};
for (auto w = (QWidget*)_field.get(); w; w = w->parentWidget()) {
base::install_event_filter(raw, w, [=](not_null<QEvent*> e) {
if (e->type() == QEvent::Move || e->type() == QEvent::Resize) {
recountPostponed();
}
return base::EventFilterResult::Continue;
});
if (w == parent) {
break;
}
}
}
void EditCaptionBox::setInitialText() {
_field->setTextWithTags(
_initialText,

View File

@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace ChatHelpers {
class TabbedPanel;
class FieldAutocomplete;
} // namespace ChatHelpers
namespace Window {
@@ -68,6 +69,8 @@ public:
bool invertCaption,
Fn<void()> saved);
void showFinished() override;
protected:
void prepare() override;
void setInnerFocus() override;
@@ -81,6 +84,7 @@ private:
void setupEditEventHandler();
void setupPhotoEditorEventHandler();
void setupField();
void setupFieldAutocomplete();
void setupControls();
void setInitialText();
@@ -115,6 +119,8 @@ private:
const base::unique_qptr<Ui::InputField> _field;
const base::unique_qptr<Ui::EmojiButton> _emojiToggle;
std::unique_ptr<ChatHelpers::FieldAutocomplete> _autocomplete;
base::unique_qptr<Ui::AbstractSinglePreview> _content;
base::unique_qptr<ChatHelpers::TabbedPanel> _emojiPanel;
base::unique_qptr<QObject> _emojiFilter;

View File

@@ -36,13 +36,63 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_settings.h"
#include "styles/style_layers.h"
#include "styles/style_menu_icons.h"
#include "styles/style_window.h"
namespace {
constexpr auto kPremiumsRowId = PeerId(FakeChatId(BareId(1))).value;
constexpr auto kMiniAppsRowId = PeerId(FakeChatId(BareId(2))).value;
using Exceptions = Api::UserPrivacy::Exceptions;
enum class SpecialRowType {
Premiums,
MiniApps,
};
[[nodiscard]] PaintRoundImageCallback GeneratePremiumsUserpicCallback(
bool forceRound) {
return [=](QPainter &p, int x, int y, int outerWidth, int size) {
auto gradient = QLinearGradient(
QPointF(x, y),
QPointF(x + size, y + size));
gradient.setStops(Ui::Premium::ButtonGradientStops());
auto hq = PainterHighQualityEnabler(p);
p.setPen(Qt::NoPen);
p.setBrush(gradient);
if (forceRound) {
p.drawEllipse(x, y, size, size);
} else {
const auto radius = size * Ui::ForumUserpicRadiusMultiplier();
p.drawRoundedRect(x, y, size, size, radius, radius);
}
st::settingsPrivacyPremium.paintInCenter(p, QRect(x, y, size, size));
};
}
[[nodiscard]] PaintRoundImageCallback GenerateMiniAppsUserpicCallback(
bool forceRound) {
return [=](QPainter &p, int x, int y, int outerWidth, int size) {
const auto &color1 = st::historyPeer6UserpicBg;
const auto &color2 = st::historyPeer6UserpicBg2;
auto hq = PainterHighQualityEnabler(p);
auto gradient = QLinearGradient(x, y, x, y + size);
gradient.setStops({ { 0., color1->c }, { 1., color2->c } });
p.setPen(Qt::NoPen);
p.setBrush(gradient);
if (forceRound) {
p.drawEllipse(x, y, size, size);
} else {
const auto radius = size * Ui::ForumUserpicRadiusMultiplier();
p.drawRoundedRect(x, y, size, size, radius, radius);
}
st::windowFilterTypeBots.paintInCenter(p, QRect(x, y, size, size));
};
}
void CreateRadiobuttonLock(
not_null<Ui::RpWidget*> widget,
const style::Checkbox &st) {
@@ -102,7 +152,7 @@ public:
not_null<Main::Session*> session,
rpl::producer<QString> title,
const Exceptions &selected,
bool allowChoosePremiums);
std::optional<SpecialRowType> allowChooseSpecial);
Main::Session &session() const override;
void rowClicked(not_null<PeerListRow*> row) override;
@@ -110,18 +160,20 @@ public:
bool handleDeselectForeignRow(PeerListRowId itemId) override;
[[nodiscard]] bool premiumsSelected() const;
[[nodiscard]] bool miniAppsSelected() const;
protected:
void prepareViewHook() override;
std::unique_ptr<Row> createRow(not_null<History*> history) override;
private:
[[nodiscard]] object_ptr<Ui::RpWidget> preparePremiumsRowList();
[[nodiscard]] object_ptr<Ui::RpWidget> prepareSpecialRowList(
SpecialRowType type);
const not_null<Main::Session*> _session;
rpl::producer<QString> _title;
Exceptions _selected;
bool _allowChoosePremiums = false;
std::optional<SpecialRowType> _allowChooseSpecial;
PeerListContentDelegate *_typesDelegate = nullptr;
Fn<void(PeerListRowId)> _deselectOption;
@@ -133,9 +185,9 @@ struct RowSelectionChange {
bool checked = false;
};
class PremiumsRow final : public PeerListRow {
class SpecialRow final : public PeerListRow {
public:
PremiumsRow();
explicit SpecialRow(SpecialRowType type);
QString generateName() override;
QString generateShortName() override;
@@ -147,66 +199,61 @@ public:
class TypesController final : public PeerListController {
public:
TypesController(not_null<Main::Session*> session, bool premiums);
TypesController(not_null<Main::Session*> session, SpecialRowType type);
Main::Session &session() const override;
void prepare() override;
void rowClicked(not_null<PeerListRow*> row) override;
[[nodiscard]] bool premiumsSelected() const;
[[nodiscard]] rpl::producer<bool> premiumsChanges() const;
[[nodiscard]] bool specialSelected() const;
[[nodiscard]] rpl::producer<bool> specialChanges() const;
[[nodiscard]] auto rowSelectionChanges() const
-> rpl::producer<RowSelectionChange>;
private:
const not_null<Main::Session*> _session;
const SpecialRowType _type;
rpl::event_stream<> _selectionChanged;
rpl::event_stream<RowSelectionChange> _rowSelectionChanges;
};
PremiumsRow::PremiumsRow() : PeerListRow(kPremiumsRowId) {
setCustomStatus(tr::lng_edit_privacy_premium_status(tr::now));
SpecialRow::SpecialRow(SpecialRowType type)
: PeerListRow((type == SpecialRowType::Premiums)
? kPremiumsRowId
: kMiniAppsRowId) {
setCustomStatus((id() == kPremiumsRowId)
? tr::lng_edit_privacy_premium_status(tr::now)
: tr::lng_edit_privacy_miniapps_status(tr::now));
}
QString PremiumsRow::generateName() {
return tr::lng_edit_privacy_premium(tr::now);
QString SpecialRow::generateName() {
return (id() == kPremiumsRowId)
? tr::lng_edit_privacy_premium(tr::now)
: tr::lng_edit_privacy_miniapps(tr::now);
}
QString PremiumsRow::generateShortName() {
QString SpecialRow::generateShortName() {
return generateName();
}
PaintRoundImageCallback PremiumsRow::generatePaintUserpicCallback(
PaintRoundImageCallback SpecialRow::generatePaintUserpicCallback(
bool forceRound) {
return [=](QPainter &p, int x, int y, int outerWidth, int size) {
auto gradient = QLinearGradient(
QPointF(x, y),
QPointF(x + size, y + size));
gradient.setStops(Ui::Premium::ButtonGradientStops());
auto hq = PainterHighQualityEnabler(p);
p.setPen(Qt::NoPen);
p.setBrush(gradient);
if (forceRound) {
p.drawEllipse(x, y, size, size);
} else {
const auto radius = size * Ui::ForumUserpicRadiusMultiplier();
p.drawRoundedRect(x, y, size, size, radius, radius);
}
st::settingsPrivacyPremium.paintInCenter(p, { x, y, size, size });
};
return (id() == kPremiumsRowId)
? GeneratePremiumsUserpicCallback(forceRound)
: GenerateMiniAppsUserpicCallback(forceRound);
}
bool PremiumsRow::useForumLikeUserpic() const {
bool SpecialRow::useForumLikeUserpic() const {
return true;
}
TypesController::TypesController(
not_null<Main::Session*> session,
bool premiums)
: _session(session) {
SpecialRowType type)
: _session(session)
, _type(type) {
}
Main::Session &TypesController::session() const {
@@ -214,12 +261,15 @@ Main::Session &TypesController::session() const {
}
void TypesController::prepare() {
delegate()->peerListAppendRow(std::make_unique<PremiumsRow>());
delegate()->peerListAppendRow(std::make_unique<SpecialRow>(_type));
delegate()->peerListRefreshRows();
}
bool TypesController::premiumsSelected() const {
const auto row = delegate()->peerListFindRow(kPremiumsRowId);
bool TypesController::specialSelected() const {
const auto premiums = (_type == SpecialRowType::Premiums);
const auto row = delegate()->peerListFindRow(premiums
? kPremiumsRowId
: kMiniAppsRowId);
Assert(row != nullptr);
return row->checked();
@@ -231,10 +281,10 @@ void TypesController::rowClicked(not_null<PeerListRow*> row) {
_rowSelectionChanges.fire({ row, checked });
}
rpl::producer<bool> TypesController::premiumsChanges() const {
rpl::producer<bool> TypesController::specialChanges() const {
return _rowSelectionChanges.events(
) | rpl::map([=] {
return premiumsSelected();
return specialSelected();
});
}
@@ -247,12 +297,12 @@ PrivacyExceptionsBoxController::PrivacyExceptionsBoxController(
not_null<Main::Session*> session,
rpl::producer<QString> title,
const Exceptions &selected,
bool allowChoosePremiums)
std::optional<SpecialRowType> allowChooseSpecial)
: ChatsListBoxController(session)
, _session(session)
, _title(std::move(title))
, _selected(selected)
, _allowChoosePremiums(allowChoosePremiums) {
, _allowChooseSpecial(allowChooseSpecial) {
}
Main::Session &PrivacyExceptionsBoxController::session() const {
@@ -261,14 +311,18 @@ Main::Session &PrivacyExceptionsBoxController::session() const {
void PrivacyExceptionsBoxController::prepareViewHook() {
delegate()->peerListSetTitle(std::move(_title));
if (_allowChoosePremiums || _selected.premiums) {
delegate()->peerListSetAboveWidget(preparePremiumsRowList());
if (_allowChooseSpecial || _selected.premiums || _selected.miniapps) {
delegate()->peerListSetAboveWidget(prepareSpecialRowList(
_allowChooseSpecial.value_or(_selected.premiums
? SpecialRowType::Premiums
: SpecialRowType::MiniApps)));
}
delegate()->peerListAddSelectedPeers(_selected.peers);
}
bool PrivacyExceptionsBoxController::isForeignRow(PeerListRowId itemId) {
return (itemId == kPremiumsRowId);
return (itemId == kPremiumsRowId)
|| (itemId == kMiniAppsRowId);
}
bool PrivacyExceptionsBoxController::handleDeselectForeignRow(
@@ -280,7 +334,8 @@ bool PrivacyExceptionsBoxController::handleDeselectForeignRow(
return false;
}
auto PrivacyExceptionsBoxController::preparePremiumsRowList()
auto PrivacyExceptionsBoxController::prepareSpecialRowList(
SpecialRowType type)
-> object_ptr<Ui::RpWidget> {
auto result = object_ptr<Ui::VerticalLayout>((QWidget*)nullptr);
const auto container = result.data();
@@ -291,30 +346,39 @@ auto PrivacyExceptionsBoxController::preparePremiumsRowList()
_typesDelegate = lifetime.make_state<PeerListContentDelegateSimple>();
const auto controller = lifetime.make_state<TypesController>(
&session(),
_selected.premiums);
type);
const auto content = result->add(object_ptr<PeerListContent>(
container,
controller));
_typesDelegate->setContent(content);
controller->setDelegate(_typesDelegate);
const auto selectType = [&](PeerListRowId id) {
const auto row = _typesDelegate->peerListFindRow(id);
if (row) {
content->changeCheckState(row, true, anim::type::instant);
this->delegate()->peerListSetForeignRowChecked(
row,
true,
anim::type::instant);
}
};
if (_selected.premiums) {
const auto row = _typesDelegate->peerListFindRow(kPremiumsRowId);
Assert(row != nullptr);
content->changeCheckState(row, true, anim::type::instant);
this->delegate()->peerListSetForeignRowChecked(
row,
true,
anim::type::instant);
selectType(kPremiumsRowId);
} else if (_selected.miniapps) {
selectType(kMiniAppsRowId);
}
container->add(CreatePeerListSectionSubtitle(
container,
tr::lng_edit_privacy_users_and_groups()));
controller->premiumsChanges(
) | rpl::start_with_next([=](bool premiums) {
_selected.premiums = premiums;
controller->specialChanges(
) | rpl::start_with_next([=](bool chosen) {
if (type == SpecialRowType::Premiums) {
_selected.premiums = chosen;
} else {
_selected.miniapps = chosen;
}
}, lifetime);
controller->rowSelectionChanges(
@@ -329,6 +393,8 @@ auto PrivacyExceptionsBoxController::preparePremiumsRowList()
if (const auto row = _typesDelegate->peerListFindRow(itemId)) {
if (itemId == kPremiumsRowId) {
_selected.premiums = false;
} else if (itemId == kMiniAppsRowId) {
_selected.miniapps = false;
}
_typesDelegate->peerListSetRowChecked(row, false);
}
@@ -337,10 +403,14 @@ auto PrivacyExceptionsBoxController::preparePremiumsRowList()
return result;
}
[[nodiscard]] bool PrivacyExceptionsBoxController::premiumsSelected() const {
bool PrivacyExceptionsBoxController::premiumsSelected() const {
return _selected.premiums;
}
bool PrivacyExceptionsBoxController::miniAppsSelected() const {
return _selected.miniapps;
}
void PrivacyExceptionsBoxController::rowClicked(not_null<PeerListRow*> row) {
const auto peer = row->peer();
@@ -356,11 +426,12 @@ void PrivacyExceptionsBoxController::rowClicked(not_null<PeerListRow*> row) {
auto PrivacyExceptionsBoxController::createRow(not_null<History*> history)
-> std::unique_ptr<Row> {
if (history->peer->isSelf() || history->peer->isRepliesChat()) {
const auto peer = history->peer;
if (peer->isSelf() || peer->isRepliesChat() || peer->isVerifyCodes()) {
return nullptr;
} else if (!history->peer->isUser()
&& !history->peer->isChat()
&& !history->peer->isMegagroup()) {
} else if (!peer->isUser()
&& !peer->isChat()
&& !peer->isMegagroup()) {
return nullptr;
}
auto result = std::make_unique<Row>(history);
@@ -411,6 +482,11 @@ EditPrivacyBox::EditPrivacyBox(
// If we switch from Everyone to Contacts or Nobody suggest Premiums.
_value.always.premiums = true;
}
if (_controller->allowMiniAppsToggle(Exception::Always)
&& _value.option == Option::Everyone) {
// If we switch from Everyone to Contacts or Nobody suggest MiniApps.
_value.always.miniapps = true;
}
}
void EditPrivacyBox::prepare() {
@@ -426,12 +502,18 @@ void EditPrivacyBox::editExceptions(
&_window->session(),
_controller->exceptionBoxTitle(exception),
exceptions(exception),
_controller->allowPremiumsToggle(exception));
(_controller->allowPremiumsToggle(exception)
? SpecialRowType::Premiums
: _controller->allowMiniAppsToggle(exception)
? SpecialRowType::MiniApps
: std::optional<SpecialRowType>()));
auto initBox = [=, controller = controller.get()](
not_null<PeerListBox*> box) {
box->addButton(tr::lng_settings_save(), crl::guard(this, [=] {
exceptions(exception).peers = box->collectSelectedRows();
exceptions(exception).premiums = controller->premiumsSelected();
auto &setTo = exceptions(exception);
setTo.peers = box->collectSelectedRows();
setTo.premiums = controller->premiumsSelected();
setTo.miniapps = controller->miniAppsSelected();
const auto type = [&] {
switch (exception) {
case Exception::Always: return Exception::Never;
@@ -439,11 +521,17 @@ void EditPrivacyBox::editExceptions(
}
Unexpected("Invalid exception value.");
}();
auto &removeFrom = exceptions(type).peers;
auto &removeFrom = exceptions(type);
for (const auto peer : exceptions(exception).peers) {
removeFrom.erase(
ranges::remove(removeFrom, peer),
end(removeFrom));
removeFrom.peers.erase(
ranges::remove(removeFrom.peers, peer),
end(removeFrom.peers));
}
if (setTo.premiums) {
removeFrom.premiums = false;
}
if (setTo.miniapps) {
removeFrom.miniapps = false;
}
done();
box->closeBox();
@@ -565,14 +653,21 @@ void EditPrivacyBox::setupContent() {
lt_count,
count)
: tr::lng_edit_privacy_exceptions_add(tr::now);
return !value.premiums
? users
: !count
? tr::lng_edit_privacy_premium(tr::now)
: tr::lng_edit_privacy_exceptions_premium_and(
tr::now,
lt_users,
users);
return value.premiums
? (!count
? tr::lng_edit_privacy_premium(tr::now)
: tr::lng_edit_privacy_exceptions_premium_and(
tr::now,
lt_users,
users))
: value.miniapps
? (!count
? tr::lng_edit_privacy_miniapps(tr::now)
: tr::lng_edit_privacy_exceptions_miniapps_and(
tr::now,
lt_users,
users))
: users;
});
_controller->handleExceptionsChange(
exception,

View File

@@ -61,6 +61,10 @@ public:
Exception exception) const {
return false;
}
[[nodiscard]] virtual bool allowMiniAppsToggle(
Exception exception) const {
return false;
}
virtual void handleExceptionsChange(
Exception exception,
rpl::producer<int> value) {

View File

@@ -131,10 +131,13 @@ ExceptionRow::ExceptionRow(not_null<History*> history) : Row(history) {
}
QString ExceptionRow::generateName() {
return peer()->isSelf()
const auto peer = this->peer();
return peer->isSelf()
? tr::lng_saved_messages(tr::now)
: peer()->isRepliesChat()
: peer->isRepliesChat()
? tr::lng_replies_messages(tr::now)
: peer->isVerifyCodes()
? tr::lng_verification_codes(tr::now)
: Row::generateName();
}
@@ -152,10 +155,11 @@ PaintRoundImageCallback ExceptionRow::generatePaintUserpicCallback(
return ForceRoundUserpicCallback(peer);
}
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
using namespace Ui;
if (saved) {
Ui::EmptyUserpic::PaintSavedMessages(p, x, y, outerWidth, size);
EmptyUserpic::PaintSavedMessages(p, x, y, outerWidth, size);
} else if (replies) {
Ui::EmptyUserpic::PaintRepliesMessages(p, x, y, outerWidth, size);
EmptyUserpic::PaintRepliesMessages(p, x, y, outerWidth, size);
} else {
peer->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
}

View File

@@ -122,9 +122,11 @@ void FilterChatsPreview::paintEvent(QPaintEvent *e) {
top += st.height;
}
for (auto &[history, userpic, name, button] : _removePeer) {
const auto savedMessages = history->peer->isSelf();
const auto repliesMessages = history->peer->isRepliesChat();
if (savedMessages || repliesMessages) {
const auto peer = history->peer;
const auto savedMessages = peer->isSelf();
const auto repliesMessages = peer->isRepliesChat();
const auto verifyCodes = peer->isVerifyCodes();
if (savedMessages || repliesMessages || verifyCodes) {
if (savedMessages) {
Ui::EmptyUserpic::PaintSavedMessages(
p,
@@ -132,13 +134,21 @@ void FilterChatsPreview::paintEvent(QPaintEvent *e) {
top + iconTop,
width(),
st.photoSize);
} else {
} else if (repliesMessages) {
Ui::EmptyUserpic::PaintRepliesMessages(
p,
iconLeft,
top + iconTop,
width(),
st.photoSize);
} else {
history->peer->paintUserpicLeft(
p,
userpic,
iconLeft,
top + iconTop,
width(),
st.photoSize);
}
p.setPen(st::contactsNameFg);
p.drawTextLeft(
@@ -147,7 +157,9 @@ void FilterChatsPreview::paintEvent(QPaintEvent *e) {
width(),
(savedMessages
? tr::lng_saved_messages(tr::now)
: tr::lng_replies_messages(tr::now)));
: repliesMessages
? tr::lng_replies_messages(tr::now)
: tr::lng_verification_codes(tr::now)));
} else {
history->peer->paintUserpicLeft(
p,

View File

@@ -31,6 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/vertical_layout.h"
#include "ui/wrap/slide_wrap.h"
#include "ui/painter.h"
#include "ui/rect.h"
#include "ui/vertical_list.h"
#include "window/window_session_controller.h"
#include "styles/style_info.h"
@@ -336,12 +337,13 @@ PaintRoundImageCallback ChatRow::generatePaintUserpicCallback(
int y,
int outerWidth,
int size) mutable {
using namespace Ui;
if (forceRound && peer->isForum()) {
ForceRoundUserpicCallback(peer)(p, x, y, outerWidth, size);
} else if (saved) {
Ui::EmptyUserpic::PaintSavedMessages(p, x, y, outerWidth, size);
EmptyUserpic::PaintSavedMessages(p, x, y, outerWidth, size);
} else if (replies) {
Ui::EmptyUserpic::PaintRepliesMessages(p, x, y, outerWidth, size);
EmptyUserpic::PaintRepliesMessages(p, x, y, outerWidth, size);
} else {
peer->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
}
@@ -581,6 +583,7 @@ void LinkController::addLinkBlock(not_null<Ui::VerticalLayout*> container) {
});
const auto getLinkQr = crl::guard(weak, [=] {
delegate()->peerListUiShow()->showBox(InviteLinkQrBox(
nullptr,
link,
tr::lng_group_invite_qr_title(),
tr::lng_filters_link_qr_about()));
@@ -889,6 +892,7 @@ base::unique_qptr<Ui::PopupMenu> LinksController::createRowContextMenu(
};
const auto getLinkQr = [=] {
delegate()->peerListUiShow()->showBox(InviteLinkQrBox(
nullptr,
link,
tr::lng_group_invite_qr_title(),
tr::lng_filters_link_qr_about()));
@@ -965,9 +969,9 @@ void LinksController::rowPaintIcon(
p.setBrush(*bg);
{
auto hq = PainterHighQualityEnabler(p);
p.drawEllipse(QRect(0, 0, inner, inner));
p.drawEllipse(Rect(Size(inner)));
}
st::inviteLinkIcon.paintInCenter(p, { 0, 0, inner, inner });
st::inviteLinkIcon.paintInCenter(p, Rect(Size(inner)));
}
p.drawImage(x + skip, y + skip, icon);
}
@@ -1113,7 +1117,7 @@ QString FilterChatStatusText(not_null<PeerData*> peer) {
? tr::lng_chat_status_subscribers
: tr::lng_chat_status_members)(
tr::now,
lt_count,
lt_count_decimal,
channel->membersCount());
}
}

View File

@@ -98,7 +98,7 @@ void GiftCreditsBox(
) | rpl::map([](TextWithEntities text) {
return Ui::Text::Link(
std::move(text),
tr::lng_credits_box_history_entry_gift_about_url(tr::now));
u"internal:stars_examples"_q);
});
content->add(
object_ptr<Ui::CenterWrap<>>(
@@ -123,7 +123,9 @@ void GiftCreditsBox(
box->verticalLayout(),
peer,
0,
[=] { gifted(); box->uiShow()->hideLayer(); });
[=] { gifted(); box->uiShow()->hideLayer(); },
tr::lng_credits_summary_options_subtitle(),
{});
box->setPinnedToBottomContent(
object_ptr<Ui::VerticalLayout>(box));

File diff suppressed because it is too large Load Diff

View File

@@ -9,13 +9,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mtproto/sender.h"
class UserData;
namespace Api {
struct GiftCode;
} // namespace Api
namespace Data {
struct Boost;
struct CreditsHistoryEntry;
struct GiveawayStart;
struct GiveawayResults;
@@ -28,29 +27,9 @@ class VerticalLayout;
} // namespace Ui
namespace Window {
class SessionController;
class SessionNavigation;
} // namespace Window
class GiftPremiumValidator final {
public:
GiftPremiumValidator(not_null<Window::SessionController*> controller);
void showBox(not_null<UserData*> user);
void showChoosePeerBox(const QString &ref);
void showChosenPeerBox(not_null<UserData*> user, const QString &ref);
void cancel();
private:
const not_null<Window::SessionController*> _controller;
MTP::Sender _api;
mtpRequestId _requestId = 0;
rpl::lifetime _manyGiftsLifetime;
};
[[nodiscard]] rpl::producer<QString> GiftDurationValue(int months);
[[nodiscard]] QString GiftDuration(int months);
@@ -75,6 +54,11 @@ void ResolveGiveawayInfo(
std::optional<Data::GiveawayStart> start,
std::optional<Data::GiveawayResults> results);
void AddStarGiftTable(
not_null<Window::SessionNavigation*> controller,
not_null<Ui::VerticalLayout*> container,
const Data::CreditsHistoryEntry &entry,
Fn<void()> convertToStars);
void AddCreditsHistoryEntryTable(
not_null<Window::SessionNavigation*> controller,
not_null<Ui::VerticalLayout*> container,
@@ -89,3 +73,8 @@ void AddSubscriberEntryTable(
not_null<Ui::VerticalLayout*> container,
not_null<PeerData*> peer,
TimeId date);
void AddCreditsBoostTable(
not_null<Window::SessionNavigation*> controller,
not_null<Ui::VerticalLayout*> container,
const Data::Boost &boost);

View File

@@ -240,7 +240,8 @@ int LocalStorageBox::Row::resizeGetHeight(int newWidth) {
}
void LocalStorageBox::Row::paintEvent(QPaintEvent *e) {
if (!_progress || true) {
#if 0 // not used
if (!_progress) {
return;
}
auto p = QPainter(this);
@@ -254,6 +255,7 @@ void LocalStorageBox::Row::paintEvent(QPaintEvent *e) {
st::proxyCheckingPosition.y() + bottom
},
width());
#endif
}
QString LocalStorageBox::Row::titleText(const Database::TaggedSummary &data) const {

View File

@@ -436,14 +436,16 @@ void CreateModerateMessagesBox(
return result;
}();
auto [checkboxes, getRestrictions, changes] = CreateEditRestrictions(
box,
Ui::AddSubsectionTitle(
inner,
rpl::conditional(
rpl::single(isSingle),
tr::lng_restrict_users_part_single_header(),
tr::lng_restrict_users_part_header(
lt_count,
rpl::single(participants.size()) | tr::to_count())),
rpl::single(participants.size()) | tr::to_count())));
auto [checkboxes, getRestrictions, changes] = CreateEditRestrictions(
box,
prepareFlags,
disabledMessages,
{ .isForum = peer->isForum() });

View File

@@ -206,7 +206,9 @@ void PeerListBox::keyPressEvent(QKeyEvent *e) {
content()->selectSkipPage(height(), 1);
} else if (e->key() == Qt::Key_PageUp) {
content()->selectSkipPage(height(), -1);
} else if (e->key() == Qt::Key_Escape && _select && !_select->entity()->getQuery().isEmpty()) {
} else if (e->key() == Qt::Key_Escape
&& _select
&& !_select->entity()->getQuery().isEmpty()) {
_select->entity()->clearQuery();
} else {
BoxContent::keyPressEvent(e);
@@ -215,7 +217,19 @@ void PeerListBox::keyPressEvent(QKeyEvent *e) {
void PeerListBox::searchQueryChanged(const QString &query) {
scrollToY(0);
content()->searchQueryChanged(query);
const auto isEmpty = content()->searchQueryChanged(query);
if (_specialTabsMode.enabled) {
const auto was = _specialTabsMode.searchIsActive;
_specialTabsMode.searchIsActive = !isEmpty;
if (was != _specialTabsMode.searchIsActive) {
if (_specialTabsMode.searchIsActive) {
_specialTabsMode.topSkip = _addedTopScrollSkip;
setAddedTopScrollSkip(0);
} else {
setAddedTopScrollSkip(_specialTabsMode.topSkip);
}
}
}
}
void PeerListBox::resizeEvent(QResizeEvent *e) {
@@ -447,6 +461,8 @@ void PeerListBox::addSelectItem(
? tr::lng_saved_short(tr::now)
: (respect && peer->isRepliesChat())
? tr::lng_replies_messages(tr::now)
: (respect && peer->isVerifyCodes())
? tr::lng_verification_codes(tr::now)
: peer->shortName();
addSelectItem(
peer->id.value,
@@ -541,6 +557,19 @@ auto PeerListBox::collectSelectedRows()
return result;
}
rpl::producer<int> PeerListBox::multiSelectHeightValue() const {
return _select ? _select->heightValue() : rpl::single(0);
}
void PeerListBox::setSpecialTabMode(bool value) {
content()->setIgnoreHiddenRowsOnSearch(value);
if (value) {
_specialTabsMode.enabled = true;
} else {
_specialTabsMode = {};
}
}
PeerListRow::PeerListRow(not_null<PeerData*> peer)
: PeerListRow(peer, peer->id.value) {
}
@@ -625,6 +654,8 @@ void PeerListRow::refreshName(const style::PeerListItem &st) {
? tr::lng_saved_messages(tr::now)
: _isRepliesMessagesChat
? tr::lng_replies_messages(tr::now)
: _isVerifyCodesChat
? tr::lng_verification_codes(tr::now)
: generateName();
_name.setText(st.nameStyle, text, Ui::NameTextOptions());
}
@@ -695,6 +726,8 @@ QString PeerListRow::generateShortName() {
? tr::lng_saved_short(tr::now)
: _isRepliesMessagesChat
? tr::lng_replies_messages(tr::now)
: _isVerifyCodesChat
? tr::lng_verification_codes(tr::now)
: peer()->shortName();
}
@@ -715,10 +748,11 @@ PaintRoundImageCallback PeerListRow::generatePaintUserpicCallback(
return ForceRoundUserpicCallback(peer);
}
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
using namespace Ui;
if (saved) {
Ui::EmptyUserpic::PaintSavedMessages(p, x, y, outerWidth, size);
EmptyUserpic::PaintSavedMessages(p, x, y, outerWidth, size);
} else if (replies) {
Ui::EmptyUserpic::PaintRepliesMessages(p, x, y, outerWidth, size);
EmptyUserpic::PaintRepliesMessages(p, x, y, outerWidth, size);
} else {
peer->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
}
@@ -757,12 +791,14 @@ int PeerListRow::paintNameIconGetWidth(
int availableWidth,
int outerWidth,
bool selected) {
if (special()
if (_skipPeerBadge
|| special()
|| !_savedMessagesStatus.isEmpty()
|| _isRepliesMessagesChat) {
|| _isRepliesMessagesChat
|| _isVerifyCodesChat) {
return 0;
}
return _bagde.drawGetWidth(
return _badge.drawGetWidth(
p,
QRect(
nameLeft,
@@ -874,12 +910,13 @@ void PeerListRow::paintDisabledCheckUserpic(
auto iconBorderPen = st.checkbox.check.border->p;
iconBorderPen.setWidth(st.checkbox.selectWidth);
const auto size = userpicRadius * 2;
if (!_savedMessagesStatus.isEmpty()) {
Ui::EmptyUserpic::PaintSavedMessages(p, userpicLeft, userpicTop, outerWidth, userpicRadius * 2);
Ui::EmptyUserpic::PaintSavedMessages(p, userpicLeft, userpicTop, outerWidth, size);
} else if (_isRepliesMessagesChat) {
Ui::EmptyUserpic::PaintRepliesMessages(p, userpicLeft, userpicTop, outerWidth, userpicRadius * 2);
Ui::EmptyUserpic::PaintRepliesMessages(p, userpicLeft, userpicTop, outerWidth, size);
} else {
peer()->paintUserpicLeft(p, _userpic, userpicLeft, userpicTop, outerWidth, userpicRadius * 2);
peer()->paintUserpicLeft(p, _userpic, userpicLeft, userpicTop, outerWidth, size);
}
{
@@ -1069,10 +1106,13 @@ void PeerListContent::setRowHidden(not_null<PeerListRow*> row, bool hidden) {
void PeerListContent::addRowEntry(not_null<PeerListRow*> row) {
const auto savedMessagesStatus = _controller->savedMessagesChatStatus();
if (!savedMessagesStatus.isEmpty() && !row->special()) {
if (row->peer()->isSelf()) {
const auto peer = row->peer();
if (peer->isSelf()) {
row->setSavedMessagesChatStatus(savedMessagesStatus);
} else if (row->peer()->isRepliesChat()) {
} else if (peer->isRepliesChat()) {
row->setIsRepliesMessagesChat(true);
} else if (peer->isVerifyCodes()) {
row->setIsVerifyCodesChat(true);
}
}
_rowsById.emplace(row->id(), row);
@@ -1372,10 +1412,12 @@ int PeerListContent::labelHeight() const {
void PeerListContent::refreshRows() {
if (!_hiddenRows.empty()) {
_filterResults.clear();
for (const auto &row : _rows) {
if (!row->hidden()) {
_filterResults.push_back(row.get());
if (!_ignoreHiddenRowsOnSearch || _normalizedSearchQuery.isEmpty()) {
_filterResults.clear();
for (const auto &row : _rows) {
if (!row->hidden()) {
_filterResults.push_back(row.get());
}
}
}
}
@@ -1931,6 +1973,13 @@ PeerListContent::SkipResult PeerListContent::selectSkip(int direction) {
}
}
if (_controller->overrideKeyboardNavigation(
direction,
_selected.index.value,
newSelectedIndex)) {
return { _selected.index.value, _selected.index.value };
}
_selected.index.value = newSelectedIndex;
_selected.element = 0;
if (newSelectedIndex >= 0) {
@@ -2030,13 +2079,16 @@ void PeerListContent::checkScrollForPreload() {
}
}
void PeerListContent::searchQueryChanged(QString query) {
PeerListContent::IsEmpty PeerListContent::searchQueryChanged(QString query) {
const auto searchWordsList = TextUtilities::PrepareSearchWords(query);
const auto normalizedQuery = searchWordsList.join(' ');
if (_ignoreHiddenRowsOnSearch && !normalizedQuery.isEmpty()) {
_filterResults.clear();
}
if (_normalizedSearchQuery != normalizedQuery) {
setSearchQuery(query, normalizedQuery);
if (_controller->searchInLocal() && !searchWordsList.isEmpty()) {
Assert(_hiddenRows.empty());
Assert(_hiddenRows.empty() || _ignoreHiddenRowsOnSearch);
auto minimalList = (const std::vector<not_null<PeerListRow*>>*)nullptr;
for (const auto &searchWord : searchWordsList) {
@@ -2084,6 +2136,7 @@ void PeerListContent::searchQueryChanged(QString query) {
}
refreshRows();
}
return _normalizedSearchQuery.isEmpty();
}
std::unique_ptr<PeerListState> PeerListContent::saveState() const {
@@ -2172,6 +2225,10 @@ void PeerListContent::dragLeft() {
clearSelection();
}
void PeerListContent::setIgnoreHiddenRowsOnSearch(bool value) {
_ignoreHiddenRowsOnSearch = value;
}
void PeerListContent::visibleTopBottomUpdated(
int visibleTop,
int visibleBottom) {

View File

@@ -200,6 +200,9 @@ public:
void setIsRepliesMessagesChat(bool isRepliesMessagesChat) {
_isRepliesMessagesChat = isRepliesMessagesChat;
}
void setIsVerifyCodesChat(bool isVerifyCodesChat) {
_isVerifyCodesChat = isVerifyCodesChat;
}
template <typename UpdateCallback>
void setChecked(
@@ -251,6 +254,10 @@ public:
return _nameFirstLetters;
}
void setSkipPeerBadge(bool skip) {
_skipPeerBadge = skip;
}
virtual void lazyInitialize(const style::PeerListItem &st);
virtual void paintStatusText(
Painter &p,
@@ -288,7 +295,7 @@ private:
std::unique_ptr<Ui::RoundImageCheckbox> _checkbox;
Ui::Text::String _name;
Ui::Text::String _status;
Ui::PeerBadge _bagde;
Ui::PeerBadge _badge;
StatusType _statusType = StatusType::Online;
crl::time _statusValidTill = 0;
base::flat_set<QChar> _nameFirstLetters;
@@ -299,6 +306,8 @@ private:
bool _initialized : 1 = false;
bool _isSearchResult : 1 = false;
bool _isRepliesMessagesChat : 1 = false;
bool _isVerifyCodesChat : 1 = false;
bool _skipPeerBadge : 1 = false;
};
@@ -348,6 +357,8 @@ public:
virtual int peerListPartitionRows(Fn<bool(const PeerListRow &a)> border) = 0;
virtual std::shared_ptr<Main::SessionShow> peerListUiShow() = 0;
virtual void peerListSelectSkip(int direction) = 0;
virtual void peerListPressLeftToContextMenu(bool shown) = 0;
virtual bool peerListTrackRowPressFromGlobal(QPoint globalPosition) = 0;
@@ -564,6 +575,13 @@ public:
Unexpected("PeerListController::customRowRippleMaskGenerator.");
}
virtual bool overrideKeyboardNavigation(
int direction,
int fromIndex,
int toIndex) {
return false;
}
[[nodiscard]] rpl::lifetime &lifetime() {
return _lifetime;
}
@@ -634,12 +652,15 @@ public:
[[nodiscard]] bool hasPressed() const;
void clearSelection();
void searchQueryChanged(QString query);
using IsEmpty = bool;
IsEmpty searchQueryChanged(QString query);
bool submitted();
PeerListRowId updateFromParentDrag(QPoint globalPosition);
void dragLeft();
void setIgnoreHiddenRowsOnSearch(bool value);
// Interface for the controller.
void appendRow(std::unique_ptr<PeerListRow> row);
void appendSearchRow(std::unique_ptr<PeerListRow> row);
@@ -861,6 +882,7 @@ private:
int _aboveHeight = 0;
int _belowHeight = 0;
bool _hideEmpty = false;
bool _ignoreHiddenRowsOnSearch = false;
object_ptr<Ui::RpWidget> _aboveWidget = { nullptr };
object_ptr<Ui::RpWidget> _aboveSearchWidget = { nullptr };
object_ptr<Ui::RpWidget> _belowWidget = { nullptr };
@@ -1007,6 +1029,10 @@ public:
bool highlightRow,
Fn<void(not_null<Ui::PopupMenu*>)> destroyed = nullptr) override;
void peerListSelectSkip(int direction) override {
_content->selectSkip(direction);
}
void peerListPressLeftToContextMenu(bool shown) override {
_content->pressLeftToContextMenu(shown);
}
@@ -1080,6 +1106,9 @@ public:
[[nodiscard]] std::vector<PeerListRowId> collectSelectedIds();
[[nodiscard]] std::vector<not_null<PeerData*>> collectSelectedRows();
[[nodiscard]] rpl::producer<int> multiSelectHeightValue() const;
void setSpecialTabMode(bool value);
void peerListSetTitle(rpl::producer<QString> title) override {
setTitle(std::move(title));
@@ -1146,4 +1175,11 @@ private:
bool _scrollBottomFixed = false;
int _addedTopScrollSkip = 0;
struct SpecialTabsMode final {
bool enabled = false;
bool searchIsActive = false;
int topSkip = 0;
};
SpecialTabsMode _specialTabsMode;
};

View File

@@ -842,6 +842,7 @@ auto ChooseRecipientBoxController::createRow(
? !_filter(history)
: ((peer->isBroadcast() && !Data::CanSendAnything(peer))
|| peer->isRepliesChat()
|| peer->isVerifyCodes()
|| (peer->isUser() && (_premiumRequiredError
? !peer->asUser()->canSendIgnoreRequirePremium()
: !Data::CanSendAnything(peer))));
@@ -1064,6 +1065,11 @@ std::unique_ptr<PeerListRow> ChooseTopicBoxController::createSearchRow(
return nullptr;
}
std::unique_ptr<PeerListRow> ChooseTopicBoxController::MakeRow(
not_null<Data::ForumTopic*> topic) {
return std::make_unique<Row>(topic);
}
auto ChooseTopicBoxController::createRow(not_null<Data::ForumTopic*> topic)
-> std::unique_ptr<Row> {
const auto skip = _filter && !_filter(topic);

View File

@@ -335,6 +335,9 @@ public:
void loadMoreRows() override;
std::unique_ptr<PeerListRow> createSearchRow(PeerListRowId id) override;
[[nodiscard]] static std::unique_ptr<PeerListRow> MakeRow(
not_null<Data::ForumTopic*> topic);
private:
class Row final : public PeerListRow {
public:

View File

@@ -170,11 +170,15 @@ void AddBotToGroupBoxController::requestExistingRights(
channel);
_existingRights = participant.rights().flags;
_existingRank = participant.rank();
_promotedSince = participant.promotedSince();
_promotedBy = participant.by();
addBotToGroup(_existingRightsChannel);
});
}).fail([=] {
_existingRights = ChatAdminRights();
_existingRank = QString();
_promotedSince = 0;
_promotedBy = 0;
addBotToGroup(_existingRightsChannel);
}).send();
}
@@ -191,6 +195,8 @@ void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
_existingRights = {};
_existingRank = QString();
_existingRightsChannel = nullptr;
_promotedSince = 0;
_promotedBy = 0;
_bot->session().api().request(_existingRightsRequestId).cancel();
}
const auto requestedAddAdmin = (_scope == Scope::GroupAdmin)
@@ -241,9 +247,12 @@ void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
bot,
ChatAdminRightsInfo(rights),
_existingRank,
_promotedSince,
_promotedBy ? chat->owner().user(_promotedBy).get() : nullptr,
EditAdminBotFields{
_token,
_existingRights.value_or(ChatAdminRights()) });
_existingRights.value_or(ChatAdminRights()),
});
box->setSaveCallback(saveCallback);
controller->show(std::move(box));
} else {

View File

@@ -65,6 +65,8 @@ private:
mtpRequestId _existingRightsRequestId = 0;
std::optional<ChatAdminRights> _existingRights;
QString _existingRank;
TimeId _promotedSince = 0;
UserId _promotedBy = 0;
rpl::event_stream<not_null<PeerData*>> _groups;
rpl::event_stream<not_null<PeerData*>> _channels;

View File

@@ -269,7 +269,8 @@ PaintRoundImageCallback ForbiddenRow::generatePaintUserpicCallback(
const auto peer = this->peer();
const auto saved = peer->isSelf();
const auto replies = peer->isRepliesChat();
auto userpic = (saved || replies)
const auto verifyCodes = peer->isVerifyCodes();
auto userpic = (saved || replies || verifyCodes)
? Ui::PeerUserpicView()
: ensureUserpicView();
auto paint = [=](
@@ -302,6 +303,7 @@ PaintRoundImageCallback ForbiddenRow::generatePaintUserpicCallback(
repaint = (_paletteVersion != style::PaletteVersion())
|| (!saved
&& !replies
&& !verifyCodes
&& (_userpicKey != peer->userpicUniqueKey(userpic)));
}
if (repaint) {
@@ -1276,7 +1278,9 @@ void AddSpecialBoxController::showAdmin(
_peer,
user,
currentRights,
_additional.adminRank(user));
_additional.adminRank(user),
_additional.adminPromotedSince(user),
_additional.adminPromotedBy(user));
const auto show = delegate()->peerListUiShow();
if (_additional.canAddOrEditAdmin(user)) {
const auto done = crl::guard(this, [=](
@@ -1354,7 +1358,9 @@ void AddSpecialBoxController::showRestricted(
_peer,
user,
_additional.adminRights(user).has_value(),
currentRights);
currentRights,
_additional.restrictedBy(user),
_additional.restrictedSince(user));
if (_additional.canRestrictParticipant(user)) {
const auto done = crl::guard(this, [=](
ChatRestrictionsInfo newRights) {

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "ui/controls/userpic_button.h"
#include "ui/vertical_list.h"
#include "ui/wrap/vertical_layout.h"
#include "ui/wrap/padding_wrap.h"
#include "ui/wrap/slide_wrap.h"
@@ -63,6 +64,10 @@ public:
template <typename Widget>
Widget *addControl(object_ptr<Widget> widget, QMargins margin);
[[nodiscard]] not_null<Ui::VerticalLayout*> verticalLayout() const {
return _rows;
}
protected:
int resizeGetHeight(int newWidth) override;
void paintEvent(QPaintEvent *e) override;
@@ -164,6 +169,10 @@ EditParticipantBox::EditParticipantBox(
, _hasAdminRights(hasAdminRights) {
}
not_null<Ui::VerticalLayout*> EditParticipantBox::verticalLayout() const {
return _inner->verticalLayout();
}
void EditParticipantBox::prepare() {
_inner = setInnerWidget(object_ptr<Inner>(
this,
@@ -197,6 +206,8 @@ EditAdminBox::EditAdminBox(
not_null<UserData*> user,
ChatAdminRightsInfo rights,
const QString &rank,
TimeId promotedSince,
UserData *by,
std::optional<EditAdminBotFields> addingBot)
: EditParticipantBox(
nullptr,
@@ -205,6 +216,8 @@ EditAdminBox::EditAdminBox(
(rights.flags != 0))
, _oldRights(rights)
, _oldRank(rank)
, _promotedSince(promotedSince)
, _by(by)
, _addingBot(std::move(addingBot)) {
}
@@ -279,9 +292,26 @@ void EditAdminBox::prepare() {
object_ptr<Ui::VerticalLayout>(this)));
const auto inner = _adminControlsWrap->entity();
inner->add(
object_ptr<Ui::BoxContentDivider>(inner),
st::rightsDividerMargin);
if (_promotedSince) {
const auto parsed = base::unixtime::parse(_promotedSince);
const auto label = Ui::AddDividerText(
inner,
tr::lng_rights_about_by(
lt_user,
rpl::single(_by
? Ui::Text::Link(_by->name(), 1)
: TextWithEntities{ QString::fromUtf8("\U0001F47B") }),
lt_date,
rpl::single(TextWithEntities{ langDateTimeFull(parsed) }),
Ui::Text::WithEntities));
if (_by) {
label->setLink(1, _by->createOpenLink());
}
Ui::AddSkip(inner);
} else {
Ui::AddDivider(inner);
Ui::AddSkip(inner);
}
const auto chat = peer()->asChat();
const auto channel = peer()->asChannel();
@@ -335,9 +365,9 @@ void EditAdminBox::prepare() {
.isForum = peer()->isForum(),
.anyoneCanAddMembers = anyoneCanAddMembers,
};
Ui::AddSubsectionTitle(inner, tr::lng_rights_edit_admin_header());
auto [checkboxes, getChecked, changes] = CreateEditAdminRights(
inner,
tr::lng_rights_edit_admin_header(),
prepareFlags,
disabledMessages,
options);
@@ -348,17 +378,47 @@ void EditAdminBox::prepare() {
) | rpl::then(std::move(
changes
));
_aboutAddAdmins = inner->add(
object_ptr<Ui::FlatLabel>(inner, st::boxDividerLabel),
st::rightsAboutMargin);
rpl::duplicate(
selectedFlags
) | rpl::map(
(_1 & Flag::AddAdmins) != 0
) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](bool checked) {
refreshAboutAddAdminsText(checked);
}, lifetime());
const auto hasRank = canSave() && (chat || channel->isMegagroup());
{
const auto aboutAddAdminsInner = inner->add(
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
inner,
object_ptr<Ui::VerticalLayout>(inner)));
const auto emptyAboutAddAdminsInner = inner->add(
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
inner,
object_ptr<Ui::VerticalLayout>(inner)));
aboutAddAdminsInner->toggle(false, anim::type::instant);
emptyAboutAddAdminsInner->toggle(false, anim::type::instant);
Ui::AddSkip(emptyAboutAddAdminsInner->entity());
if (hasRank) {
Ui::AddDivider(emptyAboutAddAdminsInner->entity());
Ui::AddSkip(emptyAboutAddAdminsInner->entity());
}
Ui::AddSkip(aboutAddAdminsInner->entity());
Ui::AddDividerText(
aboutAddAdminsInner->entity(),
rpl::duplicate(
selectedFlags
) | rpl::map(
(_1 & Flag::AddAdmins) != 0
) | rpl::distinct_until_changed(
) | rpl::map([=](bool canAddAdmins) -> rpl::producer<QString> {
const auto empty = (amCreator() && user()->isSelf());
aboutAddAdminsInner->toggle(!empty, anim::type::instant);
emptyAboutAddAdminsInner->toggle(empty, anim::type::instant);
if (empty) {
return rpl::single(QString());
} else if (!canSave()) {
return tr::lng_rights_about_admin_cant_edit();
} else if (canAddAdmins) {
return tr::lng_rights_about_add_admins_yes();
}
return tr::lng_rights_about_add_admins_no();
}) | rpl::flatten_latest());
}
if (canTransferOwnership()) {
const auto allFlags = AdminRightsForOwnershipTransfer(options);
@@ -373,9 +433,7 @@ void EditAdminBox::prepare() {
}
if (canSave()) {
_rank = (chat || channel->isMegagroup())
? addRankInput(inner).get()
: nullptr;
_rank = hasRank ? addRankInput(inner).get() : nullptr;
_finishSave = [=, value = getChecked] {
const auto newFlags = (value() | ChatAdminRight::Other)
& ((!channel || channel->amCreator())
@@ -441,9 +499,7 @@ void EditAdminBox::refreshButtons() {
not_null<Ui::InputField*> EditAdminBox::addRankInput(
not_null<Ui::VerticalLayout*> container) {
container->add(
object_ptr<Ui::BoxContentDivider>(container),
st::rightsRankMargin);
// Ui::AddDivider(container);
container->add(
object_ptr<Ui::FlatLabel>(
@@ -480,14 +536,13 @@ not_null<Ui::InputField*> EditAdminBox::addRankInput(
}
}, result->lifetime());
container->add(
object_ptr<Ui::FlatLabel>(
container,
tr::lng_rights_edit_admin_rank_about(
lt_title,
(isOwner ? tr::lng_owner_badge : tr::lng_admin_badge)()),
st::boxDividerLabel),
st::rightsAboutMargin);
Ui::AddSkip(container);
Ui::AddDividerText(
container,
tr::lng_rights_edit_admin_rank_about(
lt_title,
(isOwner ? tr::lng_owner_badge : tr::lng_admin_badge)()));
Ui::AddSkip(container);
return result;
}
@@ -681,27 +736,18 @@ void EditAdminBox::sendTransferRequestFrom(
})).handleFloodErrors().send();
}
void EditAdminBox::refreshAboutAddAdminsText(bool canAddAdmins) {
_aboutAddAdmins->setText([&] {
if (amCreator() && user()->isSelf()) {
return QString();
} else if (!canSave()) {
return tr::lng_rights_about_admin_cant_edit(tr::now);
} else if (canAddAdmins) {
return tr::lng_rights_about_add_admins_yes(tr::now);
}
return tr::lng_rights_about_add_admins_no(tr::now);
}());
}
EditRestrictedBox::EditRestrictedBox(
QWidget*,
not_null<PeerData*> peer,
not_null<UserData*> user,
bool hasAdminRights,
ChatRestrictionsInfo rights)
ChatRestrictionsInfo rights,
UserData *by,
TimeId since)
: EditParticipantBox(nullptr, peer, user, hasAdminRights)
, _oldRights(rights) {
, _oldRights(rights)
, _by(by)
, _since(since) {
}
void EditRestrictedBox::prepare() {
@@ -712,9 +758,8 @@ void EditRestrictedBox::prepare() {
setTitle(tr::lng_rights_user_restrictions());
addControl(
object_ptr<Ui::BoxContentDivider>(this),
st::rightsDividerMargin);
Ui::AddDivider(verticalLayout());
Ui::AddSkip(verticalLayout());
const auto chat = peer()->asChat();
const auto channel = peer()->asChannel();
@@ -749,16 +794,20 @@ void EditRestrictedBox::prepare() {
return result;
}();
Ui::AddSubsectionTitle(
verticalLayout(),
tr::lng_rights_user_restrictions_header());
auto [checkboxes, getRestrictions, changes] = CreateEditRestrictions(
this,
tr::lng_rights_user_restrictions_header(),
prepareFlags,
disabledMessages,
{ .isForum = peer()->isForum() });
addControl(std::move(checkboxes), QMargins());
_until = prepareRights.until;
addControl(object_ptr<Ui::BoxContentDivider>(this), st::rightsUntilMargin);
addControl(
object_ptr<Ui::FixedHeightWidget>(this, st::defaultVerticalListSkip));
Ui::AddDivider(verticalLayout());
addControl(
object_ptr<Ui::FlatLabel>(
this,
@@ -773,6 +822,29 @@ void EditRestrictedBox::prepare() {
// tr::lng_rights_chat_banned_block(tr::now),
// st::boxLinkButton));
if (_since) {
const auto parsed = base::unixtime::parse(_since);
const auto inner = addControl(object_ptr<Ui::VerticalLayout>(this));
const auto isBanned = (_oldRights.flags
& ChatRestriction::ViewMessages);
Ui::AddSkip(inner);
const auto label = Ui::AddDividerText(
inner,
(isBanned
? tr::lng_rights_chat_banned_by
: tr::lng_rights_chat_restricted_by)(
lt_user,
rpl::single(_by
? Ui::Text::Link(_by->name(), 1)
: TextWithEntities{ QString::fromUtf8("\U0001F47B") }),
lt_date,
rpl::single(TextWithEntities{ langDateTimeFull(parsed) }),
Ui::Text::WithEntities));
if (_by) {
label->setLink(1, _by->createOpenLink());
}
}
if (canSave()) {
const auto save = [=, value = getRestrictions] {
if (!_saveCallback) {

View File

@@ -36,6 +36,8 @@ public:
not_null<UserData*> user,
bool hasAdminRights);
[[nodiscard]] not_null<Ui::VerticalLayout*> verticalLayout() const;
protected:
void prepare() override;
@@ -77,6 +79,8 @@ public:
not_null<UserData*> user,
ChatAdminRightsInfo rights,
const QString &rank,
TimeId promotedSince,
UserData *by,
std::optional<EditAdminBotFields> addingBot = {});
void setSaveCallback(
@@ -108,7 +112,6 @@ private:
}
void finishAddAdmin();
void refreshButtons();
void refreshAboutAddAdminsText(bool canAddAdmins);
bool canTransferOwnership() const;
not_null<Ui::SlideWrap<Ui::RpWidget>*> setupTransferButton(
not_null<Ui::VerticalLayout*> container,
@@ -125,11 +128,12 @@ private:
Ui::Checkbox *_addAsAdmin = nullptr;
Ui::SlideWrap<Ui::VerticalLayout> *_adminControlsWrap = nullptr;
Ui::InputField *_rank = nullptr;
QPointer<Ui::FlatLabel> _aboutAddAdmins;
mtpRequestId _checkTransferRequestId = 0;
mtpRequestId _transferRequestId = 0;
Fn<void()> _save, _finishSave;
TimeId _promotedSince = 0;
UserData *_by = nullptr;
std::optional<EditAdminBotFields> _addingBot;
};
@@ -144,7 +148,9 @@ public:
not_null<PeerData*> peer,
not_null<UserData*> user,
bool hasAdminRights,
ChatRestrictionsInfo rights);
ChatRestrictionsInfo rights,
UserData *by,
TimeId since);
void setSaveCallback(
Fn<void(ChatRestrictionsInfo, ChatRestrictionsInfo)> callback) {
@@ -168,6 +174,8 @@ private:
TimeId getRealUntilValue() const;
const ChatRestrictionsInfo _oldRights;
UserData *_by = nullptr;
TimeId _since = 0;
TimeId _until = 0;
Fn<void(ChatRestrictionsInfo, ChatRestrictionsInfo)> _saveCallback;

View File

@@ -30,10 +30,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_changes.h"
#include "base/unixtime.h"
#include "ui/effects/outline_segments.h"
#include "ui/widgets/menu/menu_multiline_action.h"
#include "ui/widgets/popup_menu.h"
#include "ui/text/text_utilities.h"
#include "info/profile/info_profile_values.h"
#include "window/window_session_controller.h"
#include "history/history.h"
#include "styles/style_chat.h"
#include "styles/style_menu_icons.h"
namespace {
@@ -387,6 +390,24 @@ QString ParticipantsAdditionalData::adminRank(
return (i != end(_adminRanks)) ? i->second : QString();
}
TimeId ParticipantsAdditionalData::adminPromotedSince(
not_null<UserData*> user) const {
const auto i = _adminPromotedSince.find(user);
return (i != end(_adminPromotedSince)) ? i->second : TimeId(0);
}
TimeId ParticipantsAdditionalData::restrictedSince(
not_null<PeerData*> peer) const {
const auto i = _restrictedSince.find(peer);
return (i != end(_restrictedSince)) ? i->second : TimeId(0);
}
TimeId ParticipantsAdditionalData::memberSince(
not_null<UserData*> user) const {
const auto i = _memberSince.find(user);
return (i != end(_memberSince)) ? i->second : TimeId(0);
}
auto ParticipantsAdditionalData::restrictedRights(
not_null<PeerData*> participant) const
-> std::optional<ChatRestrictionsInfo> {
@@ -689,6 +710,11 @@ UserData *ParticipantsAdditionalData::applyAdmin(
} else {
_adminRanks.remove(user);
}
if (data.promotedSince()) {
_adminPromotedSince[user] = data.promotedSince();
} else {
_adminPromotedSince.remove(user);
}
if (const auto by = _peer->owner().userLoaded(data.by())) {
const auto i = _adminPromotedBy.find(user);
if (i == _adminPromotedBy.end()) {
@@ -741,6 +767,11 @@ PeerData *ParticipantsAdditionalData::applyBanned(
} else {
_kicked.erase(participant);
}
if (data.restrictedSince()) {
_restrictedSince[participant] = data.restrictedSince();
} else {
_restrictedSince.remove(participant);
}
_restrictedRights[participant] = data.restrictions();
if (const auto by = _peer->owner().userLoaded(data.by())) {
const auto i = _restrictedBy.find(participant);
@@ -1617,6 +1648,51 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
auto result = base::make_unique_q<Ui::PopupMenu>(
parent,
st::popupMenuWithIcons);
const auto addToEnd = gsl::finally([&] {
const auto addInfoAction = [&](
not_null<PeerData*> by,
tr::phrase<lngtag_user, lngtag_date> phrase,
TimeId since) {
auto text = phrase(
tr::now,
lt_user,
Ui::Text::Bold(by->name()),
lt_date,
Ui::Text::Bold(
langDateTimeFull(base::unixtime::parse(since))),
Ui::Text::WithEntities);
auto button = base::make_unique_q<Ui::Menu::MultilineAction>(
result->menu(),
result->st().menu,
st::historyHasCustomEmoji,
st::historyHasCustomEmojiPosition,
std::move(text));
if (const auto n = _navigation) {
button->setClickedCallback([=] {
n->parentController()->show(PrepareShortInfoBox(by, n));
});
}
result->addSeparator();
result->addAction(std::move(button));
};
if (const auto by = _additional.restrictedBy(participant)) {
if (const auto since = _additional.restrictedSince(participant)) {
addInfoAction(
by,
_additional.isKicked(participant)
? tr::lng_rights_chat_banned_by
: tr::lng_rights_chat_restricted_by,
since);
}
} else if (user) {
if (const auto by = _additional.adminPromotedBy(user)) {
if (const auto since = _additional.adminPromotedSince(user)) {
addInfoAction(by, tr::lng_rights_about_by, since);
}
}
}
});
if (_navigation) {
result->addAction(
(participant->isUser()
@@ -1624,39 +1700,14 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
: participant->isBroadcast()
? tr::lng_context_view_channel
: tr::lng_context_view_group)(tr::now),
crl::guard(this, [=] {
_navigation->showPeerInfo(participant); }),
crl::guard(this, [=, this] {
_navigation->parentController()->show(
PrepareShortInfoBox(participant, _navigation));
}),
(participant->isUser()
? &st::menuIconProfile
: &st::menuIconInfo));
}
if (const auto by = _additional.restrictedBy(participant)) {
result->addAction(
(_role == Role::Kicked
? tr::lng_channel_banned_status_removed_by
: tr::lng_channel_banned_status_restricted_by)(
tr::now,
lt_user,
by->name()),
crl::guard(this, [=] {
_navigation->parentController()->show(
PrepareShortInfoBox(by, _navigation));
}),
&st::menuIconAdmin);
} else if (user) {
if (const auto by = _additional.adminPromotedBy(user)) {
result->addAction(
tr::lng_channel_admin_status_promoted_by(
tr::now,
lt_user,
by->name()),
crl::guard(this, [=] {
_navigation->parentController()->show(
PrepareShortInfoBox(by, _navigation));
}),
&st::menuIconAdmin);
}
}
if (_role == Role::Kicked) {
if (_peer->isMegagroup()
&& _additional.canRestrictParticipant(participant)) {
@@ -1720,7 +1771,9 @@ void ParticipantsBoxController::showAdmin(not_null<UserData*> user) {
_peer,
user,
currentRights,
_additional.adminRank(user));
_additional.adminRank(user),
_additional.adminPromotedSince(user),
_additional.adminPromotedBy(user));
if (_additional.canAddOrEditAdmin(user)) {
const auto done = crl::guard(this, [=](
ChatAdminRightsInfo newRights,
@@ -1776,7 +1829,9 @@ void ParticipantsBoxController::showRestricted(not_null<UserData*> user) {
_peer,
user,
hasAdminRights,
currentRights);
currentRights,
_additional.restrictedBy(user),
_additional.restrictedSince(user));
if (_additional.canRestrictParticipant(user)) {
const auto done = crl::guard(this, [=](
ChatRestrictionsInfo newRights) {

View File

@@ -106,14 +106,19 @@ public:
not_null<PeerData*> participant) const;
[[nodiscard]] std::optional<ChatAdminRightsInfo> adminRights(
not_null<UserData*> user) const;
QString adminRank(not_null<UserData*> user) const;
[[nodiscard]] QString adminRank(not_null<UserData*> user) const;
[[nodiscard]] std::optional<ChatRestrictionsInfo> restrictedRights(
not_null<PeerData*> participant) const;
[[nodiscard]] bool isCreator(not_null<UserData*> user) const;
[[nodiscard]] bool isExternal(not_null<PeerData*> participant) const;
[[nodiscard]] bool isKicked(not_null<PeerData*> participant) const;
[[nodiscard]] UserData *adminPromotedBy(not_null<UserData*> user) const;
[[nodiscard]] UserData *restrictedBy(not_null<PeerData*> participant) const;
[[nodiscard]] UserData *restrictedBy(
not_null<PeerData*> participant) const;
[[nodiscard]] TimeId adminPromotedSince(not_null<UserData*>) const;
[[nodiscard]] TimeId restrictedSince(not_null<PeerData*>) const;
[[nodiscard]] TimeId memberSince(not_null<UserData*>) const;
void migrate(not_null<ChatData*> chat, not_null<ChannelData*> channel);
@@ -144,6 +149,9 @@ private:
// Data for channels.
base::flat_map<not_null<UserData*>, ChatAdminRightsInfo> _adminRights;
base::flat_map<not_null<UserData*>, QString> _adminRanks;
base::flat_map<not_null<UserData*>, TimeId> _adminPromotedSince;
base::flat_map<not_null<PeerData*>, TimeId> _restrictedSince;
base::flat_map<not_null<UserData*>, TimeId> _memberSince;
base::flat_set<not_null<UserData*>> _adminCanEdit;
base::flat_map<not_null<UserData*>, not_null<UserData*>> _adminPromotedBy;
std::map<not_null<PeerData*>, ChatRestrictionsInfo> _restrictedRights;

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