Compare commits

...

778 Commits

Author SHA1 Message Date
John Preston
45444253fd Version 5.12.2.
- Fix some crashes.
2025-03-09 09:44:47 +04:00
John Preston
308ade6a7e Fix crash in some custom emoji cases. 2025-03-09 06:55:25 +04:00
John Preston
fc67a801e3 Version 5.12.1: Fix build with Xcode. 2025-03-08 07:09:15 +04:00
John Preston
6a3657ca87 Version 5.12.1.
- Fix a crash in some chat switchings.
- Fix crashes in empty repaint callbacks.
2025-03-08 07:06:37 +04:00
John Preston
0537c5f273 Fix crashes in empty repaint callbacks. 2025-03-08 07:05:45 +04:00
John Preston
cc4a5f30b6 Fix a crash in some chat switchings. 2025-03-07 23:56:17 +04:00
John Preston
b0d7c3e9b1 Revert "Re-enable ffmpeg optimizations on Linux"
This reverts commit bd28ac6e1f.

It fails to link in Release mode with LTO.
2025-03-07 22:20:18 +04:00
John Preston
3bf7c44fc9 Version 5.12.
- Set a fee for incoming messages from unknown users.
- Set a fee for messages in groups or channel comments.
- Show some information about who's messaging you.
- Pin gifts on your profile.
2025-03-07 20:50:29 +04:00
John Preston
4ff4e63a11 Fix sending paid intro sticker. 2025-03-07 19:03:41 +04:00
John Preston
72a35ba58b Show new-peer-info photo/name change. 2025-03-07 19:03:41 +04:00
John Preston
b6a31979f2 Add the same enter/leave check to ListWidget. 2025-03-07 19:03:40 +04:00
John Preston
7c710e22cc Always process mouse input in active window.
Fixes #29008.
2025-03-07 19:03:40 +04:00
John Preston
ab58e7a225 Show common groups userpics in new-peer-info. 2025-03-07 19:03:40 +04:00
John Preston
c9fb97cd7c Simplify marked text context logic. 2025-03-07 19:03:40 +04:00
John Preston
789f3e1584 Add non-official account info icon. 2025-03-07 19:03:39 +04:00
John Preston
0fc8229be1 Initial new peer information display. 2025-03-07 19:03:39 +04:00
John Preston
a1e555267e Fix sending invite links to paid. 2025-03-07 19:03:39 +04:00
John Preston
0ac88c0cb5 Show special blank chat for paid messages. 2025-03-07 19:03:39 +04:00
John Preston
d43a6da62b Fix sending bot commands in paid chats. 2025-03-07 19:03:39 +04:00
John Preston
940455f786 Preload gifts for the gift to user layer. 2025-03-07 19:03:39 +04:00
John Preston
0f74456f30 Support gifts pinning. 2025-03-07 19:03:39 +04:00
John Preston
7840fa6d90 Add context menu for gifts in list. 2025-03-07 19:03:39 +04:00
John Preston
95ccc99fee Hide reply in notification for paid peers. 2025-03-07 19:03:39 +04:00
23rd
7b0a156bba Added lottie icon when have no enough info for earn stats. 2025-03-07 19:03:39 +04:00
23rd
0d8ae7bb37 Renamed creditsAmount in invoice for premium gift with represented name. 2025-03-07 19:03:39 +04:00
23rd
9491cff1df Fixed display credits in list of gift options. 2025-03-07 19:03:39 +04:00
23rd
51dc5d6e37 Fixed discount calculation for gifts options with different currencies. 2025-03-07 19:03:39 +04:00
John Preston
f4c739ab92 Improve transactions history for new stuff. 2025-03-07 19:03:39 +04:00
John Preston
0dd8ae3d77 Update submodules. 2025-03-07 19:03:39 +04:00
John Preston
7d2878d81c Support gifting premium for stars. 2025-03-07 19:03:39 +04:00
23rd
bd70a05861 Removed button to turn off sponsored messages in megagroups. 2025-03-07 19:03:39 +04:00
23rd
0605c7b2bc Added ability to display possible currency earn in megagroups in future. 2025-03-07 19:03:39 +04:00
23rd
8e83a55143 Added ability to request earn stats without currency earn in megagroups. 2025-03-07 19:03:39 +04:00
John Preston
4ab4eb8ef2 Pause voice in pay-to-send chats. 2025-03-07 19:03:39 +04:00
John Preston
d1e6150874 Don't suggest userpics to paid-restricted. 2025-03-07 19:03:38 +04:00
John Preston
4121c99f36 Allow folders submenu to have a scroll. 2025-03-07 19:03:38 +04:00
John Preston
827040f487 Use paid messages values from appConfig. 2025-03-07 19:03:38 +04:00
John Preston
9032489786 Add pays-me status bar in chat. 2025-03-07 19:03:38 +04:00
John Preston
8ea7bd4913 Simplify paid message button labeling. 2025-03-07 19:03:38 +04:00
John Preston
97b021efaf Star-count button in multi-Forward/CreatePoll. 2025-03-07 19:03:38 +04:00
John Preston
b3f9a77ba7 Star-count button in SendFilesBox/ShareBox. 2025-03-07 19:03:38 +04:00
John Preston
63fdc1f876 Update API scheme on layer 200. 2025-03-07 19:03:38 +04:00
John Preston
17cf354c58 Support custom send button for paid. 2025-03-07 19:03:38 +04:00
John Preston
c6fd8bcb99 Edit paid messages exceptions. 2025-03-07 19:03:38 +04:00
John Preston
1684465e04 Add sending paid stories replies. 2025-03-07 19:03:38 +04:00
John Preston
fe2df96953 Improve paid peer-box multi-send. 2025-03-07 19:03:38 +04:00
John Preston
ee9d0cfd99 Update API scheme, disable scheduled paid. 2025-03-07 19:03:38 +04:00
John Preston
7b7e18e752 Support paid sending in ShareBox. 2025-03-07 19:03:38 +04:00
John Preston
928be4151b Update API scheme, parse premium gifts for stars. 2025-03-07 19:03:38 +04:00
John Preston
37dd648686 Implement paid location sending. 2025-03-07 19:03:38 +04:00
John Preston
93a590774e Send paid stickers/gifs/inline-results. 2025-03-07 19:03:38 +04:00
John Preston
22b99b6d3e Send paid shared contacts. 2025-03-07 19:03:37 +04:00
John Preston
101d626d4f Support paid files-with-comment and polls. 2025-03-07 19:03:37 +04:00
John Preston
3633c19208 Update API scheme, improve service messages. 2025-03-07 19:03:37 +04:00
John Preston
e302f328f7 Don't cut confirming emoji status. 2025-03-07 19:03:37 +04:00
John Preston
f74ba95e95 Don't track caption in fullscreen video view.
Fixes #28981.
2025-03-07 19:03:37 +04:00
John Preston
c38982d286 Simplify paid stars check. 2025-03-07 19:03:37 +04:00
John Preston
fe9bac096b Refresh balance after paid message sending. 2025-03-07 19:03:37 +04:00
John Preston
5b809c4fc6 Show paid stars information above a message. 2025-03-07 19:03:37 +04:00
John Preston
4729e51e14 Improve phrases for paid messages. 2025-03-07 19:03:37 +04:00
John Preston
960cf7a34b Update API scheme, new paid. 2025-03-07 19:03:37 +04:00
John Preston
852ab19760 Update API scheme, track stars-per-message. 2025-03-07 19:03:37 +04:00
John Preston
2e45d9fc6b Allow replacing default shortcuts. 2025-03-07 19:03:37 +04:00
John Preston
74b71b92b6 Update API scheme on layer 200. 2025-03-07 19:03:37 +04:00
John Preston
bbc14ba74f Allow sending paid messages. 2025-03-07 19:03:37 +04:00
John Preston
45c7829cd8 Track stars-per-message for users and channels. 2025-03-07 19:03:37 +04:00
John Preston
f2aa3afbbb Allow editing charge-for-message privacy. 2025-03-07 19:03:37 +04:00
John Preston
909b01241b Update API scheme to layer 200. 2025-03-07 19:03:36 +04:00
Ilya Fedin
abb58c58a0 QPlatformKeyMapper -> QKeyMapper 2025-03-06 17:54:54 +04:00
Ilya Fedin
700e10d32c Use flat_map::remove in clearFrom{Topic,Item}
Now that notification closing happens in destructor, the iterator is no more needed
2025-03-06 17:30:26 +04:00
Ilya Fedin
4ac48d0e4a Fix clearFromTopic on Linux
Looks like it was broken since addition
2025-03-06 16:41:34 +04:00
Ilya Fedin
345b2cb835 Move notification closing to NotificationData destruction 2025-03-04 14:17:43 +04:00
Ilya Fedin
b962309498 Move hints.lookup_value() out of xdg_notifications_notifications_call_notify
Or it gets executed after hints.end() which clears hints
2025-03-04 12:28:37 +04:00
Eugene
e99cb9bfb8 Ensure policy check before creating Zone.Identifier for downloaded files on Windows 2025-03-04 10:47:31 +04:00
Ilya Fedin
9e12e18f90 Clean up unnecessary calls to Manager::Private::clearNotification
It was added to replicate NotificationData::close but lots of places call it after the notification is already cleared
2025-03-03 18:40:22 +04:00
Ilya Fedin
66fc9b38df Fix a race condition with asynchronous notification sending 2025-03-03 18:40:06 +04:00
Ilya Fedin
5dbe429e6b Fix NotificationData initialization 2025-03-03 18:39:55 +04:00
GitHub Action
b2481ea6c1 Update User-Agent for DNS to Chrome 133.0.0.0. 2025-03-03 18:37:13 +04:00
Ilya Fedin
86a294ce4b Subscribe to XdgNotifications signals on Manager initialization 2025-03-01 09:08:10 +04:00
Ilya Fedin
a8d1eadfbf Turn NotificationData into a struct 2025-02-28 13:20:53 +04:00
Ilya Fedin
b07d3c5403 Decouple GNotification from NotificationData 2025-02-28 12:05:09 +04:00
Ilya Fedin
892db55ae1 Get rid of NotificationData::init 2025-02-28 11:12:08 +04:00
Ilya Fedin
93615fef65 Revert "Check whether notification image has alpha channel"
This reverts commit cee593c423.

Avatars couldn't be opaque anyway while this simplifies porting out of NotificationData
2025-02-28 11:12:08 +04:00
Ilya Fedin
87452706ef Remove unused has_weak_ptr from Manager::Private 2025-02-28 11:12:08 +04:00
Ilya Fedin
3569615b21 Use gi::cstring for notification actions 2025-02-28 11:12:08 +04:00
Ilya Fedin
86f7d09d31 Pass notification icon name inline 2025-02-28 11:12:08 +04:00
Ilya Fedin
d5d1254393 Destroy NotificationData signal connections with rpl::lifetme 2025-02-28 11:12:08 +04:00
davidholio
4df90cfb9e Make sure caption items can only be interacted if not in video fullscreen. 2025-02-25 11:40:05 +04:00
Ilya Fedin
ec6862d31a Communicate PiP window margins to the OS 2025-02-25 10:15:33 +04:00
Ilya Fedin
6f23010382 Fix IconGraphic::counterSlice for Window::WithSmallCounter 2025-02-24 13:25:59 +04:00
Ilya Fedin
c672f105d3 IconGraphic::isCounterNeeded helper for Linux tray 2025-02-24 13:25:59 +04:00
Ilya Fedin
e60d501e4a Have a state struct in Linux tray 2025-02-24 13:25:59 +04:00
jovaska
0d7175058b Fix compilation with ffmpeg-4.x 2025-02-24 13:15:37 +04:00
Ilya Fedin
3b0bd9d1d1 Remove duplicate entry in qt snap part 2025-02-20 17:48:37 +04:00
Ilya Fedin
bd28ac6e1f Re-enable ffmpeg optimizations on Linux
They were disabled due to -Ofast but Dockerfile is switched to -O3 since a long time
2025-02-20 11:34:55 +04:00
Ilya Fedin
0c2d00c792 More clean up in qt snap part 2025-02-20 11:34:47 +04:00
Ilya Fedin
140ba653b9 More clean up in libjxl snap part 2025-02-20 11:34:33 +04:00
Ilya Fedin
f64f008f77 Remove fmt from snap
It's not really needed for a long time
2025-02-20 11:34:24 +04:00
Ilya Fedin
a6315bef05 Move GNotiftcation action handlers to Manager 2025-02-19 14:42:11 +04:00
Ilya Fedin
f810d7c82a Fix spaces on end of lines 2025-02-18 21:26:38 +04:00
Ilya Fedin
cf61dedc79 Simplify GNotification actions 2025-02-18 21:21:37 +04:00
Ilya Fedin
2ab9587f5f Don't wrap QByteArray into std::shared_ptr
This has no sense as QByteArray is CoW
2025-02-18 21:20:53 +04:00
Ilya Fedin
4950b52359 Don't set CMAKE_EXPORT_COMPILE_COMMANDS via cmake.configureSettings
It's controlled by cmake.exportCompileCommandsFile and defaults to true
2025-02-14 20:19:29 +04:00
Nikolai Nechaev
03af444735 Notifications: stop fading in before starting to fade out
When a notification is to start hiding (i.e., fade out), it is supposed
to start fading out from the maximum opacity, even if it was not fully
restored (which only happens if the cursor passed through the
notification too quickly). Thus, call `.stop()` for the previous
animation, if any, before `.start()`ing the next animation.
2025-02-14 20:17:02 +04:00
Nikolai Nechaev
7f6221b409 Manager::startAllHiding: don't treat fading in notifications specially
Previously, `Window::Notifications::Default::Manager` would not start
hiding notifications that are fading in when other notifications should
hide. This would lead to some notifications never hiding, e.g., when the
cursor passes through the notification too quickly and there was not
enough time for the notification to fade in completely.

Also renamed `Widget::isShowing` -> `Widget::isFadingIn` for clarity.

Fixes #28811.
2025-02-14 20:17:02 +04:00
John Preston
ef859d77e9 Version 5.11.1.
- Fix arbitrary cropping support in the image editor.
- Fix crash on round video message playback.
- Fix complex custom keyboard shortcuts.
2025-02-13 21:24:40 +04:00
John Preston
0fd752657a Fix build with latest Visual Studio. 2025-02-13 21:24:40 +04:00
23rd
f1451a1de3 Added ripple animation to button for gift to channel in history widget. 2025-02-13 21:02:44 +04:00
John Preston
fa96f25683 Fix webview with old webkitgtk. 2025-02-13 21:01:28 +04:00
John Preston
9e447383df Support Shift+.. shortcuts on Linux. 2025-02-13 21:01:16 +04:00
John Preston
5e762be32b Remove redundant new progress in round videos. 2025-02-13 20:20:47 +04:00
John Preston
75de81a3ab Update lib_webview. 2025-02-13 20:20:43 +04:00
John Preston
d26b64a5bb Fix crash in video messages. 2025-02-13 20:20:40 +04:00
John Preston
cb8d40eaf2 Fix recording shortcuts on Windows. 2025-02-13 20:20:34 +04:00
John Preston
ded0936bc4 Fix arbitrary aspect in photo editor crop. 2025-02-13 20:20:14 +04:00
John Preston
16830a410c Improve gift-to-channel button conditions. 2025-02-13 20:20:07 +04:00
John Preston
9f79dda463 Version 5.11.
- Copy video links at current time.
- Set custom video covers when posting to channels.
- Send paid reactions from the name of your channels.
2025-02-13 10:37:16 +04:00
John Preston
15dc7c74d7 Make emoji status in chat bubbles clickable. 2025-02-12 18:27:21 +04:00
John Preston
f9abef9e05 Update API scheme on layer 199. 2025-02-12 17:24:24 +04:00
John Preston
ba84499f00 Send paid reactions from channels. 2025-02-12 17:24:24 +04:00
John Preston
79ce24222a Prepare code for paid reactions from channels. 2025-02-12 17:24:24 +04:00
John Preston
6cb9264864 Update API scheme to layer 199. 2025-02-12 17:24:24 +04:00
John Preston
247a070405 Prioritize last used playback timestamp. 2025-02-12 17:24:24 +04:00
John Preston
e05bb75b8a Allow sending videos with covers. 2025-02-12 17:24:24 +04:00
John Preston
6a415cf232 Support on-hover autoplay and position save. 2025-02-12 17:24:24 +04:00
John Preston
e8034189df Use video covers in messages. 2025-02-12 17:24:24 +04:00
John Preston
107f329b4f Update API scheme on layer 198. 2025-02-12 17:24:24 +04:00
John Preston
999a13358e Allow sharing video at a timestamp. 2025-02-12 17:24:24 +04:00
John Preston
2077f51084 Open video from ?t= links. 2025-02-12 17:24:24 +04:00
John Preston
1e77a3df20 Fix file reference video cover. 2025-02-12 17:24:24 +04:00
John Preston
141a291523 Start video from required timestamp. 2025-02-12 17:24:24 +04:00
John Preston
cb03d5a9d3 Show video_timestamp progress line. 2025-02-12 17:24:24 +04:00
John Preston
b618d1e56a Parse and store video_timestamp. 2025-02-12 17:24:24 +04:00
John Preston
23ae638512 Parse video cover photos. 2025-02-12 17:24:23 +04:00
John Preston
eda749d7cb Show correct shortcut text on macOS. 2025-02-12 17:00:39 +04:00
John Preston
08d0186e53 Beta version 5.10.8.
- Edit keyboard shortcuts in Settings > Chat Settings.
- Hide controls in calls with incoming video.
- Fix several crashes.
2025-02-12 11:45:58 +04:00
John Preston
443981ba31 Fix reordering of various-height pinned chats.
Fixes #28948.
2025-02-12 11:39:26 +04:00
John Preston
f3ed7c5e19 Fix crash in Instant View in some themes.
Fixes #28604.
2025-02-12 11:39:26 +04:00
John Preston
dd2378b591 Hide call controls in one-on-one video. 2025-02-12 11:39:26 +04:00
John Preston
b885779365 Support location picker on Linux. 2025-02-12 11:39:26 +04:00
John Preston
32b95f0d9a Improve forum outlines in stories/folders. 2025-02-12 11:39:26 +04:00
John Preston
2b8eec8666 Allow fast bot mode without support mode. 2025-02-12 11:39:26 +04:00
23rd
3f24627f54 Removed reactions list for anonymous non-owner admins. 2025-02-10 23:48:09 +03:00
23rd
0c4bca312e Removed ability to set wallpaper to chat with require-premium user. 2025-02-10 22:52:25 +03:00
23rd
e36afc675e Removed ability to set TTL to chat with require-premium user. 2025-02-10 22:52:00 +03:00
23rd
d754014321 Added missed label about similar channels to box for doubled limits. 2025-02-10 22:38:42 +03:00
23rd
9f73242cc5 Improved width of voice waveform. 2025-02-10 21:22:57 +03:00
23rd
fae9649773 Added log to catch possible api errors when disable calls for account. 2025-02-10 19:42:26 +03:00
23rd
4b43f4cbec Fixed color update of right buttons in chats list on palette change. 2025-02-10 10:49:53 +04:00
23rd
b61befa210 Fixed color update of badges in chat filters strip on palette change. 2025-02-10 10:49:53 +04:00
23rd
5e2bc337bc Fixed preview display of personal channel on change of last message. 2025-02-10 10:49:53 +04:00
23rd
af1608cbfa Added rpl filter to exclude incomplete sizes. 2025-02-10 10:49:53 +04:00
John Preston
9aa80976ff Fix viewing gifts from the list. 2025-02-10 10:46:49 +04:00
John Preston
c9cfe9e90f Allow filtering users gifts. 2025-02-10 10:46:49 +04:00
John Preston
482e337762 Move shortcuts settings lower. 2025-02-10 10:46:49 +04:00
John Preston
a0821f5a01 Handle additional phone call discard reason. 2025-02-10 10:46:49 +04:00
John Preston
5ebdf3ed39 Save custom shortcuts to disk. 2025-02-10 10:46:49 +04:00
John Preston
86096db02d Apply shortcuts changes to actions. 2025-02-10 10:46:49 +04:00
John Preston
a93e01b896 Don't show Non-Unique status without Upgrade. 2025-02-10 10:46:49 +04:00
John Preston
0585e72c35 Section for shortcuts editing. 2025-02-10 10:46:48 +04:00
John Preston
c82fbefcfc Don't show Send a Gift to service users. 2025-02-10 10:46:48 +04:00
John Preston
23542a1db1 Fix boost group phrases. 2025-02-10 10:46:48 +04:00
John Preston
1bf50d60d8 Fix possible crash in stories. 2025-02-10 10:46:48 +04:00
John Preston
8596b0309e Fix bot chat scroll shift on state restore.
Fixes #28085.
2025-02-10 10:46:48 +04:00
John Preston
7f6e871b26 Fix crash in emoji color picker. 2025-02-10 10:46:48 +04:00
John Preston
8912d4d55a Fix weather widget in stories. 2025-02-10 10:46:48 +04:00
John Preston
7ac849ab12 Don't update mouse in non-active window. 2025-02-10 10:46:48 +04:00
John Preston
4cab699b04 Use larger unique gift preview. 2025-02-10 10:46:48 +04:00
John Preston
03aa05e4d2 Remove creation of telesco.pe links. 2025-02-10 10:46:48 +04:00
John Preston
428a3cf0ce Improve phrases for forward-from-saved. 2025-02-10 10:46:48 +04:00
John Preston
1c8b165a64 Show quantity of issued unique gifts. 2025-02-10 10:46:48 +04:00
John Preston
1869071ef7 Sort/Filter channel gifts by non-admins. 2025-02-10 10:46:48 +04:00
John Preston
33ca5ee39f Limited before In Stock. 2025-02-10 10:46:48 +04:00
John Preston
e46d5a86d3 Don't auto-submit /start on non-loaded history. 2025-02-10 10:46:48 +04:00
John Preston
2729bcac3b Fix multi-line description in gift box. 2025-02-10 10:46:48 +04:00
John Preston
d60ce41fa9 Add a gift button to channel bottom. 2025-02-10 10:46:48 +04:00
John Preston
958db945f3 Fix bot verify badge position. 2025-02-10 10:46:48 +04:00
John Preston
057f906ca4 Remove bot verification from saved messages. 2025-02-10 10:46:48 +04:00
23rd
8df7a45e29 Added animated arrow to toggle of business hours. 2025-02-10 10:46:47 +04:00
23rd
e4af1570cb Replaced link button for switch of business hours with small round one. 2025-02-10 10:46:47 +04:00
23rd
049ebf9027 Fixed display of credits icon in table row from gift box. 2025-02-10 10:46:47 +04:00
23rd
f2f0c7df92 Extended context menu for outgoing gifts. 2025-02-10 10:46:47 +04:00
Anton Ryzhov
bee4118513 Export media sizes 2025-02-09 12:22:37 +04:00
Ilya Fedin
bf48025d12 Update Qt 6.8.1 -> 6.8.2 2025-02-02 15:37:34 +04:00
Ilya Fedin
5e624605cf Don't print "Choosing Qt $version" multiple times 2025-02-02 15:37:34 +04:00
Ilya Fedin
026490acc6 Add geoclue and geocode-glib to snap 2025-02-02 15:37:34 +04:00
Ilya Fedin
709ce3adb8 Set UID in docker run 2025-02-01 12:54:55 +04:00
Ilya Fedin
a8d23489c4 Set up gcc toolset environment manually 2025-02-01 12:52:22 +04:00
Ilya Fedin
296df113e3 Implement getting geolocation via geoclue/geocode-glib on Linux 2025-02-01 12:51:02 +04:00
23rd
97c4e79e96 Improved title for separated windows with shared media. 2025-01-30 13:59:53 +03:00
23rd
f89bac7781 Improved handle of existing separated windows for shared media. 2025-01-30 13:59:53 +03:00
23rd
1d8a7f8fd3 Removed redundant template from Info::Media::AddCountedButton. 2025-01-30 13:59:35 +03:00
23rd
ef9f7ab27a Moved process of separated window for shared media to correspond file. 2025-01-30 13:59:00 +03:00
23rd
a676138745 Added ability to open shared media in window with Ctrl+Click. 2025-01-30 12:16:31 +03:00
23rd
7442ea7a16 Added ability to open single typed shared media in window for topics. 2025-01-30 12:04:44 +03:00
23rd
0089cad740 Replaced default shortcut to open chat menu with Ctrl+\. 2025-01-30 11:42:12 +03:00
23rd
cf1fa718a8 Improved conflict handle between IV shortcuts and Shortcuts. 2025-01-30 11:39:56 +03:00
23rd
d6ba6ac41e Added initial ability to open single typed shared media in window. 2025-01-30 11:01:04 +03:00
23rd
bbdd5feaa4 Fixed display of video userpic in short box on Retina. 2025-01-30 11:01:04 +03:00
Ilya Fedin
678527254b Add development facilities to the CentOS Dockerfile 2025-01-29 15:27:25 +01:00
John Preston
46bf7781aa Version 5.10.7: Haptic on Linux. 2025-01-27 23:43:57 +04:00
John Preston
99c547b625 Version 5.10.7: Fix gifts scrolling. 2025-01-27 23:41:07 +04:00
John Preston
6976e97de3 Fix possible crash in font selection box. 2025-01-27 23:41:07 +04:00
23rd
f8e3e70273 Added peer userpic to gift service messages. 2025-01-27 21:10:44 +03:00
23rd
23c9f7a957 Added entities support to title from ServiceBoxContent. 2025-01-27 21:10:44 +03:00
23rd
2ca763cc77 Made less strict condition to show unique status of gift in gift box. 2025-01-27 21:10:44 +03:00
John Preston
2adc811351 Version 5.10.7: Fix build. 2025-01-27 20:31:01 +04:00
23rd
be18be4a86 Added volume slider to settings box for rtmp live stream. 2025-01-27 18:35:58 +03:00
John Preston
8d7abb1b8a Version 5.10.7.
- Fix some phrases for collectible gifts.
- Fix freeze in sound reencoding on macOS and Linux.
2025-01-27 19:27:11 +04:00
John Preston
1cc5988c40 Improve gifts phrases. 2025-01-27 19:25:17 +04:00
John Preston
da426ae03b Introduce fast-buttons-bots for support mode. 2025-01-27 19:25:17 +04:00
John Preston
3cebd6d923 Fix deadlock in audio for notification repacking. 2025-01-27 18:10:38 +04:00
John Preston
f1019c8ca4 Update Qt patches in Linux build. 2025-01-27 18:07:42 +04:00
John Preston
edfb7b6b24 Add delay for anim::Disabled tabbed panel hide. 2025-01-27 18:07:42 +04:00
23rd
157a928f5a Added shortcut to open chat menu from dialogs, chat info and history. 2025-01-27 18:07:42 +04:00
Ilya Fedin
5f5a2a3ef2 Check high contrast theme for auto dark mode on Windows 2025-01-27 15:01:11 +01:00
Ilya Fedin
8534cf3756 Extract system dark mode from QPalette 2025-01-27 15:01:11 +01:00
Ilya Fedin
39b90092ff Revert "Fallback to portal on Linux if QStyleHints::colorScheme is unknown"
This reverts commit a88f48cd93.
2025-01-27 15:01:11 +01:00
John Preston
d3142ebe6d Version 5.10.6: Fix build. 2025-01-26 14:00:45 +04:00
John Preston
d914c6be2e Version 5.10.6.
- Fix crash in opening users gifts section.
- Fix unintended sound in reaction notifications.
- Fix disabling notifications sound on macOS and Linux.
2025-01-26 12:48:57 +04:00
John Preston
05c3e968df Remove 'SOON' badge for tradable feature. 2025-01-26 11:34:45 +04:00
John Preston
7756cce123 Fix viewing gifts from list of saved. 2025-01-26 11:34:44 +04:00
John Preston
8287d717f8 Fix notifications without sounds on macOS. 2025-01-26 11:34:32 +04:00
23rd
db9e60b4b5 Added amount of total voters to poll results with multiple answers.
Fixed #28879.
2025-01-26 08:49:21 +03:00
23rd
28a79bfccb Improved sort of received star gifts. 2025-01-25 20:18:42 +03:00
23rd
321490e528 Fixed ability to moderate messages from channel authors. 2025-01-25 19:32:49 +03:00
23rd
6f752357d7 Fixed ability to moderate messages from topbar in sections. 2025-01-25 19:32:49 +03:00
Ilya Fedin
e1f71baed6 Move native notifications option check logic to cross platform code 2025-01-25 18:33:13 +04:00
John Preston
df377cd5bb Version 5.10.5.
- Count all unread topics as a single chat in archive unread counter.
- Fix common groups section in bots profiles.
- Fix crash on scheduling messages from Share box.
- Fix silent notifications on macOS.
- Add support for 'sound-file' notification hint on Linux.
2025-01-24 22:23:27 +04:00
John Preston
691a0acdab Allow sound-without-toast again on macOS/Linux. 2025-01-24 22:23:27 +04:00
John Preston
5e2eda6af3 Fix webpage preview glitch. 2025-01-24 22:12:21 +04:00
23rd
17cdc2b585 Fixed search shortcut in section for comments. 2025-01-24 21:09:30 +04:00
23rd
c08266f81b Fixed reward label for point details widget in credits statistics. 2025-01-24 21:09:28 +04:00
23rd
f90a4db569 Respected pause reason in mini stars from section for main settings. 2025-01-24 21:09:27 +04:00
John Preston
22ec7a6d75 Fix notification sounds on macOS. 2025-01-24 21:08:54 +04:00
John Preston
1b16a84810 Return common groups section to bots.
Fixes #28886.
2025-01-24 20:22:16 +04:00
John Preston
d778276f5d Reuse views in gifts lists. 2025-01-24 13:40:57 +04:00
John Preston
e3030a168f Fix crash in share box scheduling. 2025-01-24 12:13:35 +04:00
John Preston
dfd07a4f4f Count all topics as one chat for outer badges. 2025-01-24 12:02:28 +04:00
John Preston
f9fc65d7de Fix webapp window top in some cases. 2025-01-24 11:14:06 +04:00
Ilya Fedin
46cf7db242 Add support for sound-file notification hint on Linux 2025-01-24 11:02:38 +04:00
John Preston
2b94cffe7e Allow getting name or path for sound. 2025-01-23 12:13:01 +04:00
John Preston
2e74ad6fbe Use common code for local sound disk cache. 2025-01-23 11:58:20 +04:00
John Preston
df7dc1583d Try settings window title for miniapps. 2025-01-23 10:55:59 +04:00
John Preston
88e80b4fae Version 5.10.4: Fix build with GCC. 2025-01-22 23:56:52 +04:00
John Preston
aea90f4b65 Version 5.10.4.
- Add messages search in channel comments.
- Allow sending your unique gifts to blockchain.
- Add option for running in backround on Linux.
- Fix possible freeze on quit on macOS.
2025-01-22 22:22:20 +04:00
John Preston
80db076f38 Improve channel gifts viewing. 2025-01-22 22:13:29 +04:00
John Preston
27bba8250a Add special phrase for unique hidden gift. 2025-01-22 22:13:29 +04:00
John Preston
3fb0fa6892 Swap confirm and password boxes on export. 2025-01-22 22:13:28 +04:00
John Preston
c3195cfcbe Improve convert-to-stars message in channel gift. 2025-01-22 22:13:28 +04:00
John Preston
51661a872c Fix channel unique gift transfer. 2025-01-22 22:13:28 +04:00
John Preston
64706ea103 Add confirmation for go-to-Fragment. 2025-01-22 22:13:28 +04:00
John Preston
ec69d557dc Add channel gifts filter. 2025-01-22 22:13:28 +04:00
John Preston
addd37fb1f Make channel gifts wearing / transferring. 2025-01-22 22:13:28 +04:00
John Preston
9dc947ecb6 Simplify run-in-background option selection. 2025-01-22 22:13:28 +04:00
John Preston
7d74d3da3a Remove dnd/focus query code on macOS. 2025-01-22 22:13:28 +04:00
John Preston
aa0c56876c Use sound in native notifications on macOS. 2025-01-22 22:13:28 +04:00
John Preston
37c7b0c6d1 Allow exporting unique gifts to blockchain. 2025-01-22 22:13:28 +04:00
John Preston
0d07d238bc Allow converting channel gifts to stars. 2025-01-22 22:13:28 +04:00
John Preston
fa4e74ffef Show and edit channel gifts notify settings. 2025-01-22 22:13:28 +04:00
John Preston
c22d76e5be Show only channel userpic in RTMP livestreams. 2025-01-22 22:13:28 +04:00
John Preston
18850ebd83 Gradient on premium gift discount badge. 2025-01-22 22:13:28 +04:00
John Preston
17abef95eb Build FFmpeg with WAV encoder/muxer. 2025-01-22 22:13:28 +04:00
John Preston
d135151477 Use native sound support in macOS notifications. 2025-01-22 22:13:28 +04:00
John Preston
07fd9b3074 Show nice collectible tooltip on wearing. 2025-01-22 22:13:27 +04:00
John Preston
0523ae705a Fix invisible chat type filter. 2025-01-22 22:13:27 +04:00
John Preston
9db2502cd0 Preserve formatting when editing links.
Fixes #28170.
2025-01-22 22:13:27 +04:00
John Preston
a174119877 Update API scheme on layer 198. 2025-01-22 22:13:27 +04:00
John Preston
569dd19932 Fix build on Xcode. 2025-01-22 22:13:27 +04:00
John Preston
530e2a1feb Support background-run options on Linux. 2025-01-22 22:13:27 +04:00
John Preston
de732ba692 Update icons for collectible wearing. 2025-01-22 22:13:27 +04:00
John Preston
c6649e84a6 Update patches for Qt 5.15. 2025-01-22 22:13:27 +04:00
John Preston
e3517aceab Improve stars in collectible emoji status. 2025-01-22 22:13:27 +04:00
John Preston
6d7abd1718 Don't use double-badge in profile, use two. 2025-01-22 22:13:27 +04:00
John Preston
e9e493707b Show left / sold gifts counts. 2025-01-22 22:13:27 +04:00
John Preston
c25adf8b57 Use a custom animated emoji for collectible status. 2025-01-22 22:13:27 +04:00
John Preston
d2be10cd4e Use "Display on my Page" big button. 2025-01-22 22:13:27 +04:00
John Preston
006ecf9a56 Fix giveaway results message sticker. 2025-01-22 22:13:27 +04:00
John Preston
a53cc52241 Ask for premium to wear a collectible. 2025-01-22 22:13:26 +04:00
John Preston
961d283325 Put on / Take off collectible wearable. 2025-01-22 22:13:26 +04:00
John Preston
4e46529eb6 Show gift on collectible status click. 2025-01-22 22:13:26 +04:00
John Preston
81001e04e9 Partially implement viewing channel gifts. 2025-01-22 22:13:26 +04:00
John Preston
2fd174ab9c Partially implement sending gifts to channels. 2025-01-22 22:13:26 +04:00
John Preston
6ff5e221ea Support similar bots section. 2025-01-22 22:13:26 +04:00
John Preston
232077b919 Allow wearing unique gifts as status. 2025-01-22 22:13:26 +04:00
John Preston
fecddb5203 Allow wearing collectibles from emoji status. 2025-01-22 22:13:26 +04:00
John Preston
d0132c0f7b Update API scheme to layer 198. 2025-01-22 22:13:26 +04:00
John Preston
37d32b32f8 Show gifts inside media view in stories. 2025-01-22 22:13:26 +04:00
John Preston
51213b499f Start showing gifts from stories. 2025-01-22 22:13:25 +04:00
John Preston
dcb98ce0fb WebPage open button doesn't inflate the preview. 2025-01-22 22:13:25 +04:00
John Preston
428e90a844 Add unique gifts link preview. 2025-01-22 22:13:25 +04:00
John Preston
017535cf7b Handle t.me/nft/slug links. 2025-01-22 22:13:25 +04:00
John Preston
409389a994 Add gift menu with Share and Transfer. 2025-01-22 22:13:25 +04:00
John Preston
ba34d92cd3 Update API scheme to layer 197. 2025-01-22 22:13:25 +04:00
23rd
b412ee258d Respected first day of week from system in calendar box. 2025-01-22 11:23:08 +03:00
23rd
f1ffe2a641 Added icon to webview buttons from bot keyboards. 2025-01-22 10:21:22 +03:00
23rd
a13ca95894 Added initial implementation of search in section for comments. 2025-01-18 01:10:28 +03:00
23rd
0989a80a57 Added ability to provide top msg id to api message search class. 2025-01-18 01:10:28 +03:00
23rd
d72c15e9d3 Added ability to set wallpaper for bots. 2025-01-17 22:08:48 +03:00
23rd
7084cf9526 Removed ability to set wallpaper for deleted accounts. 2025-01-17 22:08:48 +03:00
23rd
67cc0ef75c Removed call button from history with deleted account. 2025-01-17 22:08:48 +03:00
23rd
75714cc358 Fixed caption for personal photo in media viewer when it's single photo. 2025-01-17 22:08:48 +03:00
23rd
75e454f3fd Fixed blinking of message preview from user's personal channel. 2025-01-17 20:17:22 +03:00
23rd
97afb4e01a Added shortcut to section of public photo settings to self userpic. 2025-01-17 17:55:22 +03:00
23rd
8fcbf43410 Fixed display of reloaded boost statistics after buying of giveaway. 2025-01-17 16:52:30 +03:00
23rd
15a834b883 Fixed text color in badges from giveaway message stickers. 2025-01-17 16:37:25 +03:00
23rd
3d8396e586 Made less strict condition to show button of removed users in chat edit. 2025-01-17 16:28:11 +03:00
23rd
3257fd364a Replaced hardcoded threshold of gigagroup conversion with server value. 2025-01-17 16:09:36 +03:00
23rd
d690af99fc Fixed ripple color for top buttons in section of affiliate programs. 2025-01-17 15:45:59 +03:00
23rd
1c28495162 Fixed boost bubble position on resize container. 2025-01-17 12:46:21 +03:00
23rd
ec82d5674f Slightly improved style of section for boost statistics. 2025-01-14 20:15:11 +03:00
23rd
4a22e76bdb Fixed opening of chat export progress from history peer menu. 2025-01-14 20:15:11 +03:00
23rd
527be95618 Improved style of labels in top bar for chat export. 2025-01-14 20:15:11 +03:00
23rd
41985c0a5f Fixed ability to cancel of loading video as part of grouped media. 2025-01-09 22:52:33 +03:00
23rd
522e45ce92 Removed trial transcribe button from long voice messages. 2025-01-09 22:52:33 +03:00
John Preston
48fb0f3b1e Version 5.10.3: Fix edit of album caption. 2025-01-09 22:54:57 +04:00
John Preston
798093c58f Merge remote-tracking branch 'origin/dev' into dev 2025-01-09 22:54:43 +04:00
doliv Debian fisso
e795dad616 Fixed crash sending files in restricted permissions Group Chat 2025-01-09 22:49:40 +04:00
John Preston
c3587ff46f Fix years in affiliate program creation. 2025-01-09 22:38:18 +04:00
John Preston
dc9fa9ccf2 Add boost group item in topic groups. 2025-01-09 22:26:22 +04:00
John Preston
97c259d928 Improve "... boosted group" phrases. 2025-01-09 22:19:34 +04:00
John Preston
afffdd5bbf Don't auto-send /start in blocked bots. 2025-01-09 22:00:49 +04:00
John Preston
199e7a1d46 Fix elision of localized Verification Codes name. 2025-01-09 21:24:14 +04:00
John Preston
a1aa315187 Version 5.10.3.
- Fix a crash in legacy group opening.
2025-01-09 18:54:09 +04:00
John Preston
8c56fddc55 Fix crash in 5.10.2. 2025-01-09 18:53:25 +04:00
John Preston
277d76df3e Version 5.10.2: Update Qt patches on Linux. 2025-01-08 17:42:51 +04:00
John Preston
1ac33d30bd Version 5.10.2: Improve gifts layout. 2025-01-08 17:36:45 +04:00
23rd
658cb438f8 Added spoiler entity to email pattern in recover box. 2025-01-08 14:25:40 +03:00
23rd
2b71625ffe Moved out part of common code for cloud password to td_ui. 2025-01-08 14:25:40 +03:00
23rd
2b13fc9a24 Slightly simplified Intro::Step::setDescriptionText. 2025-01-08 14:25:40 +03:00
23rd
9e18964e7f Added spoiler entity to email pattern in intro and cloud password. 2025-01-08 14:25:40 +03:00
23rd
43dfe559a6 Added simple context for marked text. 2025-01-08 10:58:56 +03:00
23rd
aab7ba264c Added ability to open peers in window with middle button from contacts. 2025-01-07 23:45:23 +03:00
23rd
b7162b5fad Added ability to open recent peers in window with middle button. 2025-01-07 23:45:23 +03:00
23rd
ce4a081155 Added initial ability to handle middle button in peer lists. 2025-01-07 23:45:23 +03:00
23rd
5df2a048e1 Fixed ability to copy selected text with presented compose search. 2025-01-07 23:12:49 +03:00
23rd
1b6a7fafa8 Added ability to instantly delete account in test DC. 2025-01-07 23:12:49 +03:00
23rd
2ab725e5e1 Added patch for colors of strikeout format to Linux. 2025-01-07 23:12:49 +03:00
John Preston
88a310a86e Version 5.10.2: Hide unique gift userpic. 2025-01-07 21:31:06 +04:00
John Preston
86319be256 Version 5.10.2.
- Fix double verification badge in profiles.
2025-01-07 21:23:42 +04:00
John Preston
9d68ef6421 Fix bot verification showing second check. 2025-01-07 20:59:52 +04:00
John Preston
2bb1c5d39b Show verify badge on Verifications Codes. 2025-01-07 20:59:17 +04:00
John Preston
3aa15c979d Version 5.10.1.
- Show "Boost group the send messages" information.
- Fix several gifts bugs and glitches.
- Fix several crashes.
2025-01-06 21:42:23 +04:00
John Preston
c062ba3426 Fix possible crash in sticker click. 2025-01-06 21:42:23 +04:00
John Preston
343560225c Fix crash in QR code copy on scale < 100. 2025-01-06 21:42:23 +04:00
John Preston
e0dd77f0c3 Fix possible crash in forward box. 2025-01-06 21:42:23 +04:00
John Preston
92ff07f723 Fix possible crash in message translation. 2025-01-06 21:42:23 +04:00
John Preston
a23dca080a Always show "View" button in gifts. 2025-01-06 21:42:23 +04:00
John Preston
6844f88567 Improve gift layout. 2025-01-06 21:42:23 +04:00
John Preston
e6060ea277 Improve gift corner badge display. 2025-01-06 21:42:23 +04:00
John Preston
549de7fa54 Show both verify and status emoji in opened chat. 2025-01-06 21:42:23 +04:00
John Preston
ecf9faa21d Fix usernames and QR overlap. 2025-01-06 21:42:23 +04:00
John Preston
a87ebd41e7 Fix reactions for call messages. 2025-01-06 21:42:23 +04:00
John Preston
183dd40f39 Improve gift phrases usage. 2025-01-06 21:42:23 +04:00
John Preston
c722c5c46f Improve gift pattern transparency. 2025-01-06 21:42:23 +04:00
John Preston
865200db5e Improve custom verification icon display. 2025-01-06 21:42:23 +04:00
John Preston
c3e15de759 Don't show Downloads if it's empty in search. 2025-01-06 21:42:23 +04:00
John Preston
44bfdbdc83 Add global search chat type filter. 2025-01-06 21:42:23 +04:00
John Preston
5f10c1875c Ask for boosts to unlock group restrictions. 2025-01-06 21:42:23 +04:00
23rd
a7ae7a8cda Slightly improved fade effect in price categories from star gift box. 2025-01-06 20:40:17 +03:00
23rd
706f142a98 Slightly improved ripple animation for button to gift credits. 2025-01-06 20:40:17 +03:00
23rd
08df3b2dff Removed unused badge in giveaway box. 2025-01-06 20:40:17 +03:00
23rd
14672ff145 Excluded cases of divisions by zero in dates from statistics charts. 2025-01-06 20:40:17 +03:00
Nikolai Nechaev
7fcd84d08e Fix handling of notification disappearing under cursor
Previously, notifications disappearing under cursor (e.g., because closed
manually or open from another device) did not notify the manager
properly, as the leaveEventHook was not triggered. This could lead to
notifications staying around when not supposed to (see #28813).

This commit fixes that by explicitly notifying manager when the
notification widget disappears under the cursor.

Fixes #28813.
2025-01-06 09:51:09 +04:00
dependabot[bot]
12f8686326 Bump jinja2 from 3.1.4 to 3.1.5 in /Telegram/build/docker/centos_env
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.4...3.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 09:48:00 +04:00
John Preston
aa445adfff Fix possible crash in ListWidget destructor. 2025-01-04 22:00:38 +04:00
John Preston
603aa5db5f Version 5.10: Fix build with GCC. 2025-01-02 12:23:07 +04:00
John Preston
c34289036f Version 5.10: Show folder tags premium promo. 2025-01-02 11:25:08 +04:00
John Preston
5b6bec775b Version 5.10: Fix build with Xcode. 2025-01-02 11:02:33 +04:00
John Preston
3b0fe3043f Version 5.10.
- Collectible Gifts.
- Reactions for Service Messages.
- Verification from Third Parties.
- Custom Emoji in Folder Names.
2025-01-02 10:54:50 +04:00
GitHub Action
c99165891f Update copyright year to 2025. 2025-01-02 10:48:21 +04:00
John Preston
4938b18f9d Fix display of gifts from bots. 2025-01-02 10:47:37 +04:00
John Preston
8895b4e8a3 Implement buying gifts for myself. 2024-12-31 21:40:18 +04:00
John Preston
a7321c9beb Return native verify icon to the right. 2024-12-31 17:18:59 +04:00
John Preston
c23b533704 Hide shared media layer when jumping to message. 2024-12-31 16:44:22 +04:00
John Preston
de34c75788 Support custom emoji in folder menus. 2024-12-31 16:29:10 +04:00
John Preston
06341efe0d Allow disabling animations in folder emoji. 2024-12-31 15:41:13 +04:00
John Preston
c810005f86 Don't parse empty messages in channels. 2024-12-31 13:44:52 +04:00
John Preston
cdedf283ac Show correct topic buttons in admin log. 2024-12-31 13:12:16 +04:00
John Preston
acfd92e2e6 Display emoji correctly in folder tags. 2024-12-31 13:12:16 +04:00
John Preston
51b81dba87 Fix animated side buttons with locks. 2024-12-31 13:12:16 +04:00
John Preston
7f6dfcf52f Improve new gift transactions a bit. 2024-12-31 13:12:16 +04:00
John Preston
92582d8434 Implement refunded upgraded gift view. 2024-12-31 13:12:16 +04:00
John Preston
e2bff474db Show upgraded gift from old "View" button. 2024-12-31 13:12:15 +04:00
John Preston
4f702e12b7 Improve upgrade/transfer toasts. 2024-12-31 13:12:15 +04:00
John Preston
083400d1c2 Implement unique gift transfer. 2024-12-31 13:12:15 +04:00
John Preston
7491337bfd Show forward original date for edited items. 2024-12-31 13:12:15 +04:00
John Preston
d6b833fbb2 Add icons for gift upgrading. 2024-12-31 13:12:15 +04:00
John Preston
2113a2b634 Implement nice unique gifts in the list. 2024-12-31 13:12:15 +04:00
John Preston
5df632264f Allow pay for upgrade when sending. 2024-12-31 13:12:15 +04:00
John Preston
42c350243a Implement unique gift view box. 2024-12-31 13:12:15 +04:00
John Preston
522ca3b04a Pause gift view ministars in an inactive window. 2024-12-31 13:12:15 +04:00
John Preston
2d53ec5d34 Implement unique gift view in chat. 2024-12-31 13:12:15 +04:00
John Preston
13d2f70c3a Implement upgraded unique gifts. 2024-12-31 13:12:15 +04:00
John Preston
a87d19998e Support bot verifications without modify access. 2024-12-31 13:12:15 +04:00
John Preston
6ddf241293 Update API scheme on layer 196. 2024-12-31 13:12:15 +04:00
John Preston
e43ec6c4ea Add unique gift phrases. 2024-12-31 13:12:15 +04:00
John Preston
5f3db95cbd Parse unique gift fields. 2024-12-31 13:12:15 +04:00
John Preston
d874829b06 Start animating emoji in filter titles. 2024-12-31 13:12:15 +04:00
John Preston
6cfbccd955 Handle report_delivery_until_date. 2024-12-25 11:09:35 +04:00
John Preston
0d821c3630 Implement simple bot verification management. 2024-12-25 11:09:35 +04:00
John Preston
b61e3b580d Return chat type icons. 2024-12-25 11:09:35 +04:00
John Preston
5c301353ec Improve verified badge display. 2024-12-25 11:09:35 +04:00
John Preston
0363421862 Apply server side bot verifications. 2024-12-25 11:09:35 +04:00
John Preston
6f18b9b691 Proof-of-concept custom verify badges. 2024-12-25 11:09:35 +04:00
John Preston
35e40be550 Support service messages reactions. 2024-12-25 11:09:35 +04:00
John Preston
c1528f532e Update API scheme to layer 196. 2024-12-25 11:09:35 +04:00
John Preston
4505a2bf2d Beta version 5.9.2.
- Fix some jump-to-message highlightings.
- Fix some long round video messages sending.
- Fix possible crash in global photos / videos.
- Fix streaming starting for some large video files.
- Fix possible drop of top peers / recent chats cache.
- Fix possible crashes in audio on macOS (rollback OpenAL).
2024-12-24 10:44:15 +04:00
John Preston
a314380b08 Rollback OpenAL on macOS. 2024-12-23 22:51:33 +04:00
John Preston
0c07a015c6 Always show VIEW DISCUSSION from comments. 2024-12-23 22:46:43 +04:00
John Preston
a0c7697280 Fix affiliate program ending confirmation box.
Fixes #28780.
2024-12-23 22:46:42 +04:00
John Preston
04023da723 Highlight search query part in separate window chat. 2024-12-23 21:29:40 +04:00
John Preston
13ea045055 Fix collision of dice_sticker last frames. 2024-12-23 21:29:40 +04:00
John Preston
f03351d112 Allow filter gifts by "In Stock". 2024-12-23 21:29:40 +04:00
John Preston
48d9f10f5b Improve message part highlighting. 2024-12-23 21:29:39 +04:00
John Preston
2b53df98cd Fix long message parts highlighting in topics. 2024-12-23 21:29:34 +04:00
John Preston
99a7a13218 Always send video messages as not "big" files. 2024-12-23 21:27:12 +04:00
John Preston
2d2d4ac002 Reduce video message bitrate so they always fit. 2024-12-23 21:27:12 +04:00
John Preston
d12e8023e3 Fix scheduled replies loading. 2024-12-23 21:27:12 +04:00
John Preston
17181cee8f Fix possible crash in Forward folders switch. 2024-12-23 21:27:12 +04:00
23rd
a74ee911b3 Removed chats filters strip from forward box while search. 2024-12-23 11:02:09 +04:00
Ilya Fedin
b0b37172ce Fix the naming of TitleControlsLayout static methods 2024-12-23 11:01:35 +04:00
Pavel Zolotarevskiy
cccf048e3f Don't export a duplicate "text" field on star gift
Fixes #28781
2024-12-21 22:32:12 +04:00
John Preston
82e890746b Fix possible crash in global media search. 2024-12-20 21:07:20 +04:00
John Preston
188d65d700 Improve streaming of large files. 2024-12-20 21:07:20 +04:00
John Preston
4569f93e70 Fix username disappearance in My Profile. 2024-12-20 21:07:20 +04:00
23rd
bcd1d8461f Added ability to open context menu for active account from main menu. 2024-12-20 19:33:06 +03:00
23rd
183a9139f9 Moved out ability to mark as read all chats from hidden shortcut. 2024-12-20 19:33:06 +03:00
23rd
80a1e6ecf3 Fixed ability to mark as read all chats for wrong account. 2024-12-20 19:33:06 +03:00
23rd
aa1f8cfb8f Fixed display at least one injected sponsored message. 2024-12-20 15:53:43 +03:00
23rd
8060691f3d Fixed preview of chats filters in filter link box when window is small. 2024-12-19 15:54:26 +03:00
Ilya Fedin
bf26de495a Adapt to TitleControlsLayout change 2024-12-19 15:59:25 +04:00
Ilya Fedin
73b3f7e298 Adapt to TitleControlsOnLeft change 2024-12-19 15:59:25 +04:00
Ilya Fedin
22191649aa Update lib_base and lib_ui 2024-12-19 15:59:25 +04:00
bitxer
0557907310 Enhance experimental setting description 2024-12-19 15:49:24 +04:00
bitxer
0f283c484d Added experimental settings to prefer ipv6 when it is available 2024-12-19 15:49:24 +04:00
John Preston
e33ca9d316 Fix top/recent peers cache write error. 2024-12-19 13:51:47 +04:00
John Preston
f93f4c72f7 Beta version 5.9.1.
- Add global media overview tabs in chats search.
- Add main menu "My Profile" with my stories and gifts access.
- Highlight some of search query on result message open.
- Fix highlighting quotes from bottom parts of long messages.
- Allow forward and reply bars together.
- Make gift price categories scrollable.
- Auto-send deep-link /start in existing bot chats.
2024-12-18 19:12:12 +04:00
23rd
f0b9bc10c2 Added fade effect to price categories in star gift box. 2024-12-18 17:39:46 +03:00
John Preston
f583879aee Update OpenAL to 1.24.1 on Windows/macOS. 2024-12-18 18:22:54 +04:00
23rd
7ea6c6c84b Fixed width of username label with button for QR in profiles. 2024-12-18 16:21:07 +03:00
23rd
2532a0ff59 Moved out to single place ministars creation in top of box. 2024-12-18 15:47:57 +03:00
23rd
c3f354826d Fixed text color of custom icon in some phrases with links. 2024-12-18 15:01:57 +03:00
23rd
6d1e421ad7 Fixed color of strikeout format when spellcheck underline is present. 2024-12-18 11:54:26 +03:00
23rd
29b0055e39 Slightly improved some phrases on error while add participant to chat. 2024-12-18 11:03:44 +03:00
Ilya Fedin
2cb20fe342 Switch macOS packaged action to latest ffmpeg 2024-12-18 10:53:43 +04:00
Ilya Fedin
fc97fa4415 Fix snap action 2024-12-18 09:56:23 +04:00
Ilya Fedin
876a50f759 Update OpenAL to 1.24.1 on Linux 2024-12-18 09:55:58 +04:00
Ilya Fedin
eb0d2868f5 Expand "always run in background" behavior from GNOME/Pantheon to all Linux
Right now it checks the title controls layout that is typically set only by gtk based DEs and KDE matching the GNOME's and Pantheon's defaults.

There are more and more reports about window manager not to supporting both tray and minimization out of the box and title controls layout seem to typically be either unset or set to nothing leaving users with no way to run tdesktop with no window open.
2024-12-18 09:55:35 +04:00
John Preston
e215d5bc64 Fix build with Xcode. 2024-12-17 21:27:08 +04:00
John Preston
3f0d687656 Add cache for global media search requests. 2024-12-17 21:17:14 +04:00
John Preston
d59eb8e731 Support global media in chats search. 2024-12-17 21:17:14 +04:00
John Preston
04e9eed88d Reuse filters slider scroll for search. 2024-12-17 21:17:14 +04:00
John Preston
5072e95f16 Support folders strip touch-screen scroll. 2024-12-17 21:17:14 +04:00
John Preston
a2b8366477 Show forward original date in context menu. 2024-12-17 21:17:14 +04:00
John Preston
e9a6bee046 Fix sending old topic messages. 2024-12-17 21:13:29 +04:00
John Preston
080a8d7ee5 Fix "Open" miniapp button antialiasing. 2024-12-17 21:13:29 +04:00
John Preston
f94fd3118b Add "My Profile" instead of "My Stories". 2024-12-17 21:13:29 +04:00
John Preston
8ddb13d6e2 Show verified/premium badge in chat preview. 2024-12-17 21:13:29 +04:00
John Preston
c6cf8be8d4 Redesign gift visibility toggle. 2024-12-17 21:13:29 +04:00
John Preston
e92270a9ab Add "View Discussion" button to third column. 2024-12-17 21:13:29 +04:00
John Preston
65d6636a41 Add special toast title for anonymous stars. 2024-12-17 21:13:29 +04:00
John Preston
4701badb2a Highlight text in bottom of a long bubble. 2024-12-17 21:13:29 +04:00
John Preston
3565215c81 Highlight word from search query. 2024-12-17 21:13:29 +04:00
John Preston
3957fea5e4 Send start in bots auto in existing bot chats. 2024-12-17 21:13:29 +04:00
John Preston
10f1ae152d Fix crash in sending games from inline bots.
Regression was introduced in 2d1fb0562d.
2024-12-17 21:13:29 +04:00
John Preston
eb29b6bffe Allow forward+reply, options in single box. 2024-12-17 21:13:29 +04:00
John Preston
d157eb0b6e Enter selects from-row in reply-in-another-chat. 2024-12-17 21:13:29 +04:00
John Preston
0045eb4598 Make price categories scrollable. 2024-12-17 21:13:27 +04:00
23rd
b61c66c385 Fixed display of title widgets in separate panel while show animation. 2024-12-16 06:46:36 +03:00
23rd
56d6c4eb30 Fixed mouse track on right button for bots when there is unread badge. 2024-12-16 05:45:56 +03:00
23rd
a6030d708d Fixed display of unread state in chats filters strip after reorder. 2024-12-16 05:45:56 +03:00
23rd
683c3c4f36 Fixed Escape hotkey in info sections with search field. 2024-12-16 05:45:56 +03:00
23rd
bd084f9181 Fixed blink of submenu in profile section on section destroy. 2024-12-16 05:45:56 +03:00
23rd
fef133bf0a Fixed incorrect action type of userpic change with image from clipboard.
Fixed #28731.
2024-12-16 05:45:56 +03:00
23rd
15c226e6cf Removed confusing lock state from button in earn out section. 2024-12-16 05:45:56 +03:00
23rd
84f111d641 Fixed unreachable bottom button from contact media in some cases. 2024-12-16 05:45:55 +03:00
23rd
18c1e7ac60 Removed animation cache from dialogs widget on instant clear search. 2024-12-16 05:45:55 +03:00
Daniel Novomeský
ee6dbdced6 Update libjxl and libheif on Linux 2024-12-14 17:50:51 +04:00
Daniel Novomeský
cb443d797d Update kimageformats submodule 2024-12-14 17:50:51 +04:00
Daniel Novomeský
5a6497ec70 Upgrade libheif to 1.18.2, upgrade libjxl to 0.11.1 2024-12-14 17:50:51 +04:00
Andrey Egorov
893ca8bcbd Residence country instead of Citizenship 2024-12-06 18:29:17 +04:00
John Preston
f91e4c8b69 Version 5.9.
- Affiliate programs for bots.
- Add option to show folder tags in chats list.
2024-12-04 19:03:17 +04:00
Ilya Fedin
f7c777d07d Add branding colors to metainfo 2024-12-04 19:03:11 +04:00
John Preston
12a8e8616c Fix giveaway sticker badge. 2024-12-04 13:51:20 +04:00
John Preston
2fbf7e8504 Fix build with Xcode. 2024-12-04 13:51:20 +04:00
John Preston
6864e6d5bf Improve phrase for revoked starref link. 2024-12-04 13:51:20 +04:00
John Preston
09b4e0e21b Use nice format for numbers. 2024-12-04 13:51:20 +04:00
John Preston
f381005184 Add "New" badge for affiliate programs. 2024-12-04 13:51:20 +04:00
John Preston
42a2de4bf0 Add a NEW badge to "Earn Stars". 2024-12-04 13:51:20 +04:00
John Preston
1fd1e34844 Add link icon to connected starref programs. 2024-12-04 13:51:20 +04:00
John Preston
64dbbd7d09 Green badges for commissions. 2024-12-04 13:51:20 +04:00
John Preston
c137e577dc Allow sorting suggested starref programs. 2024-12-04 13:51:20 +04:00
John Preston
f592a9202f Improve arrow down in choose recipient box. 2024-12-04 13:51:20 +04:00
John Preston
cdc24d2e57 Fix states in joined/suggested lists. 2024-12-04 13:51:20 +04:00
John Preston
b8bf3f6520 Allow changing the recipients. 2024-12-04 13:51:20 +04:00
John Preston
82cec83d87 "Add {bot}" button in existing starrefs list. 2024-12-04 13:51:20 +04:00
John Preston
1e14667006 Add affiliate program point to bot info. 2024-12-04 13:51:20 +04:00
John Preston
6539d14852 Create/Update confirm box for the starref. 2024-12-04 13:51:20 +04:00
John Preston
400df0f980 Add referral link preview to the box. 2024-12-04 13:51:19 +04:00
John Preston
4cafb3f966 Make nicer footer in starref boxes. 2024-12-04 13:51:19 +04:00
John Preston
d8892c4eb4 Nice referral link icon in the box. 2024-12-04 13:51:19 +04:00
John Preston
1ebd25e76e Start/Update/End toasts for starref programs. 2024-12-04 13:51:19 +04:00
John Preston
ca89aa8377 Confirm box for revoke link / end program. 2024-12-04 13:51:19 +04:00
John Preston
ad6272bfe5 Show correct error on stopped starref. 2024-12-04 13:51:19 +04:00
John Preston
b401c37c39 Correctly show commission in stars stats. 2024-12-04 13:51:19 +04:00
John Preston
552dd318cd Implement nice starref start button. 2024-12-04 13:51:19 +04:00
John Preston
a97880132a Respect appconfig starref restrictions. 2024-12-04 13:51:19 +04:00
John Preston
89058c63c8 Check appconfig start ref prefixes. 2024-12-04 13:51:19 +04:00
John Preston
747e417809 Apply connected programs in realtime. 2024-12-04 13:51:19 +04:00
John Preston
fd26e1618c Add "Affiliate programs" to Manage Channel. 2024-12-04 13:51:19 +04:00
John Preston
86ea760011 Show list of programs in View Existing. 2024-12-04 13:51:19 +04:00
John Preston
824237deb3 Nice starref link box. 2024-12-04 13:51:19 +04:00
John Preston
ca8c70cc95 Fix creating default starref program. 2024-12-04 13:51:19 +04:00
John Preston
46fcc695a5 Add starref entry point to my/bot stars page. 2024-12-04 13:51:19 +04:00
John Preston
0e866a0266 Nice starref join confirmation box. 2024-12-04 13:51:19 +04:00
John Preston
63c36f5907 Implement nice limited duration slider. 2024-12-04 13:51:19 +04:00
John Preston
5299500d78 Implement nice commission slider. 2024-12-04 13:51:19 +04:00
John Preston
3b3d1aa9cc Update some icons for starref sections. 2024-12-04 13:51:19 +04:00
John Preston
62d2346471 Initial starref programs list implementation. 2024-12-04 13:51:19 +04:00
John Preston
1e15764bb9 Initial starref setup section implementation. 2024-12-04 13:51:19 +04:00
John Preston
a6bfd35f1a Add phrases for star referrals. 2024-12-04 13:51:18 +04:00
John Preston
3296efe46b Use correct format for double formatting. 2024-12-04 13:51:18 +04:00
John Preston
51ddfbc340 Update API scheme to layer 195. 2024-12-04 13:51:18 +04:00
23rd
42142d819a Added support of media with spoiler to export to JSON. 2024-12-04 11:48:07 +03:00
23rd
bbf9d523a6 Fixed incorrect calculation of title width in sponsored messages. 2024-12-04 11:48:07 +03:00
23rd
721877e10a Removed redundant special tab mode from PeerListBox. 2024-12-04 11:48:07 +03:00
23rd
a9e95a128f Fixed display of filters tabs on some cases of first activating. 2024-12-04 11:48:07 +03:00
John Preston
2b920eaa87 Use new Vazirmatn repository URL.
Co-authored-by: ilya-fedin <fedin-ilja2010@ya.ru>
2024-12-04 10:21:37 +04:00
Amir Hossein "Amiria" Maher
a3ec759e62 Update from 'vazir' to 'vazirmatn' 2024-12-04 10:21:37 +04:00
Ilya Fedin
3661442acd Add more screenshots to metainfo 2024-12-04 10:14:58 +04:00
Ilya Fedin
f232d329c5 Add transparency to the preview image 2024-12-04 10:14:18 +04:00
Ilya Fedin
ac5cf3bd80 Update summary in metainfo and comment in desktop file 2024-12-04 10:11:39 +04:00
Ilya Fedin
ac13ac7a2c Remove "Desktop" from application name on Linux 2024-12-04 10:08:04 +04:00
John Preston
0bccb35cb0 Use "Open" non-upper-case. 2024-12-03 17:26:46 +04:00
23rd
18d9484ab1 Removed Ui::show from LocalStorageBox. 2024-12-03 17:26:46 +04:00
23rd
fe7c06bc84 Added Enter shortcut to box for adding or removing of shared filter. 2024-12-03 17:26:46 +04:00
23rd
b6fb3bbf1d Fixed build of shortcuts settings included with another Session declare. 2024-12-03 17:26:46 +04:00
23rd
927d7a3aeb Renamed sessions_box to settings_active_sessions. 2024-12-03 17:26:46 +04:00
23rd
979973745b Fixed build of notifications type included with another Session declare. 2024-12-03 17:26:46 +04:00
23rd
afab863f11 Fixed non-closed last tag for inline buttons in HTML export. 2024-12-03 17:26:46 +04:00
23rd
168162c174 Fixed color of float button from sponsored message bar in new window. 2024-12-03 17:26:46 +04:00
23rd
2b122087c4 Re-fixed focus capture from compose search widget. 2024-12-03 17:26:46 +04:00
23rd
043d97cfdf Moved out SearchFieldController to td_ui. 2024-12-03 17:26:46 +04:00
GitHub Action
794818953d Update User-Agent for DNS to Chrome 131.0.0.0. 2024-12-03 17:22:11 +04:00
Ilya Fedin
783570fe9f Update Qt 6.8.0 -> 6.8.1 2024-12-03 12:15:46 +04:00
John Preston
b1e2a4243e Fix join requests list for legacy groups. 2024-11-29 20:18:31 +04:00
John Preston
b347308137 Show bot app name in title. 2024-11-29 20:18:31 +04:00
John Preston
b3c8a79946 Use langpack-ed about for Verification Codes. 2024-11-29 20:18:31 +04:00
23rd
9822c56f1a Removed display of right button for bots when there is unread badge. 2024-11-29 16:03:42 +03:00
23rd
cdd7ff5c6d Fixed count of current size for non-thumbed media with long bottom info. 2024-11-29 15:56:31 +03:00
23rd
5aba2f25cc Fixed drawing of currency icon with non-default scale in profile. 2024-11-29 15:56:31 +03:00
John Preston
96398daa78 Beta version 5.8.5: Fix build with Xcode. 2024-11-29 11:25:29 +04:00
John Preston
61ceb66415 Beta version 5.8.5.
- Fix pinned chats in folders.
- Fix emoji in folder tags.
- Fix several crashes.
2024-11-29 10:52:14 +04:00
John Preston
b4f173cdb3 Fix possible crash in ads preloading. 2024-11-29 10:33:29 +04:00
John Preston
03e4592082 Fix search in group/channel requests list. 2024-11-29 10:33:29 +04:00
John Preston
cf2dbe50a1 Fix crash in narrow column reactions view. 2024-11-29 10:33:29 +04:00
John Preston
e5bb5b75fe Fix crash in webview teardown on Windows. 2024-11-29 10:33:29 +04:00
23rd
cffce47eb1 Fixed emoji in chats filter tags. 2024-11-29 08:31:49 +03:00
23rd
ca0adba6cf Fixed pinned chats in chats filters.
Regression was introduced in e3465da979.
2024-11-28 22:08:22 +03:00
John Preston
8502b90c25 Beta version 5.8.4.
- Add option to show folder tags in chats list.
- Count group with topics as one chat in folder unread counter.
2024-11-28 21:10:45 +04:00
John Preston
cef43e7f06 Fix build with Xcode. 2024-11-28 21:10:45 +04:00
John Preston
18aaf3cc93 Fix build for MSVC. 2024-11-28 20:33:13 +04:00
John Preston
f13740cb7f Update lib_webview. 2024-11-28 20:27:35 +04:00
Daniel Novomeský
bddac79b40 Update kimageformats submodule 2024-11-28 20:26:18 +04:00
John Preston
e52baf555f Update video qualities list. 2024-11-28 20:21:26 +04:00
John Preston
475dec3014 Allow adding media to text with a link preview. 2024-11-28 20:21:26 +04:00
23rd
f2ed649694 Fixed focus capture from compose search widget. 2024-11-28 14:37:31 +03:00
23rd
e82506e0c4 Added ministars to button in service messages for premium requirements. 2024-11-28 12:28:12 +03:00
23rd
3071daa6f3 Replaced header style in statistics sections with classic subsections. 2024-11-27 15:58:54 +03:00
23rd
5d71286000 Fixed display of title in sponsored messages with shorter description. 2024-11-27 15:01:46 +03:00
23rd
339d7be9c1 Removed unused include directives from Application. 2024-11-27 14:38:06 +03:00
23rd
7f85494b1d Moved out UnreadState to td_ui. 2024-11-27 14:27:31 +03:00
23rd
a405794a03 Allowed to display of hundreds digit in unread badge of filters. 2024-11-27 12:25:18 +03:00
23rd
4e8e096fdb Removed display of corner badges in narrowed mode when entry has unread. 2024-11-27 12:22:33 +03:00
23rd
eb821c1f36 Improved display of unread badges in dialogs list with narrowed mode. 2024-11-27 11:58:34 +03:00
23rd
bf07b832f0 Replaced header in credits settings for credits history with subtitle. 2024-11-27 11:27:59 +03:00
23rd
5934614edb Fixed counting of unread topics from unread state in filters. 2024-11-27 11:27:59 +03:00
23rd
96b5c1d3d3 Added icons and color indices to dialogs menu to choose chats filters. 2024-11-27 11:27:59 +03:00
23rd
cb2972b145 Moved out fixing of ampersand from text in actions to single place. 2024-11-27 11:27:59 +03:00
23rd
cd5a1980c9 Fixed display of button for earn out when withdrawal is locked. 2024-11-27 11:27:59 +03:00
23rd
0e35107e17 Added ability to create new filter with selected dialog from menu. 2024-11-27 11:27:59 +03:00
23rd
10b026dfe0 Added ability to open peer in new window from short info box. 2024-11-27 11:27:59 +03:00
23rd
743c3c54a7 Added message counter to each peer in moderate box. 2024-11-27 11:27:59 +03:00
23rd
489c86dad8 Added ability to disable debug logs even for debug builds. 2024-11-27 11:27:59 +03:00
23rd
a9824fde91 Added right button for bots in list from recent dialogs. 2024-11-27 11:27:59 +03:00
23rd
6c62bbe6fb Added right button for bots in dialogs list in filtered mode. 2024-11-27 11:27:59 +03:00
23rd
8a3aa660cb Added initial implementation of right button for bots in dialogs list. 2024-11-27 11:27:59 +03:00
23rd
14cc7789d9 Allowed to choose filters from any profile of peers in chats list. 2024-11-27 11:27:59 +03:00
23rd
728d9a0993 Added ability to remove peer from chats filters when leave it. 2024-11-27 11:27:59 +03:00
23rd
aa8d543ed8 Fixed ability to remove peer from chats filter to make it empty. 2024-11-27 11:27:59 +03:00
23rd
b335981621 Removed duplicated search of correspond chat filter for tags in dialogs. 2024-11-27 11:27:59 +03:00
23rd
9d5ca1252a Added ability to pass preloaded chats filter tags toggle on logging in. 2024-11-27 11:27:59 +03:00
23rd
d5dbbd566f Fixed display tags with NoRead flag while history has fake unread state. 2024-11-27 11:27:59 +03:00
23rd
5362d54ab6 Fixed display of chats filter tag for active dialog rows. 2024-11-27 11:27:59 +03:00
23rd
1f162aa2a0 Fixed tags display when color of chats filter tag is toggled. 2024-11-27 11:27:59 +03:00
23rd
4a19f193ce Added float preview of color for chats filter to settings. 2024-11-27 11:27:59 +03:00
23rd
cfc40ee966 Added ability to set color for chats filter from settings. 2024-11-27 11:27:59 +03:00
23rd
6baba5a7b2 Added ability to disable chats filters tags from settings. 2024-11-27 11:27:59 +03:00
23rd
ba082081b3 Added api support for enabled tags of chats filters. 2024-11-27 11:27:59 +03:00
23rd
e314c68a56 Optimized height refresh of chats list for chat filters with rules. 2024-11-27 11:27:59 +03:00
23rd
889fcb3939 Optimized height refresh of non-main list on receiving chats filters. 2024-11-27 11:27:59 +03:00
23rd
632abd2225 Optimized height refresh of main list on receiving chats filters. 2024-11-27 11:27:59 +03:00
23rd
e3465da979 Switched order of data filter applying of changes from api. 2024-11-27 11:27:59 +03:00
23rd
f4523b2dba Added initial implementation of filter tags to dialog rows. 2024-11-27 11:27:59 +03:00
23rd
0d58b32914 Added ability to recount height of dialog rows by chats filter id. 2024-11-27 11:27:59 +03:00
23rd
aea2d34080 Added styles for dialog rows with tags. 2024-11-26 08:38:40 +03:00
23rd
d5dbde0a24 Added ability to cache filter colors in dialog entries. 2024-11-26 08:38:40 +03:00
23rd
f888008dc1 Removed counting of unread topics from unread state in filters. 2024-11-25 17:45:56 +03:00
23rd
021a5881c2 Improved display of history begin for channels with enabled auto-delete. 2024-11-23 14:10:04 +03:00
23rd
3e49b45418 Added chats filters list to each exception row in edit chats filter box. 2024-11-23 10:28:04 +03:00
23rd
23e22650f9 Added ability to choose filters for channel from its profile. 2024-11-23 10:28:04 +03:00
John Preston
85267a921e Version 5.8.3.
- Ctrl+Click on Reply in groups to reply in another chat.
- Fix freeze on forward messages box opening.
- Improve phrases in bot subscriptions.
- Several bugfixes.
2024-11-23 11:11:39 +04:00
John Preston
2c7089d47f Ctrl+Reply+Click replies in another chat. 2024-11-23 10:47:36 +04:00
John Preston
edc6cfe210 Replace non-started calls. 2024-11-23 10:04:55 +04:00
John Preston
03b6e2df17 Don't confirm each bot-url webapp open. 2024-11-23 09:37:26 +04:00
John Preston
5309138980 Support display of messageActionPaymentSentMe. 2024-11-23 09:36:09 +04:00
John Preston
a5e927ea4f Fix build for Windows. 2024-11-23 08:59:53 +04:00
23rd
ec83f4ae72 Removed unnecessary rebuild of chats filters strip when order is same. 2024-11-23 06:01:23 +03:00
23rd
71efd95136 Slightly shifted selection marks along x. 2024-11-23 05:28:36 +03:00
23rd
0c21eba1f8 Fixed display of preview for sticker packs. 2024-11-23 05:11:13 +03:00
23rd
2ae4e15f87 Fixed ability to copy transactions id from credits history entries.
Regression was introduced in 77e7796b3f.
2024-11-21 16:45:00 +04:00
23rd
d69905feae Added ability to subscribe again via slug from subscriptions list. 2024-11-21 16:45:00 +04:00
23rd
f795d56b2a Handled subscriptions list changes in settings section for credits. 2024-11-21 16:45:00 +04:00
23rd
4608ffcab4 Added weak pointer for rebuilder of subscription list to Data::Session. 2024-11-21 16:45:00 +04:00
23rd
9824df5f2a Added phrases for business subscriptions. 2024-11-21 16:45:00 +04:00
23rd
27a5ba4681 Added top close button to ReceiptCreditsBox. 2024-11-21 16:45:00 +04:00
23rd
73936dca73 Added mini stars to subscriptions with details in ReceiptCreditsBox. 2024-11-21 16:45:00 +04:00
23rd
213274e96c Replaced style of button to cancel subscription with hyper link. 2024-11-21 16:45:00 +04:00
23rd
7518361266 Improved style of ReceiptCreditsBox for subscription with detailed info. 2024-11-21 16:45:00 +04:00
23rd
f7aaece2f7 Extended width of ReceiptCreditsBox. 2024-11-21 16:45:00 +04:00
23rd
fbce06cb26 Added support of subscription status when it is cancelled by bot. 2024-11-21 16:45:00 +04:00
23rd
ccc0bf57a1 Added support of items with different heights in list of subscriptions. 2024-11-21 16:45:00 +04:00
23rd
ee29deee47 Improved display of detailed subscriptions in list of credits history. 2024-11-21 16:45:00 +04:00
23rd
17e54104a9 Added api support of subscription details. 2024-11-21 16:45:00 +04:00
23rd
479e369d29 Replaced list of credits subscriptions with peer list with widgets. 2024-11-21 16:45:00 +04:00
23rd
3042fb7299 Added initial very limited implementation of peer list with widgets. 2024-11-21 16:45:00 +04:00
23rd
36fa455aad Added third line to entries of list for credits history. 2024-11-21 16:45:00 +04:00
23rd
1c64e90537 Split creation of button for pagination in statistics lists. 2024-11-21 16:45:00 +04:00
23rd
09643aef82 Added support of credits subscriptions to send credits box. 2024-11-21 16:45:00 +04:00
23rd
03d9fb4115 Added api support of subscription period in credits invoices. 2024-11-21 16:45:00 +04:00
23rd
81bea04db0 Moved out peer bubble widget to separated file. 2024-11-21 16:45:00 +04:00
John Preston
9211e338e7 Fix tooltip render glitches on macOS. 2024-11-21 16:32:32 +04:00
John Preston
23464ac55f Don't repeat premium effect on chat reopen. 2024-11-21 13:13:06 +04:00
John Preston
af78e4ea29 Show scheduled limit error. 2024-11-21 13:10:59 +04:00
John Preston
e3d9216b10 Fix switch_inline_query with same_peer in topics.
Fixes #27290.
2024-11-21 11:41:46 +04:00
John Preston
9532a2e3da Fix emoji status set cancel.
Fixes #28674.
Fixes https://bugs.telegram.org/c/45691.
2024-11-21 10:01:31 +04:00
23rd
e70f50d837 Changed engine of chats filters in forward box with restoring state. 2024-11-20 16:37:49 +03:00
23rd
2dfa58aae2 Moved out some constant color indices to separated style file. 2024-11-20 16:37:49 +03:00
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
799 changed files with 44622 additions and 10143 deletions

32
.devcontainer.json Normal file
View File

@@ -0,0 +1,32 @@
{
"name": "CentOS",
"image": "tdesktop:centos_env",
"customizations": {
"vscode": {
"settings": {
"C_Cpp.intelliSenseEngine": "disabled",
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/out"
],
"cmake.generator": "Ninja Multi-Config",
"cmake.buildDirectory": "${workspaceFolder}/out"
},
"extensions": [
"ms-vscode.cpptools-extension-pack",
"llvm-vs-code-extensions.vscode-clangd",
"TheQtCompany.qt",
"ms-python.python",
"ms-azuretools.vscode-docker",
"eamodio.gitlens"
]
}
},
"capAdd": [
"SYS_PTRACE"
],
"securityOpt": [
"seccomp=unconfined"
],
"workspaceMount": "source=${localWorkspaceFolder},target=/usr/src/tdesktop,type=bind,consistency=cached",
"workspaceFolder": "/usr/src/tdesktop"
}

View File

@@ -83,6 +83,7 @@ jobs:
fi
docker run --rm \
-u $(id -u) \
-v $PWD:/usr/src/tdesktop \
-e CONFIG=Debug \
tdesktop:centos_env \
@@ -114,8 +115,8 @@ jobs:
if: env.UPLOAD_ARTIFACT == 'true'
run: |
cd $REPO_NAME/out/Debug
sudo mkdir artifact
sudo mv {Telegram,Updater} artifact/
mkdir artifact
mv {Telegram,Updater} artifact/
- uses: actions/upload-artifact@v4
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.

View File

@@ -69,7 +69,7 @@ jobs:
run: |
brew update
brew upgrade || true
brew install ada-url autoconf automake boost cmake ffmpeg@6 libtool openal-soft openh264 openssl opus ninja pkg-config python qt yasm xz
brew install ada-url autoconf automake boost cmake ffmpeg 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

View File

@@ -57,14 +57,14 @@ jobs:
sudo iptables -P FORWARD ACCEPT
sudo snap install --classic snapcraft
sudo usermod -aG lxd $USER
sudo snap run lxd init --auto
sudo snap run lxd waitready
sudo lxd init --auto
sudo lxd waitready
- name: Free up some disk space.
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
- name: Telegram Desktop snap build.
run: sg lxd -c 'snap run snapcraft --verbosity=debug'
run: sudo -u $USER snap run snapcraft --verbosity=debug
- name: Move artifact.
if: env.UPLOAD_ARTIFACT == 'true'

1
.gitignore vendored
View File

@@ -19,6 +19,7 @@ Release/
ipch/
.vs/
.vscode/
.cache/
/Telegram/log.txt
/Telegram/data

2
LEGAL
View File

@@ -1,7 +1,7 @@
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
Copyright (c) 2014-2024 The Telegram Desktop Authors.
Copyright (c) 2014-2025 The Telegram Desktop Authors.
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -58,7 +58,7 @@ Version **1.8.15** was the last that supports older systems
* Guideline Support Library ([MIT License](https://github.com/Microsoft/GSL/blob/master/LICENSE))
* Range-v3 ([Boost License](https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt))
* Open Sans font ([Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html))
* Vazir font ([SIL Open Font License 1.1](https://github.com/rastikerdar/vazir-font/blob/master/OFL.txt))
* Vazirmatn font ([SIL Open Font License 1.1](https://github.com/rastikerdar/vazirmatn/blob/master/OFL.txt))
* Emoji alpha codes ([MIT License](https://github.com/emojione/emojione/blob/master/extras/alpha-codes/LICENSE.md))
* xxHash ([BSD License](https://github.com/Cyan4973/xxHash/blob/dev/LICENSE))
* QR Code generator ([MIT License](https://github.com/nayuki/QR-Code-generator#license))

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
@@ -244,6 +246,8 @@ PRIVATE
boxes/peers/prepare_short_info_box.h
boxes/peers/replace_boost_box.cpp
boxes/peers/replace_boost_box.h
boxes/peers/verify_peers_box.cpp
boxes/peers/verify_peers_box.h
boxes/about_box.cpp
boxes/about_box.h
boxes/about_sponsored_box.cpp
@@ -292,6 +296,8 @@ PRIVATE
boxes/peer_list_box.h
boxes/peer_list_controllers.cpp
boxes/peer_list_controllers.h
boxes/peer_list_widgets.cpp
boxes/peer_list_widgets.h
boxes/peer_lists_box.cpp
boxes/peer_lists_box.h
boxes/passcode_box.cpp
@@ -318,8 +324,6 @@ PRIVATE
boxes/send_gif_with_caption_box.h
boxes/send_files_box.cpp
boxes/send_files_box.h
boxes/sessions_box.cpp
boxes/sessions_box.h
boxes/share_box.cpp
boxes/share_box.h
boxes/star_gift_box.cpp
@@ -328,6 +332,8 @@ PRIVATE
boxes/sticker_set_box.h
boxes/stickers_box.cpp
boxes/stickers_box.h
boxes/transfer_gift_box.cpp
boxes/transfer_gift_box.h
boxes/translate_box.cpp
boxes/translate_box.h
boxes/url_auth_box.cpp
@@ -466,6 +472,7 @@ PRIVATE
core/sandbox.h
core/shortcuts.cpp
core/shortcuts.h
core/stars_amount.h
core/ui_integration.cpp
core/ui_integration.h
core/update_checker.cpp
@@ -623,6 +630,7 @@ PRIVATE
data/data_shared_media.h
data/data_sparse_ids.cpp
data/data_sparse_ids.h
data/data_star_gift.h
data/data_statistics.h
data/data_stories.cpp
data/data_stories.h
@@ -636,6 +644,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
@@ -791,6 +801,8 @@ PRIVATE
history/view/media/history_view_story_mention.h
history/view/media/history_view_theme_document.cpp
history/view/media/history_view_theme_document.h
history/view/media/history_view_unique_gift.cpp
history/view/media/history_view_unique_gift.h
history/view/media/history_view_userpic_suggestion.cpp
history/view/media/history_view_userpic_suggestion.h
history/view/media/history_view_web_page.cpp
@@ -913,6 +925,12 @@ PRIVATE
info/bot/earn/info_bot_earn_list.h
info/bot/earn/info_bot_earn_widget.cpp
info/bot/earn/info_bot_earn_widget.h
info/bot/starref/info_bot_starref_common.cpp
info/bot/starref/info_bot_starref_common.h
info/bot/starref/info_bot_starref_join_widget.cpp
info/bot/starref/info_bot_starref_join_widget.h
info/bot/starref/info_bot_starref_setup_widget.cpp
info/bot/starref/info_bot_starref_setup_widget.h
info/channel_statistics/boosts/create_giveaway_box.cpp
info/channel_statistics/boosts/create_giveaway_box.h
info/channel_statistics/boosts/giveaway/giveaway_list_controllers.cpp
@@ -935,6 +953,13 @@ PRIVATE
info/downloads/info_downloads_provider.h
info/downloads/info_downloads_widget.cpp
info/downloads/info_downloads_widget.h
info/global_media/info_global_media_widget.cpp
info/global_media/info_global_media_widget.h
info/global_media/info_global_media_inner_widget.cpp
info/global_media/info_global_media_inner_widget.h
info/global_media/info_global_media_provider.cpp
info/global_media/info_global_media_provider.h
info/media/info_media_buttons.cpp
info/media/info_media_buttons.h
info/media/info_media_common.cpp
info/media/info_media_common.h
@@ -982,12 +1007,16 @@ 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
info/settings/info_settings_widget.h
info/similar_channels/info_similar_channels_widget.cpp
info/similar_channels/info_similar_channels_widget.h
info/similar_peers/info_similar_peers_widget.cpp
info/similar_peers/info_similar_peers_widget.h
info/statistics/info_statistics_common.h
info/statistics/info_statistics_inner_widget.cpp
info/statistics/info_statistics_inner_widget.h
@@ -1032,6 +1061,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
@@ -1103,6 +1136,8 @@ PRIVATE
media/audio/media_audio_loader.h
media/audio/media_audio_loaders.cpp
media/audio/media_audio_loaders.h
media/audio/media_audio_local_cache.cpp
media/audio/media_audio_local_cache.h
media/audio/media_audio_track.cpp
media/audio/media_audio_track.h
media/audio/media_child_ffmpeg_loader.cpp
@@ -1171,6 +1206,8 @@ PRIVATE
media/streaming/media_streaming_video_track.h
media/view/media_view_group_thumbs.cpp
media/view/media_view_group_thumbs.h
media/view/media_view_open_common.cpp
media/view/media_view_open_common.h
media/view/media_view_overlay_opengl.cpp
media/view/media_view_overlay_opengl.h
media/view/media_view_overlay_raster.cpp
@@ -1189,7 +1226,6 @@ PRIVATE
media/view/media_view_playback_controls.h
media/view/media_view_playback_progress.cpp
media/view/media_view_playback_progress.h
media/view/media_view_open_common.h
media/system_media_controls_manager.h
media/system_media_controls_manager.cpp
menu/menu_antispam_validator.cpp
@@ -1377,8 +1413,6 @@ PRIVATE
settings/business/settings_recipients_helper.h
settings/business/settings_working_hours.cpp
settings/business/settings_working_hours.h
settings/cloud_password/settings_cloud_password_common.cpp
settings/cloud_password/settings_cloud_password_common.h
settings/cloud_password/settings_cloud_password_email.cpp
settings/cloud_password/settings_cloud_password_email.h
settings/cloud_password/settings_cloud_password_email_confirm.cpp
@@ -1391,6 +1425,10 @@ PRIVATE
settings/cloud_password/settings_cloud_password_manage.h
settings/cloud_password/settings_cloud_password_start.cpp
settings/cloud_password/settings_cloud_password_start.h
settings/cloud_password/settings_cloud_password_step.cpp
settings/cloud_password/settings_cloud_password_step.h
settings/settings_active_sessions.cpp
settings/settings_active_sessions.h
settings/settings_advanced.cpp
settings/settings_advanced.h
settings/settings_blocked_peers.cpp
@@ -1437,6 +1475,8 @@ PRIVATE
settings/settings_privacy_security.h
settings/settings_scale_preview.cpp
settings/settings_scale_preview.h
settings/settings_shortcuts.cpp
settings/settings_shortcuts.h
settings/settings_type.h
settings/settings_websites.cpp
settings/settings_websites.h
@@ -1537,6 +1577,10 @@ 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/widgets/peer_bubble.cpp
ui/widgets/peer_bubble.h
ui/countryinput.cpp
ui/countryinput.h
ui/dynamic_thumbnails.cpp
@@ -1548,8 +1592,6 @@ PRIVATE
ui/item_text_options.cpp
ui/item_text_options.h
ui/resize_area.h
ui/search_field_controller.cpp
ui/search_field_controller.h
ui/unread_badge.cpp
ui/unread_badge.h
window/main_window.cpp

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

View File

@@ -1,6 +1,7 @@
// This is a list of your own shortcuts for Telegram Desktop
// You can see full list of commands in the 'shortcuts-default.json' file
// Place a null value instead of a command string to switch the shortcut off
// You can also edit them in Settings > Chat Settings > Keyboard Shortcuts.
[
// {

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,8 @@
<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="starref_link.tgs">../../animations/starref_link.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

@@ -4,6 +4,7 @@
<file alias="art/bg_thumbnail.png">../../art/bg_thumbnail.png</file>
<file alias="art/bg_initial.jpg">../../art/bg_initial.jpg</file>
<file alias="art/business_logo.png">../../art/business_logo.png</file>
<file alias="art/affiliate_logo.png">../../art/affiliate_logo.png</file>
<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>

View File

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

View File

@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,7,2,0
PRODUCTVERSION 5,7,2,0
FILEVERSION 5,12,2,0
PRODUCTVERSION 5,12,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.7.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "FileVersion", "5.12.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2025"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.7.2.0"
VALUE "ProductVersion", "5.12.2.0"
END
END
BLOCK "VarFileInfo"

View File

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

View File

@@ -217,7 +217,11 @@ void Authorizations::toggleCallsDisabled(uint64 hash, bool disabled) {
MTP_bool(disabled)
)).done([=] {
_toggleCallsDisabledRequests.remove(hash);
}).fail([=] {
}).fail([=](const MTP::Error &error) {
LOG(("API Error: toggle calls %1. Hash: %2. %3.")
.arg(disabled ? u"disabled"_q : u"enabled"_q)
.arg(hash)
.arg(error.type()));
_toggleCallsDisabledRequests.remove(hash);
}).send();
_toggleCallsDisabledRequests.emplace(hash, id);

View File

@@ -7,11 +7,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_chat_filters.h"
#include "api/api_text_entities.h"
#include "apiwrap.h"
#include "base/event_filter.h"
#include "boxes/peer_list_box.h"
#include "boxes/premium_limits_box.h"
#include "boxes/filters/edit_filter_links.h" // FilterChatStatusText
#include "core/application.h"
#include "core/core_settings.h"
#include "core/ui_integration.h"
#include "data/data_channel.h"
#include "data/data_chat.h"
#include "data/data_chat_filters.h"
@@ -23,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/boxes/confirm_box.h"
#include "ui/controls/filter_link_header.h"
#include "ui/text/text_utilities.h"
#include "ui/toast/toast.h"
#include "ui/widgets/buttons.h"
#include "ui/filter_icons.h"
#include "ui/vertical_list.h"
@@ -47,7 +52,7 @@ public:
ToggleChatsController(
not_null<Window::SessionController*> window,
ToggleAction action,
const QString &title,
Data::ChatFilterTitle title,
std::vector<not_null<PeerData*>> chats,
std::vector<not_null<PeerData*>> additional);
@@ -73,7 +78,6 @@ private:
Ui::RpWidget *_addedBottomWidget = nullptr;
ToggleAction _action = ToggleAction::Adding;
QString _filterTitle;
base::flat_set<not_null<PeerData*>> _checkable;
std::vector<not_null<PeerData*>> _chats;
std::vector<not_null<PeerData*>> _additional;
@@ -104,9 +108,9 @@ private:
[[nodiscard]] TextWithEntities AboutText(
Ui::FilterLinkHeaderType type,
const QString &title) {
TextWithEntities title) {
using Type = Ui::FilterLinkHeaderType;
auto boldTitle = Ui::Text::Bold(title);
auto boldTitle = Ui::Text::Wrapped(title, EntityType::Bold);
return (type == Type::AddingFilter)
? tr::lng_filters_by_link_sure(
tr::now,
@@ -136,22 +140,29 @@ void InitFilterLinkHeader(
not_null<PeerListBox*> box,
Fn<void(int minHeight, int maxHeight, int addedTopHeight)> adjust,
Ui::FilterLinkHeaderType type,
const QString &title,
const QString &iconEmoji,
rpl::producer<int> count) {
Data::ChatFilterTitle title,
QString iconEmoji,
rpl::producer<int> count,
bool horizontalFilters) {
const auto icon = Ui::LookupFilterIcon(
Ui::LookupFilterIconByEmoji(
iconEmoji
).value_or(Ui::FilterIcon::Custom)).active;
const auto isStatic = title.isStatic;
auto header = Ui::MakeFilterLinkHeader(box, {
.type = type,
.title = TitleText(type)(tr::now),
.about = AboutText(type, title),
.folderTitle = title,
.about = AboutText(type, title.text),
.aboutContext = Core::TextContext({
.session = &box->peerListUiShow()->session(),
.customEmojiLoopLimit = isStatic ? -1 : 0,
}),
.folderTitle = title.text,
.folderIcon = icon,
.badge = (type == Ui::FilterLinkHeaderType::AddingChats
? std::move(count)
: rpl::single(0)),
.horizontalFilters = horizontalFilters,
});
const auto widget = header.widget;
widget->resizeToWidth(st::boxWideWidth);
@@ -244,12 +255,11 @@ void ImportInvite(
ToggleChatsController::ToggleChatsController(
not_null<Window::SessionController*> window,
ToggleAction action,
const QString &title,
Data::ChatFilterTitle title,
std::vector<not_null<PeerData*>> chats,
std::vector<not_null<PeerData*>> additional)
: _window(window)
, _action(action)
, _filterTitle(title)
, _chats(std::move(chats))
, _additional(std::move(additional)) {
setStyleOverrides(&st::filterLinkChatsList);
@@ -525,7 +535,7 @@ void ShowImportError(
void ShowImportToast(
base::weak_ptr<Window::SessionController> weak,
const QString &title,
Data::ChatFilterTitle title,
Ui::FilterLinkHeaderType type,
int added) {
const auto strong = weak.get();
@@ -536,22 +546,51 @@ void ShowImportToast(
const auto phrase = created
? tr::lng_filters_added_title
: tr::lng_filters_updated_title;
auto text = Ui::Text::Bold(phrase(tr::now, lt_folder, title));
auto text = Ui::Text::Wrapped(
phrase(tr::now, lt_folder, title.text, Ui::Text::WithEntities),
EntityType::Bold);
if (added > 0) {
const auto phrase = created
? tr::lng_filters_added_also
: tr::lng_filters_updated_also;
text.append('\n').append(phrase(tr::now, lt_count, added));
}
strong->showToast(std::move(text));
const auto isStatic = title.isStatic;
strong->showToast({
.text = std::move(text),
.textContext = Core::TextContext({
.session = &strong->session(),
.customEmojiLoopLimit = isStatic ? -1 : 0,
})
});
}
void HandleEnterInBox(not_null<Ui::BoxContent*> box) {
const auto isEnter = [=](not_null<QEvent*> event) {
if (event->type() == QEvent::KeyPress) {
if (const auto k = static_cast<QKeyEvent*>(event.get())) {
return (k->key() == Qt::Key_Enter)
|| (k->key() == Qt::Key_Return);
}
}
return false;
};
base::install_event_filter(box, [=](not_null<QEvent*> event) {
if (isEnter(event)) {
box->triggerButton(0);
return base::EventFilterResult::Cancel;
}
return base::EventFilterResult::Continue;
});
}
void ProcessFilterInvite(
base::weak_ptr<Window::SessionController> weak,
const QString &slug,
FilterId filterId,
const QString &title,
const QString &iconEmoji,
Data::ChatFilterTitle title,
QString iconEmoji,
std::vector<not_null<PeerData*>> peers,
std::vector<not_null<PeerData*>> already) {
const auto strong = weak.get();
@@ -570,6 +609,8 @@ void ProcessFilterInvite(
title,
std::move(peers),
std::move(already));
const auto horizontalFilters = !strong->enoughSpaceForFilters()
|| Core::App().settings().chatFiltersHorizontal();
const auto raw = controller.get();
auto initBox = [=](not_null<PeerListBox*> box) {
box->setStyle(st::filterInviteBox);
@@ -586,14 +627,19 @@ void ProcessFilterInvite(
});
InitFilterLinkHeader(box, [=](int min, int max, int addedTop) {
raw->adjust(min, max, addedTop);
}, type, title, iconEmoji, rpl::duplicate(badge));
}, type, title, iconEmoji, rpl::duplicate(badge), horizontalFilters);
raw->setRealContentHeight(box->heightValue());
const auto isStatic = title.isStatic;
auto owned = Ui::FilterLinkProcessButton(
box,
type,
title,
title.text,
Core::TextContext({
.session = &strong->session(),
.customEmojiLoopLimit = isStatic ? -1 : 0,
}),
std::move(badge));
const auto button = owned.data();
@@ -608,6 +654,8 @@ void ProcessFilterInvite(
box->addButton(std::move(owned));
HandleEnterInBox(box);
struct State {
bool importing = false;
};
@@ -692,7 +740,7 @@ void CheckFilterInvite(
if (!strong) {
return;
}
auto title = QString();
auto title = Data::ChatFilterTitle();
auto iconEmoji = QString();
auto filterId = FilterId();
auto peers = std::vector<not_null<PeerData*>>();
@@ -711,7 +759,8 @@ void CheckFilterInvite(
return result;
};
result.match([&](const MTPDchatlists_chatlistInvite &data) {
title = qs(data.vtitle());
title.text = ParseTextWithEntities(session, data.vtitle());
title.isStatic = data.is_title_noanimate();
iconEmoji = data.vemoticon().value_or_empty();
peers = parseList(data.vpeers());
}, [&](const MTPDchatlists_chatlistInviteAlready &data) {
@@ -776,8 +825,8 @@ void ProcessFilterUpdate(
void ProcessFilterRemove(
base::weak_ptr<Window::SessionController> weak,
const QString &title,
const QString &iconEmoji,
Data::ChatFilterTitle title,
QString iconEmoji,
std::vector<not_null<PeerData*>> all,
std::vector<not_null<PeerData*>> suggest,
Fn<void(std::vector<not_null<PeerData*>>)> done) {
@@ -796,6 +845,8 @@ void ProcessFilterRemove(
title,
std::move(suggest),
std::move(all));
const auto horizontalFilters = !strong->enoughSpaceForFilters()
|| Core::App().settings().chatFiltersHorizontal();
const auto raw = controller.get();
auto initBox = [=](not_null<PeerListBox*> box) {
box->setStyle(st::filterInviteBox);
@@ -807,12 +858,17 @@ void ProcessFilterRemove(
});
InitFilterLinkHeader(box, [=](int min, int max, int addedTop) {
raw->adjust(min, max, addedTop);
}, type, title, iconEmoji, rpl::single(0));
}, type, title, iconEmoji, rpl::single(0), horizontalFilters);
const auto isStatic = title.isStatic;
auto owned = Ui::FilterLinkProcessButton(
box,
type,
title,
title.text,
Core::TextContext({
.session = &strong->session(),
.customEmojiLoopLimit = isStatic ? -1 : 0,
}),
std::move(badge));
const auto button = owned.data();
@@ -827,6 +883,8 @@ void ProcessFilterRemove(
box->addButton(std::move(owned));
HandleEnterInBox(box);
raw->selectedValue(
) | rpl::start_with_next([=](
base::flat_set<not_null<PeerData*>> &&peers) {

View File

@@ -17,6 +17,7 @@ class SessionController;
namespace Data {
class ChatFilter;
struct ChatFilterTitle;
} // namespace Data
namespace Api {
@@ -36,8 +37,8 @@ void ProcessFilterUpdate(
void ProcessFilterRemove(
base::weak_ptr<Window::SessionController> weak,
const QString &title,
const QString &iconEmoji,
Data::ChatFilterTitle title,
QString iconEmoji,
std::vector<not_null<PeerData*>> all,
std::vector<not_null<PeerData*>> suggest,
Fn<void(std::vector<not_null<PeerData*>>)> done);

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

@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_chat_invite.h"
#include "apiwrap.h"
#include "api/api_credits.h"
#include "boxes/premium_limits_box.h"
#include "core/application.h"
#include "data/components/credits.h"
@@ -206,32 +207,12 @@ void ConfirmSubscriptionBox(
Ui::AddSkip(content);
Ui::AddSkip(content);
{
const auto widget = Ui::CreateChild<Ui::RpWidget>(content);
using ColoredMiniStars = Ui::Premium::ColoredMiniStars;
const auto stars = widget->lifetime().make_state<ColoredMiniStars>(
widget,
false,
Ui::Premium::MiniStars::Type::BiStars);
stars->setColorOverride(Ui::Premium::CreditsIconGradientStops());
widget->resize(
st::boxWideWidth - photoSize,
photoSize * 2);
content->sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
widget->moveToLeft(photoSize / 2, 0);
const auto starsRect = Rect(widget->size());
stars->setPosition(starsRect.topLeft());
stars->setSize(starsRect.size());
widget->lower();
}, widget->lifetime());
widget->paintRequest(
) | rpl::start_with_next([=](const QRect &r) {
auto p = QPainter(widget);
p.fillRect(r, Qt::transparent);
stars->paint(p);
}, widget->lifetime());
}
Settings::AddMiniStars(
content,
Ui::CreateChild<Ui::RpWidget>(content),
photoSize,
box->width(),
2.);
box->addRow(
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
@@ -295,20 +276,39 @@ void ConfirmSubscriptionBox(
const auto buttonWidth = state->saveButton
? state->saveButton->width()
: 0;
const auto finish = [=] {
state->api = std::nullopt;
state->loading.force_assign(false);
if (const auto strong = weak.data()) {
strong->closeBox();
}
};
state->api->request(
MTPpayments_SendStarsForm(
MTP_long(formId),
MTP_inputInvoiceChatInviteSubscription(MTP_string(hash)))
).done([=](const MTPpayments_PaymentResult &result) {
state->api = std::nullopt;
state->loading.force_assign(false);
result.match([&](const MTPDpayments_paymentResult &data) {
session->api().applyUpdates(data.vupdates());
}, [](const MTPDpayments_paymentVerificationNeeded &data) {
});
if (weak) {
box->closeBox();
const auto refill = session->data().activeCreditsSubsRebuilder();
const auto strong = weak.data();
if (!strong) {
return;
}
if (!refill) {
return finish();
}
const auto api
= strong->lifetime().make_state<Api::CreditsHistory>(
session->user(),
true,
true);
api->requestSubscriptions({}, [=](Data::CreditsStatusSlice d) {
refill->fire(std::move(d));
finish();
});
}).fail([=](const MTP::Error &error) {
const auto id = error.type();
if (weak) {

View File

@@ -211,11 +211,10 @@ void ApplyBotsList(
Data::PeerUpdate::Flag::FullInfo);
}
[[nodiscard]] ChatParticipants::Channels ParseSimilar(
[[nodiscard]] ChatParticipants::Peers ParseSimilarChannels(
not_null<Main::Session*> session,
const MTPmessages_Chats &chats) {
auto result = ChatParticipants::Channels();
std::vector<not_null<ChannelData*>>();
auto result = ChatParticipants::Peers();
chats.match([&](const auto &data) {
const auto &list = data.vchats().v;
result.list.reserve(list.size());
@@ -234,10 +233,29 @@ void ApplyBotsList(
return result;
}
[[nodiscard]] ChatParticipants::Channels ParseSimilar(
[[nodiscard]] ChatParticipants::Peers ParseSimilarChannels(
not_null<ChannelData*> channel,
const MTPmessages_Chats &chats) {
return ParseSimilar(&channel->session(), chats);
return ParseSimilarChannels(&channel->session(), chats);
}
[[nodiscard]] ChatParticipants::Peers ParseSimilarBots(
not_null<Main::Session*> session,
const MTPusers_Users &users) {
auto result = ChatParticipants::Peers();
users.match([&](const auto &data) {
const auto &list = data.vusers().v;
result.list.reserve(list.size());
for (const auto &user : list) {
result.list.push_back(session->data().processUser(user));
}
if constexpr (MTPDusers_usersSlice::Is<decltype(data)>()) {
if (session->premiumPossible()) {
result.more = data.vcount().v - data.vusers().v.size();
}
}
});
return result;
}
} // namespace
@@ -782,52 +800,65 @@ void ChatParticipants::unblock(
_kickRequests.emplace(kick, requestId);
}
void ChatParticipants::loadSimilarChannels(not_null<ChannelData*> channel) {
if (!channel->isBroadcast()) {
return;
} else if (const auto i = _similar.find(channel); i != end(_similar)) {
void ChatParticipants::loadSimilarPeers(not_null<PeerData*> peer) {
if (const auto i = _similar.find(peer); i != end(_similar)) {
if (i->second.requestId
|| !i->second.channels.more
|| !channel->session().premium()) {
|| !i->second.peers.more
|| !peer->session().premium()) {
return;
}
}
using Flag = MTPchannels_GetChannelRecommendations::Flag;
_similar[channel].requestId = _api.request(
MTPchannels_GetChannelRecommendations(
MTP_flags(Flag::f_channel),
channel->inputChannel)
).done([=](const MTPmessages_Chats &result) {
auto &similar = _similar[channel];
similar.requestId = 0;
auto parsed = ParseSimilar(channel, result);
if (similar.channels == parsed) {
return;
}
similar.channels = std::move(parsed);
if (const auto history = channel->owner().historyLoaded(channel)) {
if (const auto item = history->joinedMessageInstance()) {
history->owner().requestItemResize(item);
if (const auto channel = peer->asBroadcast()) {
using Flag = MTPchannels_GetChannelRecommendations::Flag;
_similar[peer].requestId = _api.request(
MTPchannels_GetChannelRecommendations(
MTP_flags(Flag::f_channel),
channel->inputChannel)
).done([=](const MTPmessages_Chats &result) {
auto &similar = _similar[channel];
similar.requestId = 0;
auto parsed = ParseSimilarChannels(channel, result);
if (similar.peers == parsed) {
return;
}
}
_similarLoaded.fire_copy(channel);
}).send();
similar.peers = std::move(parsed);
if (const auto history = channel->owner().historyLoaded(channel)) {
if (const auto item = history->joinedMessageInstance()) {
history->owner().requestItemResize(item);
}
}
_similarLoaded.fire_copy(channel);
}).send();
} else if (const auto bot = peer->asBot()) {
_similar[peer].requestId = _api.request(
MTPbots_GetBotRecommendations(bot->inputUser)
).done([=](const MTPusers_Users &result) {
auto &similar = _similar[peer];
similar.requestId = 0;
auto parsed = ParseSimilarBots(&peer->session(), result);
if (similar.peers == parsed) {
return;
}
similar.peers = std::move(parsed);
_similarLoaded.fire_copy(peer);
}).send();
}
}
auto ChatParticipants::similar(not_null<ChannelData*> channel)
-> const Channels & {
const auto i = channel->isBroadcast()
? _similar.find(channel)
auto ChatParticipants::similar(not_null<PeerData*> peer)
-> const Peers & {
const auto i = (peer->isBroadcast() || peer->isBot())
? _similar.find(peer)
: end(_similar);
if (i != end(_similar)) {
return i->second.channels;
return i->second.peers;
}
static const auto empty = Channels();
static const auto empty = Peers();
return empty;
}
auto ChatParticipants::similarLoaded() const
-> rpl::producer<not_null<ChannelData*>> {
-> rpl::producer<not_null<PeerData*>> {
return _similarLoaded.events();
}
@@ -841,15 +872,15 @@ void ChatParticipants::loadRecommendations() {
MTP_inputChannelEmpty())
).done([=](const MTPmessages_Chats &result) {
_recommendations.requestId = 0;
auto parsed = ParseSimilar(_session, result);
_recommendations.channels = std::move(parsed);
_recommendations.channels.more = 0;
auto parsed = ParseSimilarChannels(_session, result);
_recommendations.peers = std::move(parsed);
_recommendations.peers.more = 0;
_recommendationsLoaded = true;
}).send();
}
const ChatParticipants::Channels &ChatParticipants::recommendations() const {
return _recommendations.channels;
const ChatParticipants::Peers &ChatParticipants::recommendations() const {
return _recommendations.peers;
}
rpl::producer<> ChatParticipants::recommendationsLoaded() const {

View File

@@ -138,27 +138,27 @@ public:
not_null<ChannelData*> channel,
not_null<PeerData*> participant);
void loadSimilarChannels(not_null<ChannelData*> channel);
void loadSimilarPeers(not_null<PeerData*> peer);
struct Channels {
std::vector<not_null<ChannelData*>> list;
struct Peers {
std::vector<not_null<PeerData*>> list;
int more = 0;
friend inline bool operator==(
const Channels &,
const Channels &) = default;
const Peers &,
const Peers &) = default;
};
[[nodiscard]] const Channels &similar(not_null<ChannelData*> channel);
[[nodiscard]] const Peers &similar(not_null<PeerData*> peer);
[[nodiscard]] auto similarLoaded() const
-> rpl::producer<not_null<ChannelData*>>;
-> rpl::producer<not_null<PeerData*>>;
void loadRecommendations();
[[nodiscard]] const Channels &recommendations() const;
[[nodiscard]] const Peers &recommendations() const;
[[nodiscard]] rpl::producer<> recommendationsLoaded() const;
private:
struct SimilarChannels {
Channels channels;
struct SimilarPeers {
Peers peers;
mtpRequestId requestId = 0;
};
@@ -186,10 +186,10 @@ private:
not_null<PeerData*>>;
base::flat_map<KickRequest, mtpRequestId> _kickRequests;
base::flat_map<not_null<ChannelData*>, SimilarChannels> _similar;
rpl::event_stream<not_null<ChannelData*>> _similarLoaded;
base::flat_map<not_null<PeerData*>, SimilarPeers> _similar;
rpl::event_stream<not_null<PeerData*>> _similarLoaded;
SimilarChannels _recommendations;
SimilarPeers _recommendations;
rpl::variable<bool> _recommendationsLoaded = false;
};

View File

@@ -25,6 +25,7 @@ struct SendOptions {
TimeId scheduled = 0;
BusinessShortcutId shortcutId = 0;
EffectId effectId = 0;
int starsApproved = 0;
bool silent = false;
bool handleSupportSwitch = false;
bool invertCaption = false;
@@ -74,6 +75,7 @@ struct MessageToSend {
struct RemoteFileInfo {
MTPInputFile file;
std::optional<MTPInputFile> thumb;
std::optional<MTPInputPhoto> videoCover;
std::vector<MTPInputDocument> attachedStickers;
};

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_credits.h"
#include "api/api_premium.h"
#include "api/api_statistics_data_deserialize.h"
#include "api/api_updates.h"
#include "apiwrap.h"
@@ -73,9 +74,33 @@ constexpr auto kTransactionsLimit = 100;
return PeerId(0);
}).value;
const auto stargift = tl.data().vstargift();
const auto nonUniqueGift = stargift
? stargift->match([&](const MTPDstarGift &data) {
return &data;
}, [](const auto &) { return (const MTPDstarGift*)nullptr; })
: nullptr;
const auto reaction = tl.data().is_reaction();
const auto incoming = (int64(tl.data().vstars().v) >= 0);
const auto saveActorId = (reaction || !extended.empty()) && incoming;
const auto amount = Data::FromTL(tl.data().vstars());
const auto starrefAmount = tl.data().vstarref_amount()
? Data::FromTL(*tl.data().vstarref_amount())
: StarsAmount();
const auto starrefCommission
= tl.data().vstarref_commission_permille().value_or_empty();
const auto starrefBarePeerId = tl.data().vstarref_peer()
? peerFromMTP(*tl.data().vstarref_peer()).value
: 0;
const auto incoming = (amount >= StarsAmount());
const auto paidMessagesCount
= tl.data().vpaid_messages().value_or_empty();
const auto premiumMonthsForStars
= tl.data().vpremium_gift_months().value_or_empty();
const auto saveActorId = (reaction
|| !extended.empty()
|| paidMessagesCount) && incoming;
const auto parsedGift = stargift
? FromTL(&peer->session(), *stargift)
: std::optional<Data::StarGift>();
const auto giftStickerId = parsedGift ? parsedGift->document->id : 0;
return Data::CreditsHistoryEntry{
.id = qs(tl.data().vid()),
.title = qs(tl.data().vtitle().value_or_empty()),
@@ -83,15 +108,17 @@ constexpr auto kTransactionsLimit = 100;
.date = base::unixtime::parse(tl.data().vdate().v),
.photoId = photo ? photo->id : 0,
.extended = std::move(extended),
.credits = tl.data().vstars().v,
.credits = Data::FromTL(tl.data().vstars()),
.bareMsgId = uint64(tl.data().vmsg_id().value_or_empty()),
.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),
.bareGiftStickerId = giftStickerId,
.bareActorId = saveActorId ? barePeerId : uint64(0),
.uniqueGift = parsedGift ? parsedGift->unique : nullptr,
.starrefAmount = paidMessagesCount ? StarsAmount() : starrefAmount,
.starrefCommission = paidMessagesCount ? 0 : starrefCommission,
.starrefRecipientId = paidMessagesCount ? 0 : starrefBarePeerId,
.peerType = tl.data().vpeer().match([](const HistoryPeerTL &) {
return Data::CreditsHistoryEntry::PeerType::Peer;
}, [](const MTPDstarsTransactionPeerPlayMarket &) {
@@ -117,11 +144,19 @@ constexpr auto kTransactionsLimit = 100;
? base::unixtime::parse(tl.data().vtransaction_date()->v)
: QDateTime(),
.successLink = qs(tl.data().vtransaction_url().value_or_empty()),
.convertStars = int(stargift
? stargift->data().vconvert_stars().v
.paidMessagesCount = paidMessagesCount,
.paidMessagesAmount = (paidMessagesCount
? starrefAmount
: StarsAmount()),
.paidMessagesCommission = paidMessagesCount ? starrefCommission : 0,
.starsConverted = int(nonUniqueGift
? nonUniqueGift->vconvert_stars().v
: 0),
.premiumMonthsForStars = premiumMonthsForStars,
.floodSkip = int(tl.data().vfloodskip_number().value_or(0)),
.converted = stargift && incoming,
.stargift = stargift.has_value(),
.giftUpgraded = tl.data().is_stargift_upgrade(),
.reaction = tl.data().is_reaction(),
.refunded = tl.data().is_refund(),
.pending = tl.data().is_pending(),
@@ -132,17 +167,26 @@ constexpr auto kTransactionsLimit = 100;
}
[[nodiscard]] Data::SubscriptionEntry SubscriptionFromTL(
const MTPStarsSubscription &tl) {
const MTPStarsSubscription &tl,
not_null<PeerData*> peer) {
return Data::SubscriptionEntry{
.id = qs(tl.data().vid()),
.inviteHash = qs(tl.data().vchat_invite_hash().value_or_empty()),
.title = qs(tl.data().vtitle().value_or_empty()),
.slug = qs(tl.data().vinvoice_slug().value_or_empty()),
.until = base::unixtime::parse(tl.data().vuntil_date().v),
.subscription = Data::PeerSubscription{
.credits = tl.data().vpricing().data().vamount().v,
.period = tl.data().vpricing().data().vperiod().v,
},
.barePeerId = peerFromMTP(tl.data().vpeer()).value,
.photoId = (tl.data().vphoto()
? peer->owner().photoFromWeb(
*tl.data().vphoto(),
ImageLocation())->id
: 0),
.cancelled = tl.data().is_canceled(),
.cancelledByBot = tl.data().is_bot_canceled(),
.expired = (base::unixtime::now() > tl.data().vuntil_date().v),
.canRefulfill = tl.data().is_can_refulfill(),
};
@@ -165,16 +209,17 @@ constexpr auto kTransactionsLimit = 100;
if (const auto history = data.vsubscriptions()) {
subscriptions.reserve(history->v.size());
for (const auto &tl : history->v) {
subscriptions.push_back(SubscriptionFromTL(tl));
subscriptions.push_back(SubscriptionFromTL(tl, peer));
}
}
return Data::CreditsStatusSlice{
.list = std::move(entries),
.subscriptions = std::move(subscriptions),
.balance = status.data().vbalance().v,
.balance = Data::FromTL(status.data().vbalance()),
.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()),
@@ -257,8 +302,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);
const auto &balance = result.data().vbalance();
_peer->session().credits().apply(_peer->id, Data::FromTL(balance));
if (const auto onstack = done) {
onstack(StatusFromTL(result, _peer));
}
@@ -337,7 +382,9 @@ rpl::producer<not_null<PeerData*>> PremiumPeerBot(
const auto api = lifetime.make_state<MTP::Sender>(&session->mtp());
api->request(MTPcontacts_ResolveUsername(
MTP_string(username)
MTP_flags(0),
MTP_string(username),
MTP_string()
)).done([=](const MTPcontacts_ResolvedPeer &result) {
session->data().processUsers(result.data().vusers());
session->data().processChats(result.data().vchats());
@@ -369,12 +416,13 @@ rpl::producer<rpl::no_value, QString> CreditsEarnStatistics::request() {
)).done([=](const MTPpayments_StarsRevenueStats &result) {
const auto &data = result.data();
const auto &status = data.vstatus().data();
using Data::FromTL;
_data = Data::CreditsEarnStatistics{
.revenueGraph = StatisticalGraphFromTL(
data.vrevenue_graph()),
.currentBalance = status.vcurrent_balance().v,
.availableBalance = status.vavailable_balance().v,
.overallRevenue = status.voverall_revenue().v,
.currentBalance = FromTL(status.vcurrent_balance()),
.availableBalance = FromTL(status.vavailable_balance()),
.overallRevenue = FromTL(status.voverall_revenue()),
.usdRate = data.vusd_rate().v,
.isWithdrawalEnabled = status.is_withdrawal_enabled(),
.nextWithdrawalAt = status.vnext_withdrawal_at()
@@ -461,4 +509,28 @@ Data::CreditsGiveawayOptions CreditsGiveawayOptions::options() const {
return _options;
}
void EditCreditsSubscription(
not_null<Main::Session*> session,
const QString &id,
bool cancel,
Fn<void()> done,
Fn<void(QString)> fail) {
using Flag = MTPpayments_ChangeStarsSubscription::Flag;
session->api().request(
MTPpayments_ChangeStarsSubscription(
MTP_flags(Flag::f_canceled),
MTP_inputPeerSelf(),
MTP_string(id),
MTP_bool(cancel)
)).done(done).fail([=](const MTP::Error &e) { fail(e.type()); }).send();
}
MTPInputSavedStarGift InputSavedStarGiftId(const Data::SavedStarGiftId &id) {
return id.isUser()
? MTP_inputSavedStarGiftUser(MTP_int(id.userMessageId().bare))
: MTP_inputSavedStarGiftChat(
id.chat()->input,
MTP_long(id.chatSavedId()));
}
} // namespace Api

View File

@@ -12,6 +12,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_credits_earn.h"
#include "mtproto/sender.h"
namespace Data {
class SavedStarGiftId;
} // namespace Data
namespace Main {
class Session;
} // namespace Main
@@ -109,4 +113,14 @@ private:
[[nodiscard]] rpl::producer<not_null<PeerData*>> PremiumPeerBot(
not_null<Main::Session*> session);
void EditCreditsSubscription(
not_null<Main::Session*> session,
const QString &id,
bool cancel,
Fn<void()> done,
Fn<void(QString)> fail);
[[nodiscard]] MTPInputSavedStarGift InputSavedStarGiftId(
const Data::SavedStarGiftId &id);
} // namespace Api

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;

View File

@@ -276,14 +276,22 @@ mtpRequestId EditTextMessage(
takeFileReference = [=] { return photo->fileReference(); };
} else if (const auto document = media->document()) {
using Flag = MTPDinputMediaDocument::Flag;
const auto videoCover = media->videoCover();
const auto videoTimestamp = media->videoTimestamp();
const auto flags = Flag()
| (media->ttlSeconds() ? Flag::f_ttl_seconds : Flag())
| (spoilered ? Flag::f_spoiler : Flag());
| (spoilered ? Flag::f_spoiler : Flag())
| (videoTimestamp ? Flag::f_video_timestamp : Flag())
| (videoCover ? Flag::f_video_cover : Flag());
takeInputMedia = [=] {
return MTP_inputMediaDocument(
MTP_flags(flags),
document->mtpInput(),
(videoCover
? videoCover->mtpInput()
: MTPInputPhoto()),
MTP_int(media->ttlSeconds()),
MTP_int(videoTimestamp),
MTPstring()); // query
};
takeFileReference = [=] { return document->fileReference(); };

View File

@@ -13,6 +13,32 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Api {
PeerId ParsePaidReactionShownPeer(
not_null<Main::Session*> session,
const MTPPaidReactionPrivacy &value) {
return value.match([&](const MTPDpaidReactionPrivacyDefault &) {
return session->userPeerId();
}, [](const MTPDpaidReactionPrivacyAnonymous &) {
return PeerId();
}, [&](const MTPDpaidReactionPrivacyPeer &data) {
return data.vpeer().match([&](const MTPDinputPeerSelf &) {
return session->userPeerId();
}, [](const MTPDinputPeerUser &data) {
return peerFromUser(data.vuser_id());
}, [](const MTPDinputPeerChat &data) {
return peerFromChat(data.vchat_id());
}, [](const MTPDinputPeerChannel &data) {
return peerFromChannel(data.vchannel_id());
}, [](const MTPDinputPeerUserFromMessage &data) -> PeerId {
Unexpected("From message peer in ParsePaidReactionShownPeer.");
}, [](const MTPDinputPeerChannelFromMessage &data) -> PeerId {
Unexpected("From message peer in ParsePaidReactionShownPeer.");
}, [](const MTPDinputPeerEmpty &) -> PeerId {
Unexpected("Empty peer in ParsePaidReactionShownPeer.");
});
});
}
GlobalPrivacy::GlobalPrivacy(not_null<ApiWrap*> api)
: _session(&api->session())
, _api(&api->instance()) {
@@ -88,7 +114,8 @@ void GlobalPrivacy::updateHideReadTime(bool hide) {
archiveAndMuteCurrent(),
unarchiveOnNewMessageCurrent(),
hide,
newRequirePremiumCurrent());
newRequirePremiumCurrent(),
newChargeStarsCurrent());
}
bool GlobalPrivacy::hideReadTimeCurrent() const {
@@ -99,14 +126,6 @@ rpl::producer<bool> GlobalPrivacy::hideReadTime() const {
return _hideReadTime.value();
}
void GlobalPrivacy::updateNewRequirePremium(bool value) {
update(
archiveAndMuteCurrent(),
unarchiveOnNewMessageCurrent(),
hideReadTimeCurrent(),
value);
}
bool GlobalPrivacy::newRequirePremiumCurrent() const {
return _newRequirePremium.current();
}
@@ -115,27 +134,46 @@ rpl::producer<bool> GlobalPrivacy::newRequirePremium() const {
return _newRequirePremium.value();
}
void GlobalPrivacy::loadPaidReactionAnonymous() {
if (_paidReactionAnonymousLoaded) {
int GlobalPrivacy::newChargeStarsCurrent() const {
return _newChargeStars.current();
}
rpl::producer<int> GlobalPrivacy::newChargeStars() const {
return _newChargeStars.value();
}
void GlobalPrivacy::updateMessagesPrivacy(
bool requirePremium,
int chargeStars) {
update(
archiveAndMuteCurrent(),
unarchiveOnNewMessageCurrent(),
hideReadTimeCurrent(),
requirePremium,
chargeStars);
}
void GlobalPrivacy::loadPaidReactionShownPeer() {
if (_paidReactionShownPeerLoaded) {
return;
}
_paidReactionAnonymousLoaded = true;
_paidReactionShownPeerLoaded = true;
_api.request(MTPmessages_GetPaidReactionPrivacy(
)).done([=](const MTPUpdates &result) {
_session->api().applyUpdates(result);
}).send();
}
void GlobalPrivacy::updatePaidReactionAnonymous(bool value) {
_paidReactionAnonymous = value;
void GlobalPrivacy::updatePaidReactionShownPeer(PeerId shownPeer) {
_paidReactionShownPeer = shownPeer;
}
bool GlobalPrivacy::paidReactionAnonymousCurrent() const {
return _paidReactionAnonymous.current();
PeerId GlobalPrivacy::paidReactionShownPeerCurrent() const {
return _paidReactionShownPeer.current();
}
rpl::producer<bool> GlobalPrivacy::paidReactionAnonymous() const {
return _paidReactionAnonymous.value();
rpl::producer<PeerId> GlobalPrivacy::paidReactionShownPeer() const {
return _paidReactionShownPeer.value();
}
void GlobalPrivacy::updateArchiveAndMute(bool value) {
@@ -143,7 +181,8 @@ void GlobalPrivacy::updateArchiveAndMute(bool value) {
value,
unarchiveOnNewMessageCurrent(),
hideReadTimeCurrent(),
newRequirePremiumCurrent());
newRequirePremiumCurrent(),
newChargeStarsCurrent());
}
void GlobalPrivacy::updateUnarchiveOnNewMessage(
@@ -152,14 +191,16 @@ void GlobalPrivacy::updateUnarchiveOnNewMessage(
archiveAndMuteCurrent(),
value,
hideReadTimeCurrent(),
newRequirePremiumCurrent());
newRequirePremiumCurrent(),
newChargeStarsCurrent());
}
void GlobalPrivacy::update(
bool archiveAndMute,
UnarchiveOnNewMessage unarchiveOnNewMessage,
bool hideReadTime,
bool newRequirePremium) {
bool newRequirePremium,
int newChargeStars) {
using Flag = MTPDglobalPrivacySettings::Flag;
_api.request(_requestId).cancel();
@@ -178,35 +219,44 @@ void GlobalPrivacy::update(
| (hideReadTime ? Flag::f_hide_read_marks : Flag())
| ((newRequirePremium && newRequirePremiumAllowed)
? Flag::f_new_noncontact_peers_require_premium
: Flag());
: Flag())
| Flag::f_noncontact_peers_paid_stars;
_requestId = _api.request(MTPaccount_SetGlobalPrivacySettings(
MTP_globalPrivacySettings(MTP_flags(flags))
MTP_globalPrivacySettings(
MTP_flags(flags),
MTP_long(newChargeStars))
)).done([=](const MTPGlobalPrivacySettings &result) {
_requestId = 0;
apply(result);
}).fail([=](const MTP::Error &error) {
_requestId = 0;
if (error.type() == u"PREMIUM_ACCOUNT_REQUIRED"_q) {
update(archiveAndMute, unarchiveOnNewMessage, hideReadTime, {});
update(
archiveAndMute,
unarchiveOnNewMessage,
hideReadTime,
false,
0);
}
}).send();
_archiveAndMute = archiveAndMute;
_unarchiveOnNewMessage = unarchiveOnNewMessage;
_hideReadTime = hideReadTime;
_newRequirePremium = newRequirePremium;
_newChargeStars = newChargeStars;
}
void GlobalPrivacy::apply(const MTPGlobalPrivacySettings &data) {
data.match([&](const MTPDglobalPrivacySettings &data) {
_archiveAndMute = data.is_archive_and_mute_new_noncontact_peers();
_unarchiveOnNewMessage = data.is_keep_archived_unmuted()
? UnarchiveOnNewMessage::None
: data.is_keep_archived_folders()
? UnarchiveOnNewMessage::NotInFoldersUnmuted
: UnarchiveOnNewMessage::AnyUnmuted;
_hideReadTime = data.is_hide_read_marks();
_newRequirePremium = data.is_new_noncontact_peers_require_premium();
});
void GlobalPrivacy::apply(const MTPGlobalPrivacySettings &settings) {
const auto &data = settings.data();
_archiveAndMute = data.is_archive_and_mute_new_noncontact_peers();
_unarchiveOnNewMessage = data.is_keep_archived_unmuted()
? UnarchiveOnNewMessage::None
: data.is_keep_archived_folders()
? UnarchiveOnNewMessage::NotInFoldersUnmuted
: UnarchiveOnNewMessage::AnyUnmuted;
_hideReadTime = data.is_hide_read_marks();
_newRequirePremium = data.is_new_noncontact_peers_require_premium();
_newChargeStars = data.vnoncontact_peers_paid_stars().value_or_empty();
}
} // namespace Api

View File

@@ -23,6 +23,10 @@ enum class UnarchiveOnNewMessage {
AnyUnmuted,
};
[[nodiscard]] PeerId ParsePaidReactionShownPeer(
not_null<Main::Session*> session,
const MTPPaidReactionPrivacy &value);
class GlobalPrivacy final {
public:
explicit GlobalPrivacy(not_null<ApiWrap*> api);
@@ -45,23 +49,28 @@ public:
[[nodiscard]] bool hideReadTimeCurrent() const;
[[nodiscard]] rpl::producer<bool> hideReadTime() const;
void updateNewRequirePremium(bool value);
[[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;
[[nodiscard]] int newChargeStarsCurrent() const;
[[nodiscard]] rpl::producer<int> newChargeStars() const;
void updateMessagesPrivacy(bool requirePremium, int chargeStars);
void loadPaidReactionShownPeer();
void updatePaidReactionShownPeer(PeerId shownPeer);
[[nodiscard]] PeerId paidReactionShownPeerCurrent() const;
[[nodiscard]] rpl::producer<PeerId> paidReactionShownPeer() const;
private:
void apply(const MTPGlobalPrivacySettings &data);
void apply(const MTPGlobalPrivacySettings &settings);
void update(
bool archiveAndMute,
UnarchiveOnNewMessage unarchiveOnNewMessage,
bool hideReadTime,
bool newRequirePremium);
bool newRequirePremium,
int newChargeStars);
const not_null<Main::Session*> _session;
MTP::Sender _api;
@@ -72,9 +81,10 @@ private:
rpl::variable<bool> _showArchiveAndMute = false;
rpl::variable<bool> _hideReadTime = false;
rpl::variable<bool> _newRequirePremium = false;
rpl::variable<bool> _paidReactionAnonymous = false;
rpl::variable<int> _newChargeStars = 0;
rpl::variable<PeerId> _paidReactionShownPeer = false;
std::vector<Fn<void()>> _callbacks;
bool _paidReactionAnonymousLoaded = false;
bool _paidReactionShownPeerLoaded = false;
};

View File

@@ -111,7 +111,8 @@ MTPInputMedia PrepareUploadedDocument(
| (info.thumb ? Flag::f_thumb : Flag())
| (item->groupId() ? Flag::f_nosound_video : Flag())
| (info.attachedStickers.empty() ? Flag::f_stickers : Flag())
| (ttlSeconds ? Flag::f_ttl_seconds : Flag());
| (ttlSeconds ? Flag::f_ttl_seconds : Flag())
| (info.videoCover ? Flag::f_video_cover : Flag());
const auto document = item->media()->document();
return MTP_inputMediaUploadedDocument(
MTP_flags(flags),
@@ -121,6 +122,8 @@ MTPInputMedia PrepareUploadedDocument(
ComposeSendingDocumentAttributes(document),
MTP_vector<MTPInputDocument>(
ranges::to<QVector<MTPInputDocument>>(info.attachedStickers)),
info.videoCover.value_or(MTPInputPhoto()),
MTP_int(0), // video_timestamp
MTP_int(ttlSeconds));
}

View File

@@ -103,6 +103,7 @@ void MessagesSearch::searchRequest() {
_requestId = _history->session().api().request(MTPmessages_Search(
MTP_flags((fromPeer ? Flag::f_from_id : Flag())
| (savedPeer ? Flag::f_saved_peer_id : Flag())
| (_request.topMsgId ? Flag::f_top_msg_id : Flag())
| (_request.tags.empty() ? Flag() : Flag::f_saved_reaction)),
_history->peer->input,
MTP_string(_request.query),
@@ -111,7 +112,7 @@ void MessagesSearch::searchRequest() {
MTP_vector_from_range(_request.tags | ranges::views::transform(
Data::ReactionToMTP
)),
MTPint(), // top_msg_id
MTP_int(_request.topMsgId), // top_msg_id
MTP_inputMessagesFilterEmpty(),
MTP_int(0), // min_date
MTP_int(0), // max_date

View File

@@ -32,6 +32,7 @@ public:
QString query;
PeerData *from = nullptr;
std::vector<Data::ReactionId> tags;
MsgId topMsgId;
friend inline bool operator==(
const Request &,

View File

@@ -64,6 +64,10 @@ MessagesSearchMerged::MessagesSearchMerged(not_null<History*> history)
}
}
void MessagesSearchMerged::disableMigrated() {
_migratedSearch = std::nullopt;
}
void MessagesSearchMerged::addFound(const FoundMessages &data) {
for (const auto &message : data.messages) {
_concatedFound.messages.push_back(message);
@@ -74,12 +78,17 @@ const FoundMessages &MessagesSearchMerged::messages() const {
return _concatedFound;
}
const MessagesSearch::Request &MessagesSearchMerged::request() const {
return _request;
}
void MessagesSearchMerged::clear() {
_concatedFound = {};
_migratedFirstFound = {};
}
void MessagesSearchMerged::search(const Request &search) {
_request = search;
if (_migratedSearch) {
_waitingForTotal = true;
_migratedSearch->searchMessages(search);

View File

@@ -29,8 +29,10 @@ public:
void clear();
void search(const Request &search);
void searchMore();
void disableMigrated();
[[nodiscard]] const FoundMessages &messages() const;
[[nodiscard]] const Request &request() const;
[[nodiscard]] rpl::producer<> newFounds() const;
[[nodiscard]] rpl::producer<> nextFounds() const;
@@ -39,6 +41,7 @@ private:
void addFound(const FoundMessages &data);
MessagesSearch _apiSearch;
Request _request;
std::optional<MessagesSearch> _migratedSearch;
FoundMessages _migratedFirstFound;

View File

@@ -37,7 +37,7 @@ Polls::Polls(not_null<ApiWrap*> api)
void Polls::create(
const PollData &data,
const SendAction &action,
SendAction action,
Fn<void()> done,
Fn<void()> fail) {
_session->api().sendAction(action);
@@ -59,6 +59,9 @@ void Polls::create(
history->startSavingCloudDraft(topicRootId);
}
const auto silentPost = ShouldSendSilent(peer, action.options);
const auto starsPaid = std::min(
peer->starsPerMessageChecked(),
action.options.starsApproved);
if (silentPost) {
sendFlags |= MTPmessages_SendMedia::Flag::f_silent;
}
@@ -71,6 +74,10 @@ void Polls::create(
if (action.options.effectId) {
sendFlags |= MTPmessages_SendMedia::Flag::f_effect;
}
if (starsPaid) {
action.options.starsApproved -= starsPaid;
sendFlags |= MTPmessages_SendMedia::Flag::f_allow_paid_stars;
}
const auto sendAs = action.options.sendAs;
if (sendAs) {
sendFlags |= MTPmessages_SendMedia::Flag::f_send_as;
@@ -93,7 +100,8 @@ void Polls::create(
MTP_int(action.options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, action.options.shortcutId),
MTP_long(action.options.effectId)
MTP_long(action.options.effectId),
MTP_long(starsPaid)
), [=](const MTPUpdates &result, const MTP::Response &response) {
if (clearCloudDraft) {
history->finishSavingCloudDraft(

View File

@@ -27,7 +27,7 @@ public:
void create(
const PollData &data,
const SendAction &action,
SendAction action,
Fn<void()> done,
Fn<void()> fail);
void sendVotes(

View File

@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_text_entities.h"
#include "apiwrap.h"
#include "base/random.h"
#include "data/data_channel.h"
#include "data/data_document.h"
#include "data/data_peer.h"
#include "data/data_peer_values.h"
@@ -377,15 +378,15 @@ const Data::PremiumSubscriptionOptions &Premium::subscriptionOptions() const {
return _subscriptionOptions;
}
rpl::producer<> Premium::somePremiumRequiredResolved() const {
return _somePremiumRequiredResolved.events();
rpl::producer<> Premium::someMessageMoneyRestrictionsResolved() const {
return _someMessageMoneyRestrictionsResolved.events();
}
void Premium::resolvePremiumRequired(not_null<UserData*> user) {
_resolvePremiumRequiredUsers.emplace(user);
if (!_premiumRequiredRequestScheduled
&& _resolvePremiumRequestedUsers.empty()) {
_premiumRequiredRequestScheduled = true;
void Premium::resolveMessageMoneyRestrictions(not_null<UserData*> user) {
_resolveMessageMoneyRequiredUsers.emplace(user);
if (!_messageMoneyRequestScheduled
&& _resolveMessageMoneyRequestedUsers.empty()) {
_messageMoneyRequestScheduled = true;
crl::on_main(_session, [=] {
requestPremiumRequiredSlice();
});
@@ -393,50 +394,65 @@ void Premium::resolvePremiumRequired(not_null<UserData*> user) {
}
void Premium::requestPremiumRequiredSlice() {
_premiumRequiredRequestScheduled = false;
if (!_resolvePremiumRequestedUsers.empty()
|| _resolvePremiumRequiredUsers.empty()) {
_messageMoneyRequestScheduled = false;
if (!_resolveMessageMoneyRequestedUsers.empty()
|| _resolveMessageMoneyRequiredUsers.empty()) {
return;
}
constexpr auto kPerRequest = 100;
auto users = MTP_vector_from_range(_resolvePremiumRequiredUsers
auto users = MTP_vector_from_range(_resolveMessageMoneyRequiredUsers
| ranges::views::transform(&UserData::inputUser));
if (users.v.size() > kPerRequest) {
auto shortened = users.v;
shortened.resize(kPerRequest);
users = MTP_vector<MTPInputUser>(std::move(shortened));
const auto from = begin(_resolvePremiumRequiredUsers);
_resolvePremiumRequestedUsers = { from, from + kPerRequest };
_resolvePremiumRequiredUsers.erase(from, from + kPerRequest);
const auto from = begin(_resolveMessageMoneyRequiredUsers);
_resolveMessageMoneyRequestedUsers = { from, from + kPerRequest };
_resolveMessageMoneyRequiredUsers.erase(from, from + kPerRequest);
} else {
_resolvePremiumRequestedUsers
= base::take(_resolvePremiumRequiredUsers);
_resolveMessageMoneyRequestedUsers
= base::take(_resolveMessageMoneyRequiredUsers);
}
const auto finish = [=](const QVector<MTPBool> &list) {
constexpr auto me = UserDataFlag::MeRequiresPremiumToWrite;
constexpr auto known = UserDataFlag::RequirePremiumToWriteKnown;
constexpr auto mask = me | known;
const auto finish = [=](const QVector<MTPRequirementToContact> &list) {
auto index = 0;
for (const auto &user : base::take(_resolvePremiumRequestedUsers)) {
const auto require = (index < list.size())
&& mtpIsTrue(list[index++]);
user->setFlags((user->flags() & ~mask)
| known
| (require ? me : UserDataFlag()));
for (const auto &user : base::take(_resolveMessageMoneyRequestedUsers)) {
const auto set = [&](bool requirePremium, int stars) {
using Flag = UserDataFlag;
constexpr auto me = Flag::RequiresPremiumToWrite;
constexpr auto known = Flag::MessageMoneyRestrictionsKnown;
constexpr auto hasPrem = Flag::HasRequirePremiumToWrite;
constexpr auto hasStars = Flag::HasStarsPerMessage;
user->setStarsPerMessage(stars);
user->setFlags((user->flags() & ~(me | hasPrem | hasStars))
| known
| (requirePremium ? (me | hasPrem) : Flag())
| (stars ? hasStars : Flag()));
};
if (index >= list.size()) {
set(false, 0);
continue;
}
list[index++].match([&](const MTPDrequirementToContactEmpty &) {
set(false, 0);
}, [&](const MTPDrequirementToContactPremium &) {
set(true, 0);
}, [&](const MTPDrequirementToContactPaidMessages &data) {
set(false, data.vstars_amount().v);
});
}
if (!_premiumRequiredRequestScheduled
&& !_resolvePremiumRequiredUsers.empty()) {
_premiumRequiredRequestScheduled = true;
if (!_messageMoneyRequestScheduled
&& !_resolveMessageMoneyRequiredUsers.empty()) {
_messageMoneyRequestScheduled = true;
crl::on_main(_session, [=] {
requestPremiumRequiredSlice();
});
}
_somePremiumRequiredResolved.fire({});
_someMessageMoneyRestrictionsResolved.fire({});
};
_session->api().request(
MTPusers_GetIsPremiumRequiredToContact(std::move(users))
).done([=](const MTPVector<MTPBool> &result) {
MTPusers_GetRequirementsToContact(std::move(users))
).done([=](const MTPVector<MTPRequirementToContact> &result) {
finish(result.v);
}).fail([=] {
finish({});
@@ -463,10 +479,14 @@ rpl::producer<rpl::no_value, QString> PremiumGiftCodeOptions::request() {
for (const auto &tlOption : result.v) {
const auto &data = tlOption.data();
tlMapOptions[data.vusers().v].push_back(tlOption);
if (qs(data.vcurrency()) == Ui::kCreditsCurrency) {
continue;
}
const auto token = Token{ data.vusers().v, data.vmonths().v };
_stores[token] = Store{
.amount = data.vamount().v,
.currency = qs(data.vcurrency()),
.product = qs(data.vstore_product().value_or_empty()),
.quantity = data.vstore_quantity().value_or_empty(),
};
@@ -475,14 +495,14 @@ rpl::producer<rpl::no_value, QString> PremiumGiftCodeOptions::request() {
}
}
for (const auto &[amount, tlOptions] : tlMapOptions) {
if (amount == 1 && _optionsForOnePerson.currency.isEmpty()) {
_optionsForOnePerson.currency = qs(
tlOptions.front().data().vcurrency());
if (amount == 1 && _optionsForOnePerson.currencies.empty()) {
for (const auto &option : tlOptions) {
_optionsForOnePerson.months.push_back(
option.data().vmonths().v);
_optionsForOnePerson.totalCosts.push_back(
option.data().vamount().v);
_optionsForOnePerson.currencies.push_back(
qs(option.data().vcurrency()));
}
}
_subscriptionOptions[amount] = GiftCodesFromTL(tlOptions);
@@ -509,7 +529,7 @@ rpl::producer<rpl::no_value, QString> PremiumGiftCodeOptions::applyPrepaid(
_api.request(MTPpayments_LaunchPrepaidGiveaway(
_peer->input,
MTP_long(prepaidId),
invoice.creditsAmount
invoice.giveawayCredits
? Payments::InvoiceCreditsGiveawayToTL(invoice)
: Payments::InvoicePremiumGiftCodeGiveawayToTL(invoice)
)).done([=](const MTPUpdates &result) {
@@ -540,7 +560,7 @@ Payments::InvoicePremiumGiftCode PremiumGiftCodeOptions::invoice(
const auto token = Token{ users, months };
const auto &store = _stores[token];
return Payments::InvoicePremiumGiftCode{
.currency = _optionsForOnePerson.currency,
.currency = store.currency,
.storeProduct = store.product,
.randomId = randomId,
.amount = store.amount,
@@ -553,14 +573,15 @@ Payments::InvoicePremiumGiftCode PremiumGiftCodeOptions::invoice(
std::vector<GiftOptionData> PremiumGiftCodeOptions::optionsForPeer() const {
auto result = std::vector<GiftOptionData>();
if (!_optionsForOnePerson.currency.isEmpty()) {
if (!_optionsForOnePerson.currencies.empty()) {
const auto count = int(_optionsForOnePerson.months.size());
result.reserve(count);
for (auto i = 0; i != count; ++i) {
Assert(i < _optionsForOnePerson.totalCosts.size());
Assert(i < _optionsForOnePerson.currencies.size());
result.push_back({
.cost = _optionsForOnePerson.totalCosts[i],
.currency = _optionsForOnePerson.currency,
.currency = _optionsForOnePerson.currencies[i],
.months = _optionsForOnePerson.months[i],
});
}
@@ -581,7 +602,7 @@ Data::PremiumSubscriptionOptions PremiumGiftCodeOptions::options(int amount) {
MTP_int(_optionsForOnePerson.months[i]),
MTPstring(),
MTPint(),
MTP_string(_optionsForOnePerson.currency),
MTP_string(_optionsForOnePerson.currencies[i]),
MTP_long(_optionsForOnePerson.totalCosts[i] * amount)));
}
_subscriptionOptions[amount] = GiftCodesFromTL(tlOptions);
@@ -601,7 +622,7 @@ auto PremiumGiftCodeOptions::requestStarGifts()
_giftsHash = data.vhash().v;
const auto &list = data.vgifts().v;
const auto session = &_peer->session();
auto gifts = std::vector<StarGift>();
auto gifts = std::vector<Data::StarGift>();
gifts.reserve(list.size());
for (const auto &gift : list) {
if (auto parsed = FromTL(session, gift)) {
@@ -620,7 +641,8 @@ auto PremiumGiftCodeOptions::requestStarGifts()
};
}
const std::vector<StarGift> &PremiumGiftCodeOptions::starGifts() const {
auto PremiumGiftCodeOptions::starGifts() const
-> const std::vector<Data::StarGift> & {
return _gifts;
}
@@ -693,28 +715,38 @@ rpl::producer<rpl::no_value, QString> SponsoredToggle::setToggled(bool v) {
};
}
RequirePremiumState ResolveRequiresPremiumToWrite(
MessageMoneyRestriction ResolveMessageMoneyRestrictions(
not_null<PeerData*> peer,
History *maybeHistory) {
const auto user = peer->asUser();
if (!user
|| !user->someRequirePremiumToWrite()
|| user->session().premium()) {
return RequirePremiumState::No;
} else if (user->requirePremiumToWriteKnown()) {
return user->meRequiresPremiumToWrite()
? RequirePremiumState::Yes
: RequirePremiumState::No;
} else if (user->flags() & UserDataFlag::MutualContact) {
return RequirePremiumState::No;
} else if (!maybeHistory) {
return RequirePremiumState::Unknown;
if (const auto channel = peer->asChannel()) {
return {
.starsPerMessage = channel->starsPerMessageChecked(),
.known = true,
};
}
const auto user = peer->asUser();
if (!user) {
return { .known = true };
} else if (user->messageMoneyRestrictionsKnown()) {
return {
.starsPerMessage = user->starsPerMessageChecked(),
.premiumRequired = (user->requiresPremiumToWrite()
&& !user->session().premium()),
.known = true,
};
} else if (user->hasStarsPerMessage()) {
return {};
} else if (!user->hasRequirePremiumToWrite()) {
return { .known = true };
} else if (user->flags() & UserDataFlag::MutualContact) {
return { .known = true };
} else if (!maybeHistory) {
return {};
}
const auto update = [&](bool require) {
using Flag = UserDataFlag;
constexpr auto known = Flag::RequirePremiumToWriteKnown;
constexpr auto me = Flag::MeRequiresPremiumToWrite;
constexpr auto known = Flag::MessageMoneyRestrictionsKnown;
constexpr auto me = Flag::RequiresPremiumToWrite;
user->setFlags((user->flags() & ~me)
| known
| (require ? me : Flag()));
@@ -726,16 +758,19 @@ RequirePremiumState ResolveRequiresPremiumToWrite(
const auto item = view->data();
if (!item->out() && !item->isService()) {
update(false);
return RequirePremiumState::No;
return { .known = true };
}
}
}
if (user->isContact() // Here we know, that we're not in his contacts.
&& maybeHistory->loadedAtTop() // And no incoming messages.
&& maybeHistory->loadedAtBottom()) {
update(true);
return {
.premiumRequired = !user->session().premium(),
.known = true,
};
}
return RequirePremiumState::Unknown;
return {};
}
rpl::producer<DocumentData*> RandomHelloStickerValue(
@@ -758,40 +793,100 @@ rpl::producer<DocumentData*> RandomHelloStickerValue(
}) | rpl::take(1) | rpl::map(random));
}
std::optional<StarGift> FromTL(
std::optional<Data::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),
.convertStars = 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(),
};
return gift.match([&](const MTPDstarGift &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 std::optional<Data::StarGift>();
}
return std::optional<Data::StarGift>(Data::StarGift{
.id = uint64(data.vid().v),
.stars = int64(data.vstars().v),
.starsConverted = int64(data.vconvert_stars().v),
.starsToUpgrade = int64(data.vupgrade_stars().value_or_empty()),
.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(),
.upgradable = data.vupgrade_stars().has_value(),
.birthday = data.is_birthday(),
});
}, [&](const MTPDstarGiftUnique &data) {
const auto total = data.vavailability_total().v;
auto model = std::optional<Data::UniqueGiftModel>();
auto pattern = std::optional<Data::UniqueGiftPattern>();
for (const auto &attribute : data.vattributes().v) {
attribute.match([&](const MTPDstarGiftAttributeModel &data) {
model = FromTL(session, data);
}, [&](const MTPDstarGiftAttributePattern &data) {
pattern = FromTL(session, data);
}, [&](const MTPDstarGiftAttributeBackdrop &data) {
}, [&](const MTPDstarGiftAttributeOriginalDetails &data) {
});
}
if (!model
|| !model->document->sticker()
|| !pattern
|| !pattern->document->sticker()) {
return std::optional<Data::StarGift>();
}
auto result = Data::StarGift{
.id = uint64(data.vid().v),
.unique = std::make_shared<Data::UniqueGift>(Data::UniqueGift{
.id = data.vid().v,
.slug = qs(data.vslug()),
.title = qs(data.vtitle()),
.ownerAddress = qs(data.vowner_address().value_or_empty()),
.ownerName = qs(data.vowner_name().value_or_empty()),
.ownerId = (data.vowner_id()
? peerFromMTP(*data.vowner_id())
: PeerId()),
.number = data.vnum().v,
.model = *model,
.pattern = *pattern,
}),
.document = model->document,
.limitedLeft = (total - data.vavailability_issued().v),
.limitedCount = total,
};
const auto unique = result.unique.get();
for (const auto &attribute : data.vattributes().v) {
attribute.match([&](const MTPDstarGiftAttributeModel &data) {
}, [&](const MTPDstarGiftAttributePattern &data) {
}, [&](const MTPDstarGiftAttributeBackdrop &data) {
unique->backdrop = FromTL(data);
}, [&](const MTPDstarGiftAttributeOriginalDetails &data) {
unique->originalDetails = FromTL(session, data);
});
}
return std::make_optional(result);
});
}
std::optional<UserStarGift> FromTL(
not_null<UserData*> to,
const MTPuserStarGift &gift) {
std::optional<Data::SavedStarGift> FromTL(
not_null<PeerData*> to,
const MTPsavedStarGift &gift) {
const auto session = &to->session();
const auto &data = gift.data();
auto parsed = FromTL(session, data.vgift());
if (!parsed) {
return {};
} else if (const auto unique = parsed->unique.get()) {
unique->starsForTransfer = data.vtransfer_stars().value_or(-1);
unique->exportAt = data.vcan_export_at().value_or_empty();
}
return UserStarGift{
using Id = Data::SavedStarGiftId;
return Data::SavedStarGift{
.info = std::move(*parsed),
.manageId = (to->isUser()
? Id::User(data.vmsg_id().value_or_empty())
: Id::Chat(to, data.vsaved_id().value_or_empty())),
.message = (data.vmessage()
? TextWithEntities{
.text = qs(data.vmessage()->data().vtext()),
@@ -800,16 +895,72 @@ std::optional<UserStarGift> FromTL(
data.vmessage()->data().ventities().v),
}
: TextWithEntities()),
.convertStars = int64(data.vconvert_stars().value_or_empty()),
.starsConverted = int64(data.vconvert_stars().value_or_empty()),
.starsUpgradedBySender = int64(
data.vupgrade_stars().value_or_empty()),
.fromId = (data.vfrom_id()
? peerFromUser(data.vfrom_id()->v)
? peerFromMTP(*data.vfrom_id())
: PeerId()),
.messageId = data.vmsg_id().value_or_empty(),
.date = data.vdate().v,
.upgradable = data.is_can_upgrade(),
.anonymous = data.is_name_hidden(),
.pinned = data.is_pinned_to_top(),
.hidden = data.is_unsaved(),
.mine = to->isSelf(),
};
}
Data::UniqueGiftModel FromTL(
not_null<Main::Session*> session,
const MTPDstarGiftAttributeModel &data) {
auto result = Data::UniqueGiftModel{
.document = session->data().processDocument(data.vdocument()),
};
result.name = qs(data.vname());
result.rarityPermille = data.vrarity_permille().v;
return result;
}
Data::UniqueGiftPattern FromTL(
not_null<Main::Session*> session,
const MTPDstarGiftAttributePattern &data) {
auto result = Data::UniqueGiftPattern{
.document = session->data().processDocument(data.vdocument()),
};
result.document->overrideEmojiUsesTextColor(true);
result.name = qs(data.vname());
result.rarityPermille = data.vrarity_permille().v;
return result;
}
Data::UniqueGiftBackdrop FromTL(const MTPDstarGiftAttributeBackdrop &data) {
auto result = Data::UniqueGiftBackdrop();
result.name = qs(data.vname());
result.rarityPermille = data.vrarity_permille().v;
result.centerColor = Ui::ColorFromSerialized(
data.vcenter_color());
result.edgeColor = Ui::ColorFromSerialized(
data.vedge_color());
result.patternColor = Ui::ColorFromSerialized(
data.vpattern_color());
result.textColor = Ui::ColorFromSerialized(
data.vtext_color());
return result;
}
Data::UniqueGiftOriginalDetails FromTL(
not_null<Main::Session*> session,
const MTPDstarGiftAttributeOriginalDetails &data) {
auto result = Data::UniqueGiftOriginalDetails();
result.date = data.vdate().v;
result.senderId = data.vsender_id()
? peerFromMTP(*data.vsender_id())
: PeerId();
result.recipientId = peerFromMTP(data.vrecipient_id());
result.message = data.vmessage()
? ParseTextWithEntities(session, *data.vmessage())
: TextWithEntities();
return result;
}
} // namespace Api

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