Compare commits

...

244 Commits

Author SHA1 Message Date
John Preston
14e4524776 Version 4.4.
- You can set a Global Auto-Delete Timer
for all new chats and groups you create.
- New messages will be deleted after 1 day, week, month,
or a custom duration you choose.
- The new menu in Settings > Privacy & Security > Auto-Delete Messages
also lets you set up Auto-Delete for any of your existing chats faster.
- Admins of groups with 100+ members can organize discussions
into separate topics.
- Topics now have a two-column layout
that keeps recent chats easily accessible as you browse topics.
- Previews of topic messages in the chat list work like a button,
click to jump to the last updated topic.
- Up to 5 topics can be pinned to the top of the list.
- Each topic now supports multiple pinned messages.
- The View as Messages mode now shows
which topic each message belongs to.
- Badge counters for topics you never opened
will have a lighter, less distracting color.
- A new General topic is now included by default,
containing service messages and the earlier message history from the
group.
- Admins can rename the General topic.
- Large groups can enable Aggressive Filtering in Manage Group
> Administrators to remove more spam with automated algorithms.
- Admins help improve filtering
by reporting any false positives in Recent Actions.
2022-12-06 23:40:56 +04:00
John Preston
7dc9d5c37f Fix empty menu toggle in closed topics. 2022-12-06 23:36:28 +04:00
John Preston
d827045199 Fix possible crash on forum switch off. 2022-12-06 23:22:50 +04:00
John Preston
76d44172f1 Add "Copy Topic Link" topic profile menu item. 2022-12-06 23:22:50 +04:00
23rd
afc9eb7cef Improved filter of list to apply TTL for multiple chats. 2022-12-06 22:17:33 +03:00
John Preston
b0bb8b05fd Fix reply from notification replyTo field value. 2022-12-06 22:52:04 +04:00
John Preston
6e75668e45 Fix forum without last topic opening. 2022-12-06 22:51:33 +04:00
John Preston
f86afc9539 Fix userpics view cache invalidation. 2022-12-06 22:51:14 +04:00
John Preston
74ecd44294 Show anti-spam checkbox only to admins. 2022-12-06 22:50:54 +04:00
John Preston
273a2809cf Fix username change error display. 2022-12-06 22:13:15 +04:00
John Preston
ebb6b4ab63 Fix build. 2022-12-06 21:10:37 +04:00
John Preston
a8106aa38d Fix glitches in search results. 2022-12-06 20:33:17 +04:00
John Preston
6abfdd20fa Don't apply deleted GYP patch in Windows prepare. 2022-12-06 18:23:51 +04:00
John Preston
4dd1f95fbf Disable deprecated warning when building dump_syms.
Fixes #25366.
2022-12-06 18:13:23 +04:00
John Preston
a1faee285c Use LTCG on Windows for two targets only. 2022-12-06 18:11:47 +04:00
John Preston
8937d732f6 Fix build with GCC. 2022-12-06 18:08:07 +04:00
John Preston
589556442c Closed alpha version 4.3.4.1. 2022-12-06 16:50:03 +04:00
GitHub Action
0e6b333bde Update User-Agent for DNS to Chrome 107.0.5304.110. 2022-12-06 16:47:50 +04:00
Ilya Fedin
9328f31a65 Configure the template chooser 2022-12-06 16:47:06 +04:00
John Preston
d5c145b707 Fix forum userpic rounding on Retina screens. 2022-12-06 16:38:54 +04:00
John Preston
3649cb41e2 Fix build with Xcode. 2022-12-06 16:38:42 +04:00
John Preston
cd85c4911c Migrate macOS build to patched Qt 6.3.2.
Fixes #24915.
2022-12-06 16:38:08 +04:00
John Preston
4db2b83c9b Fix Ctrl+Tab/Ctrl+Shift+Tab jumps in topics. 2022-12-06 14:32:46 +04:00
John Preston
a1de77e8d2 Improve child list closing. 2022-12-06 14:32:46 +04:00
23rd
6bd2be0aee Added support of drag events to back button in dialogs list. 2022-12-06 12:56:56 +03:00
23rd
1b364f2621 Added support of drag events to filters menu. 2022-12-06 12:56:56 +03:00
23rd
0310d9902c Added ripple animation to right action in messages. 2022-12-06 12:56:56 +03:00
23rd
d55d383627 Cached TTL badge in dialogs list. 2022-12-06 12:56:56 +03:00
23rd
84de08cad6 Added separated unread counter to single peer window titles. 2022-12-06 12:56:56 +03:00
23rd
cc0b1b1d54 Added option for chat names in titles of single peer windows. 2022-12-06 12:56:56 +03:00
23rd
e2205c7251 Fixed build on macOS. 2022-12-06 12:56:56 +03:00
John Preston
2d6bac5a28 Fix background color in collapsed row with child list. 2022-12-06 13:05:05 +04:00
John Preston
7ad26a0fca Fix minimal unwrapped message height as userpic size.
Fixes #25354.
2022-12-06 13:04:38 +04:00
John Preston
48148a8cc3 Revert "Provide the same sizes for tray icon as for main window icon"
This reverts commit f9bf68461d.
2022-12-06 12:55:09 +04:00
John Preston
1be37a10b3 Show info on forum top bar click. 2022-12-06 12:46:10 +04:00
John Preston
4937cea38f Fix reply-to re-appear after voice message sending. 2022-12-06 12:38:46 +04:00
John Preston
b775d577a4 Fix forum rounding in folder editing box. 2022-12-06 12:12:07 +04:00
John Preston
cb653df0f6 Support adaptive forum userpic rounding radius. 2022-12-05 16:18:10 +04:00
John Preston
2407ac50bc Improve shading of collapsed chats list. 2022-12-05 10:07:54 +04:00
John Preston
fbf3168317 Fix crash in unread bar destruction. 2022-12-05 09:47:54 +04:00
John Preston
fe9cf7ddad Report in forum menu, remove from topic menu. 2022-12-05 09:03:31 +04:00
John Preston
88b555e907 Fix incorrect topic names in forum preview row. 2022-12-05 08:55:39 +04:00
23rd
234fdbed4a One more time fixed display of send as button above voice record bar. 2022-12-05 05:35:26 +03:00
23rd
6cb0834d19 Added chat name to titles of single peer windows. 2022-12-05 02:49:34 +03:00
John Preston
e26dd4e418 Fix a crash in chats filter results. 2022-12-04 08:00:20 +04:00
John Preston
a8c230aba3 Update API scheme on layer 150: AntiSpam admin log. 2022-12-04 08:00:20 +04:00
23rd
b81868eeba Simplified drawing of empty userpics in theme previews. 2022-12-04 03:46:44 +03:00
23rd
b2e9c4ab75 Moved Ui::EmptyUserpic to td_ui. 2022-12-04 03:46:44 +03:00
23rd
a458c89810 Changed default colors for empty userpic backgrounds. 2022-12-04 03:46:44 +03:00
23rd
5df0b08a42 Added support of second colors for empty userpic backgrounds. 2022-12-04 03:46:44 +03:00
23rd
c8d273c2a3 Added some icons for global TTL settings and anti-spam. 2022-12-03 18:58:14 +03:00
23rd
badebb261b Fixed reporting to anti-spam incorrect message id from admin log. 2022-12-03 18:58:06 +03:00
23rd
beb062dd64 Removed requesting of full peers from box of applying TTL for chats.
Since TTL is provided from the dialog info.
2022-12-03 13:51:14 +03:00
John Preston
33c0c79593 Correct unread counter after first topic open. 2022-12-02 21:29:51 +04:00
John Preston
1a9c6749ae Correct pen width in TTL dialogs badge. 2022-12-02 20:51:06 +04:00
John Preston
587715a966 Add jump-to-topic panel to stickers. 2022-12-02 20:32:06 +04:00
John Preston
b5cb2bc9f0 Fix build on Qt 5.* for Windows. 2022-12-02 18:31:52 +04:00
John Preston
a4e4681835 Add jump-to-topic panel in View as Messages. 2022-12-02 18:20:22 +04:00
John Preston
8281990bb8 Fix some HP device model names on Linux. 2022-12-02 18:20:22 +04:00
23rd
2c1e7bfcb6 Added ability to forward messages to multiple chats. 2022-12-02 17:02:11 +03:00
23rd
bd8e7fdddd Moved out sending method of many messages to many peers to single place. 2022-12-02 17:01:11 +03:00
John Preston
037f2bcce2 Fix closing forum by escape. 2022-12-02 13:48:30 +04:00
23rd
819e1602ef Slightly improved style of anti-spam buttons. 2022-12-02 01:46:31 +03:00
23rd
fe6ad54836 Fixed crash in translate box for text with spoilers. 2022-12-02 01:23:54 +03:00
23rd
92756f418b Added TTL badge to dialogs list. 2022-12-02 00:28:19 +03:00
23rd
cbbbcd877c Added support of switching between corner layers in dialogs list. 2022-12-02 00:25:23 +03:00
John Preston
34f0aae418 Respect topic pin limit from appConfig. 2022-12-01 21:44:32 +04:00
John Preston
f0b8ccbd71 Collapse forum row height in narrow layout. 2022-12-01 21:36:26 +04:00
John Preston
c200263f2e Don't duplicate Update Telegram / Download Bar. 2022-12-01 19:18:32 +04:00
John Preston
1ff53eb585 Fix opening _childList from archive. 2022-12-01 18:59:03 +04:00
John Preston
32491ead5e Animate child topics list open / close. 2022-12-01 18:03:20 +04:00
John Preston
468d01fc1a Show square rounded photo in forum userpic change message. 2022-12-01 17:48:15 +04:00
John Preston
1c44121db7 Fix forum userpic button if no userpic is set. 2022-12-01 17:43:29 +04:00
John Preston
b561705528 Use Window::SlideAnimation in all widgets. 2022-12-01 14:18:37 +04:00
23rd
eed706f917 Added ability to filter and report of anti-spam in admin log. 2022-12-01 05:49:33 +03:00
23rd
4bd2091e6e Added initial ability to enable anti-spam mode in megagroups. 2022-12-01 05:49:33 +03:00
23rd
22f45bc1fb Added loading peer animation to peer list content. 2022-12-01 05:49:33 +03:00
23rd
1cc3440fcc Added new loading element animation for peer list. 2022-12-01 05:49:33 +03:00
23rd
1cd4cb3baa Added ability to set TTL on creation groups. 2022-12-01 05:49:33 +03:00
23rd
11165abc09 Removed skip translation setting when it is disabled. 2022-11-30 17:17:16 +03:00
23rd
f8a17bd9c9 Moved tmp string for temporary folder to single place. 2022-11-30 17:17:16 +03:00
23rd
47bb04b019 Added ability to download multiple files to custom location. 2022-11-30 17:17:16 +03:00
23rd
8bcb30e84d Added settings link for global TTL to TTL box. 2022-11-30 17:17:16 +03:00
23rd
81c48e1b09 Added phrase of global TTL for new chats. 2022-11-30 17:17:16 +03:00
23rd
377ee7df06 Added ability to apply TTL for multiple chats. 2022-11-30 17:17:16 +03:00
23rd
4fabb3f2a2 Replaced some qsl with u""_q literal. 2022-11-30 17:17:14 +03:00
John Preston
ad3f8e72a0 Remove namespace App. 2022-11-30 17:28:09 +04:00
John Preston
01139e1b04 Remove facades module. 2022-11-30 16:55:51 +04:00
John Preston
eaed91263e Simplify HistoryHider, remove most of uses. 2022-11-30 16:13:31 +04:00
John Preston
188c6ba64a Paint expanded topics indicator. 2022-11-30 13:57:00 +04:00
John Preston
823bbb1b77 Fix jump-to-topic area and unread counter overlapping. 2022-11-30 13:55:46 +04:00
John Preston
f324017299 Don't open unread topic on full forum row click. 2022-11-30 13:03:42 +04:00
John Preston
76837c6f44 Fix render glitches in pinned forum reordering. 2022-11-30 13:03:42 +04:00
John Preston
5e6a4d9e8d Fix crash in jump-to-topic from filtered results. 2022-11-30 13:03:42 +04:00
John Preston
01773e5bb1 Fix custom notifications in topics. 2022-11-30 13:03:42 +04:00
John Preston
5d8a2bc7b7 Implement simple sub-column for topics list. 2022-11-30 13:03:42 +04:00
John Preston
beaea9c57d Update dialog row height on topic switch. 2022-11-29 23:13:51 +04:00
John Preston
3c799a5cc1 Correctly track General editing service messages. 2022-11-29 23:13:51 +04:00
John Preston
5e20c15c20 Adapt edit topic box to General. 2022-11-29 23:13:51 +04:00
23rd
d0ae07f3c2 Added initial implementation of global TTL settings. 2022-11-29 18:03:37 +03:00
23rd
97fa92de0b Added api support for global TTL settings. 2022-11-29 17:41:20 +03:00
23rd
c481d48865 Added some phrases for global TTL settings. 2022-11-29 17:41:20 +03:00
John Preston
545cf93d82 Show nice General icon in an empty topic. 2022-11-29 18:30:38 +04:00
John Preston
6ff29b8902 Don't show 'Discussion started' in General topic. 2022-11-29 18:30:38 +04:00
John Preston
623176e901 Show loading state for non-loaded forum topics list. 2022-11-29 18:30:38 +04:00
John Preston
03b35457fa Fix collapsed narrow archive row display. 2022-11-29 18:30:38 +04:00
John Preston
01748d8aba Better General topic support. 2022-11-29 18:30:38 +04:00
John Preston
7866013ab6 Clear draft that failed to be saved. 2022-11-29 18:30:38 +04:00
John Preston
ac3834bfdb Support custom icon for General topic. 2022-11-29 18:30:38 +04:00
John Preston
57af221d39 Support General topic somehow. 2022-11-29 18:30:38 +04:00
John Preston
8cd5105813 Fix unread badge render glitch. 2022-11-29 18:30:38 +04:00
John Preston
d89573bab5 Update API scheme to layer 150. 2022-11-29 18:30:38 +04:00
23rd
39f9fee22f Added ability to translate peer description. 2022-11-29 15:56:17 +03:00
23rd
6695d7d503 Respected copy restriction on translate box. 2022-11-29 14:57:53 +03:00
23rd
3fdb807a1e Respected new error for occupied usernames in manage channel. 2022-11-29 14:12:57 +03:00
23rd
2acedca6b7 Replaced some qstr with u""_q literal. 2022-11-29 14:12:50 +03:00
23rd
22dc7023fc Respected new error for occupied usernames in UsernameBox. 2022-11-29 14:12:50 +03:00
23rd
9946fbbd89 Moved out check info text in UsernameBox to separated row. 2022-11-29 14:12:50 +03:00
23rd
fec7febc8e Added small round to document thumbnails in overview layout. 2022-11-29 14:12:50 +03:00
23rd
0b86caef67 Added ability to translate polls. 2022-11-29 14:12:49 +03:00
John Preston
c39b9e9635 Add 'Copy Username' context menu to usernames in profiles. 2022-11-29 13:42:09 +04:00
Ilya Fedin
05524c3f6c Don't show reply button in Linux native notifications when it's not supposed to
All modern notification daemons have support for the default action and it's a requirement with the portal spec
2022-11-28 21:55:00 +01:00
Ilya Fedin
b9a766387c Replace docker buildx with DOCKER_BUILDKIT=1 environment variable
This seem to work better with distribution-provided Docker
2022-11-28 21:54:37 +01:00
Ilya Fedin
54a0f443b4 Better check for download path availability in sandbox 2022-11-28 12:16:57 +01:00
Ilya Fedin
04a8a9b7ee Update lib_base 2022-11-28 12:12:09 +01:00
Ilya Fedin
c77f07239f Have full path to the binary in .desktop file
After removing the -workdir, this is the last difference with URL scheme handler command
2022-11-28 12:12:09 +01:00
Ilya Fedin
b383dad6ac Install launcher before registering URL scheme 2022-11-28 12:12:09 +01:00
Ilya Fedin
f18bf46fb1 Speed up Linux action
The binary is stripped anyway, there's no sense in producing debug symbols
2022-11-28 12:09:45 +01:00
Ilya Fedin
2bda3c4e2b Don't save temp file for native notification userpics on Linux 2022-11-26 22:15:39 +01:00
Ilya Fedin
4484edd212 Get rid of unneeded QTextStream from GenerateDesktopFile 2022-11-26 17:26:52 +01:00
Ilya Fedin
ace363f432 Use GBytesIcon with GNotification
GFileIcon is not supported by xdg-desktop-portal
2022-11-26 17:26:52 +01:00
Ilya Fedin
d6ed23b3dd Fix race condition between GApplication and GNotification 2022-11-26 17:26:52 +01:00
Ilya Fedin
51cd07945b Restore launchable tag in metainfo
Fixes #25378
2022-11-26 17:26:52 +01:00
Ilya Fedin
9ee4ad95d0 Fix GApplication with some binary paths 2022-11-26 17:26:52 +01:00
Ilya Fedin
4ade80905f Add proper build-time checks to AutostartSupported on Linux 2022-11-26 17:26:52 +01:00
Ilya Fedin
70b039a6e4 Don't build unneeded libprotoc in snap 2022-11-26 17:26:52 +01:00
John Preston
4bde87cda4 Don't use LTCG in Debug builds on Windows. 2022-11-25 16:56:42 +01:00
Ilya Fedin
94b4809cdf Get XDG activation token also from DESKTOP_STARTUP_ID 2022-11-25 15:11:25 +01:00
Ilya Fedin
109f6614f0 Unset XDG_ACTIVATION_TOKEN after used with GApplication 2022-11-25 15:11:25 +01:00
23rd
88b0ea70b3 Respected download manager when loading multiple files from menu. 2022-11-25 16:42:47 +03:00
23rd
c7583e3106 Fixed codesign in Github CI on macOS. 2022-11-25 16:42:47 +03:00
23rd
b9003202bf Removed differentiation of replies by color in channels. 2022-11-25 16:42:47 +03:00
23rd
53c4b511f8 Fixed different configuration flags for FFmpeg on macOS. 2022-11-25 16:01:41 +03:00
John Preston
b474db2106 Version 4.3.4.
- Fix OpenGL regression in Qt and language detection.
2022-11-25 12:21:45 +01:00
Ilya Fedin
ca408828c1 Update patches on Linux 2022-11-25 12:20:12 +01:00
Ilya Fedin
d63e483615 Use command-chain for desktop-launch in snap 2022-11-25 12:20:12 +01:00
Ilya Fedin
bea3e5d48f Add mm-common to glibmm build-packages 2022-11-25 12:20:12 +01:00
Ilya Fedin
8b20c27ba7 Add protobuf to snap 2022-11-25 12:20:12 +01:00
Ilya Fedin
e561f93d44 Revert "Implement sonnet-based language detection backend"
This reverts commit 4b2d8b0c53.
2022-11-25 12:20:12 +01:00
Ilya Fedin
5df4dd36a7 Update Python to 3.8 in Docker 2022-11-25 11:14:15 +01:00
John Preston
1e6937a075 Version 4.3.3.
- Fix an issue with media auto-download on Windows.
- Fix switching accounts in maximized window.
- Fix collapsed archive row layout.
2022-11-23 23:09:31 +01:00
John Preston
d714c1edc0 Update submodules. 2022-11-23 23:01:05 +01:00
John Preston
ebf46e1270 Paint unread counter in expanded archive row. 2022-11-23 23:01:05 +01:00
John Preston
116a598508 Fix displaying of collapsed archive row. 2022-11-23 23:01:05 +01:00
23rd
f9a14fc6bc Fixed first check for skipping translation. 2022-11-23 23:01:05 +01:00
23rd
7cdc3eb2b2 Fixed translation of non-server messages. 2022-11-23 23:01:04 +01:00
23rd
294432ceed Differentiated replies in groups by color. 2022-11-23 23:01:04 +01:00
23rd
551bf4f9a7 Switched default language for skip translation to application language. 2022-11-23 23:01:04 +01:00
Ilya Fedin
4b2d8b0c53 Implement sonnet-based language detection backend 2022-11-23 23:00:06 +01:00
John Preston
58e35dec12 Fix auto-download with LTCG on Windows. 2022-11-23 10:07:16 +01:00
John Preston
ae90347c6c Revert "Fixed switching between accounts with filters at screen edge."
This reverts commit 8f3c3b2a54.

Regressions with account switch in a maximized window.
2022-11-23 00:44:31 +01:00
John Preston
1aece79a47 Version 4.3.2.
- Enable message translations in Settings > Language.
- Fast jump to the last updated topic.
- Bug fixes and other minor improvements.
2022-11-22 00:28:07 +00:00
John Preston
79a2d85287 Fix build with GCC. 2022-11-22 00:28:07 +00:00
23rd
937d243a4c Respected translation preferences in sections. 2022-11-22 00:28:07 +00:00
23rd
f82bae15f0 Added translation preferences. 2022-11-22 00:28:07 +00:00
23rd
7aede75e43 Added external cld3 library. 2022-11-22 00:28:03 +00:00
23rd
b72fce4894 Removed LanguageBox::createMultiSelect method. 2022-11-22 00:26:49 +00:00
23rd
32cebc0d9b Fixed position of show more button in translate box. 2022-11-22 00:26:49 +00:00
John Preston
2de76cb75b Highlight primary usernames in profiles like the additional ones. 2022-11-22 00:26:49 +00:00
John Preston
ab06574fd9 Add some margin for one-line profile values copying. 2022-11-22 00:26:49 +00:00
John Preston
473e190aeb Fix single-column forum-by-user search. 2022-11-22 00:26:49 +00:00
John Preston
4b5a0942b1 Open just topic in quick jump-to-last-topic click. 2022-11-22 00:26:49 +00:00
John Preston
106bdae9ce Always open first topic in two-column layout. 2022-11-22 00:26:49 +00:00
John Preston
f97e5d6307 Fix build with Xcode. 2022-11-22 00:26:49 +00:00
John Preston
bb106b07af Show small unread mark for non-opened topics. 2022-11-22 00:26:49 +00:00
John Preston
ce631436bf Show non-read non-opened topics as unread. 2022-11-22 00:26:49 +00:00
23rd
bc5aa7338e Removed inaccessible users from choosing recipients for forwards box. 2022-11-22 00:26:49 +00:00
23rd
6db7840fa7 Added translate ability to context menu. 2022-11-22 00:26:49 +00:00
23rd
921d2239c7 Added initial implementation of choosing translation language from list. 2022-11-22 00:26:49 +00:00
23rd
0feef675f7 Added loading text effect to translate box. 2022-11-22 00:26:49 +00:00
23rd
f16d30de37 Added initial implementation of loading element effect. 2022-11-22 00:26:49 +00:00
23rd
cf54d9fb12 Moved out glare effect to separate file. 2022-11-22 00:26:49 +00:00
23rd
b7647fbcc1 Added initial implementation of translate box. 2022-11-22 00:26:49 +00:00
23rd
95a1ab6b0b Fixed display of send as button above voice record bar. 2022-11-22 00:26:49 +00:00
23rd
823b4e6b98 Added icon for inaccessible users. 2022-11-22 00:26:49 +00:00
23rd
3467fe226f Added ability to send webp as compressed image. 2022-11-22 00:26:49 +00:00
23rd
57c50c8655 Optimized includes of attach_prepare.h. 2022-11-22 00:26:48 +00:00
23rd
8f3c3b2a54 Fixed switching between accounts with filters at screen edge. 2022-11-22 00:26:48 +00:00
23rd
efc0908ed8 Fixed forum closing with Back mouse button.
- Fixed #25330.
2022-11-22 00:26:48 +00:00
John Preston
561e3f4809 Handle clicks on topic jump area. 2022-11-22 00:26:48 +00:00
John Preston
ede34578da Display jump to last topic message bubble. 2022-11-22 00:26:48 +00:00
John Preston
97356032ac Fix build in Xcode. 2022-11-22 00:26:48 +00:00
John Preston
4c8187f623 Topics list in forum chats list entry. 2022-11-22 00:26:48 +00:00
John Preston
996b6bf46a Fix unread mentions / reactions button in topics. 2022-11-22 00:26:48 +00:00
John Preston
37308cde21 Support dialog rows with variable height. 2022-11-22 00:26:48 +00:00
John Preston
248337daf5 Implement topics pin limit box. 2022-11-22 00:26:48 +00:00
John Preston
8a288476b8 Implement pinned topics reordering. 2022-11-22 00:26:48 +00:00
John Preston
c7741cb62a Apply short topic info from channelMessages. 2022-11-22 00:26:48 +00:00
John Preston
983b6af0b4 Update API scheme to layer 149. 2022-11-22 00:26:48 +00:00
Ilya Fedin
a94dd22caa Rewrite GenerateDesktopFile using Glib::KeyFile and KShell 2022-11-21 21:30:17 +00:00
Ilya Fedin
899ab9a16a Fix range loop warnings in Snap build 2022-11-21 21:30:17 +00:00
Ilya Fedin
2f0d14bd35 Use customWorkingDir() outside of Core::Launcher
This allows to add -workdir to shortcuts only if the process was launched with -workdir
2022-11-21 21:30:17 +00:00
Ilya Fedin
9b66b76bac Use GNotification only in flatpak by default
The UX is not the best without sound, so there's no advantage in using GNotification on GNOME.

Remove mention about being native to GNOME as it's not true anymore.
2022-11-20 08:52:36 +00:00
Ilya Fedin
a1e60a3f20 Ensure GNotification is not autodetected in snap
Snap reports it as present, but prevents the access and GNotification attempts to use portal that doesn't work in snap
2022-11-19 02:21:51 +04:00
Ilya Fedin
f7971733f4 Update msys2 base
It has new signatures and fixes the CI
2022-11-19 02:21:32 +04:00
Ilya Fedin
e33b62ad28 Update cmake_helpers 2022-11-18 20:40:57 +04:00
Ilya Fedin
82629dd3e5 Update Qt to 6.4.1 on Linux 2022-11-18 20:40:57 +04:00
Ilya Fedin
768fc9b8f6 Use the new Glib::Variant qint64/quint64 compatibility with old code 2022-11-18 20:40:33 +04:00
Ilya Fedin
b9b6a9e747 Follow desktop file naming specification
This is required for GApplication to enable all the features

https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#file-naming
2022-11-18 20:40:33 +04:00
Ilya Fedin
b4d310fd1e Don't subscribe to inhibiton changes when not supported 2022-11-18 20:40:33 +04:00
Ilya Fedin
f9dd2b4a0a Support GNotification
It's used if there's a gtk notification daemon or application is running sandboxed without access to the freedesktop protocol.

GNotification API is poor, but should feel native on environments using GNOME technologies.
2022-11-18 20:40:33 +04:00
Ilya Fedin
afaad155a0 Update to changes in MPRIS SystemMediaControlsManager backend
And let it use service name provided by flatpak by default
2022-11-11 11:47:13 +04:00
Ilya Fedin
9726b3c298 Avoid race condition when registering Wayland interfaces 2022-11-11 11:47:01 +04:00
23rd
85b94bc6fd Changed behavior to always delete messages for bots.
Fixed #17033.
2022-11-11 11:45:13 +04:00
23rd
f0645753d4 Toggled checkbox of deleting messages for both participants. 2022-11-11 11:45:13 +04:00
23rd
8b570f2e8f Fixed duplicated transcribe buttons for video messages.
Fixed #25327.
2022-11-11 11:45:13 +04:00
23rd
2b7b278b52 Respected global notify sound for Saved Messages.
Fixed #25315.
2022-11-11 11:45:13 +04:00
23rd
a02c01cce7 Added phrases for various types of albums in chats list. 2022-11-11 11:45:13 +04:00
23rd
9601207b2c Fixed warnings from Github CI. 2022-11-11 11:45:12 +04:00
John Preston
c06f0b3ea1 Fix contact status bar in single column layout. 2022-11-11 11:44:10 +04:00
John Preston
b514496546 Simplify SendProgressManager::done prototype. 2022-11-11 11:44:03 +04:00
John Preston
ca460dab6d Fix mute value casting. 2022-11-11 11:43:47 +04:00
John Preston
644ec1f599 Remove base::Observable / base::Variable. 2022-11-11 11:43:24 +04:00
John Preston
73e2cc96d1 Fix music player with RTL song names. 2022-11-11 11:43:06 +04:00
Ilya Fedin
d756ecc609 Handle cancel in menu_item_download_files, too 2022-11-10 17:43:48 +04:00
Ilya Fedin
0cd0ad7a5b Handle cancel for default download path in Linux sandbox 2022-11-10 00:24:37 +04:00
John Preston
9229c57e7a Fix monospace-wide comments thread root message.
Fixes #16343.
2022-11-09 12:51:44 +04:00
John Preston
5b17416177 Fix spoiler glitches in reply previews. 2022-11-09 12:40:28 +04:00
John Preston
0b7a2c18a2 Pause spoilers in reply / edit panels. 2022-11-09 12:40:27 +04:00
John Preston
187f5fa4f3 Fix emoji panel section appearance in topics. 2022-11-09 11:00:24 +04:00
John Preston
3fad69d3c8 Hide pinned bar in topics for a single pin. 2022-11-09 11:00:22 +04:00
John Preston
7e2a49c1f9 Fix possible crash in pinned bar destruction. 2022-11-09 10:22:48 +04:00
John Preston
66435d5269 Better folder / chat closing by escape. 2022-11-09 10:22:44 +04:00
John Preston
4a8b5c3015 Add "Show Topics List" button to topic profile. 2022-11-09 10:22:33 +04:00
John Preston
d0d2a4f488 Show messages count in forum. 2022-11-09 10:22:23 +04:00
John Preston
8ee28f6665 Skip forum send action painting. 2022-11-09 10:22:07 +04:00
John Preston
a2b0c551c2 Pass default download path in sandboxed environments. 2022-11-09 10:21:52 +04:00
Ilya Fedin
bff641c217 Update cmake_helpers 2022-11-08 23:37:58 +04:00
Ilya Fedin
a9c0b817d1 Explain how to build a backward compatible binary on Linux 2022-11-08 23:37:58 +04:00
Ilya Fedin
0f38dabd84 Update cmake for -flto=auto support 2022-11-08 23:37:58 +04:00
Ilya Fedin
8552047210 Always build glibmm with LTO to be able to build backward compatible binary 2022-11-08 23:37:58 +04:00
John Preston
092923fe6e Don't autodownload files if sandbox prevents it.
Partially fixes #25308.
2022-11-08 18:26:02 +04:00
John Preston
ab5792f59f Revert "Fix crash when asking download path in sandbox environment"
This reverts commit a4b0443047.
2022-11-08 18:26:01 +04:00
Dragoon Aethis
9d59e42b52 Add an experimental "small message radius" toggle (#25305)
Add an experimental "small message radius" toggle.

This toggle allows switching to the pre-4.3.0, smaller message bubble
radius after an app restart. The message bubble radius styles now have
to be referenced via the Ui::BubbleRadius* and Ui::MsgFileThumbRadius*
wrappers to use the appropriate value.
2022-11-08 14:19:17 +04:00
503 changed files with 11950 additions and 5902 deletions

View File

@@ -1,8 +0,0 @@
---
name: Question
about: Ask a question.
title: "[Question] "
labels: 'question'
assignees: ''
---

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: API issue
url: https://bugs.telegram.org
about: Any bug report or feature request affecting more than only Telegram Desktop.
- name: Issue of other client
url: https://bugs.telegram.org
about: Any bug report or feature request not about Telegram Desktop.
- name: Question
url: https://t.me/TelegramDesktopTalk
about: Ask a question.

View File

@@ -20,7 +20,7 @@ jobs:
steps:
- name: Clone.
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
with:
submodules: recursive
@@ -31,7 +31,7 @@ jobs:
run: |
cd Telegram/build/docker/centos_env
poetry install
DEBUG= LTO= poetry run gen_dockerfile | docker buildx build -t $IMAGE_TAG -
DEBUG= LTO= poetry run gen_dockerfile | DOCKER_BUILDKIT=1 docker build -t $IMAGE_TAG -
- name: Push the Docker image.
if: ${{ github.ref_name == github.event.repository.default_branch }}

View File

@@ -51,7 +51,7 @@ jobs:
defaults:
run:
shell: scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- bash --noprofile --norc -eo pipefail {0}
shell: scl enable rh-python38 -- scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- bash --noprofile --norc -eo pipefail {0}
strategy:
matrix:
@@ -69,7 +69,7 @@ jobs:
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Clone.
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
@@ -93,6 +93,8 @@ jobs:
fi
./configure.sh \
-D CMAKE_C_FLAGS_DEBUG="" \
-D CMAKE_CXX_FLAGS_DEBUG="" \
-D CMAKE_C_FLAGS="-Werror" \
-D CMAKE_CXX_FLAGS="-Werror" \
-D CMAKE_EXE_LINKER_FLAGS="-s" \

View File

@@ -56,7 +56,7 @@ jobs:
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Clone.
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
@@ -73,7 +73,7 @@ jobs:
- name: ThirdParty cache.
id: cache-third-party
uses: actions/cache@v2
uses: actions/cache@v3.0.11
with:
path: ThirdParty
key: ${{ runner.OS }}-third-party-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
@@ -81,7 +81,7 @@ jobs:
- name: Libraries cache.
id: cache-libs
uses: actions/cache@v2
uses: actions/cache@v3.0.11
with:
path: Libraries
key: ${{ runner.OS }}-libs-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
@@ -119,7 +119,7 @@ jobs:
cd ../out
xcoderun='xcodebuild build -project Telegram.xcodeproj -scheme Telegram -destination "platform=macOS,arch=x86_64" -configuration Debug'
xcoderun='xcodebuild build -project Telegram.xcodeproj -scheme Telegram -destination "platform=macOS,arch=x86_64" -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO'
bash -c "$xcoderun" || bash -c "$xcoderun" || bash -c "$xcoderun"
- name: Move artifact.

View File

@@ -11,7 +11,7 @@ jobs:
SKIP: "0"
to_branch: "master"
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3.1.0
if: env.SKIP == '0'
- name: Push the code to the master branch.
if: env.SKIP == '0'

View File

@@ -47,7 +47,7 @@ jobs:
steps:
- name: Clone.
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
submodules: recursive

View File

@@ -60,21 +60,24 @@ jobs:
steps:
- name: Prepare directories.
run: |
mkdir %userprofile%\TBuild
mklink /d %GITHUB_WORKSPACE%\TBuild %userprofile%\TBuild
echo TBUILD=%GITHUB_WORKSPACE%\TBuild>>%GITHUB_ENV%
mkdir %userprofile%\TBuild Libraries
mklink /d %userprofile%\TBuild\Libraries %GITHUB_WORKSPACE%\Libraries
echo TBUILD=%userprofile%\TBuild>>%GITHUB_ENV%
- name: Get repository name.
shell: bash
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- uses: ilammy/msvc-dev-cmd@v1.10.0
- uses: ilammy/msvc-dev-cmd@v1.12.0
name: Native Tools Command Prompt.
with:
arch: ${{ matrix.arch }}
- name: Clone.
uses: LebedevRI/checkout@issue197
uses: actions/checkout@v3.1.0
with:
submodules: recursive
path: ${{ env.TBUILD }}\${{ env.REPO_NAME }}
@@ -98,7 +101,7 @@ jobs:
- name: Libraries cache.
id: cache-libs
uses: actions/cache@v2
uses: actions/cache@v3.0.11
with:
path: Libraries
key: ${{ runner.OS }}-${{ matrix.arch }}-libs-${{ env.CACHE_KEY }}
@@ -132,7 +135,6 @@ jobs:
- name: Telegram Desktop build.
if: env.ONLY_CACHE == 'false'
run: |
C:
cd %TBUILD%\%REPO_NAME%\Telegram
call configure.bat ^

3
.gitmodules vendored
View File

@@ -97,3 +97,6 @@
[submodule "Telegram/ThirdParty/kcoreaddons"]
path = Telegram/ThirdParty/kcoreaddons
url = https://github.com/KDE/kcoreaddons.git
[submodule "Telegram/ThirdParty/cld3"]
path = Telegram/ThirdParty/cld3
url = https://github.com/google/cld3.git

View File

@@ -54,9 +54,9 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
if (WIN32)
set(qt_version 5.15.4)
elseif (APPLE)
set(qt_version 6.3.1)
set(qt_version 6.3.2)
else()
set(qt_version 6.4.0)
set(qt_version 6.4.1)
endif()
endif()
include(cmake/external/qt/package.cmake)

View File

@@ -287,6 +287,8 @@ PRIVATE
boxes/sticker_set_box.h
boxes/stickers_box.cpp
boxes/stickers_box.h
boxes/translate_box.cpp
boxes/translate_box.h
boxes/url_auth_box.cpp
boxes/url_auth_box.h
boxes/username_box.cpp
@@ -581,6 +583,8 @@ PRIVATE
dialogs/ui/dialogs_layout.h
dialogs/ui/dialogs_message_view.cpp
dialogs/ui/dialogs_message_view.h
dialogs/ui/dialogs_topics_view.cpp
dialogs/ui/dialogs_topics_view.h
dialogs/ui/dialogs_video_userpic.cpp
dialogs/ui/dialogs_video_userpic.h
editor/color_picker.cpp
@@ -976,6 +980,8 @@ PRIVATE
media/view/media_view_playback_progress.cpp
media/view/media_view_playback_progress.h
media/view/media_view_open_common.h
menu/menu_antispam_validator.cpp
menu/menu_antispam_validator.h
menu/menu_item_download_files.cpp
menu/menu_item_download_files.h
menu/menu_mute.cpp
@@ -1125,6 +1131,7 @@ PRIVATE
platform/platform_integration.h
platform/platform_main_window.h
platform/platform_notifications_manager.h
platform/platform_specific.cpp
platform/platform_specific.h
platform/platform_tray.h
platform/platform_window_title.h
@@ -1168,6 +1175,8 @@ PRIVATE
settings/settings_experimental.h
settings/settings_folders.cpp
settings/settings_folders.h
settings/settings_global_ttl.cpp
settings/settings_global_ttl.h
settings/settings_information.cpp
settings/settings_information.h
settings/settings_intro.cpp
@@ -1264,8 +1273,6 @@ PRIVATE
ui/widgets/level_meter.h
ui/countryinput.cpp
ui/countryinput.h
ui/empty_userpic.cpp
ui/empty_userpic.h
ui/filter_icons.cpp
ui/filter_icons.h
ui/filter_icon_panel.cpp
@@ -1337,8 +1344,6 @@ PRIVATE
apiwrap.cpp
apiwrap.h
config.h
facades.cpp
facades.h
logs.cpp
logs.h
main.cpp
@@ -1596,6 +1601,17 @@ if (WIN32)
/DELAYLOAD:wtsapi32.dll
/DELAYLOAD:propsys.dll
)
if (NOT build_win64 AND DESKTOP_APP_SPECIAL_TARGET)
target_compile_options(Telegram
PRIVATE
$<IF:$<CONFIG:Debug>,,/GL>
)
target_link_options(Telegram
PRIVATE
$<IF:$<CONFIG:Debug>,,/LTCG>
)
endif()
endif()
target_prepare_qrc(Telegram)
@@ -1680,8 +1696,9 @@ endif()
if (LINUX AND DESKTOP_APP_USE_PACKAGED)
include(GNUInstallDirs)
configure_file("../lib/xdg/telegramdesktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/telegramdesktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/telegramdesktop.metainfo.xml")
configure_file("../lib/xdg/org.telegram.desktop.desktop" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.desktop" @ONLY)
configure_file("../lib/xdg/org.telegram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml")
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "telegram.png")
@@ -1690,6 +1707,6 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "telegram.png")
install(FILES "../lib/xdg/telegramdesktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/telegramdesktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
endif()

Binary file not shown.

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>general</title>
<g id="general" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M14.4576257,1.02558449 C15.189053,1.1696007 15.6657078,1.88165413 15.5222641,2.61600035 L14.8818905,5.62412405 L16.6504058,5.62421139 C17.3957661,5.62421139 18,6.23085664 18,6.97919149 C18,7.72752633 17.3957661,8.33417159 16.6504058,8.33417159 L14.3525674,8.33397488 L13.6850637,11.7513347 L15.3008116,11.7515071 C16.0461719,11.7515071 16.6504058,12.3581524 16.6504058,13.1064872 C16.6504058,13.8548221 16.0461719,14.4614673 15.3008116,14.4614673 L13.1557407,14.4614328 L12.4307242,17.9055215 C12.2872804,18.6398677 11.5780573,19.1184247 10.84663,18.9744085 C10.1152028,18.8303923 9.63854794,18.1183389 9.7819917,17.3839927 L10.4051821,14.4614328 L7.75733538,14.4614328 L7.03234733,17.9055215 C6.90989534,18.5324024 6.37514133,18.9728813 5.76623746,18.9987859 L5.71387199,19 C5.62631985,19.0002755 5.53745163,18.9919715 5.44825318,18.9744085 C4.71682589,18.8303923 4.24017107,18.1183389 4.38361482,17.3839927 L5.00702313,14.4614328 L3.34959422,14.4614673 C2.60423391,14.4614673 2,13.8548221 2,13.1064872 C2,12.3581524 2.60423391,11.7515071 3.34959422,11.7515071 L5.53634616,11.7513347 L6.20384986,8.33397488 L4.69918844,8.33417159 C3.95382813,8.33417159 3.34959422,7.72752633 3.34959422,6.97919149 C3.34959422,6.23085664 3.95382813,5.62421139 4.69918844,5.62421139 L6.73317289,5.62412405 L7.4751547,2.09447154 C7.60110532,1.44967974 8.16325465,1.00209364 8.79363004,1 L8.84631136,1.00087004 C8.91674267,1.00340951 8.98789009,1.01153413 9.05924885,1.02558449 C9.79067614,1.1696007 10.267331,1.88165413 10.1238872,2.61600035 L9.48348515,5.62412405 L12.1315782,5.62412405 L12.8735316,2.09447154 C13.0169753,1.36012532 13.7261984,0.881568286 14.4576257,1.02558449 Z M10.9345052,11.7513347 L11.6020089,8.33397488 L8.95416211,8.33397488 L8.28665842,11.7513347 L10.9345052,11.7513347 Z" id="Combined-Shape-Copy-6" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -204,6 +204,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_filter_pin_limit2#one" = "Unpin some of the currently pinned ones or subscribe to **Telegram Premium** to double the limit to **{count}** chat.";
"lng_filter_pin_limit2#other" = "Unpin some of the currently pinned ones or subscribe to **Telegram Premium** to double the limit to **{count}** chats.";
"lng_forum_pin_limit#one" = "Sorry, you can't pin more than **{count}** topic to the top.";
"lng_forum_pin_limit#other" = "Sorry, you can't pin more than **{count}** topics to the top.";
"lng_fave_sticker_limit_title#one" = "The Limit of {count} Stickers Reached";
"lng_fave_sticker_limit_title#other" = "The Limit of {count} Stickers Reached";
"lng_fave_sticker_limit_more#one" = "An older sticker was replaced with this one.\nYou can {link} to {count} sticker.";
@@ -399,6 +402,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_username_invalid" = "This username is invalid.";
"lng_username_occupied" = "This username is already occupied.";
"lng_username_too_short" = "This username is too short.";
"lng_username_purchase_available" = "Sorry, this link is occupied by someone. But it's available for purchase through\nofficial {link}.";
"lng_username_bad_symbols" = "Only a-z, 0-9, and underscores allowed.";
"lng_username_available" = "This username is available.";
"lng_username_not_found" = "User @{user} not found.";
@@ -663,6 +667,37 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_cloud_password_email_confirm" = "Confirm and Finish";
"lng_settings_cloud_password_reset_in" = "You can reset your password in {duration}.";
"lng_settings_ttl_title" = "Auto-Delete Messages";
"lng_settings_ttl_about" = "Automatically delete messages for everyone after a period of time in all new chats you start.";
"lng_settings_ttl_after" = "After {after_duration}";
"lng_settings_ttl_after_hours#one" = "{count} hour";
"lng_settings_ttl_after_hours#other" = "{count} hours";
"lng_settings_ttl_after_days#one" = "{count} day";
"lng_settings_ttl_after_days#other" = "{count} days";
"lng_settings_ttl_after_weeks#one" = "{count} week";
"lng_settings_ttl_after_weeks#other" = "{count} weeks";
"lng_settings_ttl_after_months#one" = "{count} month";
"lng_settings_ttl_after_months#other" = "{count} months";
"lng_settings_ttl_after_years#one" = "{count} year";
"lng_settings_ttl_after_years#other" = "{count} years";
"lng_settings_ttl_after_off" = "Off";
"lng_settings_ttl_after_custom" = "Set Custom Time";
"lng_settings_ttl_after_about" = "If enabled, all new messages in chats you start will be automatically deleted for everyone at some point after they have been sent. You can also {link}.";
"lng_settings_ttl_after_about_link" = "apply this setting for your existing chats";
"lng_settings_ttl_after_subtitle" = "Self-destruct timer";
"lng_settings_ttl_after_sure" = "Are you sure you want all messages in new chats started by you to be automatically deleted for everyone {after_duration} after they have been sent?";
"lng_settings_ttl_after_toast" = "Messages in all new chats you start will be automatically deleted after {after_duration}.";
"lng_settings_ttl_select_chats_title" = "Select Chats";
"lng_settings_ttl_select_chats_subtitle" = "to apply the self-destruct timer";
"lng_settings_ttl_select_chats_subtitle_chosen" = "will have the self-destruct timer";
"lng_settings_ttl_select_chats_status" = "auto-delete after {after_duration}";
"lng_settings_ttl_select_chats_status_disabled" = "auto-deletion disabled";
"lng_settings_ttl_select_chats_toast#one" = "Self-destruct timer for {duration} has been enabled in {count} selected chat.";
"lng_settings_ttl_select_chats_toast#other" = "Self-destruct timer for {duration} has been enabled in {count} selected chats.";
"lng_settings_ttl_select_chats_disabled_toast#one" = "Self-destruct timer has been disabled in {count} selected chat.";
"lng_settings_ttl_select_chats_disabled_toast#other" = "Self-destruct timer has been disabled in {count} selected chats.";
"lng_clear_payment_info_title" = "Clear payment info";
"lng_clear_payment_info_sure" = "Are you sure you want to clear your payment and shipping info?";
"lng_clear_payment_info_shipping" = "Shipping info";
@@ -1234,6 +1269,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_manage_peer_reactions_some_title" = "Only allow these reactions";
"lng_manage_peer_reactions_available" = "Available reactions";
"lng_manage_peer_antispam" = "Aggressive Anti-Spam";
"lng_manage_peer_antispam_about" = "Telegram will filter more spam but may occasionally affect ordinary messages. You can report False Positives in Recent Actions.";
"lng_manage_peer_antispam_not_enough#one" = "Aggressive filtering can be enabled only in groups with more than **{count} member**.";
"lng_manage_peer_antispam_not_enough#other" = "Aggressive filtering can be enabled only in groups with more than **{count} members**.";
"lng_manage_peer_group_type" = "Group type";
"lng_manage_peer_channel_type" = "Channel type";
"lng_manage_peer_link_type" = "Link type";
@@ -1293,6 +1333,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_ttl_edit_about" = "Automatically delete new messages after a certain period of time for you and {user}.";
"lng_ttl_edit_about_group" = "Automatically delete new messages sent in this chat after a certain period of time.";
"lng_ttl_edit_about_channel" = "Automatically delete new messages sent in this channel after a certain period of time.";
"lng_ttl_edit_about2" = "You can also set your default {link} for all chats in Settings.";
"lng_ttl_edit_about2_link" = "self-destruct timer";
"lng_ttl_edit_save" = "Confirm";
"lng_ttl_about_tooltip" = "New messages in this chat will be automatically deleted in {duration}.";
"lng_ttl_about_tooltip_channel" = "New messages in this chat will be automatically deleted in {duration}.";
@@ -1360,6 +1402,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_create_group_next" = "Next";
"lng_create_group_create" = "Create";
"lng_create_group_title" = "New Group";
"lng_create_group_ttl_about" = "Automatically delete messages in this group for everyone after a period of time.";
"lng_create_channel_title" = "New Channel";
"lng_create_public_channel_title" = "Public Channel";
"lng_create_public_channel_about" = "Anyone can find the channel in search and join";
@@ -1382,6 +1425,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_create_channel_link_too_short" = "Sorry, this link is too short";
"lng_create_channel_link_bad_symbols" = "Only 0-9, a-z, and underscores allowed.";
"lng_create_channel_link_available" = "This link is available";
"lng_create_channel_link_pending" = "Checking name...";
"lng_create_channel_link_copied" = "Link copied to clipboard";
"lng_create_group_crop" = "Select an area for group photo";
@@ -1453,6 +1497,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_action_ttl_changed" = "{from} has set messages to auto-delete in {duration}";
"lng_action_ttl_changed_you" = "You set messages to auto-delete in {duration}";
"lng_action_ttl_changed_channel" = "New messages will auto-delete in {duration}";
"lng_action_ttl_global" = "{from} uses a self-destruct timer for all chats. All new messages in this chat will be automatically deleted after {duration} they've been sent.";
"lng_action_ttl_removed" = "{from} has set messages not to auto-delete";
"lng_action_ttl_removed_you" = "You disabled the auto-delete timer";
"lng_action_ttl_removed_channel" = "New messages will not auto-delete";
@@ -1936,6 +1981,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_in_dlg_sticker" = "Sticker";
"lng_in_dlg_sticker_emoji" = "{emoji} Sticker";
"lng_in_dlg_poll" = "Poll";
"lng_in_dlg_media_count#one" = "{count} media";
"lng_in_dlg_media_count#other" = "{count} media";
"lng_in_dlg_photo_count#one" = "{count} photo";
"lng_in_dlg_photo_count#other" = "{count} photos";
"lng_in_dlg_video_count#one" = "{count} video";
"lng_in_dlg_video_count#other" = "{count} videos";
"lng_in_dlg_file_count#one" = "{count} file";
"lng_in_dlg_file_count#other" = "{count} files";
"lng_in_dlg_audio_count#one" = "{count} audio";
"lng_in_dlg_audio_count#other" = "{count} audio";
"lng_ban_user" = "Ban User";
"lng_delete_all_from_user" = "Delete all from {user}";
@@ -2186,6 +2241,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_context_copy_link" = "Copy Link";
"lng_context_copy_message_link" = "Copy Message Link";
"lng_context_copy_post_link" = "Copy Post Link";
"lng_context_copy_topic_link" = "Copy Topic Link";
"lng_context_copy_email" = "Copy Email Address";
"lng_context_copy_hashtag" = "Copy Hashtag";
"lng_context_copy_mention" = "Copy Username";
@@ -2245,6 +2301,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_context_delete_from_disk" = "Delete from disk";
"lng_context_delete_all_files" = "Delete all files";
"lng_context_save_custom_sound" = "Save for notifications";
"lng_context_translate" = "Translate";
"lng_context_translate_selected" = "Translate Selected Text";
"lng_context_animated_emoji" = "This message contains emoji from **{name} pack**.";
"lng_context_animated_emoji_many#one" = "This message contains emoji from **{count} pack**.";
@@ -3081,6 +3139,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_admin_log_disallowed_unmute_self_channel" = "{from} started muting new live stream members";
"lng_admin_log_participant_volume" = "{from} changed voice chat volume for {user} to {percent}";
"lng_admin_log_participant_volume_channel" = "{from} changed live stream volume for {user} to {percent}";
"lng_admin_log_antispam_enabled" = "{from} enabled aggressive anti-spam";
"lng_admin_log_antispam_disabled" = "{from} disabled aggressive anti-spam";
"lng_admin_log_user_with_username" = "{name} ({mention})";
"lng_admin_log_messages_ttl_set" = "{from} enabled messages auto-delete after {duration}";
"lng_admin_log_messages_ttl_changed" = "{from} changed messages auto-delete period from {previous} to {duration}";
@@ -3126,6 +3186,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_admin_log_admin_manage_calls_channel" = "Manage live streams";
"lng_admin_log_admin_add_admins" = "Add new admins";
"lng_admin_log_antispam_menu_report" = "Report False Positive";
"lng_admin_log_antispam_menu_report_toast" = "You can manage anti-spam settings in {link}.";
"lng_admin_log_antispam_menu_report_toast_link" = "Group Info > Administrators";
"lng_terms_signup" = "By signing up,\nyou agree to the {link}.";
"lng_terms_signup_link" = "Terms of Service";
"lng_terms_header" = "Terms of Service";
@@ -3372,6 +3436,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_language_not_ready_about" = "Unfortunately, this custom language pack ({lang_name}) doesn't contain data for Telegram Desktop. You can contribute to this language pack using the {link}.";
"lng_language_not_ready_link" = "translations platform";
"lng_translate_box_original" = "Original";
"lng_translate_box_error" = "Translate failed.";
"lng_translate_settings_subtitle" = "Translate Messages";
"lng_translate_settings_show" = "Show Translate Button";
"lng_translate_settings_choose" = "Do Not Translate";
"lng_translate_settings_about" = "The 'Translate' button will appear when you open a context menu on a text message.";
"lng_launch_exe_warning" = "This file has a {extension} extension.\nAre you sure you want to run it?";
"lng_launch_svg_warning" = "Opening this file can potentially expose your IP address to its sender. Continue?";
"lng_launch_exe_sure" = "Run";
@@ -3556,6 +3628,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_forum_create_topic" = "Create topic";
"lng_forum_discard_sure" = "Are you sure you want to discard this topic?";
"lng_forum_view_as_messages" = "View as Messages";
"lng_forum_no_messages" = "No messages";
"lng_forum_messages#one" = "{count} message";
"lng_forum_messages#other" = "{count} messages";
"lng_forum_show_topics_list" = "Show Topics List";
// Wnd specific

View File

@@ -8,5 +8,6 @@
<file alias="cloud_password/password_input.tgs">../../animations/cloud_password/password_input.tgs</file>
<file alias="cloud_password/hint.tgs">../../animations/cloud_password/hint.tgs</file>
<file alias="cloud_password/email.tgs">../../animations/cloud_password/email.tgs</file>
<file alias="ttl.tgs">../../animations/ttl.tgs</file>
</qresource>
</RCC>

View File

@@ -35,6 +35,7 @@
<file alias="topic_icons/rose.svg">../../art/topic_icons/rose.svg</file>
<file alias="topic_icons/red.svg">../../art/topic_icons/red.svg</file>
<file alias="topic_icons/gray.svg">../../art/topic_icons/gray.svg</file>
<file alias="topic_icons/general.svg">../../art/topic_icons/general.svg</file>
</qresource>
<qresource prefix="/icons">
<file alias="calls/hands.lottie">../../icons/calls/hands.lottie</file>
@@ -53,6 +54,6 @@
</qresource>
<qresource prefix="/misc">
<file alias="default_shortcuts-custom.json">../../default_shortcuts-custom.json</file>
<file alias="telegramdesktop.desktop">../../../../lib/xdg/telegramdesktop.desktop</file>
<file alias="org.telegram.desktop.desktop">../../../../lib/xdg/org.telegram.desktop.desktop</file>
</qresource>
</RCC>

View File

@@ -129,7 +129,7 @@ channel#83259464 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.
channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;
chatFull#c9d31138 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions = ChatFull;
channelFull#f2355507 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions = ChatFull;
channelFull#f2355507 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions = ChatFull;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;
@@ -185,7 +185,7 @@ messageActionContactSignUp#f3f25f76 = MessageAction;
messageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;
messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;
messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> = MessageAction;
messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;
messageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.0?long = MessageAction;
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
@@ -193,9 +193,9 @@ messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
messageActionGiftPremium#aba0f5c6 currency:string amount:long months:int = MessageAction;
messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
messageActionTopicEdit#b18a431c flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool = MessageAction;
messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction;
dialog#a8edd0f5 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;
dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
photoEmpty#2331b22d id:long = Photo;
@@ -266,7 +266,7 @@ messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.channelMessages#64479808 flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesNotModified#74535f21 count:int = messages.Messages;
messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
@@ -401,7 +401,8 @@ updateRecentEmojiStatuses#30f443db = Update;
updateRecentReactions#6f7863f4 = Update;
updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?true stickerset:long = Update;
updateMessageExtendedMedia#5a73a98c peer:Peer msg_id:int extended_media:MessageExtendedMedia = Update;
updateChannelPinnedTopic#f694b0ae flags:# channel_id:long topic_id:flags.0?int = Update;
updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update;
updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@@ -723,6 +724,7 @@ auth.codeTypeSms#72a3158c = auth.CodeType;
auth.codeTypeCall#741cd3e3 = auth.CodeType;
auth.codeTypeFlashCall#226ccefb = auth.CodeType;
auth.codeTypeMissedCall#d61ad6ee = auth.CodeType;
auth.codeTypeFragmentSms#6ed998c = auth.CodeType;
auth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;
auth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;
@@ -731,6 +733,7 @@ auth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;
auth.sentCodeTypeMissedCall#82006484 prefix:string length:int = auth.SentCodeType;
auth.sentCodeTypeEmailCode#5a159841 flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true email_pattern:string length:int next_phone_login_date:flags.2?int = auth.SentCodeType;
auth.sentCodeTypeSetUpEmailRequired#a5491dea flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true = auth.SentCodeType;
auth.sentCodeTypeFragmentSms#d9565c39 url:string length:int = auth.SentCodeType;
messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;
@@ -964,6 +967,7 @@ channelAdminLogEventActionCreateTopic#58707d28 topic:ForumTopic = ChannelAdminLo
channelAdminLogEventActionEditTopic#f06fe208 prev_topic:ForumTopic new_topic:ForumTopic = ChannelAdminLogEventAction;
channelAdminLogEventActionDeleteTopic#ae168909 topic:ForumTopic = ChannelAdminLogEventAction;
channelAdminLogEventActionPinTopic#5d8d353b flags:# prev_topic:flags.0?ForumTopic new_topic:flags.1?ForumTopic = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleAntiSpam#64f36dfc new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
@@ -1466,10 +1470,14 @@ stickerKeyword#fcfeb29c document_id:long keyword:Vector<string> = StickerKeyword
username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username;
forumTopicDeleted#23f109b id:int = ForumTopic;
forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;
defaultHistoryTTL#43b46b20 period:int = DefaultHistoryTTL;
exportedContactToken#41bf109b url:string expires:int = ExportedContactToken;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -1499,6 +1507,7 @@ auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long
auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
auth.checkRecoveryPassword#d36bf79 code:string = Bool;
auth.importWebTokenAuthorization#2db873a9 api_id:int api_hash:string web_auth_token:string = auth.Authorization;
account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;
account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;
@@ -1608,6 +1617,8 @@ contacts.acceptContact#f831a20f id:InputUser = Updates;
contacts.getLocated#d348bc44 flags:# background:flags.1?true geo_point:InputGeoPoint self_expires:flags.0?int = Updates;
contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
contacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;
contacts.exportContactToken#f8654027 = ExportedContactToken;
contacts.importContactToken#13005788 token:string = User;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
@@ -1630,7 +1641,7 @@ messages.editChatTitle#73783ffd chat_id:long title:string = Updates;
messages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates;
messages.addChatUser#f24753e3 chat_id:long user_id:InputUser fwd_limit:int = Updates;
messages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;
messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
messages.createChat#34a818 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = Updates;
messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
@@ -1786,6 +1797,8 @@ messages.getTopReactions#bb8125ba limit:int hash:long = messages.Reactions;
messages.getRecentReactions#39461db2 limit:int hash:long = messages.Reactions;
messages.clearRecentReactions#9dfeefb4 = Bool;
messages.getExtendedMedia#84f80814 peer:InputPeer id:Vector<int> = Updates;
messages.setDefaultHistoryTTL#9eb51445 period:int = Bool;
messages.getDefaultHistoryTTL#658b7188 = DefaultHistoryTTL;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
@@ -1837,7 +1850,7 @@ channels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipant
channels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;
channels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;
channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
channels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;
channels.createChannel#91006707 flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string ttl_period:flags.4?int = Updates;
channels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;
channels.editTitle#566decd0 channel:InputChannel title:string = Updates;
channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;
@@ -1877,9 +1890,12 @@ channels.toggleForum#a4298b29 channel:InputChannel enabled:Bool = Updates;
channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;
channels.editForumTopic#6c883e2d flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool = Updates;
channels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;
channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates;
channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory;
channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:InputChannel order:Vector<int> = Updates;
channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates;
channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
@@ -1958,4 +1974,4 @@ stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel
stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
// LAYER 148
// LAYER 150

View File

@@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="4.3.1.0" />
Version="4.4.0.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 4,3,1,0
PRODUCTVERSION 4,3,1,0
FILEVERSION 4,4,0,0
PRODUCTVERSION 4,4,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "4.3.1.0"
VALUE "FileVersion", "4.4.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2022"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.3.1.0"
VALUE "ProductVersion", "4.4.0.0"
END
END
BLOCK "VarFileInfo"

View File

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

View File

@@ -34,8 +34,8 @@ Authorizations::Entry ParseEntry(const MTPDauthorization &data) {
|| isTest;
const auto appName = isDesktop
? QString("Telegram Desktop%1").arg(isTest ? " (GitHub)" : QString())
: qs(data.vapp_name());// +qsl(" for ") + qs(d.vplatform());
? u"Telegram Desktop%1"_q.arg(isTest ? " (GitHub)" : QString())
: qs(data.vapp_name());// + u" for "_q + qs(d.vplatform());
const auto appVer = [&] {
const auto version = qs(data.vapp_version());
if (isDesktop) {

View File

@@ -426,10 +426,19 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
return false;
}();
if (!fastSwitchDone) {
controller->content()->inlineSwitchLayer('@'
const auto botAndQuery = '@'
+ bot->username()
+ ' '
+ QString::fromUtf8(button->data));
+ QString::fromUtf8(button->data);
const auto chosen = [=](not_null<Data::Thread*> thread) {
return controller->content()->inlineSwitchChosen(
thread,
botAndQuery);
};
Window::ShowChooseRecipientBox(
controller,
chosen,
tr::lng_inline_switch_choose());
}
}
} break;

View File

@@ -17,9 +17,7 @@ namespace Api {
void SaveNewFilterPinned(
not_null<Main::Session*> session,
FilterId filterId) {
const auto &order = session->data().pinnedChatsOrder(
nullptr,
filterId);
const auto &order = session->data().pinnedChatsOrder(filterId);
auto &filters = session->data().chatsFilters();
const auto &filter = filters.applyUpdatedPinned(filterId, order);
session->api().request(MTPmessages_UpdateDialogFilter(

View File

@@ -116,14 +116,11 @@ void CheckChatInvite(
}
Core::App().hideMediaView();
const auto show = [&](not_null<PeerData*> chat) {
const auto way = Window::SectionShow::Way::Forward;
if (const auto forum = chat->forum()) {
strong->openForum(
forum->channel(),
Window::SectionShow::Way::Forward);
strong->showForum(forum, way);
} else {
strong->showPeerHistory(
chat,
Window::SectionShow::Way::Forward);
strong->showPeerHistory(chat, way);
}
};
result.match([=](const MTPDchatInvite &data) {
@@ -174,6 +171,11 @@ void CheckChatInvite(
} // namespace Api
struct ConfirmInviteBox::Participant {
not_null<UserData*> user;
Ui::PeerUserpicView userpic;
};
ConfirmInviteBox::ConfirmInviteBox(
QWidget*,
not_null<Main::Session*> session,
@@ -244,7 +246,7 @@ ConfirmInviteBox::ConfirmInviteBox(
}
} else {
_photoEmpty = std::make_unique<Ui::EmptyUserpic>(
Data::PeerUserpicColor(0),
Ui::EmptyUserpic::UserpicColor(0),
invite.title);
}
}
@@ -359,7 +361,7 @@ void ConfirmInviteBox::paintEvent(QPaintEvent *e) {
{ .options = Images::Option::RoundCircle }));
}
} else if (_photoEmpty) {
_photoEmpty->paint(
_photoEmpty->paintCircle(
p,
(width() - st::confirmInvitePhotoSize) / 2,
st::confirmInvitePhotoTop,

View File

@@ -21,7 +21,6 @@ class SessionController;
} // namespace Window
namespace Data {
class CloudImageView;
class PhotoMedia;
} // namespace Data
@@ -55,10 +54,7 @@ protected:
void paintEvent(QPaintEvent *e) override;
private:
struct Participant {
not_null<UserData*> user;
std::shared_ptr<Data::CloudImageView> userpic;
};
struct Participant;
struct ChatInvite {
QString title;
QString about;

View File

@@ -598,7 +598,7 @@ void ChatParticipants::requestSelf(not_null<ChannelData*> channel) {
});
}).fail([=](const MTP::Error &error) {
_selfParticipantRequests.erase(channel);
if (error.type() == qstr("CHANNEL_PRIVATE")) {
if (error.type() == u"CHANNEL_PRIVATE"_q) {
channel->privateErrorReceived();
}
finalize();

View File

@@ -45,6 +45,8 @@ void ConfirmPhone::resolve(
return 0;
}, [&](const MTPDauth_sentCodeTypeSms &data) {
return data.vlength().v;
}, [&](const MTPDauth_sentCodeTypeFragmentSms &data) {
return data.vlength().v;
}, [&](const MTPDauth_sentCodeTypeCall &data) {
return data.vlength().v;
}, [&](const MTPDauth_sentCodeTypeFlashCall &) {

View File

@@ -23,7 +23,7 @@ MTPVector<MTPDocumentAttribute> ComposeSendingDocumentAttributes(
auto attributes = QVector<MTPDocumentAttribute>(1, filenameAttribute);
if (dimensions.width() > 0 && dimensions.height() > 0) {
const auto duration = document->getDuration();
if (duration >= 0 && !document->hasMimeType(qstr("image/gif"))) {
if (duration >= 0 && !document->hasMimeType(u"image/gif"_q)) {
auto flags = MTPDdocumentAttributeVideo::Flags(0);
using VideoFlag = MTPDdocumentAttributeVideo::Flag;
if (document->isVideoMessage()) {

View File

@@ -152,18 +152,22 @@ void MessagesSearch::searchReceived(
const auto total = int(data.vcount().v);
return FoundMessages{ total, std::move(items), nextToken };
}, [&](const MTPDmessages_channelMessages &data) {
if (const auto channel = _history->peer->asChannel()) {
channel->ptsReceived(data.vpts().v);
} else {
LOG(("API Error: "
"received messages.channelMessages when no channel "
"was passed!"));
}
if (_requestId != 0) {
// Don't apply cached data!
owner.processUsers(data.vusers());
owner.processChats(data.vchats());
}
if (const auto channel = _history->peer->asChannel()) {
channel->ptsReceived(data.vpts().v);
if (_requestId != 0) {
// Don't apply cached data!
channel->processTopics(data.vtopics());
}
} else {
LOG(("API Error: "
"received messages.channelMessages when no channel "
"was passed!"));
}
auto items = HistoryItemsFromTL(&owner, data.vmessages().v);
const auto total = int(data.vcount().v);
return FoundMessages{ total, std::move(items), nextToken };

View File

@@ -16,36 +16,61 @@ SelfDestruct::SelfDestruct(not_null<ApiWrap*> api)
}
void SelfDestruct::reload() {
if (_requestId) {
return;
if (!_accountTTL.requestId) {
_accountTTL.requestId = _api.request(MTPaccount_GetAccountTTL(
)).done([=](const MTPAccountDaysTTL &result) {
_accountTTL.requestId = 0;
_accountTTL.days = result.data().vdays().v;
}).fail([=] {
_accountTTL.requestId = 0;
}).send();
}
if (!_defaultHistoryTTL.requestId) {
_defaultHistoryTTL.requestId = _api.request(
MTPmessages_GetDefaultHistoryTTL()
).done([=](const MTPDefaultHistoryTTL &result) {
_defaultHistoryTTL.requestId = 0;
_defaultHistoryTTL.period = result.data().vperiod().v;
}).fail([=] {
_defaultHistoryTTL.requestId = 0;
}).send();
}
_requestId = _api.request(MTPaccount_GetAccountTTL(
)).done([=](const MTPAccountDaysTTL &result) {
_requestId = 0;
result.match([&](const MTPDaccountDaysTTL &data) {
_days = data.vdays().v;
});
}).fail([=] {
_requestId = 0;
}).send();
}
rpl::producer<int> SelfDestruct::days() const {
using namespace rpl::mappers;
return _days.value() | rpl::filter(_1 != 0);
rpl::producer<int> SelfDestruct::daysAccountTTL() const {
return _accountTTL.days.value() | rpl::filter(rpl::mappers::_1 != 0);
}
void SelfDestruct::update(int days) {
_api.request(_requestId).cancel();
_requestId = _api.request(MTPaccount_SetAccountTTL(
rpl::producer<TimeId> SelfDestruct::periodDefaultHistoryTTL() const {
return _defaultHistoryTTL.period.value();
}
TimeId SelfDestruct::periodDefaultHistoryTTLCurrent() const {
return _defaultHistoryTTL.period.current();
}
void SelfDestruct::updateAccountTTL(int days) {
_api.request(_accountTTL.requestId).cancel();
_accountTTL.requestId = _api.request(MTPaccount_SetAccountTTL(
MTP_accountDaysTTL(MTP_int(days))
)).done([=] {
_requestId = 0;
_accountTTL.requestId = 0;
}).fail([=] {
_requestId = 0;
_accountTTL.requestId = 0;
}).send();
_days = days;
_accountTTL.days = days;
}
void SelfDestruct::updateDefaultHistoryTTL(TimeId period) {
_api.request(_defaultHistoryTTL.requestId).cancel();
_defaultHistoryTTL.requestId = _api.request(
MTPmessages_SetDefaultHistoryTTL(MTP_int(period))
).done([=] {
_defaultHistoryTTL.requestId = 0;
}).fail([=] {
_defaultHistoryTTL.requestId = 0;
}).send();
_defaultHistoryTTL.period = period;
}
} // namespace Api

View File

@@ -18,14 +18,24 @@ public:
explicit SelfDestruct(not_null<ApiWrap*> api);
void reload();
void update(int days);
void updateAccountTTL(int days);
void updateDefaultHistoryTTL(TimeId period);
rpl::producer<int> days() const;
[[nodiscard]] rpl::producer<int> daysAccountTTL() const;
[[nodiscard]] rpl::producer<TimeId> periodDefaultHistoryTTL() const;
[[nodiscard]] TimeId periodDefaultHistoryTTLCurrent() const;
private:
MTP::Sender _api;
mtpRequestId _requestId = 0;
rpl::variable<int> _days = 0;
struct {
mtpRequestId requestId = 0;
rpl::variable<int> days = 0;
} _accountTTL;
struct {
mtpRequestId requestId = 0;
rpl::variable<TimeId> period = 0;
} _defaultHistoryTTL;
};

View File

@@ -141,7 +141,7 @@ void SendProgressManager::send(const Key &key, int progress) {
MTP_int(key.topMsgId),
action
)).done([=](const MTPBool &result, mtpRequestId requestId) {
done(result, requestId);
done(requestId);
}).send();
_requests.emplace(key, requestId);
@@ -171,9 +171,7 @@ bool SendProgressManager::skipRequest(const Key &key) const {
}
}
void SendProgressManager::done(
const MTPBool &result,
mtpRequestId requestId) {
void SendProgressManager::done(mtpRequestId requestId) {
for (auto i = _requests.begin(), e = _requests.end(); i != e; ++i) {
if (i->second == requestId) {
_requests.erase(i);

View File

@@ -90,7 +90,7 @@ private:
bool updated(const Key &key, bool doing);
void send(const Key &key, int progress);
void done(const MTPBool &result, mtpRequestId requestId);
void done(mtpRequestId requestId);
[[nodiscard]] bool skipRequest(const Key &key) const;

View File

@@ -166,7 +166,7 @@ void SendExistingMedia(
), [=](const MTPUpdates &result, const MTP::Response &response) {
}, [=](const MTP::Error &error, const MTP::Response &response) {
if (error.code() == 400
&& error.type().startsWith(qstr("FILE_REFERENCE_"))) {
&& error.type().startsWith(u"FILE_REFERENCE_"_q)) {
api->refreshFileReference(origin, [=](const auto &result) {
if (media->fileReference() != usedFileReference) {
repeatRequest(repeatRequest);

View File

@@ -33,12 +33,12 @@ Key ExtractKey(const QString &query) {
qthelp::UrlParamNameTransform::ToLower)
: QMap<QString, QString>();
};
if (check.startsWith(qstr("tg://privatepost"), Qt::CaseInsensitive)) {
if (check.startsWith(u"tg://privatepost"_q, Qt::CaseInsensitive)) {
const auto params = parse();
const auto channel = params.value("channel");
const auto post = params.value("post").toInt();
return (channel.toULongLong() && post) ? Key{ channel, post } : Key();
} else if (check.startsWith(qstr("tg://resolve"), Qt::CaseInsensitive)) {
} else if (check.startsWith(u"tg://resolve"_q, Qt::CaseInsensitive)) {
const auto params = parse();
const auto domain = params.value("domain");
const auto post = params.value("post").toInt();
@@ -220,7 +220,7 @@ QString ConvertPeerSearchQuery(const QString &query) {
const auto trimmed = query.trimmed();
const auto local = Core::TryConvertUrlToLocal(trimmed);
const auto check = local.isEmpty() ? trimmed : local;
if (!check.startsWith(qstr("tg://resolve"), Qt::CaseInsensitive)) {
if (!check.startsWith(u"tg://resolve"_q, Qt::CaseInsensitive)) {
return query;
}
const auto delimeter = check.indexOf('?');

View File

@@ -95,7 +95,7 @@ void ProcessScheduledMessageWithElapsedTime(
}
bool IsForceLogoutNotification(const MTPDupdateServiceNotification &data) {
return qs(data.vtype()).startsWith(qstr("AUTH_KEY_DROP_"));
return qs(data.vtype()).startsWith(u"AUTH_KEY_DROP_"_q);
}
bool HasForceLogoutNotification(const MTPUpdates &updates) {
@@ -2213,7 +2213,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
history->requestChatListMessage();
if (!history->folderKnown()
|| (!history->unreadCountKnown()
&& !history->peer->isForum())) {
&& !history->isForum())) {
history->owner().histories().requestDialogEntry(history);
}
if (!channel->amCreator()) {
@@ -2297,14 +2297,37 @@ void Updates::feedUpdate(const MTPUpdate &update) {
const auto &d = update.c_updateChannelPinnedTopic();
const auto peerId = peerFromChannel(d.vchannel_id());
if (const auto peer = session().data().peerLoaded(peerId)) {
const auto rootId = d.vtopic_id().value_or_empty();
const auto rootId = d.vtopic_id().v;
if (const auto topic = peer->forumTopicFor(rootId)) {
session().data().setChatPinned(topic, 0, true);
session().data().setChatPinned(topic, 0, d.is_pinned());
} else if (const auto forum = peer->forum()) {
if (rootId) {
forum->requestTopic(rootId);
} else {
forum->unpinTopic();
forum->requestTopic(rootId);
}
}
} break;
case mtpc_updateChannelPinnedTopics: {
const auto &d = update.c_updateChannelPinnedTopics();
const auto peerId = peerFromChannel(d.vchannel_id());
if (const auto peer = session().data().peerLoaded(peerId)) {
if (const auto forum = peer->forum()) {
const auto done = [&] {
const auto list = d.vorder();
if (!list) {
return false;
}
const auto &order = list->v;
const auto notLoaded = [&](const MTPint &topicId) {
return !forum->topicFor(topicId.v);
};
if (!ranges::none_of(order, notLoaded)) {
return false;
}
session().data().applyPinnedTopics(forum, order);
return true;
}();
if (!done) {
forum->reloadTopics();
}
}
}

View File

@@ -114,7 +114,7 @@ struct Context {
struct Userpic {
not_null<PeerData*> peer;
QString customEntityData;
mutable std::shared_ptr<Data::CloudImageView> view;
mutable Ui::PeerUserpicView view;
mutable InMemoryKey uniqueKey;
};
@@ -380,7 +380,7 @@ bool UpdateUserpics(
const auto peer = not_null{ resolved.peer };
const auto &data = ReactionEntityData(resolved.reaction);
const auto i = ranges::find(was, peer, &Userpic::peer);
if (i != end(was) && i->view) {
if (i != end(was) && i->view.cloud) {
now.push_back(std::move(*i));
now.back().customEntityData = data;
continue;

View File

@@ -39,6 +39,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_web_page.h"
#include "data/data_folder.h"
#include "data/data_forum_topic.h"
#include "data/data_forum.h"
#include "data/data_media_types.h"
#include "data/data_sparse_ids.h"
#include "data/data_search_controller.h"
@@ -95,7 +96,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/storage_shared_media.h"
#include "storage/storage_media_prepare.h"
#include "storage/storage_account.h"
#include "facades.h"
namespace {
@@ -384,10 +384,8 @@ void ApiWrap::checkChatInvite(
}
void ApiWrap::savePinnedOrder(Data::Folder *folder) {
const auto &order = _session->data().pinnedChatsOrder(
folder,
FilterId());
const auto input = [](const Dialogs::Key &key) {
const auto &order = _session->data().pinnedChatsOrder(folder);
const auto input = [](Dialogs::Key key) {
if (const auto history = key.history()) {
return MTP_inputDialogPeer(history->peer->input);
} else if (const auto folder = key.folder()) {
@@ -408,6 +406,29 @@ void ApiWrap::savePinnedOrder(Data::Folder *folder) {
)).send();
}
void ApiWrap::savePinnedOrder(not_null<Data::Forum*> forum) {
const auto &order = _session->data().pinnedChatsOrder(forum);
const auto input = [](Dialogs::Key key) {
if (const auto topic = key.topic()) {
return MTP_int(topic->rootId().bare);
}
Unexpected("Key type in pinnedDialogsOrder().");
};
auto topics = QVector<MTPint>();
topics.reserve(order.size());
ranges::transform(
order,
ranges::back_inserter(topics),
input);
request(MTPchannels_ReorderPinnedForumTopics(
MTP_flags(MTPchannels_ReorderPinnedForumTopics::Flag::f_force),
forum->channel()->inputChannel,
MTP_vector(topics)
)).done([=](const MTPUpdates &result) {
applyUpdates(result);
}).send();
}
void ApiWrap::toggleHistoryArchived(
not_null<History*> history,
bool archived,
@@ -457,15 +478,15 @@ void ApiWrap::sendMessageFail(
FullMsgId itemId) {
const auto show = ShowForPeer(peer);
if (error == qstr("PEER_FLOOD")) {
if (error == u"PEER_FLOOD"_q) {
show->showBox(
Ui::MakeInformBox(
PeerFloodErrorText(&session(), PeerFloodType::Send)),
Ui::LayerOption::CloseOther);
} else if (error == qstr("USER_BANNED_IN_CHANNEL")) {
} else if (error == u"USER_BANNED_IN_CHANNEL"_q) {
const auto link = Ui::Text::Link(
tr::lng_cant_more_info(tr::now),
session().createInternalLinkFull(qsl("spambot")));
session().createInternalLinkFull(u"spambot"_q));
show->showBox(
Ui::MakeInformBox(
tr::lng_error_public_groups_denied(
@@ -474,8 +495,8 @@ void ApiWrap::sendMessageFail(
link,
Ui::Text::WithEntities)),
Ui::LayerOption::CloseOther);
} else if (error.startsWith(qstr("SLOWMODE_WAIT_"))) {
const auto chop = qstr("SLOWMODE_WAIT_").size();
} else if (error.startsWith(u"SLOWMODE_WAIT_"_q)) {
const auto chop = u"SLOWMODE_WAIT_"_q.size();
const auto left = base::StringViewMid(error, chop).toInt();
if (const auto channel = peer->asChannel()) {
const auto seconds = channel->slowmodeSeconds();
@@ -486,7 +507,7 @@ void ApiWrap::sendMessageFail(
requestFullPeer(peer);
}
}
} else if (error == qstr("SCHEDULE_STATUS_PRIVATE")) {
} else if (error == u"SCHEDULE_STATUS_PRIVATE"_q) {
auto &scheduled = _session->data().scheduledMessages();
Assert(peer->isUser());
if (const auto item = scheduled.lookupItem(peer->id, itemId.msg)) {
@@ -495,7 +516,7 @@ void ApiWrap::sendMessageFail(
Ui::MakeInformBox(tr::lng_cant_do_this()),
Ui::LayerOption::CloseOther);
}
} else if (error == qstr("CHAT_FORWARDS_RESTRICTED")) {
} else if (error == u"CHAT_FORWARDS_RESTRICTED"_q) {
if (show->valid()) {
Ui::ShowMultilineToast({
.parentOverride = show->toastParent(),
@@ -506,7 +527,7 @@ void ApiWrap::sendMessageFail(
.duration = kJoinErrorDuration
});
}
} else if (error == qstr("PREMIUM_ACCOUNT_REQUIRED")) {
} else if (error == u"PREMIUM_ACCOUNT_REQUIRED"_q) {
Settings::ShowPremium(&session(), "premium_stickers");
}
if (const auto item = _session->data().message(itemId)) {
@@ -667,7 +688,7 @@ QString ApiWrap::exportDirectMessageLink(
auto linkItemId = item->id;
auto linkCommentId = MsgId();
auto linkThreadId = MsgId();
//auto linkThreadIsTopic = false;
auto linkThreadIsTopic = false;
if (inRepliesContext) {
if (const auto rootId = item->replyToTop()) {
const auto root = item->history()->owner().message(
@@ -689,7 +710,7 @@ QString ApiWrap::exportDirectMessageLink(
} else {
// Reply in a thread, maybe comment in a private channel.
linkThreadId = rootId;
//linkThreadIsTopic = (item->topicRootId() == rootId);
linkThreadIsTopic = (item->topicRootId() == rootId);
}
}
}
@@ -701,7 +722,7 @@ QString ApiWrap::exportDirectMessageLink(
+ '/'
+ (linkCommentId
? (post + "?comment=" + QString::number(linkCommentId.bare))
: (linkThreadId/* && !linkThreadIsTopic*/)
: (linkThreadId && !linkThreadIsTopic)
? (post + "?thread=" + QString::number(linkThreadId.bare))
: linkThreadId
? (QString::number(linkThreadId.bare) + '/' + post)
@@ -713,7 +734,7 @@ QString ApiWrap::exportDirectMessageLink(
if (const auto media = item->media()) {
if (const auto document = media->document()) {
if (document->isVideoMessage()) {
return qsl("https://telesco.pe/") + query;
return u"https://telesco.pe/"_q + query;
}
}
}
@@ -2112,6 +2133,7 @@ void ApiWrap::saveDraftsToCloud() {
if (const auto cloudDraft = history->cloudDraft(topicRootId)) {
if (cloudDraft->saveRequestId == requestId) {
history->clearCloudDraft(topicRootId);
history->applyCloudDraft(topicRootId);
}
}
const auto i = _draftsSaveRequestIds.find(weak);
@@ -2870,18 +2892,18 @@ void ApiWrap::requestMessageAfterDate(
};
const auto list = result.match([&](
const MTPDmessages_messages &data) {
return handleMessages(result.c_messages_messages());
return handleMessages(data);
}, [&](const MTPDmessages_messagesSlice &data) {
return handleMessages(result.c_messages_messagesSlice());
return handleMessages(data);
}, [&](const MTPDmessages_channelMessages &data) {
const auto &messages = result.c_messages_channelMessages();
if (peer && peer->isChannel()) {
peer->asChannel()->ptsReceived(messages.vpts().v);
if (const auto channel = peer->asChannel()) {
channel->ptsReceived(data.vpts().v);
channel->processTopics(data.vtopics());
} else {
LOG(("API Error: received messages.channelMessages when "
"no channel was passed! (ApiWrap::jumpToDate)"));
}
return handleMessages(messages);
return handleMessages(data);
}, [&](const MTPDmessages_messagesNotModified &) {
LOG(("API Error: received messages.messagesNotModified! "
"(ApiWrap::jumpToDate)"));
@@ -3352,7 +3374,10 @@ void ApiWrap::sendFiles(
std::shared_ptr<SendingAlbum> album,
const SendAction &action) {
const auto haveCaption = !caption.text.isEmpty();
if (haveCaption && !list.canAddCaption(album != nullptr)) {
if (haveCaption
&& !list.canAddCaption(
album != nullptr,
type == SendMediaType::Photo)) {
auto message = MessageToSend(action);
message.textWithTags = base::take(caption);
message.action.clearDraft = false;
@@ -3464,10 +3489,12 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
const auto replyTo = replyToId
? peer->owner().message(peer, replyToId)
: nullptr;
const auto topicRootId = replyTo ? replyTo->topicRootId() : replyToId;
const auto topic = topicRootId
? peer->forumTopicFor(topicRootId)
: nullptr;
const auto topicRootId = replyTo
? replyTo->topicRootId()
: action.topicRootId
? action.topicRootId
: Data::ForumTopic::kGeneralId;
const auto topic = peer->forumTopicFor(topicRootId);
if (!(topic ? topic->canWrite() : peer->canWrite())
|| Api::SendDice(message)) {
return;
@@ -3591,7 +3618,7 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
UnixtimeFromMsgId(response.outerMsgId));
}
}, [=](const MTP::Error &error, const MTP::Response &response) {
if (error.type() == qstr("MESSAGE_EMPTY")) {
if (error.type() == u"MESSAGE_EMPTY"_q) {
lastMessage->destroy();
} else {
sendMessageFail(error, peer, randomId, newId);

View File

@@ -32,6 +32,7 @@ class WallPaper;
struct ResolvedForwardDraft;
enum class DefaultNotify;
enum class StickersType : uchar;
class Forum;
class ForumTopic;
class Thread;
} // namespace Data
@@ -149,6 +150,7 @@ public:
void saveCurrentDraftToCloud();
void savePinnedOrder(Data::Folder *folder);
void savePinnedOrder(not_null<Data::Forum*> forum);
void toggleHistoryArchived(
not_null<History*> history,
bool archived,

View File

@@ -64,7 +64,7 @@ AboutBox::AboutBox(QWidget *parent)
}
void AboutBox::prepare() {
setTitle(rpl::single(qsl("Telegram Desktop")));
setTitle(rpl::single(u"Telegram Desktop"_q));
addButton(tr::lng_close(), [this] { closeBox(); });
@@ -94,19 +94,19 @@ void AboutBox::resizeEvent(QResizeEvent *e) {
void AboutBox::showVersionHistory() {
if (cRealAlphaVersion()) {
auto url = qsl("https://tdesktop.com/");
auto url = u"https://tdesktop.com/"_q;
if (Platform::IsWindows32Bit()) {
url += qsl("win/%1.zip");
url += u"win/%1.zip"_q;
} else if (Platform::IsWindows64Bit()) {
url += qsl("win64/%1.zip");
url += u"win64/%1.zip"_q;
} else if (Platform::IsMac()) {
url += qsl("mac/%1.zip");
url += u"mac/%1.zip"_q;
} else if (Platform::IsLinux()) {
url += qsl("linux/%1.tar.xz");
url += u"linux/%1.tar.xz"_q;
} else {
Unexpected("Platform value.");
}
url = url.arg(qsl("talpha%1_%2").arg(cRealAlphaVersion()).arg(Core::countAlphaVersionSignature(cRealAlphaVersion())));
url = url.arg(u"talpha%1_%2"_q.arg(cRealAlphaVersion()).arg(Core::countAlphaVersionSignature(cRealAlphaVersion())));
QGuiApplication::clipboard()->setText(url);
@@ -129,7 +129,7 @@ void AboutBox::keyPressEvent(QKeyEvent *e) {
}
QString telegramFaqLink() {
const auto result = qsl("https://telegram.org/faq");
const auto result = u"https://telegram.org/faq"_q;
const auto langpacked = [&](const char *language) {
return result + '/' + language;
};
@@ -139,7 +139,7 @@ QString telegramFaqLink() {
return langpacked(language);
}
}
if (current.startsWith(qstr("pt-br"))) {
if (current.startsWith(u"pt-br"_q)) {
return langpacked("br");
}
return result;
@@ -148,7 +148,7 @@ QString telegramFaqLink() {
QString currentVersionText() {
auto result = QString::fromLatin1(AppVersionStr);
if (cAlphaVersion()) {
result += qsl(" alpha %1").arg(cAlphaVersion() % 1000);
result += u" alpha %1"_q.arg(cAlphaVersion() % 1000);
} else if (AppBetaVersion) {
result += " beta";
}

View File

@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/about_sponsored_box.h"
#include "lang/lang_keys.h"
#include "ui/layers/generic_box.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/labels.h"
#include "styles/style_boxes.h"

View File

@@ -7,10 +7,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "ui/layers/generic_box.h"
namespace Ui {
class GenericBox;
void AboutSponsoredBox(not_null<Ui::GenericBox*> box);
} // namespace Ui

View File

@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "boxes/abstract_box.h"
#include "core/application.h"
#include "window/window_controller.h"
#include "mainwidget.h"
#include "mainwindow.h"
@@ -17,25 +19,30 @@ void showBox(
object_ptr<BoxContent> content,
LayerOptions options,
anim::type animated) {
if (auto w = App::wnd()) {
w->ui_showBox(std::move(content), options, animated);
const auto window = Core::IsAppLaunched()
? Core::App().primaryWindow()
: nullptr;
if (window) {
window->show(std::move(content), options, animated);
}
}
} // namespace internal
void hideLayer(anim::type animated) {
if (auto w = App::wnd()) {
w->ui_showBox(
{ nullptr },
LayerOption::CloseOther,
animated);
const auto window = Core::IsAppLaunched()
? Core::App().primaryWindow()
: nullptr;
if (window) {
window->hideLayer(animated);
}
}
bool isLayerShown() {
if (auto w = App::wnd()) return w->ui_isLayerShown();
return false;
const auto window = Core::IsAppLaunched()
? Core::App().primaryWindow()
: nullptr;
return window && window->isLayerShown();
}
} // namespace Ui

View File

@@ -47,6 +47,5 @@ QPointer<BoxType> show(
}
void hideLayer(anim::type animated = anim::type::normal);
bool isLayerShown();
} // namespace Ui

View File

@@ -21,12 +21,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "chat_helpers/emoji_suggestions_widget.h"
#include "countries/countries_instance.h" // Countries::ExtractPhoneCode.
#include "window/window_session_controller.h"
#include "menu/menu_ttl.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/labels.h"
#include "ui/toast/toast.h"
#include "ui/special_buttons.h"
#include "ui/widgets/fields/special_fields.h"
#include "ui/widgets/popup_menu.h"
#include "ui/text/format_values.h"
#include "ui/text/text_options.h"
#include "ui/text/text_utilities.h"
#include "ui/unread_badge.h"
@@ -42,8 +45,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_invite_links.h"
#include "api/api_peer_photo.h"
#include "main/main_session.h"
#include "facades.h"
#include "styles/style_info.h"
#include "styles/style_layers.h"
#include "styles/style_menu_icons.h"
#include "styles/style_boxes.h"
#include "styles/style_dialogs.h"
#include "styles/style_widgets.h"
@@ -54,19 +58,20 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace {
bool IsValidPhone(QString phone) {
phone = phone.replace(QRegularExpression(qsl("[^\\d]")), QString());
phone = phone.replace(QRegularExpression(u"[^\\d]"_q), QString());
return (phone.length() >= 8)
|| (phone == qsl("333"))
|| (phone.startsWith(qsl("42"))
|| (phone == u"333"_q)
|| (phone.startsWith(u"42"_q)
&& (phone.length() == 2
|| phone.length() == 5
|| phone.length() == 6
|| phone == qsl("4242")));
|| phone == u"4242"_q));
}
void ChatCreateDone(
not_null<Window::SessionNavigation*> navigation,
QImage image,
TimeId ttlPeriod,
const MTPUpdates &updates) {
navigation->session().api().applyUpdates(updates);
@@ -98,7 +103,10 @@ void ChatCreateDone(
chat,
std::move(image));
}
Ui::showPeerHistory(chat, ShowAtUnreadMsgId);
if (ttlPeriod) {
chat->setMessagesTTL(ttlPeriod);
}
navigation->showPeerHistory(chat);
};
if (!success) {
LOG(("API Error: chat not found in updates "
@@ -113,7 +121,7 @@ TextWithEntities PeerFloodErrorText(
PeerFloodType type) {
const auto link = Ui::Text::Link(
tr::lng_cant_more_info(tr::now),
session->createInternalLinkFull(qsl("spambot")));
session->createInternalLinkFull(u"spambot"_q));
return ((type == PeerFloodType::InviteGroup)
? tr::lng_cant_invite_not_contact
: tr::lng_cant_send_to_not_contact)(
@@ -398,7 +406,9 @@ void AddContactBox::save() {
: extractUser(list.front());
if (user) {
if (user->isContact() || user->session().supportMode()) {
Ui::showPeerHistory(user, ShowAtTheEndMsgId);
if (const auto window = user->session().tryResolveWindow()) {
window->showPeerHistory(user);
}
}
if (weak) { // showPeerHistory could close the box.
getDelegate()->hideLayer();
@@ -515,6 +525,39 @@ void GroupInfoBox::prepare() {
[=] { submit(); });
addButton(tr::lng_cancel(), [this] { closeBox(); });
if (_type == Type::Group) {
const auto top = addTopButton(st::infoTopBarMenu);
const auto menu =
top->lifetime().make_state<base::unique_qptr<Ui::PopupMenu>>();
top->setClickedCallback([=] {
*menu = base::make_unique_q<Ui::PopupMenu>(
top,
st::popupMenuWithIcons);
const auto text = tr::lng_manage_messages_ttl_menu(tr::now)
+ (_ttlPeriod
? ('\t' + Ui::FormatTTLTiny(_ttlPeriod))
: QString());
(*menu)->addAction(
text,
[=, show = std::make_shared<Ui::BoxShow>(this)] {
show->showBox(Box(TTLMenu::TTLBox, TTLMenu::Args{
.show = show,
.startTtl = _ttlPeriod,
.about = nullptr,
.callback = crl::guard(this, [=](
TimeId t,
Fn<void()> close) {
_ttlPeriod = t;
close();
}),
}));
}, &st::menuIconTTL);
(*menu)->popup(QCursor::pos());
return true;
});
}
updateMaxHeight();
}
@@ -592,14 +635,18 @@ void GroupInfoBox::createGroup(
return;
}
_creationRequestId = _api.request(MTPmessages_CreateChat(
MTP_flags(_ttlPeriod
? MTPmessages_CreateChat::Flag::f_ttl_period
: MTPmessages_CreateChat::Flags(0)),
MTP_vector<TLUsers>(inputs),
MTP_string(title)
MTP_string(title),
MTP_int(_ttlPeriod)
)).done([=](const MTPUpdates &result) {
auto image = _photo->takeResultImage();
const auto navigation = _navigation;
getDelegate()->hideLayer(); // Destroys 'this'.
ChatCreateDone(navigation, std::move(image), result);
ChatCreateDone(navigation, std::move(image), _ttlPeriod, result);
}).fail([=](const MTP::Error &error) {
const auto &type = error.type();
_creationRequestId = 0;
@@ -675,15 +722,19 @@ void GroupInfoBox::createChannel(
const QString &description) {
Expects(!_creationRequestId);
const auto flags = (_type == Type::Megagroup)
? MTPchannels_CreateChannel::Flag::f_megagroup
: MTPchannels_CreateChannel::Flag::f_broadcast;
const auto flags = ((_type == Type::Megagroup)
? MTPchannels_CreateChannel::Flag::f_megagroup
: MTPchannels_CreateChannel::Flag::f_broadcast)
| (_ttlPeriod
? MTPchannels_CreateChannel::Flag::f_ttl_period
: MTPchannels_CreateChannel::Flags(0));
_creationRequestId = _api.request(MTPchannels_CreateChannel(
MTP_flags(flags),
MTP_string(title),
MTP_string(description),
MTPInputGeoPoint(), // geo_point
MTPstring() // address
MTPstring(), // address
MTP_int((_type == Type::Megagroup) ? _ttlPeriod : 0)
)).done([=](const MTPUpdates &result) {
_navigation->session().api().applyUpdates(result);
@@ -716,6 +767,9 @@ void GroupInfoBox::createChannel(
channel,
std::move(image));
}
if (_ttlPeriod && channel->isMegagroup()) {
channel->setMessagesTTL(_ttlPeriod);
}
channel->session().api().requestFullPeer(channel);
_createdChannel = channel;
checkInviteLink();
@@ -1225,6 +1279,8 @@ SetupChannelBox::UsernameResult SetupChannelBox::parseError(
return UsernameResult::Invalid;
} else if (error == u"USERNAME_OCCUPIED"_q) {
return UsernameResult::Occupied;
} else if (error == u"USERNAME_PURCHASE_AVAILABLE"_q) {
return UsernameResult::Occupied;
} else if (error == u"USERNAMES_UNAVAILABLE"_q) {
return UsernameResult::Occupied;
} else if (error == u"CHANNEL_PUBLIC_GROUP_NA"_q) {

View File

@@ -139,6 +139,7 @@ private:
mtpRequestId _creationRequestId = 0;
bool _creatingInviteLink = false;
ChannelData *_createdChannel = nullptr;
TimeId _ttlPeriod = 0;
};

View File

@@ -273,7 +273,7 @@ notificationsSampleMargin: 2px;
notificationSampleOpacity: 0.5;
notificationSampleSize: size(64px, 16px);
membersAboutLimitPadding: margins(0px, 12px, 0px, 12px);
membersAboutLimitPadding: margins(0px, 16px, 0px, 16px);
membersAbout: FlatLabel(defaultFlatLabel) {
minWidth: 240px;
textFg: membersAboutLimitFg;

View File

@@ -229,6 +229,9 @@ void ChangePhone::EnterPhone::sendPhoneDone(
}, [&](const MTPDauth_sentCodeTypeSms &typeData) {
codeLength = typeData.vlength().v;
return true;
}, [&](const MTPDauth_sentCodeTypeFragmentSms &typeData) {
codeLength = typeData.vlength().v;
return true;
}, [&](const MTPDauth_sentCodeTypeCall &typeData) {
codeLength = typeData.vlength().v;
return true;
@@ -270,11 +273,11 @@ void ChangePhone::EnterPhone::sendPhoneFail(
const QString &phoneNumber) {
if (MTP::IsFloodError(error)) {
showError(tr::lng_flood_error(tr::now));
} else if (error.type() == qstr("PHONE_NUMBER_INVALID")) {
} else if (error.type() == u"PHONE_NUMBER_INVALID"_q) {
showError(tr::lng_bad_phone(tr::now));
} else if (error.type() == qstr("PHONE_NUMBER_BANNED")) {
} else if (error.type() == u"PHONE_NUMBER_BANNED"_q) {
Ui::ShowPhoneBannedError(&_controller->window(), phoneNumber);
} else if (error.type() == qstr("PHONE_NUMBER_OCCUPIED")) {
} else if (error.type() == u"PHONE_NUMBER_OCCUPIED"_q) {
_controller->show(
Ui::MakeInformBox(
tr::lng_change_phone_occupied(
@@ -428,13 +431,13 @@ void ChangePhone::EnterCode::showError(const QString &text) {
void ChangePhone::EnterCode::sendCodeFail(const MTP::Error &error) {
if (MTP::IsFloodError(error)) {
showError(tr::lng_flood_error(tr::now));
} else if (error.type() == qstr("PHONE_CODE_EMPTY")
|| error.type() == qstr("PHONE_CODE_INVALID")) {
} else if (error.type() == u"PHONE_CODE_EMPTY"_q
|| error.type() == u"PHONE_CODE_INVALID"_q) {
showError(tr::lng_bad_code(tr::now));
} else if (error.type() == qstr("PHONE_CODE_EXPIRED")
|| error.type() == qstr("PHONE_NUMBER_BANNED")) {
} else if (error.type() == u"PHONE_CODE_EXPIRED"_q
|| error.type() == u"PHONE_NUMBER_BANNED"_q) {
closeBox(); // Go back to phone input.
} else if (error.type() == qstr("PHONE_NUMBER_INVALID")) {
} else if (error.type() == u"PHONE_NUMBER_INVALID"_q) {
showError(tr::lng_bad_phone(tr::now));
} else {
showError(Lang::Hard::ServerError());

View File

@@ -127,7 +127,7 @@ ChooseFilterValidator::LimitData ChooseFilterValidator::limitReached(
const auto list = _history->owner().chatsFilters().list();
const auto i = ranges::find(list, filterId, &Data::ChatFilter::id);
const auto limit = _history->owner().pinnedChatsLimit(nullptr, filterId);
const auto limit = _history->owner().pinnedChatsLimit(filterId);
return {
.reached = (i != end(list))
&& !ranges::contains(i->always(), _history)

View File

@@ -1092,17 +1092,17 @@ ProxiesBoxController::ProxiesBoxController(not_null<Main::Account*> account)
void ProxiesBoxController::ShowApplyConfirmation(
Type type,
const QMap<QString, QString> &fields) {
const auto server = fields.value(qsl("server"));
const auto port = fields.value(qsl("port")).toUInt();
const auto server = fields.value(u"server"_q);
const auto port = fields.value(u"port"_q).toUInt();
auto proxy = ProxyData();
proxy.type = type;
proxy.host = server;
proxy.port = port;
if (type == Type::Socks5) {
proxy.user = fields.value(qsl("user"));
proxy.password = fields.value(qsl("pass"));
proxy.user = fields.value(u"user"_q);
proxy.password = fields.value(u"pass"_q);
} else if (type == Type::Mtproto) {
proxy.password = fields.value(qsl("secret"));
proxy.password = fields.value(u"secret"_q);
}
if (proxy) {
const auto displayed = "https://" + server + "/";
@@ -1504,12 +1504,9 @@ void ProxiesBoxController::updateView(const Item &item) {
const auto deleted = item.deleted;
const auto type = [&] {
switch (item.data.type) {
case Type::Http:
return qsl("HTTP");
case Type::Socks5:
return qsl("SOCKS5");
case Type::Mtproto:
return qsl("MTPROTO");
case Type::Http: return u"HTTP"_q;
case Type::Socks5: return u"SOCKS5"_q;
case Type::Mtproto: return u"MTPROTO"_q;
}
Unexpected("Proxy type in ProxiesBoxController::updateView.");
}();
@@ -1541,7 +1538,7 @@ void ProxiesBoxController::share(const ProxyData &proxy) {
if (proxy.type == Type::Http) {
return;
}
const auto link = qsl("https://t.me/")
const auto link = u"https://t.me/"_q
+ (proxy.type == Type::Socks5 ? "socks" : "proxy")
+ "?server=" + proxy.host + "&port=" + QString::number(proxy.port)
+ ((proxy.type == Type::Socks5 && !proxy.user.isEmpty())

View File

@@ -79,7 +79,7 @@ DeleteMessagesBox::DeleteMessagesBox(
void DeleteMessagesBox::prepare() {
auto details = TextWithEntities();
const auto appendDetails = [&](TextWithEntities &&text) {
details.append(qstr("\n\n")).append(std::move(text));
details.append(u"\n\n"_q).append(std::move(text));
};
auto deleteText = lifetime().make_state<rpl::variable<QString>>();
*deleteText = tr::lng_box_delete();
@@ -232,7 +232,7 @@ void DeleteMessagesBox::prepare() {
_revoke.create(
this,
revoke->checkbox,
false,
true,
st::defaultBoxCheckbox);
appendDetails(std::move(revoke->description));
} else if (peer->isChannel()) {
@@ -249,6 +249,9 @@ void DeleteMessagesBox::prepare() {
tr::lng_delete_for_me_chat_hint(tr::now, lt_count, count)
});
} else if (!peer->isSelf()) {
if (const auto user = peer->asUser(); user && user->isBot()) {
_revokeForBot = true;
}
appendDetails({
tr::lng_delete_for_me_hint(tr::now, lt_count, count)
});
@@ -466,7 +469,7 @@ void DeleteMessagesBox::keyPressEvent(QKeyEvent *e) {
}
void DeleteMessagesBox::deleteAndClear() {
const auto revoke = _revoke ? _revoke->checked() : false;
const auto revoke = _revoke ? _revoke->checked() : _revokeForBot;
const auto session = _session;
const auto invokeCallbackAndClose = [&] {
// deleteMessages can initiate closing of the current section,

View File

@@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "boxes/abstract_box.h"
#include "ui/layers/box_content.h"
namespace Main {
class Session;
@@ -69,6 +69,8 @@ private:
bool _moderateBan = false;
bool _moderateDeleteAll = false;
bool _revokeForBot = false;
object_ptr<Ui::FlatLabel> _text = { nullptr };
object_ptr<Ui::Checkbox> _revoke = { nullptr };
object_ptr<Ui::Checkbox> _banUser = { nullptr };

View File

@@ -40,7 +40,7 @@ void DownloadPathBox::prepare() {
_group->setChangedCallback([this](Directory value) { radioChanged(value); });
_pathLink->addClickHandler([=] { editPath(); });
if (!_path.isEmpty() && _path != qsl("tmp")) {
if (!_path.isEmpty() && _path != FileDialog::Tmp()) {
setPathText(QDir::toNativeSeparators(_path));
}
updateControlsVisibility();
@@ -73,14 +73,14 @@ void DownloadPathBox::resizeEvent(QResizeEvent *e) {
void DownloadPathBox::radioChanged(Directory value) {
if (value == Directory::Custom) {
if (_path.isEmpty() || _path == qsl("tmp")) {
if (_path.isEmpty() || _path == FileDialog::Tmp()) {
_group->setValue(_path.isEmpty() ? Directory::Downloads : Directory::Temp);
editPath();
} else {
setPathText(QDir::toNativeSeparators(_path));
}
} else if (value == Directory::Temp) {
_path = qsl("tmp");
_path = FileDialog::Tmp();
} else {
_path = QString();
}
@@ -91,7 +91,7 @@ void DownloadPathBox::radioChanged(Directory value) {
void DownloadPathBox::editPath() {
const auto initialPath = [] {
const auto path = Core::App().settings().downloadPath();
if (!path.isEmpty() && path != qstr("tmp")) {
if (!path.isEmpty() && path != FileDialog::Tmp()) {
return path.left(path.size() - (path.endsWith('/') ? 1 : 0));
}
return QString();
@@ -118,7 +118,7 @@ void DownloadPathBox::save() {
if (value == Directory::Custom) {
return _path;
} else if (value == Directory::Temp) {
return qsl("tmp");
return FileDialog::Tmp();
}
return QString();
};
@@ -134,3 +134,13 @@ void DownloadPathBox::setPathText(const QString &text) {
auto availw = st::boxWideWidth - st::boxPadding.left() - st::defaultCheck.diameter - st::defaultBoxCheckbox.textPosition.x() - st::boxPadding.right();
_pathLink->setText(st::boxTextFont->elided(text, availw));
}
DownloadPathBox::Directory DownloadPathBox::typeFromPath(
const QString &path) {
if (path.isEmpty()) {
return Directory::Downloads;
} else if (path == FileDialog::Tmp()) {
return Directory::Temp;
}
return Directory::Custom;
}

View File

@@ -39,14 +39,7 @@ private:
Custom,
};
void radioChanged(Directory value);
Directory typeFromPath(const QString &path) {
if (path.isEmpty()) {
return Directory::Downloads;
} else if (path == qsl("tmp")) {
return Directory::Temp;
}
return Directory::Custom;
}
Directory typeFromPath(const QString &path);
void save();
void updateControlsVisibility();

View File

@@ -84,7 +84,7 @@ private:
};
struct PeerButton {
not_null<History*> history;
std::shared_ptr<Data::CloudImageView> userpic;
Ui::PeerUserpicView userpic;
Ui::Text::String name;
Button button;
};

View File

@@ -49,7 +49,8 @@ public:
QString generateName() override;
QString generateShortName() override;
PaintRoundImageCallback generatePaintUserpicCallback() override;
PaintRoundImageCallback generatePaintUserpicCallback(
bool forceRound) override;
private:
[[nodiscard]] Flag flag() const;
@@ -62,7 +63,8 @@ public:
QString generateName() override;
QString generateShortName() override;
PaintRoundImageCallback generatePaintUserpicCallback() override;
PaintRoundImageCallback generatePaintUserpicCallback(
bool forceRound) override;
};
@@ -124,7 +126,8 @@ QString TypeRow::generateShortName() {
return generateName();
}
PaintRoundImageCallback TypeRow::generatePaintUserpicCallback() {
PaintRoundImageCallback TypeRow::generatePaintUserpicCallback(
bool forceRound) {
const auto flag = this->flag();
return [=](QPainter &p, int x, int y, int outerWidth, int size) {
PaintFilterChatsTypeIcon(p, flag, x, y, outerWidth, size);
@@ -153,11 +156,15 @@ QString ExceptionRow::generateShortName() {
return generateName();
}
PaintRoundImageCallback ExceptionRow::generatePaintUserpicCallback() {
PaintRoundImageCallback ExceptionRow::generatePaintUserpicCallback(
bool forceRound) {
const auto peer = this->peer();
const auto saved = peer->isSelf();
const auto replies = peer->isRepliesChat();
auto userpic = saved ? nullptr : ensureUserpicView();
auto userpic = saved ? Ui::PeerUserpicView() : ensureUserpicView();
if (forceRound && peer->isForum()) {
return ForceRoundUserpicCallback(peer);
}
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
if (saved) {
Ui::EmptyUserpic::PaintSavedMessages(p, x, y, outerWidth, size);
@@ -248,7 +255,7 @@ void PaintFilterChatsTypeIcon(
int y,
int outerWidth,
int size) {
const auto &color = [&]() -> const style::color& {
const auto &color1 = [&]() -> const style::color& {
switch (flag) {
case Flag::Contacts: return st::historyPeer4UserpicBg;
case Flag::NonContacts: return st::historyPeer7UserpicBg;
@@ -261,6 +268,19 @@ void PaintFilterChatsTypeIcon(
}
Unexpected("Flag in color paintFlagIcon.");
}();
const auto &color2 = [&]() -> const style::color& {
switch (flag) {
case Flag::Contacts: return st::historyPeer4UserpicBg2;
case Flag::NonContacts: return st::historyPeer7UserpicBg2;
case Flag::Groups: return st::historyPeer2UserpicBg2;
case Flag::Channels: return st::historyPeer1UserpicBg2;
case Flag::Bots: return st::historyPeer6UserpicBg2;
case Flag::NoMuted: return st::historyPeer6UserpicBg2;
case Flag::NoArchived: return st::historyPeer4UserpicBg2;
case Flag::NoRead: return st::historyPeer7UserpicBg2;
}
Unexpected("Flag in color paintFlagIcon.");
}();
const auto &icon = [&]() -> const style::icon& {
switch (flag) {
case Flag::Contacts: return st::windowFilterTypeContacts;
@@ -276,7 +296,9 @@ void PaintFilterChatsTypeIcon(
}();
const auto rect = style::rtlrect(x, y, size, size, outerWidth);
auto hq = PainterHighQualityEnabler(p);
p.setBrush(color->b);
auto bg = QLinearGradient(x, y, x, y + size);
bg.setStops({ { 0., color1->c }, { 1., color2->c } });
p.setBrush(bg);
p.setPen(Qt::NoPen);
p.drawEllipse(rect);
icon.paintInCenter(p, rect);
@@ -463,6 +485,6 @@ auto EditFilterChatsListController::createRow(not_null<History*> history)
void EditFilterChatsListController::updateTitle() {
const auto count = delegate()->peerListSelectedRowsCount()
- selectedTypesCount();
const auto additional = qsl("%1 / %2").arg(count).arg(_limit);
const auto additional = u"%1 / %2"_q.arg(count).arg(_limit);
delegate()->peerListSetAdditionalTitle(rpl::single(additional));
}

View File

@@ -23,18 +23,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/text/text_options.h"
#include "ui/painter.h"
#include "storage/localstorage.h"
#include "boxes/translate_box.h"
#include "ui/boxes/confirm_box.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "core/application.h"
#include "lang/lang_instance.h"
#include "lang/lang_cloud_manager.h"
#include "settings/settings_common.h"
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
#include "styles/style_info.h"
#include "styles/style_passport.h"
#include "styles/style_chat_helpers.h"
#include "styles/style_menu_icons.h"
#include "styles/style_settings.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
@@ -413,7 +416,7 @@ bool Rows::hasMenu(not_null<const Row*> row) const {
}
void Rows::share(not_null<const Row*> row) const {
const auto link = qsl("https://t.me/setlanguage/") + row->data.id;
const auto link = u"https://t.me/setlanguage/"_q + row->data.id;
QGuiApplication::clipboard()->setText(link);
Ui::Toast::Show(tr::lng_username_copied(tr::now));
}
@@ -1095,7 +1098,74 @@ void LanguageBox::prepare() {
setTitle(tr::lng_languages());
const auto select = createMultiSelect();
const auto topContainer = Ui::CreateChild<Ui::VerticalLayout>(this);
Settings::AddSubsectionTitle(
topContainer,
tr::lng_translate_settings_subtitle());
const auto translateEnabled = Settings::AddButton(
topContainer,
tr::lng_translate_settings_show(),
st::settingsButtonNoIcon
)->toggleOn(rpl::single(Core::App().settings().translateButtonEnabled()));
translateEnabled->toggledValue(
) | rpl::filter([](bool checked) {
return (checked != Core::App().settings().translateButtonEnabled());
}) | rpl::start_with_next([=](bool checked) {
Core::App().settings().setTranslateButtonEnabled(checked);
Core::App().saveSettingsDelayed();
}, translateEnabled->lifetime());
const auto label = lifetime().make_state<rpl::event_stream<QLocale>>();
const auto translateSkipWrap = topContainer->add(
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
topContainer,
object_ptr<Ui::VerticalLayout>(topContainer)));
translateSkipWrap->toggle(
translateEnabled->toggled(),
anim::type::normal);
translateSkipWrap->toggleOn(translateEnabled->toggledValue());
const auto translateSkip = Settings::AddButtonWithLabel(
translateSkipWrap->entity(),
tr::lng_translate_settings_choose(),
label->events() | rpl::map(Ui::LanguageName),
st::settingsButtonNoIcon);
{
const auto settingsLang =
Core::App().settings().skipTranslationForLanguage();
const auto locale = (settingsLang == QLocale::English)
? QLocale(Lang::LanguageIdOrDefault(Lang::Id()))
: (settingsLang == QLocale::C)
? QLocale(QLocale::English)
: QLocale(settingsLang);
label->fire_copy(locale);
}
translateSkip->setClickedCallback([=] {
Ui::BoxShow(this).showBox(
Box(Ui::ChooseLanguageBox, [=](QLocale locale) {
label->fire_copy(locale);
const auto result = (locale.language() == QLocale::English)
? QLocale::c()
: locale;
Core::App().settings().setSkipTranslationForLanguage(
result.language());
Core::App().saveSettingsDelayed();
}),
Ui::LayerOption::KeepOther);
});
Settings::AddSkip(topContainer);
Settings::AddDividerText(
topContainer,
tr::lng_translate_settings_about());
const auto select = topContainer->add(
object_ptr<Ui::MultiSelect>(
topContainer,
st::defaultMultiSelect,
tr::lng_participant_filter()));
topContainer->resizeToWidth(st::boxWidth);
using namespace rpl::mappers;
@@ -1103,18 +1173,22 @@ void LanguageBox::prepare() {
const auto inner = setInnerWidget(
object_ptr<Content>(this, recent, official),
st::boxScroll,
select->height());
topContainer->height());
inner->resizeToWidth(st::boxWidth);
const auto max = lifetime().make_state<int>(0);
rpl::combine(
inner->heightValue(),
select->heightValue(),
topContainer->heightValue(),
_1 + _2
) | rpl::start_with_next([=](int height) {
accumulate_max(*max, height);
setDimensions(st::boxWidth, qMin(*max, st::boxMaxListHeight));
}, inner->lifetime());
topContainer->heightValue(
) | rpl::start_with_next([=](int height) {
setInnerTopSkip(height);
}, inner->lifetime());
select->setSubmittedCallback([=](Qt::KeyboardModifiers) {
inner->activateBySubmit();
@@ -1180,16 +1254,6 @@ void LanguageBox::setInnerFocus() {
_setInnerFocus();
}
not_null<Ui::MultiSelect*> LanguageBox::createMultiSelect() {
const auto result = Ui::CreateChild<Ui::MultiSelect>(
this,
st::defaultMultiSelect,
tr::lng_participant_filter());
result->resizeToWidth(st::boxWidth);
result->moveToLeft(0, 0);
return result;
}
base::binary_guard LanguageBox::Show() {
auto result = base::binary_guard();

View File

@@ -33,7 +33,6 @@ protected:
private:
using Languages = Lang::CloudManager::Languages;
not_null<Ui::MultiSelect*> createMultiSelect();
int rowsInPage() const;
Fn<void()> _setInnerFocus;

View File

@@ -495,19 +495,19 @@ void PasscodeBox::setPasswordFail(const QString &type) {
closeReplacedBy();
_setRequest = 0;
if (type == qstr("PASSWORD_HASH_INVALID")
|| type == qstr("SRP_PASSWORD_CHANGED")) {
if (type == u"PASSWORD_HASH_INVALID"_q
|| type == u"SRP_PASSWORD_CHANGED"_q) {
if (_oldPasscode->isHidden()) {
_passwordReloadNeeded.fire({});
closeBox();
} else {
badOldPasscode();
}
} else if (type == qstr("SRP_ID_INVALID")) {
} else if (type == u"SRP_ID_INVALID"_q) {
handleSrpIdInvalid();
//} else if (type == qstr("NEW_PASSWORD_BAD")) {
//} else if (type == qstr("NEW_SALT_INVALID")) {
} else if (type == qstr("EMAIL_INVALID")) {
//} else if (type == u"NEW_PASSWORD_BAD"_q) {
//} else if (type == u"NEW_SALT_INVALID"_q) {
} else if (type == u"EMAIL_INVALID"_q) {
_emailError = tr::lng_cloud_password_bad_email(tr::now);
_recoverEmail->setFocus();
_recoverEmail->showError();
@@ -519,7 +519,7 @@ void PasscodeBox::setPasswordFail(
const QByteArray &newPasswordBytes,
const QString &email,
const MTP::Error &error) {
const auto prefix = qstr("EMAIL_UNCONFIRMED_");
const auto prefix = u"EMAIL_UNCONFIRMED_"_q;
if (error.type().startsWith(prefix)) {
const auto codeLength = base::StringViewMid(error.type(), prefix.size()).toInt();
@@ -552,9 +552,9 @@ void PasscodeBox::validateEmail(
_setRequest = 0;
if (MTP::IsFloodError(error)) {
errors->fire(tr::lng_flood_error(tr::now));
} else if (error.type() == qstr("CODE_INVALID")) {
} else if (error.type() == u"CODE_INVALID"_q) {
errors->fire(tr::lng_signin_wrong_code(tr::now));
} else if (error.type() == qstr("EMAIL_HASH_EXPIRED")) {
} else if (error.type() == u"EMAIL_HASH_EXPIRED"_q) {
const auto weak = Ui::MakeWeak(this);
_clearUnconfirmedPassword.fire({});
if (weak) {
@@ -801,9 +801,9 @@ bool PasscodeBox::handleCustomCheckError(const MTP::Error &error) {
bool PasscodeBox::handleCustomCheckError(const QString &type) {
if (MTP::IsFloodError(type)
|| type == qstr("PASSWORD_HASH_INVALID")
|| type == qstr("SRP_PASSWORD_CHANGED")
|| type == qstr("SRP_ID_INVALID")) {
|| type == u"PASSWORD_HASH_INVALID"_q
|| type == u"SRP_PASSWORD_CHANGED"_q
|| type == u"SRP_ID_INVALID"_q) {
setPasswordFail(type);
return true;
}
@@ -979,7 +979,7 @@ void PasscodeBox::resetSecret(
});
}).fail([=](const MTP::Error &error) {
_setRequest = 0;
if (error.type() == qstr("SRP_ID_INVALID")) {
if (error.type() == u"SRP_ID_INVALID"_q) {
handleSrpIdInvalid();
}
}).send();
@@ -1330,17 +1330,17 @@ void RecoverBox::checkSubmitFail(const MTP::Error &error) {
_submitRequest = 0;
const QString &err = error.type();
if (err == qstr("PASSWORD_EMPTY")) {
if (err == u"PASSWORD_EMPTY"_q) {
_newPasswordSet.fire(QByteArray());
getDelegate()->show(
Ui::MakeInformBox(tr::lng_cloud_password_removed()),
Ui::LayerOption::CloseOther);
} else if (err == qstr("PASSWORD_RECOVERY_NA")) {
} else if (err == u"PASSWORD_RECOVERY_NA"_q) {
closeBox();
} else if (err == qstr("PASSWORD_RECOVERY_EXPIRED")) {
} else if (err == u"PASSWORD_RECOVERY_EXPIRED"_q) {
_recoveryExpired.fire({});
closeBox();
} else if (err == qstr("CODE_INVALID")) {
} else if (err == u"CODE_INVALID"_q) {
setError(tr::lng_signin_wrong_code(tr::now));
_recoverCode->selectAll();
_recoverCode->setFocus();
@@ -1381,9 +1381,9 @@ RecoveryEmailValidation ConfirmRecoveryEmail(
*requestId = 0;
if (MTP::IsFloodError(error)) {
errors->fire(tr::lng_flood_error(tr::now));
} else if (error.type() == qstr("CODE_INVALID")) {
} else if (error.type() == u"CODE_INVALID"_q) {
errors->fire(tr::lng_signin_wrong_code(tr::now));
} else if (error.type() == qstr("EMAIL_HASH_EXPIRED")) {
} else if (error.type() == u"EMAIL_HASH_EXPIRED"_q) {
cancels->fire({});
if (*weak) {
auto box = Ui::MakeInformBox(

View File

@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/labels.h"
#include "ui/widgets/scroll_area.h"
#include "ui/widgets/popup_menu.h"
#include "ui/effects/loading_element.h"
#include "ui/effects/round_checkbox.h"
#include "ui/effects/ripple_animation.h"
#include "ui/empty_userpic.h"
@@ -47,12 +48,31 @@ PaintRoundImageCallback PaintUserpicCallback(
};
}
}
auto userpic = std::shared_ptr<Data::CloudImageView>();
auto userpic = Ui::PeerUserpicView();
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
peer->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
};
}
PaintRoundImageCallback ForceRoundUserpicCallback(not_null<PeerData*> peer) {
auto userpic = Ui::PeerUserpicView();
auto cache = std::make_shared<QImage>();
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
const auto ratio = style::DevicePixelRatio();
const auto cacheSize = QSize(size, size) * ratio;
if (cache->size() != cacheSize) {
*cache = QImage(cacheSize, QImage::Format_ARGB32_Premultiplied);
cache->setDevicePixelRatio(ratio);
}
auto q = Painter(cache.get());
peer->paintUserpicLeft(q, userpic, 0, 0, outerWidth, size);
q.end();
*cache = Images::Circle(std::move(*cache));
p.drawImage(x, y, *cache);
};
}
PeerListContentDelegateShow::PeerListContentDelegateShow(
std::shared_ptr<Ui::Show> show)
: _show(show) {
@@ -355,14 +375,6 @@ void PeerListController::setDescriptionText(const QString &text) {
}
}
void PeerListController::setSearchLoadingText(const QString &text) {
if (text.isEmpty()) {
setSearchLoading(nullptr);
} else {
setSearchLoading(object_ptr<Ui::FlatLabel>(nullptr, text, st::membersAbout));
}
}
void PeerListController::setSearchNoResultsText(const QString &text) {
if (text.isEmpty()) {
setSearchNoResults(nullptr);
@@ -419,7 +431,9 @@ void PeerListBox::addSelectItem(
addSelectItem(
peer->id.value,
text,
PaintUserpicCallback(peer, respect),
(peer->isForum()
? ForceRoundUserpicCallback(peer)
: PaintUserpicCallback(peer, respect)),
animated);
}
@@ -429,7 +443,7 @@ void PeerListBox::addSelectItem(
addSelectItem(
row->id(),
row->generateShortName(),
row->generatePaintUserpicCallback(),
row->generatePaintUserpicCallback(true),
animated);
}
@@ -642,18 +656,22 @@ QString PeerListRow::generateShortName() {
: peer()->shortName();
}
std::shared_ptr<Data::CloudImageView> &PeerListRow::ensureUserpicView() {
if (!_userpic) {
Ui::PeerUserpicView &PeerListRow::ensureUserpicView() {
if (!_userpic.cloud && peer()->hasUserpic()) {
_userpic = peer()->createUserpicView();
}
return _userpic;
}
PaintRoundImageCallback PeerListRow::generatePaintUserpicCallback() {
PaintRoundImageCallback PeerListRow::generatePaintUserpicCallback(
bool forceRound) {
const auto saved = _isSavedMessagesChat;
const auto replies = _isRepliesMessagesChat;
const auto peer = this->peer();
auto userpic = saved ? nullptr : ensureUserpicView();
auto userpic = saved ? Ui::PeerUserpicView() : ensureUserpicView();
if (forceRound && peer->isForum()) {
return ForceRoundUserpicCallback(peer);
}
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
if (saved) {
Ui::EmptyUserpic::PaintSavedMessages(p, x, y, outerWidth, size);
@@ -776,7 +794,7 @@ void PeerListRow::paintUserpic(
paintDisabledCheckUserpic(p, st, x, y, outerWidth);
} else if (_checkbox) {
_checkbox->paint(p, x, y, outerWidth);
} else if (const auto callback = generatePaintUserpicCallback()) {
} else if (const auto callback = generatePaintUserpicCallback(false)) {
callback(p, x, y, outerWidth, st.photoSize);
}
}
@@ -847,15 +865,15 @@ void PeerListRow::lazyInitialize(const style::PeerListItem &st) {
void PeerListRow::createCheckbox(
const style::RoundImageCheckbox &st,
Fn<void()> updateCallback) {
const auto generateRadius = [=] {
const auto generateRadius = [=](int size) {
return (!special() && peer()->isForum())
? ImageRoundRadius::Large
: ImageRoundRadius::Ellipse;
? int(size * Ui::ForumUserpicRadiusMultiplier())
: std::optional<int>();
};
_checkbox = std::make_unique<Ui::RoundImageCheckbox>(
st,
std::move(updateCallback),
generatePaintUserpicCallback(),
generatePaintUserpicCallback(false),
generateRadius);
}
@@ -1243,7 +1261,7 @@ int PeerListContent::labelHeight() const {
if (!_filterResults.empty()) {
return 0;
}
if (_controller->isSearchLoading()) {
if (_controller->isSearchLoading() && _searchLoading) {
return computeLabelHeight(_searchLoading);
}
return computeLabelHeight(_searchNoResults);
@@ -1279,11 +1297,20 @@ void PeerListContent::setSearchMode(PeerListSearchMode mode) {
}
_searchMode = mode;
if (_controller->hasComplexSearch()) {
if (!_searchLoading) {
setSearchLoading(object_ptr<Ui::FlatLabel>(
this,
tr::lng_contacts_loading(tr::now),
st::membersAbout));
if (_mode == Mode::Custom) {
if (!_searchLoading) {
setSearchLoading(object_ptr<Ui::FlatLabel>(
this,
tr::lng_contacts_loading(tr::now),
st::membersAbout));
}
} else {
if (!_loadingAnimation) {
_loadingAnimation = Ui::CreateLoadingPeerListItemWidget(
this,
_st.item,
2);
}
}
} else {
clearSearchRows();
@@ -1378,6 +1405,14 @@ int PeerListContent::resizeGetHeight(int newWidth) {
_searchLoading->moveToLeft(st::contactsPadding.left(), labelTop + st::membersAboutLimitPadding.top(), newWidth);
_searchLoading->setVisible(!hideAll && showingSearch() && _filterResults.empty() && _controller->isSearchLoading());
}
if (_loadingAnimation) {
_loadingAnimation->resizeToWidth(newWidth);
_loadingAnimation->moveToLeft(0, rowsTop(), newWidth);
_loadingAnimation->setVisible(!hideAll
&& showingSearch()
&& _filterResults.empty()
&& _controller->isSearchLoading());
}
const auto label = labelHeight();
const auto belowTop = (label > 0 || rowsCount > 0)
? (labelTop + label + _st.padding.bottom())

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/rp_widget.h"
#include "ui/empty_userpic.h"
#include "ui/unread_badge.h"
#include "ui/userpic_view.h"
#include "boxes/abstract_box.h"
#include "mtproto/sender.h"
#include "data/data_cloud_file.h"
@@ -46,6 +47,8 @@ using PaintRoundImageCallback = Fn<void(
[[nodiscard]] PaintRoundImageCallback PaintUserpicCallback(
not_null<PeerData*> peer,
bool respectSavedMessagesChat);
[[nodiscard]] PaintRoundImageCallback ForceRoundUserpicCallback(
not_null<PeerData*> peer);
using PeerListRowId = uint64;
@@ -84,12 +87,12 @@ public:
return _id;
}
[[nodiscard]] std::shared_ptr<Data::CloudImageView> &ensureUserpicView();
[[nodiscard]] Ui::PeerUserpicView &ensureUserpicView();
[[nodiscard]] virtual QString generateName();
[[nodiscard]] virtual QString generateShortName();
[[nodiscard]] virtual auto generatePaintUserpicCallback()
-> PaintRoundImageCallback;
[[nodiscard]] virtual auto generatePaintUserpicCallback(
bool forceRound) -> PaintRoundImageCallback;
[[nodiscard]] virtual auto generateNameFirstLetters() const
-> const base::flat_set<QChar> &;
@@ -262,7 +265,7 @@ private:
PeerListRowId _id = 0;
PeerData *_peer = nullptr;
mutable std::shared_ptr<Data::CloudImageView> _userpic;
mutable Ui::PeerUserpicView _userpic;
std::unique_ptr<Ui::RippleAnimation> _ripple;
std::unique_ptr<Ui::RoundImageCheckbox> _checkbox;
Ui::Text::String _name;
@@ -294,7 +297,6 @@ public:
virtual void peerListSetAdditionalTitle(rpl::producer<QString> title) = 0;
virtual void peerListSetHideEmpty(bool hide) = 0;
virtual void peerListSetDescription(object_ptr<Ui::FlatLabel> description) = 0;
virtual void peerListSetSearchLoading(object_ptr<Ui::FlatLabel> loading) = 0;
virtual void peerListSetSearchNoResults(object_ptr<Ui::FlatLabel> noResults) = 0;
virtual void peerListSetAboveWidget(object_ptr<TWidget> aboveWidget) = 0;
virtual void peerListSetAboveSearchWidget(object_ptr<TWidget> aboveWidget) = 0;
@@ -541,14 +543,10 @@ protected:
}
void setDescriptionText(const QString &text);
void setSearchLoadingText(const QString &text);
void setSearchNoResultsText(const QString &text);
void setDescription(object_ptr<Ui::FlatLabel> description) {
delegate()->peerListSetDescription(std::move(description));
}
void setSearchLoading(object_ptr<Ui::FlatLabel> loading) {
delegate()->peerListSetSearchLoading(std::move(loading));
}
void setSearchNoResults(object_ptr<Ui::FlatLabel> noResults) {
delegate()->peerListSetSearchNoResults(std::move(noResults));
}
@@ -822,6 +820,7 @@ private:
object_ptr<Ui::FlatLabel> _description = { nullptr };
object_ptr<Ui::FlatLabel> _searchNoResults = { nullptr };
object_ptr<Ui::FlatLabel> _searchLoading = { nullptr };
object_ptr<Ui::RpWidget> _loadingAnimation = { nullptr };
std::vector<std::unique_ptr<PeerListRow>> _searchRows;
base::Timer _repaintByStatus;
@@ -898,9 +897,6 @@ public:
void peerListSetDescription(object_ptr<Ui::FlatLabel> description) override {
_content->setDescription(std::move(description));
}
void peerListSetSearchLoading(object_ptr<Ui::FlatLabel> loading) override {
_content->setSearchLoading(std::move(loading));
}
void peerListSetSearchNoResults(object_ptr<Ui::FlatLabel> noResults) override {
_content->setSearchNoResults(std::move(noResults));
}

View File

@@ -33,7 +33,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "dialogs/dialogs_main_list.h"
#include "window/window_session_controller.h" // showAddContact()
#include "base/unixtime.h"
#include "facades.h"
#include "styles/style_boxes.h"
#include "styles/style_profile.h"
#include "styles/style_dialogs.h"
@@ -378,7 +377,10 @@ std::unique_ptr<PeerListRow> ContactsBoxController::createSearchRow(
}
void ContactsBoxController::rowClicked(not_null<PeerListRow*> row) {
Ui::showPeerHistory(row->peer(), ShowAtUnreadMsgId);
const auto peer = row->peer();
if (const auto window = peer->session().tryResolveWindow()) {
window->showPeerHistory(row->peer());
}
}
void ContactsBoxController::setSortMode(SortMode mode) {
@@ -533,6 +535,7 @@ auto ChooseRecipientBoxController::createRow(
const auto skip = _filter
? !_filter(history)
: ((peer->isBroadcast() && !peer->canWrite())
|| (peer->isUser() && !peer->canWrite())
|| peer->isRepliesChat());
return skip ? nullptr : std::make_unique<Row>(history);
}
@@ -621,7 +624,8 @@ QString ChooseTopicBoxController::Row::generateShortName() {
return _topic->title();
}
auto ChooseTopicBoxController::Row::generatePaintUserpicCallback()
auto ChooseTopicBoxController::Row::generatePaintUserpicCallback(
bool forceRound)
-> PaintRoundImageCallback {
return [=](
Painter &p,
@@ -629,10 +633,11 @@ auto ChooseTopicBoxController::Row::generatePaintUserpicCallback()
int y,
int outerWidth,
int size) {
auto view = std::shared_ptr<Data::CloudImageView>();
auto view = Ui::PeerUserpicView();
p.translate(x, y);
_topic->paintUserpic(p, view, {
.st = &st::forumTopicRow,
.currentBg = st::windowBg,
.now = crl::now(),
.width = outerWidth,
.paused = false,

View File

@@ -235,7 +235,8 @@ private:
QString generateName() override;
QString generateShortName() override;
PaintRoundImageCallback generatePaintUserpicCallback() override;
PaintRoundImageCallback generatePaintUserpicCallback(
bool forceRound) override;
auto generateNameFirstLetters() const
-> const base::flat_set<QChar> & override;

View File

@@ -402,7 +402,9 @@ void PeerListsBox::addSelectItem(
addSelectItem(
peer->id.value,
peer->shortName(),
PaintUserpicCallback(peer, false),
(peer->isForum()
? ForceRoundUserpicCallback(peer)
: PaintUserpicCallback(peer, false)),
animated);
}
@@ -412,7 +414,7 @@ void PeerListsBox::addSelectItem(
addSelectItem(
row->id(),
row->generateShortName(),
row->generatePaintUserpicCallback(),
row->generatePaintUserpicCallback(true),
animated);
}

View File

@@ -26,7 +26,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_chat_participants.h"
#include "window/window_session_controller.h"
#include "apiwrap.h"
#include "facades.h"
#include "styles/style_boxes.h"
namespace {
@@ -406,5 +405,7 @@ void AddBotToGroup(
} else {
chat->session().api().chatParticipants().add(chat, { 1, bot });
}
Ui::showPeerHistory(chat, ShowAtUnreadMsgId);
if (const auto window = chat->session().tryResolveWindow()) {
window->showPeerHistory(chat);
}
}

View File

@@ -166,7 +166,7 @@ void AddParticipantsBoxController::updateTitle() {
&& _peer->isChannel()
&& !_peer->isMegagroup())
? QString()
: qsl("%1 / %2"
: (u"%1 / %2"_q
).arg(fullCount()
).arg(session().serverConfig().megagroupSizeMax);
delegate()->peerListSetTitle(tr::lng_profile_add_participant());

View File

@@ -194,6 +194,38 @@ bool DefaultIconEmoji::readyInDefaultState() {
return result;
}
[[nodiscard]] not_null<Ui::AbstractButton*> GeneralIconPreview(
not_null<QWidget*> parent) {
using namespace Info::Profile;
struct State {
QImage frame;
};
const auto size = EditIconSize();
const auto result = Ui::CreateChild<Ui::AbstractButton>(parent.get());
result->show();
result->setAttribute(Qt::WA_TransparentForMouseEvents);
const auto state = result->lifetime().make_state<State>();
rpl::single(rpl::empty) | rpl::then(
style::PaletteChanged()
) | rpl::start_with_next([=] {
state->frame = Data::ForumTopicGeneralIconFrame(
st::largeForumTopicIcon.size,
st::windowSubTextFg);
result->update();
}, result->lifetime());
result->resize(size, size);
result->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
auto p = QPainter(result);
const auto skip = (size - st::largeForumTopicIcon.size) / 2;
p.drawImage(skip, skip, state->frame);
}, result->lifetime());
return result;
}
struct IconSelector {
Fn<bool(not_null<Ui::RpWidget*>)> paintIconFrame;
rpl::producer<DocumentId> iconIdValue;
@@ -404,14 +436,16 @@ void EditForumTopicBox(
});
const auto paintIconFrame = [=](not_null<Ui::RpWidget*> widget) {
return state->paintIconFrame(widget);
return state->paintIconFrame && state->paintIconFrame(widget);
};
const auto icon = EditIconButton(
title->parentWidget(),
controller,
state->defaultIcon.value(),
state->iconId.value(),
paintIconFrame);
const auto icon = (topic && topic->isGeneral())
? GeneralIconPreview(title->parentWidget())
: EditIconButton(
title->parentWidget(),
controller,
state->defaultIcon.value(),
state->iconId.value(),
paintIconFrame);
title->geometryValue(
) | rpl::start_with_next([=](QRect geometry) {
@@ -444,27 +478,29 @@ void EditForumTopicBox(
};
}, box->lifetime());
Settings::AddDividerText(
top,
tr::lng_forum_choose_title_and_icon());
if (!topic || !topic->isGeneral()) {
Settings::AddDividerText(
top,
tr::lng_forum_choose_title_and_icon());
box->setScrollStyle(st::reactPanelScroll);
box->setScrollStyle(st::reactPanelScroll);
auto selector = AddIconSelector(
box,
icon,
controller,
state->defaultIcon.value(),
top->heightValue(),
state->iconId.current(),
[&](object_ptr<Ui::RpWidget> footer) {
top->add(std::move(footer)); });
state->paintIconFrame = std::move(selector.paintIconFrame);
std::move(
selector.iconIdValue
) | rpl::start_with_next([=](DocumentId iconId) {
state->iconId = (iconId != kDefaultIconId) ? iconId : 0;
}, box->lifetime());
auto selector = AddIconSelector(
box,
icon,
controller,
state->defaultIcon.value(),
top->heightValue(),
state->iconId.current(),
[&](object_ptr<Ui::RpWidget> footer) {
top->add(std::move(footer)); });
state->paintIconFrame = std::move(selector.paintIconFrame);
std::move(
selector.iconIdValue
) | rpl::start_with_next([=](DocumentId iconId) {
state->iconId = (iconId != kDefaultIconId) ? iconId : 0;
}, box->lifetime());
}
const auto create = [=] {
const auto channel = forum->peer->asChannel();
@@ -508,12 +544,14 @@ void EditForumTopicBox(
const auto api = &forum->session().api();
const auto weak = Ui::MakeWeak(box.get());
state->requestId = api->request(MTPchannels_EditForumTopic(
MTP_flags(Flag::f_title | Flag::f_icon_emoji_id),
MTP_flags(Flag::f_title
| (topic->isGeneral() ? Flag() : Flag::f_icon_emoji_id)),
topic->channel()->inputChannel,
MTP_int(rootId),
MTP_string(title->getLastText().trimmed()),
MTP_long(state->iconId.current()),
MTPBool() // closed
MTPBool(), // closed
MTPBool() // hidden
)).done([=](const MTPUpdates &result) {
api->applyUpdates(result);
if (const auto strong = weak.data()) {

View File

@@ -647,15 +647,15 @@ void EditAdminBox::sendTransferRequestFrom(
const auto &type = error.type();
const auto problem = [&] {
if (type == qstr("CHANNELS_ADMIN_PUBLIC_TOO_MUCH")) {
if (type == u"CHANNELS_ADMIN_PUBLIC_TOO_MUCH"_q) {
return tr::lng_channels_too_much_public_other(tr::now);
} else if (type == qstr("CHANNELS_ADMIN_LOCATED_TOO_MUCH")) {
} else if (type == u"CHANNELS_ADMIN_LOCATED_TOO_MUCH"_q) {
return tr::lng_channels_too_much_located_other(tr::now);
} else if (type == qstr("ADMINS_TOO_MUCH")) {
} else if (type == u"ADMINS_TOO_MUCH"_q) {
return (channel->isBroadcast()
? tr::lng_error_admin_limit_channel
: tr::lng_error_admin_limit)(tr::now);
} else if (type == qstr("CHANNEL_INVALID")) {
} else if (type == u"CHANNEL_INVALID"_q) {
return (channel->isBroadcast()
? tr::lng_channel_not_accessible
: tr::lng_group_not_accessible)(tr::now);
@@ -663,9 +663,9 @@ void EditAdminBox::sendTransferRequestFrom(
return Lang::Hard::ServerError();
}();
const auto recoverable = [&] {
return (type == qstr("PASSWORD_MISSING"))
|| (type == qstr("PASSWORD_TOO_FRESH_XXX"))
|| (type == qstr("SESSION_TOO_FRESH_XXX"));
return (type == u"PASSWORD_MISSING"_q)
|| (type == u"PASSWORD_TOO_FRESH_XXX"_q)
|| (type == u"SESSION_TOO_FRESH_XXX"_q);
}();
const auto weak = Ui::MakeWeak(this);
getDelegate()->show(Ui::MakeInformBox(problem));

View File

@@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/max_invite_box.h"
#include "boxes/add_contact_box.h"
#include "main/main_session.h"
#include "menu/menu_antispam_validator.h"
#include "mtproto/mtproto_config.h"
#include "apiwrap.h"
#include "lang/lang_keys.h"
@@ -112,7 +113,7 @@ void SaveChatAdmin(
const auto &type = error.type();
if (retryOnNotParticipant
&& isAdmin
&& (type == qstr("USER_NOT_PARTICIPANT"))) {
&& (type == u"USER_NOT_PARTICIPANT"_q)) {
AddChatParticipant(chat, user, [=] {
SaveChatAdmin(chat, user, isAdmin, onDone, onFail, false);
}, onFail);
@@ -1186,6 +1187,15 @@ void ParticipantsBoxController::prepare() {
}
Unexpected("Role in ParticipantsBoxController::prepare()");
}();
if (const auto megagroup = _peer->asMegagroup()) {
if ((_role == Role::Admins)
&& (megagroup->amCreator() || megagroup->hasAdminRights())) {
const auto validator = AntiSpamMenu::AntiSpamValidator(
_navigation->parentController(),
_peer->asChannel());
delegate()->peerListSetAboveWidget(validator.createButton());
}
}
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
delegate()->peerListSetTitle(std::move(title));
setDescriptionText(tr::lng_contacts_loading(tr::now));

View File

@@ -154,7 +154,7 @@ void SaveDefaultRestrictions(
done();
}).fail([=](const MTP::Error &error) {
api->clearModifyRequest(key);
if (error.type() != qstr("CHAT_NOT_MODIFIED")) {
if (error.type() != u"CHAT_NOT_MODIFIED"_q) {
return;
}
if (const auto chat = peer->asChat()) {
@@ -187,7 +187,7 @@ void SaveSlowmodeSeconds(
done();
}).fail([=](const MTP::Error &error) {
api->clearModifyRequest(key);
if (error.type() != qstr("CHAT_NOT_MODIFIED")) {
if (error.type() != u"CHAT_NOT_MODIFIED"_q) {
return;
}
channel->setSlowmodeSeconds(seconds);
@@ -863,8 +863,7 @@ void Controller::fillForumButton() {
ShowForumForDiscussionError(_navigation);
} else {
Ui::ShowMultilineToast({
.parentOverride = Window::Show(
_navigation).toastParent(),
.parentOverride = Window::Show(_navigation).toastParent(),
.text = tr::lng_forum_topics_not_enough(
tr::now,
lt_count,
@@ -1568,7 +1567,7 @@ void Controller::saveUsername() {
continueSave();
}).fail([=](const MTP::Error &error) {
const auto &type = error.type();
if (type == qstr("USERNAME_NOT_MODIFIED")) {
if (type == u"USERNAME_NOT_MODIFIED"_q) {
channel->setName(
TextUtilities::SingleLine(channel->name()),
TextUtilities::SingleLine(*_savingData.username));
@@ -1578,10 +1577,10 @@ void Controller::saveUsername() {
// Very rare case.
showEditPeerTypeBox([&] {
if (type == qstr("USERNAME_INVALID")) {
if (type == u"USERNAME_INVALID"_q) {
return tr::lng_create_channel_link_invalid();
} else if (type == qstr("USERNAME_OCCUPIED")
|| type == qstr("USERNAMES_UNAVAILABLE")) {
} else if (type == u"USERNAME_OCCUPIED"_q
|| type == u"USERNAMES_UNAVAILABLE"_q) {
return tr::lng_create_channel_link_occupied();
}
return tr::lng_create_channel_link_invalid();
@@ -1635,8 +1634,8 @@ void Controller::saveTitle() {
};
const auto onFail = [=](const MTP::Error &error) {
const auto &type = error.type();
if (type == qstr("CHAT_NOT_MODIFIED")
|| type == qstr("CHAT_TITLE_NOT_MODIFIED")) {
if (type == u"CHAT_NOT_MODIFIED"_q
|| type == u"CHAT_TITLE_NOT_MODIFIED"_q) {
if (const auto channel = _peer->asChannel()) {
channel->setName(
*_savingData.title,
@@ -1648,7 +1647,7 @@ void Controller::saveTitle() {
return;
}
_controls.title->showError();
if (type == qstr("NO_CHAT_TITLE")) {
if (type == u"NO_CHAT_TITLE"_q) {
_box->scrollToWidget(_controls.title);
}
cancelSave();
@@ -1689,7 +1688,7 @@ void Controller::saveDescription() {
successCallback();
}).fail([=](const MTP::Error &error) {
const auto &type = error.type();
if (type == qstr("CHAT_ABOUT_NOT_MODIFIED")) {
if (type == u"CHAT_ABOUT_NOT_MODIFIED"_q) {
successCallback();
return;
}
@@ -1746,7 +1745,7 @@ void Controller::togglePreHistoryHidden(
channel->session().api().applyUpdates(result);
apply();
}).fail([=](const MTP::Error &error) {
if (error.type() == qstr("CHAT_NOT_MODIFIED")) {
if (error.type() == u"CHAT_NOT_MODIFIED"_q) {
apply();
} else {
fail();
@@ -1779,7 +1778,7 @@ void Controller::saveForum() {
channel->session().api().applyUpdates(result);
continueSave();
}).fail([=](const MTP::Error &error) {
if (error.type() == qstr("CHAT_NOT_MODIFIED")) {
if (error.type() == u"CHAT_NOT_MODIFIED"_q) {
continueSave();
} else {
cancelSave();
@@ -1801,7 +1800,7 @@ void Controller::saveSignatures() {
channel->session().api().applyUpdates(result);
continueSave();
}).fail([=](const MTP::Error &error) {
if (error.type() == qstr("CHAT_NOT_MODIFIED")) {
if (error.type() == u"CHAT_NOT_MODIFIED"_q) {
continueSave();
} else {
cancelSave();
@@ -1821,7 +1820,7 @@ void Controller::saveForwards() {
_peer->session().api().applyUpdates(result);
continueSave();
}).fail([=](const MTP::Error &error) {
if (error.type() == qstr("CHAT_NOT_MODIFIED")) {
if (error.type() == u"CHAT_NOT_MODIFIED"_q) {
continueSave();
} else {
cancelSave();
@@ -1843,7 +1842,7 @@ void Controller::saveJoinToWrite() {
_peer->session().api().applyUpdates(result);
continueSave();
}).fail([=](const MTP::Error &error) {
if (error.type() == qstr("CHAT_NOT_MODIFIED")) {
if (error.type() == u"CHAT_NOT_MODIFIED"_q) {
continueSave();
} else {
cancelSave();
@@ -1865,7 +1864,7 @@ void Controller::saveRequestToJoin() {
_peer->session().api().applyUpdates(result);
continueSave();
}).fail([=](const MTP::Error &error) {
if (error.type() == qstr("CHAT_NOT_MODIFIED")) {
if (error.type() == u"CHAT_NOT_MODIFIED"_q) {
continueSave();
} else {
cancelSave();
@@ -1921,7 +1920,7 @@ void Controller::deleteChannel() {
)).done([=](const MTPUpdates &result) {
session->api().applyUpdates(result);
//}).fail([=](const MTP::Error &error) {
// if (error.type() == qstr("CHANNEL_TOO_LARGE")) {
// if (error.type() == u"CHANNEL_TOO_LARGE"_q) {
// Ui::show(Box<Ui::InformBox>(tr::lng_cant_delete_channel(tr::now)));
// }
}).send();

View File

@@ -409,7 +409,7 @@ void Controller::addHeaderBlock(not_null<Ui::VerticalLayout*> container) {
return result;
};
const auto prefix = qstr("https://");
const auto prefix = u"https://"_q;
const auto label = container->lifetime().make_state<Ui::InviteLinkLabel>(
container,
rpl::single(link.startsWith(prefix)
@@ -982,7 +982,7 @@ void AddPermanentLinkBlock(
auto link = value->value(
) | rpl::map([=](const LinkData &data) {
const auto prefix = qstr("https://");
const auto prefix = u"https://"_q;
return data.link.startsWith(prefix)
? data.link.mid(prefix.size())
: data.link;
@@ -1042,11 +1042,12 @@ void AddPermanentLinkBlock(
state->allUserpicsLoaded = ranges::all_of(
state->list,
[](const HistoryView::UserpicInRow &element) {
return !element.peer->hasUserpic() || element.view->image();
return !element.peer->hasUserpic()
|| !Ui::PeerUserpicLoading(element.view);
});
state->content = Ui::JoinedCountContent{
.count = state->count,
.userpics = state->cachedUserpics
.userpics = state->cachedUserpics,
};
};
value->value(
@@ -1087,7 +1088,7 @@ void AddPermanentLinkBlock(
} else if (element.peer->userpicUniqueKey(element.view)
!= element.uniqueKey) {
pushing = true;
} else if (!element.view->image()) {
} else if (Ui::PeerUserpicLoading(element.view)) {
state->allUserpicsLoaded = false;
}
}

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