Compare commits

..

342 Commits

Author SHA1 Message Date
ZavaruKitsu b6bbf3a560 feat: add restart button to preferences 2024-01-03 21:06:36 +03:00
ZavaruKitsu e0c2294d50 feat: pseudo support tg://ayu 2024-01-03 20:46:36 +03:00
ZavaruKitsu 7426d285b4 feat: resolve user by tg://user?id=
Just found another use of `searchById`, so why not.

Co-authored-by: c0re100 <corehusky@gmail.com>
2024-01-03 20:36:32 +03:00
ZavaruKitsu fba53e1ec8 feat: refactor a bit 2024-01-03 16:56:32 +03:00
ZavaruKitsu 74196732ac feat: upload speed boost
Co-authored-by: RadRussianRus <radrussianrus@gmail.com>
2024-01-03 16:23:42 +03:00
ZavaruKitsu 8c41a69e67 fix: update submodules 2024-01-03 15:03:38 +03:00
ZavaruKitsu b1e91ab746 Merge tag 'v4.14.2' into dev
# Conflicts:
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/core/version.h
#	Telegram/lib_ui
2024-01-03 15:00:00 +03:00
ZavaruKitsu 2e514a748c feat: open pack owner from box 2024-01-02 18:40:11 +03:00
ZavaruKitsu 50bc6a33f6 fix: accidental crash 2024-01-02 18:14:07 +03:00
John Preston 4274f9d3f3 Version 4.14.2.
- Show original senders name in reply to forward information.
- Use original senders color / emoji pattern in forwards.
- Highlight active saved messages chat in list.
- Fix chats list scrolling on X11 (Linux).
2024-01-02 15:05:06 +04:00
John Preston c8dd94601b Don't add original name in forward of reply. 2024-01-02 15:05:06 +04:00
John Preston 382dab4ecb Don't push sublists to stack endlessly. 2024-01-02 15:05:06 +04:00
23rd bdf67645bb Improved phrase of terms in gifts box from settings. 2024-01-02 13:40:21 +03:00
John Preston 5c29cc59c8 Show forward original sender in reply bar. 2024-01-02 14:11:09 +04:00
John Preston ca9caa36da Inside message use original senders colors. 2024-01-02 13:52:55 +04:00
John Preston 0b5f05c7d4 Skip service accounts in gift premiums box. 2024-01-02 13:52:55 +04:00
John Preston 676e85983d Don't cut bio value, show what server returned. 2024-01-02 13:52:55 +04:00
Eric Kotato 7638f4cc3d Fix warning C4805 2024-01-02 13:27:37 +04:00
John Preston e2e55312b8 Fix viewer hide workaround for software renderer. 2024-01-02 12:59:41 +04:00
John Preston c51a8816eb Show selected sublist as active in list. 2024-01-02 12:59:22 +04:00
John Preston 175914f02b Show "My Notes", "Author Hidden" in title. 2024-01-02 12:12:16 +04:00
John Preston fbd6b5b640 Fix possible build issue on Windows. 2024-01-02 12:01:03 +04:00
kukuruzka 1b11731d6b Fix crash on some videos 2024-01-02 11:43:15 +04:00
Ilya Fedin 8ecb49f132 Multiple by the magic multiplier only on Wayland 2024-01-02 06:57:09 +00:00
ZavaruKitsu 2f069bcd02 feat: update README.md
feat: add note
2024-01-02 04:56:32 +03:00
ZavaruKitsu 74abaccab3 feat: rework disableStories 2024-01-02 03:48:01 +03:00
ZavaruKitsu 115517fae1 feat: hide folder notification counters 2024-01-02 03:09:55 +03:00
ZavaruKitsu 2aef563374 fix: hide Streamer mode on Linux
Until someone implements it.
2024-01-02 02:22:38 +03:00
ZavaruKitsu 040794586b fix: various message improvements 2024-01-02 01:54:39 +03:00
ZavaruKitsu c102f4c0e5 fix: make it compile 2024-01-02 01:38:47 +03:00
ZavaruKitsu 7cdbbc318a Merge tag 'v4.14.1' into dev
# Conflicts:
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/core/version.h
#	Telegram/SourceFiles/data/data_stories.cpp
#	Telegram/SourceFiles/history/history_item.cpp
#	Telegram/SourceFiles/main/main_session.cpp
#	Telegram/lib_ui
2024-01-02 01:02:43 +03:00
John Preston 0ae537478f Version 4.14.1.
- Fix crash in "Author Hidden" chat in "Saved Messages".
- Improve jump-to-original button layout in "Saved Messages".
- Show my own chat as "My Notes" in "Saved Messages".
- In screen sharing source window select first screen by default.
2024-01-02 00:22:46 +04:00
John Preston 4aa432ecbe Fix build with GCC. 2024-01-02 00:22:22 +04:00
John Preston d5a0f4890d Choose first screen for sharing by default. 2024-01-02 00:17:15 +04:00
John Preston 5e255e56eb Don't allow gifting premium if can't buy. 2024-01-02 00:12:51 +04:00
John Preston a4d7309209 Support tg://premium_multigift links. 2024-01-02 00:10:52 +04:00
John Preston a30d0eccda Avoid unnecessary saved dialogs load requests. 2024-01-01 23:42:18 +04:00
John Preston a4f4e4564a Improve jump-to-message in saved messages. 2024-01-01 23:33:19 +04:00
ZavaruKitsu 3948341d6a fix: meh 2024-01-01 19:28:48 +03:00
ZavaruKitsu c408c5fb87 feat: try to rework saveDeletedMessages 2024-01-01 19:28:48 +03:00
ZavaruKitsu fa8124cc1b feat: allow stories downloading
The icon for non-premium users looks like it's locked, but it still can be clicked.
2024-01-01 19:28:48 +03:00
ZavaruKitsu 8d93b21947 feat: message details
feat: rework `Hide`
feat: context menu configuration
2024-01-01 19:28:48 +03:00
John Preston bfe7683cdb Show myself as "My Notes" in Saved Messages sublists. 2024-01-01 09:50:24 +04:00
John Preston fbc600a978 Fix crash in pending gift payment finish. 2024-01-01 09:23:37 +04:00
GitHub Action 70eb452a09 Update User-Agent for DNS to Chrome 120.0.6099.109. 2024-01-01 05:18:11 +00:00
GitHub Action 9f7c74ae72 Update copyright year to 2024. 2024-01-01 05:17:53 +00:00
Ilya Fedin 65a3cf136b Update submodules 2023-12-31 22:03:57 +00:00
Ilya Fedin 2d86ec1e84 Update hunspell for warning fixes 2023-12-31 22:03:57 +00:00
Ilya Fedin fdef19a009 Ensure temporaries don't detach with range loop 2023-12-31 22:03:57 +00:00
Ilya Fedin 26df482b54 Fix prototype for fill_fopen_filefunc 2023-12-31 22:03:57 +00:00
Ilya Fedin ee5b7a5100 Fix the whitespaces for KeyFormat enum 2023-12-31 22:03:57 +00:00
Ilya Fedin bd67bc4433 Ignore some unused variables 2023-12-31 22:03:57 +00:00
Ilya Fedin 9d582040e6 Fix detaching temporaries 2023-12-31 22:03:57 +00:00
Ilya Fedin f3bda59019 Replace QString::mid with base::StringViewMid where QStringView is accepted 2023-12-31 22:03:57 +00:00
Ilya Fedin 0d72d47318 Normalize signal connections 2023-12-31 22:03:57 +00:00
Ilya Fedin 29646707a1 QString::arg usage optimization 2023-12-31 22:03:57 +00:00
Ilya Fedin e6b9a07163 Instantiate QRegularExpression instances statically 2023-12-31 22:03:57 +00:00
Ilya Fedin 4b297bfa09 Make use of wrongly unused variables 2023-12-31 22:03:57 +00:00
Ilya Fedin 00e785a3af Remove unused variables 2023-12-31 22:03:57 +00:00
Ilya Fedin 78e6b3e13f Try to fix circular dependency between external_scudo and common_options 2023-12-31 21:36:32 +00:00
John Preston ad84750130 Fix crash in Saved Messages from Author Hidden.
Fixes #27293.
2024-01-01 01:18:35 +04:00
John Preston 686310489b Version 4.14.
- Improved saved messages.
- One-time voice messages.
2023-12-31 19:42:24 +04:00
John Preston 84c5310262 Revert "Update GCC to 13 in Docker"
This reverts commit 3adbfb1fb5.

There is some problem with static libstdc++ linking in Release
configuration, the Updater utility fails with unresolved externals.
2023-12-31 19:42:24 +04:00
23rd f53397e26a Fixed possible crash from voice messages with ttl. 2023-12-31 19:42:24 +04:00
John Preston 2a8a74b5b1 Display correctly forwards of forwards in sublists. 2023-12-31 19:42:24 +04:00
John Preston 9392550c01 Support pinned saved sublists. 2023-12-31 19:42:24 +04:00
23rd d2565dc944 Added badge corner to voice messages with ttl. 2023-12-31 19:42:24 +04:00
23rd 22f68b430d Disabled transcribe button for voice and round messages with ttl. 2023-12-31 19:42:24 +04:00
23rd 3962e5a680 Added animation to voice messages with ttl. 2023-12-31 19:42:24 +04:00
23rd a1c7a48958 Improved processing of out expired voice messages. 2023-12-31 19:42:23 +04:00
23rd 85286684e3 Added initial support for voice messages with TTL. 2023-12-31 19:42:23 +04:00
23rd c2712b0104 Removed redundant semicolons from code. 2023-12-31 19:42:23 +04:00
John Preston 1cb5ef7476 Show information about hidden author. 2023-12-31 19:42:23 +04:00
John Preston 9f0b42bbbd Show correct titles in sublists / sublist. 2023-12-31 19:42:23 +04:00
John Preston 634687881a Fix loading of saved sublist histories. 2023-12-31 19:42:23 +04:00
John Preston 878b4bb5af Update API scheme on layer 170. 2023-12-31 19:42:23 +04:00
John Preston 452257dcd5 Show special name/userpic for "Author Hidden". 2023-12-31 19:42:23 +04:00
John Preston 4e6d8f06d9 Show saved messages entry point from profiles. 2023-12-31 19:42:23 +04:00
John Preston fd417024fb Initial saved sublist section implementation. 2023-12-31 19:42:23 +04:00
John Preston 18c4d210e5 Show saved messages sublists in profile. 2023-12-31 19:42:23 +04:00
John Preston ead40c759e Update API scheme to layer 170. 2023-12-31 19:42:23 +04:00
Ilya Fedin be9aa3a097 Test the build of updater on the CI 2023-12-31 15:35:14 +00:00
23rd bdcb146d06 Improved style of button in group call bar for consistency. 2023-12-30 09:28:03 +04:00
westpain bf743836c1 feat: adapt AyuGram to Flatpak (#10) 2023-12-28 21:02:48 +03:00
Ilya Fedin 70115a24bb Fix some webview crashes 2023-12-28 10:05:55 +00:00
Ilya Fedin ea37e83b13 Revert "Force enable fractional-scale-v1 experimental option"
This reverts commit 4696f731da.
2023-12-27 22:44:58 +00:00
ZavaruKitsu e4e6fb14c7 feat: User Messages
Co-authored-by: RadRussianRus <radrussianrus@gmail.com>
2023-12-27 17:32:10 +03:00
ZavaruKitsu dc94f02345 fix: don't save empty messages 2023-12-27 17:32:10 +03:00
ZavaruKitsu 2482da3c3f fix: go back on escape 2023-12-27 17:32:10 +03:00
ZavaruKitsu 2c6439eeb6 fix: reactions and mentions not being read locally 2023-12-27 17:32:10 +03:00
ZavaruKitsu 0eab40b22f fix: simpleQuotesAndReplies 2023-12-27 17:32:10 +03:00
ZavaruKitsu 1a279c4409 feat: show service message time 2023-12-27 17:32:10 +03:00
ZavaruKitsu f1adebb23e feat: show DC
https://github.com/TDesktop-x64/tdesktop/pull/64/commits/9ea6c7dc52e6b69283bf065a851cbc0ef0bc5f9c

Co-authored-by: arm64v8a <48624112+arm64v8a@users.noreply.github.com>
2023-12-27 17:32:10 +03:00
ZavaruKitsu 032de55103 feat: better UI 2023-12-27 17:32:10 +03:00
Ilya Fedin 931c17418d Update to the new cppgir API 2023-12-26 15:33:33 +00:00
John Preston 5a47ed268c Fix build for Windows Store. 2023-12-25 23:21:47 +00:00
ZavaruKitsu e079a69d7e fix: update submodules 2023-12-24 21:11:59 +03:00
ZavaruKitsu 421aa31d59 Merge 4.13.1 2023-12-24 17:32:28 +03:00
ZavaruKitsu 9cc0ca5d81 fix: use custom icon for edits history action
fix: remove buggy Hide
2023-12-24 17:18:28 +03:00
ZavaruKitsu 6fab4e1dc3 fix: noforwards 2023-12-24 16:26:28 +03:00
Ilya Fedin d63ebbe62c Handle webview crash 2023-12-23 19:12:17 +00:00
John Preston cb4fce251e Version 4.13.1: Fix build with GCC. 2023-12-23 14:18:12 -04:00
John Preston 4aa8a41119 Version 4.13.1.
- Fix crash in chat history right click.
- Fix user emoji status display in main menu, profile and settings.
2023-12-23 14:15:29 -04:00
John Preston 13cba72945 Fix emoji status display for users.
Regression was introduced in 805a5d73b6.
2023-12-23 14:14:03 -04:00
John Preston cf63b0138e Fix crash in context menu.
Regression was introduced in 4e3c1460f6.

Fixes #27254.
2023-12-23 14:12:50 -04:00
John Preston 3cbe0aae4a Version 4.13.
- Support setting channel wallpaper.
- Support setting channel emoji status.
- Allow gifting premium to several recipients at once.
2023-12-22 20:55:24 -04:00
John Preston 5ab8e68366 Fix possible crash in colorizeImage. 2023-12-22 20:52:11 -04:00
John Preston 1d345299f5 Allow smartglocal to customize tokenize url. 2023-12-22 20:52:11 -04:00
23rd fc50d5c30f Improved code style in HistoryView::WebPage. 2023-12-23 03:16:58 +03:00
23rd 4e3c1460f6 Fixed display of menu items from sponsored message with selected text. 2023-12-23 01:50:12 +03:00
23rd 5bc954396c Fixed display of long title or long description in sponsored messages. 2023-12-23 01:50:12 +03:00
John Preston b24290b019 Fix text-colored emoji in long-press preview. 2023-12-22 13:46:17 -04:00
John Preston 23cce64d00 Channel message reposts to stories like reposts. 2023-12-22 13:16:14 -04:00
John Preston 73690d14f7 Allow clipboard access for attach menu bots. 2023-12-22 12:42:23 -04:00
John Preston 2a5698cf34 Admin log events about channel emoji status. 2023-12-22 07:35:02 -04:00
John Preston fd64718502 Allow setting channel wallpaper. 2023-12-22 07:35:02 -04:00
John Preston 941126ad69 Allow setting channel emoji status. 2023-12-22 07:35:02 -04:00
John Preston 0e8058adb1 Update tg_owt to support custom reflectors. 2023-12-22 07:35:02 -04:00
23rd 01906c1161 Fixed display of archiving toasts on wrong window. 2023-12-22 07:35:02 -04:00
John Preston 9201cf24f1 Respect correct min-level for colors. 2023-12-22 07:35:02 -04:00
John Preston d5a1c354d0 Support by-emoji background resolve in preview. 2023-12-22 07:35:02 -04:00
John Preston 41ae1f56ed Update API scheme to layer 169. Multigifts. 2023-12-22 07:35:02 -04:00
23rd ed7212f864 Added mini icon of boosts to description in gifts box from settings. 2023-12-19 04:06:54 +03:00
23rd 8bcb784f12 Moved out child centering within widget to single function. 2023-12-19 01:52:33 +03:00
23rd 431549c81a Improved processing of successful payment in gift box from settings. 2023-12-19 01:43:58 +03:00
23rd 12110e17a2 Slightly improved style of userpics from top in gift box from settings. 2023-12-18 05:50:14 +03:00
23rd db8338156a Slightly improved style of terms label in gift box from settings. 2023-12-18 05:50:14 +03:00
John Preston de8b09d7fc Use correct phrases for outgoing giftcodes. 2023-12-17 21:20:21 +00:00
ZavaruKitsu f06747f2a1 fix: don't mark contents read
fix: crash if config is not a valid json
2023-12-17 22:52:00 +03:00
ZavaruKitsu d940dc193e fix: custom language improvements 2023-12-17 22:42:22 +03:00
23rd fddbce5dce Added premium summary to gift box from settings. 2023-12-17 13:05:21 +03:00
23rd 081817f62a Moved out making of premium summary to separated function. 2023-12-17 13:01:36 +03:00
23rd 8efbd7a1cb Added ability to hide subscription button in preview premium boxes. 2023-12-17 13:01:36 +03:00
23rd bce310d5c8 Added complex description to top of gift box from settings. 2023-12-17 13:01:36 +03:00
23rd ed9ecbd235 Added circle badge to userpics in gift box from settings. 2023-12-17 13:01:17 +03:00
23rd 1e756dd380 Added userpics to top of gift box from settings. 2023-12-17 13:00:40 +03:00
23rd b9b6226692 Added initial ability to gift premium to contacts from settings. 2023-12-17 09:50:50 +03:00
23rd 82d73e2396 Moved out making of "new" badges to single place. 2023-12-17 09:50:50 +03:00
John Preston cd5a6025f6 Support pre-defined channel wallpapers resolving. 2023-12-16 23:52:55 +00:00
John Preston b6c679449e Support custom channel backgrounds display. 2023-12-16 23:23:24 +00:00
John Preston ac744b957a Show emoji pattern also on link preview bubbles. 2023-12-16 22:52:30 +00:00
John Preston 805a5d73b6 Show emoji statuses in channels. 2023-12-16 22:43:35 +00:00
John Preston 6aaf841a73 Ignore Cmd+Up/Down if field isn't empty. 2023-12-16 22:00:41 +00:00
John Preston 60e72768e1 Update API scheme. Shared posts in stories. 2023-12-16 21:26:40 +00:00
John Preston 94e8f2a791 Update API scheme. Anonymous gift links. 2023-12-16 20:25:02 +00:00
John Preston 1fb4a2f4ba Update API scheme. Show interactions in channel stories. 2023-12-16 20:25:02 +00:00
John Preston 28d68acfe6 Use forward declaration for ripple animation. 2023-12-16 20:25:02 +00:00
John Preston d87a0a2d25 Show reposts / forwards in story viewers. 2023-12-16 20:25:02 +00:00
23rd 8e92778b62 Fixed API support of public forwards in statistics info. 2023-12-16 20:25:02 +00:00
John Preston f7e2c7977b Update API scheme. TODO public forwards stats. 2023-12-16 20:25:02 +00:00
John Preston 4337f0b509 Fix "Keep Disabled" in OpenGL crash check. 2023-12-16 20:25:02 +00:00
John Preston 2b960a1f21 Update API scheme. 2023-12-16 20:25:02 +00:00
John Preston 4b9648d8d9 Update API scheme. Giveaway winners. 2023-12-16 20:25:02 +00:00
John Preston 62f9f3c94b Update API scheme. HistoryView::Giveaway->MediaInBubble. 2023-12-16 20:25:02 +00:00
John Preston e854f0b60c Show additional prize in giveaway message. 2023-12-16 20:25:02 +00:00
John Preston 19f38f3c6f Optimize empty->non-empty userpics repainting. 2023-12-16 20:25:02 +00:00
John Preston d56724f290 Add additional prize info to giveaway details. 2023-12-16 20:25:02 +00:00
John Preston 8abc35ca86 Make giveaway end message clickable. 2023-12-16 20:25:02 +00:00
John Preston e135f8954f Update API scheme to layer 168. Giveaways. 2023-12-16 20:25:02 +00:00
John Preston f5b59c9456 Remove old test code giveaway creation. 2023-12-16 20:25:02 +00:00
23rd 6471d43c71 Added mini preview for some types of webpages. 2023-12-16 20:25:02 +00:00
23rd 563b8d1468 Added support of inline markup reply to JSON export. 2023-12-16 20:25:01 +00:00
23rd f41a3fe01f Fixed display of non-stack bar chart view with empty values in chart. 2023-12-16 20:25:01 +00:00
23rd 29c9266ef5 Fixed display of bottom solid line in chart view for some scroll states. 2023-12-16 20:25:01 +00:00
23rd 1a856e359f Fixed display of bottom captions in chart view with long date strings. 2023-12-16 20:25:01 +00:00
23rd 59099a8d46 Added ability to open profile info through menu from public forwards. 2023-12-16 20:25:01 +00:00
23rd 98c6a3ff79 Added support of stories in list of public forwards in statistics info. 2023-12-16 20:25:01 +00:00
23rd cccc2ce0f1 Improved processing of access to boosts info. 2023-12-16 20:25:01 +00:00
23rd 88b20f6700 Fixed indents in some files. 2023-12-16 20:25:01 +00:00
Ilya Fedin 3adbfb1fb5 Update GCC to 13 in Docker 2023-12-16 09:32:50 +04:00
Ilya Fedin 0ee0ffa7f1 Update breakpad in Docker 2023-12-16 09:32:50 +04:00
Ilya Fedin 4c82620677 Disable building libstdc++ tests 2023-12-16 09:32:50 +04:00
Ilya Fedin 73294bfabf Make Linux action to use the pre-set entrypoint 2023-12-16 09:32:50 +04:00
Ilya Fedin 6c42095108 Move the GHCR authentication to the first set up step 2023-12-16 09:32:50 +04:00
John Preston fbe93b0afc Fix webpage layouts with thumbnails. 2023-12-15 14:15:35 +00:00
ZavaruKitsu a98e92639c fix: crash in server read 2023-12-12 15:26:33 +03:00
Ilya Fedin e173c727f7 Fix remaining known xdg-output fractional scaling issues on Wayland
And enable it by default
2023-12-07 10:24:19 +04:00
ZavaruKitsu 084967354b feat: rework sendReadMessages
fix: send read packet manually
fix: send read packet after sending media
2023-12-01 20:58:00 +03:00
ZavaruKitsu bde3caded7 fix: mark as β 2023-12-01 19:49:42 +03:00
ZavaruKitsu 29dd896c83 feat: disable similar channels 2023-12-01 19:21:03 +03:00
ZavaruKitsu d6457ebcc7 fix: add β note to anti-recall and disable by default 2023-12-01 17:35:30 +03:00
ZavaruKitsu c9fa0166e6 fix: prettify settings a bit 2023-12-01 17:23:29 +03:00
ZavaruKitsu 66b1fe7beb fix: make it build 2023-12-01 16:34:32 +03:00
Ilya Fedin 85f56217a8 Fix docker & snap build 2023-12-01 17:20:46 +04:00
ZavaruKitsu 0f8187fa36 Merge tag 'v4.12.2' into dev
# Conflicts:
#	.github/workflows/win.yml
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/core/version.h
#	Telegram/SourceFiles/settings/settings_advanced.cpp
#	Telegram/SourceFiles/settings/settings_main.cpp
#	Telegram/lib_ui
#	snap/snapcraft.yaml
2023-12-01 15:38:13 +03:00
Ilya Fedin 06564efe0e Build GLib manually in Docker and Snap 2023-12-01 15:39:42 +04:00
Ilya Fedin 664ebe4ed0 Use xdg-output for Wayland fractional scaling
That's way more stable
2023-12-01 15:39:14 +04:00
John Preston cb3dece478 Version 4.12.2.
- Fix choosing custom reactions in channels.

Also fix a crash on start with old hardware by rebuilding using
the 17.7.7 VS Build Tools, because 17.8.* has a regression
with emitting a SSE 4.2 instruction, see:

https://developercommunity.visualstudio.com/t/Illegal-Instruction-SSE-42-POPCNT-exc/10520578
2023-12-01 13:07:42 +04:00
John Preston c86ca6a61a Check custom reactions in channels better. 2023-12-01 13:05:06 +04:00
John Preston 8e2240d9d9 Fix custom reactions in channels. 2023-12-01 13:00:52 +04:00
John Preston 28acaf06ad Version 4.12.1.
- Fix assertion violation in imported messages rendering.
2023-12-01 09:44:38 +04:00
John Preston fe12c3639b Revert "Removed unused code of hidden sender userpics for sponsored messages."
This reverts commit 3f19dc0486.
2023-12-01 09:18:22 +04:00
John Preston 0e2131e6eb Version 4.12: Fix build with GCC. 2023-11-30 20:59:58 +04:00
John Preston 98be0a69df Version 4.12.
- Similar channels.
- Wallpapers for both sides.
- Voice-to-Text for everyone.
- Story statistics for channels.
- Custom Reactions for channels.
- Automatic code highlighting in messages.
2023-11-30 20:23:19 +04:00
Ilya Fedin d6aecdfe4b Update cmake_helpers and patches in Docker 2023-11-30 17:57:34 +04:00
John Preston fa63a220fa Fix build with Xcode. 2023-11-30 17:56:57 +04:00
John Preston 2611899448 Set custom reactions hard limit to max level. 2023-11-30 17:56:57 +04:00
John Preston 514ced1d8e Respect wallpaper_overriden flag. 2023-11-30 17:56:57 +04:00
23rd 1a69975131 Replaced Qt format of dates in statistics with internal format. 2023-11-29 09:09:36 +03:00
23rd 27b284ef5b Added initial support of trial voice transcribes. 2023-11-29 07:32:20 +03:00
23rd a546b3a9b6 Replaced display of premium layer with short box for sponsored messages. 2023-11-29 01:45:41 +03:00
John Preston 28d9330969 Add premium promo section about wallpapers. 2023-11-28 21:55:27 +04:00
John Preston 8c3fa14a75 Allow setting background for both sides. 2023-11-28 21:55:27 +04:00
John Preston e58940a876 Look for highlight language case-insensitive. 2023-11-28 21:55:27 +04:00
John Preston ae1da5baf4 Implement premium lock of similar channels. 2023-11-28 21:55:27 +04:00
23rd 2542ec5d93 Added list of public forwards for story statistics. 2023-11-28 21:55:27 +04:00
23rd dfe55b26a2 Added statistical values for stories to overview in statistics info. 2023-11-28 21:55:27 +04:00
23rd 6de95fc4ed Fixed display of recent posts with some types documents in statistics. 2023-11-28 21:55:27 +04:00
23rd 1e57563349 Improved style of icons in recent posts from list from statistics info. 2023-11-28 21:55:27 +04:00
23rd 9f0b4bc799 Added ability to paste login code from clipboard to new code input. 2023-11-28 21:55:27 +04:00
23rd ac8117a6d8 Improved style of input field for login code. 2023-11-28 21:55:27 +04:00
23rd 9ef0e5cf83 Moved animation callback for shake effect to single place. 2023-11-28 21:55:27 +04:00
23rd f433d6fbc9 Fixed button label in sponsored messages with external links. 2023-11-28 21:55:27 +04:00
23rd e24b86d460 Fixed restriction label when topic is closed.
Fixed #26344.
2023-11-28 21:55:27 +04:00
John Preston bfebb1339a Show "more similar channels" premium promo. 2023-11-28 21:55:27 +04:00
John Preston 49b59d73be Fix comments loading. Fixes #25889. 2023-11-28 21:55:27 +04:00
John Preston d41961945d Fix first time webpage preview customization. 2023-11-28 21:55:27 +04:00
John Preston aa29d1c619 Allow select single album part under spoiler. 2023-11-28 21:55:27 +04:00
John Preston d6d76c8477 Show repost-from-name in story header. 2023-11-28 21:55:27 +04:00
John Preston 6057bb2b37 Handle repost info clicks in expanded mode. 2023-11-28 21:55:27 +04:00
John Preston 5aaf119b36 Handle repost preview clicks. 2023-11-28 21:55:26 +04:00
John Preston 8f9123bb96 Display story repost nicely. 2023-11-28 21:55:26 +04:00
23rd 77b2076e0f Added build date info to version label as tooltip. 2023-11-28 21:55:26 +04:00
23rd 7681f14a3c Added icons to recent posts in list from statistics info. 2023-11-28 21:55:26 +04:00
23rd 4ad51ffb42 Removed some include directives. 2023-11-28 21:55:26 +04:00
23rd 0f3faf59ca Added support of bot apps to sponsored messages.
Added api support of custom button text in sponsored messages.
2023-11-28 21:55:26 +04:00
23rd d28ba4fad9 Moved out PeerByLinkInfo from SessionNavigation to separate file. 2023-11-28 21:55:26 +04:00
23rd 3f19dc0486 Removed unused code of hidden sender userpics for sponsored messages. 2023-11-28 21:55:26 +04:00
23rd fc86bb7a5f Removed redundant code for old sponsored messages. 2023-11-28 21:55:26 +04:00
23rd 0da515abc5 Added fast right action to sponsored messages. 2023-11-28 21:55:26 +04:00
23rd 4c5c2aadc4 Replaced style of sponsored messages with fake webpage. 2023-11-28 21:55:26 +04:00
23rd 17f89ba1f9 Added ability to get sponsored details from constructor of HistoryItem. 2023-11-28 21:55:26 +04:00
23rd a8de145e01 Moved out click handler for sponsored messages to separate module. 2023-11-28 21:55:26 +04:00
23rd c1d20d16fd Added small preview to story statistics. 2023-11-28 21:55:25 +04:00
23rd dc04a1afdb Removed display of selected index with incorrect value on bar chart. 2023-11-28 21:55:25 +04:00
23rd 856f39c123 Fixed search of indices on tiny charts in statistics. 2023-11-28 21:55:25 +04:00
23rd 909f3bf011 Added "new-windows-size-as-first" option. 2023-11-28 21:55:25 +04:00
23rd 19ab740da2 Added channel photo to recent posts in list from statistics info. 2023-11-28 21:55:25 +04:00
John Preston 11ea5e61cf Show repost header in stories. 2023-11-28 21:55:25 +04:00
John Preston 78897dd143 Show repost info on story view. 2023-11-28 21:55:25 +04:00
John Preston 23a0413113 Update API scheme on layer 167. 2023-11-28 21:55:25 +04:00
John Preston b5b5c28ac5 Request possible peer colors from API. 2023-11-28 21:55:25 +04:00
John Preston 5652abfd49 Update syntax-highlighting grammars. 2023-11-28 21:55:25 +04:00
John Preston 324f2f68ba Handle for_both chat wallpaper change. 2023-11-28 21:55:25 +04:00
John Preston f8825e8135 Update API scheme on layer 167. 2023-11-28 21:55:25 +04:00
John Preston 4dbe5c0a0f Load similar channels correctly. 2023-11-28 21:55:25 +04:00
John Preston 2df6729f2d Improve similar channels pseudo-widget. 2023-11-28 21:55:25 +04:00
John Preston 30d72f1d1d Try fixing media viewer on some Linux versions. 2023-11-28 21:55:24 +04:00
John Preston db0a31b87e Fix crash in scale preview reparenting. 2023-11-28 21:55:24 +04:00
John Preston 4b5e2582d9 Update API scheme on layer 167. 2023-11-28 21:55:24 +04:00
23rd 6a87fef851 Added reactions count to recent posts in list from statistics info. 2023-11-28 21:55:24 +04:00
23rd 1fbcec1d24 Added display of stories to list of recent posts in statistics info. 2023-11-28 21:55:24 +04:00
23rd 25d0123b9f Added more universal RecentPostId for saved state of statistics info. 2023-11-28 21:55:24 +04:00
23rd 69b9d404c0 Added api support of reactions count for recent posts in statistics. 2023-11-28 21:55:24 +04:00
23rd 0865776d9a Simplified FileOriginStory. 2023-11-28 21:55:24 +04:00
23rd 32008161a0 Fixed duration after changing of winners count in create giveaway box. 2023-11-28 21:55:24 +04:00
John Preston 36a8c49213 Show similar channels under join message. 2023-11-28 21:55:24 +04:00
John Preston 91fba41e2c Update API scheme on layer 167. 2023-11-28 21:55:24 +04:00
23rd 7d2d0bdfa2 Added initial entry point to statistics info for stories. 2023-11-28 21:55:24 +04:00
23rd 2bb8850e69 Added charts of story statistics to statistics info. 2023-11-28 21:55:24 +04:00
23rd 1056a5cc8e Added API support to resolve story statistics. 2023-11-28 21:55:24 +04:00
23rd 34d0dac351 Added ability to create statistics info layer with story id. 2023-11-28 21:55:24 +04:00
23rd f88eee8047 Added reactions count to overview in statistics info. 2023-11-28 21:55:24 +04:00
23rd 173a5046e8 Added new charts to channel and message statistics. 2023-11-28 21:55:24 +04:00
23rd 44f6280d0a Added ability to use BarChartView as non-stack as well. 2023-11-28 21:55:24 +04:00
23rd b7346c203a Renamed StackChartView to BarChartView. 2023-11-28 21:55:24 +04:00
23rd c3254a53bc Moved out calculation of height limits for linear chart to single place. 2023-11-28 21:55:24 +04:00
23rd 5ea066e6a7 Moved class of line ratio for double linear chart from private space. 2023-11-28 21:55:24 +04:00
23rd bc6556ebc4 Moved out class for cached selected points on chart from private space. 2023-11-28 21:55:23 +04:00
John Preston 4c6d33fd54 Allow sending to General in "View as Messages". 2023-11-28 21:55:23 +04:00
John Preston 96b651c29b Update "View as (Messages,Topics)" menu icons. 2023-11-28 21:55:23 +04:00
John Preston 0ffda016da Support cloud view_as_messages forum setting. 2023-11-28 21:55:23 +04:00
John Preston 43a8733fc7 Implement rich reactions selector. 2023-11-28 21:55:23 +04:00
John Preston 1e26c33b3d Implement choose-reactions input field. 2023-11-28 21:55:23 +04:00
John Preston 4ad70965e9 Don't check quote entities now that we have quote_offset. 2023-11-28 21:55:23 +04:00
John Preston 3a67e4f1f4 Support highlighting correct quoted part. 2023-11-28 21:55:23 +04:00
John Preston dcc326e17f Update API scheme to layer 167.
Support quote offset passing to API.
Support simple phrases in giveaway results message.
2023-11-28 21:55:23 +04:00
John Preston f442d69cb6 Fix possible crash on MTProto instance shutdown. 2023-11-28 21:23:27 +04:00
Ilya Fedin 17fa50bdff Update patches commit in Dockerfile 2023-11-28 13:18:43 +04:00
Ilya Fedin a04145d981 Update xkbcommon in Docker 2023-11-27 20:09:37 +04:00
Ilya Fedin e8c9cb7d2a Update Qt to 6.6.1 on Linux 2023-11-27 20:09:20 +04:00
Ilya Fedin 467a6c25a8 Fix upload artifact condition in Windows action 2023-11-27 20:09:04 +04:00
Ilya Fedin 1852386ace Add Windows Ninja CI 2023-11-27 18:02:59 +04:00
Ilya Fedin a93340c2e4 Try to restore session manager connection on Linux 2023-11-27 12:02:19 +04:00
Ilya Fedin 4a0ee22670 Shorten setting QSessionManager restart hint 2023-11-27 12:02:19 +04:00
John Preston 87a042b029 Fix build on Linux 2023-11-25 12:59:47 +04:00
Ilya Fedin 960761ef37 Replace jemalloc with scudo
This should provide a wider support for ARM hardware
2023-11-24 20:04:28 +04:00
John Preston b60e50df10 Try using hide media viewer workaround on Linux. 2023-11-22 12:18:45 +04:00
Ilya Fedin 4696f731da Force enable fractional-scale-v1 experimental option 2023-11-21 21:20:50 +04:00
Ilya Fedin 0f9d83f34b Use setFixedSize instead of set{Minimum,Maximum}Size combo 2023-11-21 21:20:50 +04:00
Ilya Fedin cfc254bd90 Switch Qt to GitHub 2023-11-21 21:20:50 +04:00
23rd bdee6e0155 Removed ability to add to contacts inaccessible users. 2023-11-20 21:03:36 +03:00
23rd ac6765ebdb Replaced default toast text for shared messages with complex phrases. 2023-11-20 16:25:28 +03:00
23rd df3ae2c5f8 Added ability to open boosts info without statistics info access. 2023-11-20 02:53:46 +03:00
23rd 1af4af6ff3 Removed display of unwrapped media in sponsored messages. 2023-11-20 02:53:46 +03:00
Ilya Fedin a92e9f7162 Try to update qtwayland to 6.6.0 again 2023-11-19 07:46:32 +04:00
ZavaruKitsu 6af28f6089 fix: update submodules 2023-11-19 01:21:39 +03:00
ZavaruKitsu 98b8840019 Merge tag 'v4.11.7' into dev
# Conflicts:
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/core/version.h
#	Telegram/lib_ui
2023-11-19 00:27:58 +03:00
ZavaruKitsu 5f5d5e43be feat: increase size of rounded video messages 2023-11-18 21:33:26 +03:00
ZavaruKitsu 1fc63407e5 feat: allow seeking voice and round video messages
fix: increase seek bar height
2023-11-18 21:14:25 +03:00
ZavaruKitsu dc6cd45f50 feat: add custom replacements
fix: remove useless shortcuts
2023-11-18 20:51:18 +03:00
ZavaruKitsu 8a4dd965e1 fix: remove useless 2023-11-18 19:59:18 +03:00
ZavaruKitsu 627322f563 fix: make it more correct 2023-11-18 19:50:00 +03:00
John Preston 27d9fa6acb Fix CI build on Linux. 2023-11-17 13:07:18 +04:00
John Preston 7d4362267a Fix compare helpers on macOS. 2023-11-17 13:06:04 +04:00
John Preston 1ba52402b5 Fix build with new MSVC, workaround compiler bug. 2023-11-17 12:01:25 +04:00
John Preston 5d0a36e456 Fix edit photo button area. 2023-11-17 12:01:25 +04:00
John Preston af6e15ed59 Fix title alignment in AskBoostBox. 2023-11-16 14:31:15 +04:00
John Preston 25216a140e Fix build on Windows. 2023-11-16 14:31:15 +04:00
John Preston 65fc7d2b10 Update lib_ui submodule. 2023-11-16 14:29:45 +04:00
John Preston 99da95880e Fix lang keys access on startup. 2023-11-15 18:20:59 +03:00
23rd 12272a450f Slightly optimized include directives in some headers. 2023-11-15 04:20:20 +03:00
23rd 819020e515 Moved out common default style entries from settings. 2023-11-15 04:20:20 +03:00
23rd acb1a7ccf2 Spread some style entries from basic style. 2023-11-15 04:19:51 +03:00
23rd 596460172f Optimized include directives of core_settings header. 2023-11-15 03:30:04 +03:00
23rd baa99be6a5 Removed some unwanted include directives of lang_keys in header files. 2023-11-15 03:30:04 +03:00
23rd f748de9dc4 Removed redundant include directives of settings_common headers. 2023-11-15 03:30:04 +03:00
23rd 85e2d54a05 Split out settings_common module into td_ui and non-td_ui variants. 2023-11-15 03:30:04 +03:00
23rd f629bf76ff Removed AddButton and CreateButton without icon from Settings. 2023-11-15 03:30:04 +03:00
23rd f6cb9072d2 Moved AddSkip and AddDivier from Settings namespace to separate module. 2023-11-15 03:30:04 +03:00
23rd 497aa6dbc8 Added ability to see admins who promoted or restricted participants. 2023-11-14 21:48:34 +03:00
John Preston 830e9a5953 Version 4.11.8. (macOS only)
- Fix phrases on macOS by doing a clean rebuild.
2023-11-14 21:28:24 +04:00
John Preston 5cabfb56e0 Fix "small" undef in Windows includes. 2023-11-14 09:27:48 +04:00
Ilya Fedin 8a19fab19c Update macOS to 13 on macOS packaged action 2023-11-13 16:10:37 +04:00
Ilya Fedin c592b66f5b Ignore brew upgrade failure in macOS packaged action 2023-11-13 13:54:36 +04:00
Ilya Fedin 8ce9a92898 Update brew packages in macOS packaged action
This ensures the same versions of packages between GitHub runners at a point in time
2023-11-13 13:34:14 +04:00
John Preston df8c80226b Version 4.11.7: Fix build with GCC. 2023-11-13 12:24:29 +04:00
John Preston 53b342f722 Version 4.11.7.
- Fix sending media files with quote replies.
- Fix quoted text highlighting in some cases.
- Fix loading statistics for some channels.
- Fix Ctrl+Shift+. shortcut on X11.
- Fix a crash in statistics.
2023-11-13 11:46:07 +04:00
Ilya Fedin d2b6012bfd Mark code unneeded after Qt 6.6.0 2023-11-13 11:41:57 +04:00
John Preston 69efd127eb Update submodules. 2023-11-13 11:39:35 +04:00
John Preston 22cedbc9cc Don't show full albums in search results. 2023-11-13 11:39:35 +04:00
John Preston d4d2eef291 Fix clearing cloud draft on message send.
Regression was introduced in 20ba417ddd.
2023-11-13 10:44:38 +04:00
23rd 98bd5757b0 Increased pagination limits for recent messages in statistics info. 2023-11-13 10:21:46 +04:00
John Preston edb7cf197a Improve reply preview above the field. 2023-11-13 10:10:18 +04:00
23rd 617be49e55 Fixed crash in statistics on linear charts with filtered first line. 2023-11-13 10:10:18 +04:00
John Preston 9324ceeb24 Destory stats sessions after a timeout. 2023-11-13 10:08:47 +04:00
23rd 1e6cf839e2 Fixed Api requests for statistics with non-default DC. 2023-11-11 15:05:20 +03:00
John Preston 468d4c5e4f Don't make multiboost badge gradient. 2023-11-10 18:07:21 +04:00
John Preston c530d7cc89 Apply Ui::Text::String modifications in highlighting. 2023-11-10 17:48:25 +04:00
John Preston f7ea0e1d00 Fix modifications tracking in Ui::Text::String.
Fixes #27031.
2023-11-10 17:46:01 +04:00
John Preston b959877598 Use explicit nativeVirtualKey on Windows only. 2023-11-10 16:28:01 +04:00
John Preston 8d0fe601cf Fix sending quote data with uploaded media.
Fixes #27032.
2023-11-10 16:27:25 +04:00
794 changed files with 39678 additions and 8391 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

+2 -3
View File
@@ -28,6 +28,7 @@ jobs:
run: |
sudo apt update
curl -sSL https://install.python-poetry.org | python3 -
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Free up some disk space.
uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8
@@ -40,6 +41,4 @@ jobs:
- name: Push the Docker image.
if: ${{ github.ref_name == github.event.repository.default_branch }}
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
docker push $IMAGE_TAG
run: docker push $IMAGE_TAG
+11 -16
View File
@@ -43,15 +43,6 @@ jobs:
linux:
name: Rocky Linux 8
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}/centos_env
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: scl enable gcc-toolset-12 -- bash --noprofile --norc -eo pipefail {0}
strategy:
matrix:
@@ -75,12 +66,13 @@ jobs:
- name: First set up.
run: |
gcc --version
ln -s /usr/src/Libraries
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
docker pull ghcr.io/$GITHUB_REPOSITORY/centos_env
docker tag ghcr.io/$GITHUB_REPOSITORY/centos_env tdesktop:centos_env
- name: Telegram Desktop build.
run: |
cd $REPO_NAME/Telegram
cd $REPO_NAME
DEFINE=""
if [ -n "${{ matrix.defines }}" ]; then
@@ -91,18 +83,21 @@ jobs:
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
fi
./configure.sh \
docker run --rm \
-v $PWD:/usr/src/tdesktop \
-e DEBUG=1 \
tdesktop:centos_env \
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.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" \
-D TDESKTOP_API_TEST=ON \
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF \
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
$DEFINE
cmake --build ../out --config Debug --parallel
- name: Check.
run: |
filePath="$REPO_NAME/out/Debug/Telegram"
@@ -121,7 +116,7 @@ jobs:
run: |
cd $REPO_NAME/out/Debug
mkdir artifact
mv Telegram artifact/
mv {Telegram,Updater} artifact/
- uses: actions/upload-artifact@master
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
+1
View File
@@ -115,6 +115,7 @@ jobs:
-D CMAKE_CXX_FLAGS="-Werror" \
-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO \
-D TDESKTOP_API_TEST=ON \
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF \
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
$DEFINE
+3 -1
View File
@@ -40,7 +40,7 @@ jobs:
macos:
name: MacOS
runs-on: macos-latest
runs-on: macos-13
strategy:
matrix:
@@ -67,6 +67,8 @@ jobs:
- name: First set up.
run: |
brew update
brew upgrade || true
brew install autoconf automake boost cmake ffmpeg openal-soft openssl opus ninja pkg-config python qt yasm xz
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
+40 -41
View File
@@ -1,7 +1,6 @@
name: Windows.
on:
workflow_dispatch:
push:
paths-ignore:
- 'docs/**'
@@ -47,10 +46,11 @@ jobs:
strategy:
matrix:
arch: [Win32]
arch: [Win32, x64]
generator: ["", "Ninja Multi-Config"]
env:
UPLOAD_ARTIFACT: "true"
UPLOAD_ARTIFACT: "false"
ONLY_CACHE: "false"
PREPARE_PATH: "Telegram/build/prepare/prepare.py"
@@ -110,19 +110,42 @@ jobs:
cd %TBUILD%
%REPO_NAME%\Telegram\build\prepare\win.bat skip-release silent
- name: Read defines.
- name: Read configuration matrix.
shell: bash
run: |
ARTIFACT_NAME="Telegram"
ARCH=""
if [ -n "${{ matrix.arch }}" ]; then
case "${{ matrix.arch }}" in
Win32) ARCH="x86";;
*) ARCH="${{ matrix.arch }}";;
esac
echo "Architecture from matrix: $ARCH"
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.arch }}"
fi
GENERATOR=""
if [ -n "${{ matrix.generator }}" ]; then
GENERATOR="-G \"${{ matrix.generator }}\""
echo "Generator from matrix: $GENERATOR"
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.generator }}"
fi
echo "TDESKTOP_BUILD_GENERATOR=$GENERATOR" >> $GITHUB_ENV
[ -n "$GENERATOR" ] && ARCH=""
echo "TDESKTOP_BUILD_ARCH=$ARCH" >> $GITHUB_ENV
DEFINE=""
if [ -n "${{ matrix.defines }}" ]; then
DEFINE="-D ${{ matrix.defines }}=ON"
echo "Define from matrix: $DEFINE"
echo "ARTIFACT_NAME=Telegram_${{ matrix.arch }}_${{ matrix.defines }}" >> $GITHUB_ENV
else
echo "ARTIFACT_NAME=Telegram_${{ matrix.arch }}" >> $GITHUB_ENV
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.defines }}"
fi
echo "TDESKTOP_BUILD_DEFINE=$DEFINE" >> $GITHUB_ENV
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
API="-D TDESKTOP_API_TEST=ON"
if [ $GITHUB_REF == 'refs/heads/nightly' ]; then
echo "Use the open credentials."
@@ -143,50 +166,26 @@ jobs:
cd %TBUILD%\%REPO_NAME%\Telegram
call configure.bat ^
${{ matrix.arch }} ^
%TDESKTOP_BUILD_GENERATOR% ^
%TDESKTOP_BUILD_ARCH% ^
%TDESKTOP_BUILD_API% ^
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF ^
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF ^
-D DESKTOP_APP_NO_PDB=ON ^
%TDESKTOP_BUILD_DEFINE% ^
-DCMAKE_SYSTEM_VERSION=%SDK%
%TDESKTOP_BUILD_DEFINE%
cd ..\out
msbuild -m Telegram.sln /p:Configuration=Debug,Platform=${{ matrix.arch }},DebugSymbols=false,DebugType=none
cmake --build ..\out --config Debug --parallel
- name: Move artifact.
if: (env.UPLOAD_ARTIFACT == 'true') || ${{ github.ref == 'refs/heads/nightly' }}
if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly')
run: |
set OUT=%TBUILD%\%REPO_NAME%\out\Debug
mkdir artifact
move %TBUILD%\%REPO_NAME%\out\Debug\AyuGram.exe artifact/
move %OUT%\Telegram.exe artifact/
move %OUT%\Updater.exe artifact/
- uses: actions/upload-artifact@master
name: Upload artifact.
if: (env.UPLOAD_ARTIFACT == 'true') || ${{ github.ref == 'refs/heads/nightly' }}
if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly')
with:
name: ${{ env.ARTIFACT_NAME }}
path: artifact\
release:
name: Release
needs: [windows]
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Merge Releases
uses: actions/download-artifact@v2
with:
name: Telegram_Win32
path: artifact
- name: Upload release
uses: Hs1r1us/Release-AIO@v1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# The name of the tag
tag_name: prelease-${{ github.run_number }}
prerelease: true
release_name: Ayugram CI
asset_files: './artifact'
-3
View File
@@ -76,9 +76,6 @@
[submodule "Telegram/lib_webview"]
path = Telegram/lib_webview
url = https://github.com/desktop-app/lib_webview.git
[submodule "Telegram/ThirdParty/jemalloc"]
path = Telegram/ThirdParty/jemalloc
url = https://github.com/jemalloc/jemalloc
[submodule "Telegram/ThirdParty/dispatch"]
path = Telegram/ThirdParty/dispatch
url = https://github.com/apple/swift-corelibs-libdispatch
+3 -2
View File
@@ -10,8 +10,9 @@ if (APPLE)
else()
cmake_minimum_required(VERSION 3.16)
endif()
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0091 NEW)
if (POLICY CMP0149)
cmake_policy(SET CMP0149 NEW)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+1 -1
View File
@@ -1,7 +1,7 @@
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
Copyright (c) 2014-2023 The Telegram Desktop Authors.
Copyright (c) 2014-2024 The Telegram Desktop Authors.
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+21 -16
View File
@@ -9,11 +9,17 @@
- Anti-recall
- Font customization
- Streamer mode
- Material Design switches
- Local Telegram Premium
- Sync read states and message history with AyuSync *(TBA)*
- Enhanced appearance
<img src='.github/demos/demo1.png' width='250'> <img src='.github/demos/demo2.png' width='250'> <img src='.github/demos/demo3.png' width='250'>
And many more. Check out our [Documentation](https://docs.ayugram.one/desktop/).
## Preferences screenshots
<img src='.github/demos/demo1.png' width='268'>
<img src='.github/demos/demo2.png' width='268'>
<img src='.github/demos/demo3.png' width='268'>
<img src='.github/demos/demo4.png' width='268'>
## Downloads
@@ -27,12 +33,7 @@ build by yourself.
### Arch Linux
It is recommended to build AyuGram from source on any Linux distro.
But if you're brave enough, you can install `ayugram-desktop-git` or `ayugram-desktop-bin`
from [AUR](https://aur.archlinux.org/packages?O=0&K=ayugram).
These packages maintained by [westpain](https://github.com/incycledream). *We're not responsible for them.*
You can install `ayugram-desktop` or `ayugram-desktop-git` from [AUR](https://aur.archlinux.org/packages?O=0&K=ayugram).
### Any other Linux distro
@@ -48,23 +49,27 @@ Make sure you have these components installed with VS Build Tools:
## Donation
If you enjoy using **AyuGram** and want to send us a tip, here's how you can do it:
Enjoy using **AyuGram**? Consider sending us a tip!
- Using [Boosty](https://boosty.to/alexeyzavar) - any card and PayPal
- Using cryptocurrency - `TRpbajq38qU8joThgAfKJLyEPbNjzsdPJ1` (Tron + USDT)
[Here's available methods.](https://docs.ayugram.one/donate/)
## Credits
### Telegram clients
- [Telegram Desktop](https://github.com/telegramdesktop/tdesktop)
- [Kotatogram](https://github.com/kotatogram/kotatogram-desktop)
- [64Gram](https://github.com/TDesktop-x64/tdesktop)
- [Forkgram](https://github.com/forkgram/tdesktop)
- [SQLite](https://github.com/sqlite/sqlite)
- [sqlite_orm](https://github.com/fnc12/sqlite_orm)
### Very special thanks to
### Libraries used
- [Solar Icon Set](https://solariconset.com/)
- [JSON for Modern C++](https://github.com/nlohmann/json)
- [BitConverter](https://github.com/YanjieHe/BitConverter)
- [Not Enough Standards](https://github.com/Alairion/not-enough-standards)
- [SQLite](https://github.com/sqlite/sqlite)
- [sqlite_orm](https://github.com/fnc12/sqlite_orm)
### Icons
- [Solar Icon Set](https://www.figma.com/community/file/1166831539721848736)
+45 -11
View File
@@ -96,6 +96,8 @@ nice_target_sources(Telegram ${src_loc}
PRIVATE
${style_files}
ayu/ayu_url_handlers.cpp
ayu/ayu_url_handlers.h
ayu/ayu_state.cpp
ayu/ayu_state.h
ayu/ayu_settings.cpp
@@ -107,6 +109,7 @@ PRIVATE
ayu/ayu_constants.h
ayu/utils/ayu_mapper.cpp
ayu/utils/ayu_mapper.h
ayu/utils/qt_key_modifiers_extended.h
ayu/utils/telegram_helpers.cpp
ayu/utils/telegram_helpers.h
ayu/utils/windows_utils.cpp
@@ -123,6 +126,8 @@ PRIVATE
ayu/ui/settings/settings_ayu.h
ayu/ui/context_menu/context_menu.cpp
ayu/ui/context_menu/context_menu.h
ayu/ui/context_menu/menu_item_subtext.cpp
ayu/ui/context_menu/menu_item_subtext.h
ayu/ui/sections/edited/edited_log_inner.cpp
ayu/ui/sections/edited/edited_log_inner.h
ayu/ui/sections/edited/edited_log_item.cpp
@@ -197,6 +202,8 @@ PRIVATE
api/api_messages_search.h
api/api_messages_search_merged.cpp
api/api_messages_search_merged.h
api/api_peer_colors.cpp
api/api_peer_colors.h
api/api_peer_photo.cpp
api/api_peer_photo.h
api/api_polls.cpp
@@ -447,16 +454,18 @@ PRIVATE
chat_helpers/gifs_list_widget.h
chat_helpers/message_field.cpp
chat_helpers/message_field.h
chat_helpers/share_message_phrase_factory.cpp
chat_helpers/share_message_phrase_factory.h
chat_helpers/spellchecker_common.cpp
chat_helpers/spellchecker_common.h
chat_helpers/stickers_dice_pack.cpp
chat_helpers/stickers_dice_pack.h
chat_helpers/stickers_emoji_image_loader.cpp
chat_helpers/stickers_emoji_image_loader.h
chat_helpers/stickers_emoji_pack.cpp
chat_helpers/stickers_emoji_pack.h
chat_helpers/stickers_gift_box_pack.cpp
chat_helpers/stickers_gift_box_pack.h
chat_helpers/stickers_dice_pack.cpp
chat_helpers/stickers_dice_pack.h
chat_helpers/stickers_list_footer.cpp
chat_helpers/stickers_list_footer.h
chat_helpers/stickers_list_widget.cpp
@@ -613,6 +622,10 @@ PRIVATE
data/data_replies_list.h
data/data_reply_preview.cpp
data/data_reply_preview.h
data/data_saved_messages.cpp
data/data_saved_messages.h
data/data_saved_sublist.cpp
data/data_saved_sublist.h
data/data_search_controller.cpp
data/data_search_controller.h
data/data_send_action.cpp
@@ -778,6 +791,8 @@ PRIVATE
history/view/media/history_view_premium_gift.h
history/view/media/history_view_service_box.cpp
history/view/media/history_view_service_box.h
history/view/media/history_view_similar_channels.cpp
history/view/media/history_view_similar_channels.h
history/view/media/history_view_slot_machine.cpp
history/view/media/history_view_slot_machine.h
history/view/media/history_view_sticker.cpp
@@ -853,8 +868,12 @@ PRIVATE
history/view/history_view_service_message.h
history/view/history_view_spoiler_click_handler.cpp
history/view/history_view_spoiler_click_handler.h
history/view/history_view_sponsored_click_handler.cpp
history/view/history_view_sponsored_click_handler.h
history/view/history_view_sticker_toast.cpp
history/view/history_view_sticker_toast.h
history/view/history_view_sublist_section.cpp
history/view/history_view_sublist_section.h
history/view/history_view_transcribe_button.cpp
history/view/history_view_transcribe_button.h
history/view/history_view_translate_bar.cpp
@@ -956,8 +975,12 @@ PRIVATE
info/profile/info_profile_values.h
info/profile/info_profile_widget.cpp
info/profile/info_profile_widget.h
info/saved/info_saved_sublists_widget.cpp
info/saved/info_saved_sublists_widget.h
info/settings/info_settings_widget.cpp
info/settings/info_settings_widget.h
info/similar_channels/info_similar_channels_widget.cpp
info/similar_channels/info_similar_channels_widget.h
info/statistics/info_statistics_common.h
info/statistics/info_statistics_inner_widget.cpp
info/statistics/info_statistics_inner_widget.h
@@ -1095,6 +1118,8 @@ PRIVATE
media/stories/media_stories_recent_views.h
media/stories/media_stories_reply.cpp
media/stories/media_stories_reply.h
media/stories/media_stories_repost_view.cpp
media/stories/media_stories_repost_view.h
media/stories/media_stories_share.cpp
media/stories/media_stories_share.h
media/stories/media_stories_sibling.cpp
@@ -1345,8 +1370,8 @@ PRIVATE
settings/settings_calls.h
settings/settings_codes.cpp
settings/settings_codes.h
settings/settings_common.cpp
settings/settings_common.h
settings/settings_common_session.cpp
settings/settings_common_session.h
settings/settings_experimental.cpp
settings/settings_experimental.h
settings/settings_folders.cpp
@@ -1506,6 +1531,7 @@ PRIVATE
window/window_section_common.h
window/window_session_controller.cpp
window/window_session_controller.h
window/window_session_controller_link_info.h
window/window_slide_animation.cpp
window/window_slide_animation.h
window/window_top_bar_wrap.h
@@ -1798,6 +1824,10 @@ endif()
set_target_properties(Telegram PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder})
if (WIN32)
target_link_libraries(Telegram
PRIVATE
delayimp
)
target_link_options(Telegram
PRIVATE
/DELAYLOAD:secur32.dll
@@ -1854,6 +1884,10 @@ if (NOT DESKTOP_APP_DISABLE_AUTOUPDATE AND NOT build_macstore AND NOT build_wins
)
target_include_directories(Updater PRIVATE ${lib_base_loc})
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_link_libraries(Updater
PRIVATE
delayimp
)
target_link_options(Updater
PRIVATE
/DELAYLOAD:user32.dll
@@ -1913,9 +1947,9 @@ endif()
if (LINUX AND DESKTOP_APP_USE_PACKAGED)
include(GNUInstallDirs)
configure_file("../lib/xdg/ayugram.desktop.service" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.service" @ONLY)
configure_file("../lib/xdg/ayugram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml")
configure_file("../lib/xdg/com.ayugram.desktop.service" "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.service" @ONLY)
configure_file("../lib/xdg/com.ayugram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.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 "ayugram.png")
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "ayugram.png")
@@ -1924,8 +1958,8 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "ayugram.png")
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "ayugram.png")
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "ayugram.png")
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "telegram-symbolic.svg")
install(FILES "../lib/xdg/ayugram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "ayugram-symbolic.svg")
install(FILES "../lib/xdg/com.ayugram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
endif()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 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: 711 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: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 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: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+204 -11
View File
@@ -395,6 +395,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_dlg_new_bot_name" = "Bot name";
"lng_no_chats" = "Your chats will be here";
"lng_no_chats_filter" = "No chats currently belong to this folder.";
"lng_no_saved_sublists" = "You can save messages from other chats here.";
"lng_contacts_loading" = "Loading...";
"lng_contacts_not_found" = "No contacts found";
"lng_topics_not_found" = "No topics found.";
@@ -591,6 +592,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_section_background" = "Chat background";
"lng_settings_bg_from_gallery" = "Choose from gallery";
"lng_settings_bg_from_file" = "Choose from file";
"lng_settings_bg_remove" = "Remove wallpaper";
"lng_settings_bg_theme_edit" = "Edit theme";
"lng_settings_bg_theme_create" = "Create new theme";
"lng_settings_bg_cloud_themes" = "Custom themes";
@@ -813,6 +815,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_manage_enabled_dictionary" = "Dictionary is enabled";
"lng_settings_manage_remove_dictionary" = "Remove Dictionary";
"lng_settings_gift_premium" = "Premium Gifting";
"lng_settings_gift_premium_users_confirm" = "Proceed";
"lng_settings_gift_premium_users_error#one" = "You can select maximum {count} user.";
"lng_settings_gift_premium_users_error#other" = "You can select maximum {count} users.";
"lng_backgrounds_header" = "Choose Wallpaper";
"lng_theme_sure_keep" = "Keep this theme?";
"lng_theme_reverting#one" = "Reverting to the old theme in {count} second.";
@@ -833,12 +840,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_background_blur" = "Blurred";
"lng_background_sure_delete" = "Are you sure you want to delete this background?";
"lng_background_other_info" = "{user} will be able to apply this wallpaper";
"lng_background_other_channel" = "All subscribers will see this wallpaper";
"lng_background_apply1" = "Apply the wallpaper in this chat.";
"lng_background_apply2" = "Enjoy the view.";
"lng_background_apply_button" = "Apply For This Chat";
"lng_background_dimming" = "Background dimming";
"lng_background_sure_reset_default" = "Are you sure you want to reset the wallpaper?";
"lng_background_reset_default" = "Reset";
"lng_background_apply_me" = "Apply for me";
"lng_background_apply_both" = "Apply for me and {user}";
"lng_background_apply_channel" = "Apply For Channel";
"lng_download_path_ask" = "Ask download path for each file";
"lng_download_path" = "Download path";
@@ -1175,6 +1186,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_profile_bot_privacy" = "Bot Privacy Policy";
"lng_profile_common_groups#one" = "{count} group in common";
"lng_profile_common_groups#other" = "{count} groups in common";
"lng_profile_similar_channels#one" = "{count} similar channel";
"lng_profile_similar_channels#other" = "{count} similar channels";
"lng_profile_saved_messages#one" = "{count} saved message";
"lng_profile_saved_messages#other" = "{count} saved messages";
"lng_profile_participants_section" = "Members";
"lng_profile_subscribers_section" = "Subscribers";
"lng_profile_add_contact" = "Add Contact";
@@ -1347,6 +1362,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_manage_peer_reactions_none_about" = "Members of the group can't add any reactions to messages.";
"lng_manage_peer_reactions_some_title" = "Only allow these reactions";
"lng_manage_peer_reactions_available" = "Available reactions";
"lng_manage_peer_reactions_own" = "You can also {link} emoji packs and use them as reactions.";
"lng_manage_peer_reactions_own_link" = "create your own";
"lng_manage_peer_reactions_level#one" = "Your channel needs to reach level **{count}** to use **{same_count}** custom reaction.";
"lng_manage_peer_reactions_level#other" = "Your channel needs to reach level **{count}** to use **{same_count}** custom reactions.";
"lng_manage_peer_reactions_boost" = "Boost your channel {link}.";
"lng_manage_peer_reactions_boost_link" = "here";
"lng_manage_peer_reactions_limit" = "Channels can't have more custom 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.";
@@ -1641,11 +1663,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_action_suggested_video_button" = "View Video";
"lng_action_attach_menu_bot_allowed" = "You allowed this bot to message you when you added it in the attachment menu.";
"lng_action_webapp_bot_allowed" = "You allowed this bot to message you in his web-app.";
"lng_action_set_wallpaper_me" = "You set a new wallpaper for this chat";
"lng_action_set_wallpaper" = "{user} set a new wallpaper for this chat";
"lng_action_set_wallpaper_me" = "You set a new wallpaper for this chat.";
"lng_action_set_wallpaper" = "{user} set a new wallpaper for this chat.";
"lng_action_set_wallpaper_both_me" = "You set a new wallpaper for {user} and you.";
"lng_action_set_wallpaper_button" = "View Wallpaper";
"lng_action_set_same_wallpaper_me" = "You set the same wallpaper for this chat";
"lng_action_set_same_wallpaper" = "{user} set the same wallpaper for this chat";
"lng_action_set_wallpaper_remove" = "Remove";
"lng_action_set_same_wallpaper_me" = "You set the same wallpaper for this chat.";
"lng_action_set_same_wallpaper" = "{user} set the same wallpaper for this chat.";
"lng_action_topic_created_inside" = "Topic created";
"lng_action_topic_closed_inside" = "Topic closed";
"lng_action_topic_reopened_inside" = "Topic reopened";
@@ -1667,6 +1691,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_action_story_mention_me_unavailable" = "The story where you mentioned {user} is no longer available.";
"lng_action_story_mention_unavailable" = "The story where {user} mentioned you is no longer available.";
"lng_action_giveaway_started" = "{from} just started a giveaway of Telegram Premium subscriptions to its followers.";
"lng_action_giveaway_results#one" = "{count} winner of the giveaway was randomly selected by Telegram and received private messages with giftcodes.";
"lng_action_giveaway_results#other" = "{count} winners of the giveaway were randomly selected by Telegram and received private messages with giftcodes.";
"lng_action_giveaway_results_some" = "Some winners of the giveaway were randomly selected by Telegram and received private messages with giftcodes.";
"lng_action_giveaway_results_none" = "No winners of the giveaway could be selected.";
"lng_similar_channels_title" = "Similar channels";
"lng_similar_channels_view_all" = "View all";
"lng_similar_channels_more" = "More Channels";
"lng_similar_channels_premium_all#one" = "Subscribe to {link} to unlock up to **{count}** similar channel.";
"lng_similar_channels_premium_all#other" = "Subscribe to {link} to unlock up to **{count}** similar channels.";
"lng_similar_channels_premium_all_link" = "Telegram Premium";
"lng_similar_channels_show_more" = "Show more channels";
"lng_premium_gift_duration_months#one" = "for {count} month";
"lng_premium_gift_duration_months#other" = "for {count} months";
@@ -1679,6 +1715,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_ttl_video_received" = "{from} sent you a self-destructing video. Please view it on your mobile.";
"lng_ttl_video_sent" = "You sent a self-destructing video.";
"lng_ttl_video_expired" = "Video has expired";
"lng_ttl_voice_sent" = "You sent a self-destructing voice messsage.";
"lng_ttl_voice_expired" = "Voice message expired";
"lng_ttl_round_sent" = "You sent a self-destructing video message.";
"lng_ttl_round_expired" = "Round message expired";
"lng_profile_add_more_after_create" = "You will be able to add more members after you create the group.";
"lng_profile_camera_title" = "Capture yourself";
@@ -1808,9 +1848,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_forwarded_hidden" = "The account was hidden by the user.";
"lng_forwarded_imported" = "This message was imported from another app. It may not be real.";
"lng_signed_author" = "Author: {user}";
"lng_sponsored" = "sponsored";
"lng_recommended" = "recommended";
"lng_sponsored_message_title" = "Sponsored";
"lng_recommended_message_title" = "Recommended";
"lng_edited" = "edited";
"lng_commented" = "commented";
"lng_edited_date" = "Edited: {date}";
"lng_sent_date" = "Sent: {date}";
"lng_views_tooltip#one" = "Views: {count}";
@@ -1921,6 +1962,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_premium_summary_subtitle_gift#other" = "{user} has gifted you a {count}-months subscription for Telegram Premium.";
"lng_premium_summary_subtitle_gift_me#one" = "You gifted {user} a {count}-month subscription for Telegram Premium.";
"lng_premium_summary_subtitle_gift_me#other" = "You gifted {user} a {count}-months subscription for Telegram Premium.";
"lng_premium_summary_subtitle_wallpapers" = "Wallpapers for Both Sides";
"lng_premium_summary_about_wallpapers" = "Set custom wallpapers for you and your chat partner.";
"lng_premium_summary_subtitle_stories" = "Upgraded Stories";
"lng_premium_summary_about_stories" = "Priority order, stealth mode, permanent views history and more.";
"lng_premium_summary_subtitle_double_limits" = "Doubled Limits";
@@ -2028,6 +2071,24 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_premium_gift_per" = "{cost} / month";
"lng_premium_gift_terms" = "You can review the list of features and terms of use for Telegram Premium {link}.";
"lng_premium_gift_terms_link" = "here";
"lng_premium_gifts_about_user1" = "Give **{user}** access to exclusive features.";
"lng_premium_gifts_about_user2" = "Give **{user}** and **{second_user}** access to exclusive features.";
"lng_premium_gifts_about_user3" = "Give **{user}**, **{second_user}** and **{name}** access to exclusive features.";
"lng_premium_gifts_about_user_more#one" = "Give **{user}**, **{second_user}**, **{name}** and **{count}** more friend access to exclusive features.";
"lng_premium_gifts_about_user_more#other" = "Give **{user}**, **{second_user}**, **{name}** and **{count}** more friends access to exclusive features.";
"lng_premium_gifts_about_reward#one" = "You will receive {emoji}**{count}** boost.";
"lng_premium_gifts_about_reward#other" = "You will receive {emoji}**{count}** boosts.";
"lng_premium_gifts_about_paid_title" = "Gifts Sent!";
"lng_premium_gifts_about_paid1" = "**{user}** has been notified about the gifts you purchased.";
"lng_premium_gifts_about_paid2" = "**{user}** and **{second_user}** have been notified about the gifts you purchased.";
"lng_premium_gifts_about_paid3" = "**{user}**, **{second_user}** and **{name}** have been notified about the gifts you purchased.";
"lng_premium_gifts_about_paid_more#one" = "**{user}**, **{second_user}**, **{name}** and **{count}** other have been notified about the gifts you purchased.";
"lng_premium_gifts_about_paid_more#other" = "**{user}**, **{second_user}**, **{name}** and **{count}** others have been notified about the gifts you purchased.";
"lng_premium_gifts_about_paid_below#one" = "They now have access to additional features.";
"lng_premium_gifts_about_paid_below#other" = "They now have access to additional features.";
"lng_premium_gifts_summary_subtitle" = "What's Included";
"lng_premium_gifts_terms" = "By gifting Telegram Premium, you agree to the Telegram {link} and {policy}.";
"lng_premium_gifts_terms_policy" = "Privacy Policy";
"lng_boost_channel_button" = "Boost Channel";
"lng_boost_again_button" = "Boost Again";
@@ -2083,6 +2144,19 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_boost_channel_title_color" = "Enable colors";
"lng_boost_channel_needs_level_color#one" = "Your channel needs to reach **Level {count}** to change channel color.";
"lng_boost_channel_needs_level_color#other" = "Your channel needs to reach **Level {count}** to change channel color.";
"lng_boost_channel_title_wallpaper" = "Enable wallpapers";
"lng_boost_channel_needs_level_wallpaper#one" = "Your channel needs to reach **Level {count}** to change channel wallpaper.";
"lng_boost_channel_needs_level_wallpaper#other" = "Your channel needs to reach **Level {count}** to change channel wallpaper.";
"lng_boost_channel_title_status" = "Enable emoji status";
"lng_boost_channel_needs_level_status#one" = "Your channel needs to reach **Level {count}** to set emoji status.";
"lng_boost_channel_needs_level_status#other" = "Your channel needs to reach **Level {count}** to set emoji status.";
"lng_boost_channel_title_reactions" = "Custom reactions";
"lng_boost_channel_needs_level_reactions#one" = "Your channel needs to reach **Level {count}** to add **{same_count}** custom emoji as a reaction.";
"lng_boost_channel_needs_level_reactions#other" = "Your channel needs to reach **Level {count}** to add **{same_count}** custom emoji as reactions.";
"lng_boost_channel_ask" = "Ask your **Premium** subscribers to boost your channel with this link:";
"lng_boost_channel_ask_button" = "Copy Link";
"lng_boost_channel_or" = "or";
@@ -2138,6 +2212,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_giveaway_maximum_users_error#other" = "You can select maximum {count} users.";
"lng_giveaway_channels_confirm_title" = "Channel is Private";
"lng_giveaway_channels_confirm_about" = "Are you sure you want to add a private channel? Users won't be able to join it without an invite link.";
"lng_giveaway_additional_prizes" = "Additional prizes";
"lng_giveaway_additional_about" = "Turn this on if you want to give the winners your own prizes in addition to Premium subscriptions.";
"lng_giveaway_additional_prizes_ph" = "Enter your prize";
"lng_giveaway_prizes_just_premium#one" = "All prizes: **{count}** Telegram Premium subscription {duration}.";
"lng_giveaway_prizes_just_premium#other" = "All prizes: **{count}** Telegram Premium subscriptions {duration}.";
"lng_giveaway_prizes_additional#one" = "All prizes: **{count}** {prize} with Telegram Premium subscription {duration}.";
"lng_giveaway_prizes_additional#other" = "All prizes: **{count}** {prize} with Telegram Premium subscriptions {duration}.";
"lng_giveaway_show_winners" = "Show winners";
"lng_giveaway_show_winners_about" = "Choose whether to make the list of winners public when the giveaway ends.";
"lng_giveaway_created_title" = "Giveaway created";
"lng_giveaway_created_body" = "Check your channels' {link} to see how this giveaway boosted your channel.";
@@ -2157,6 +2240,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_prizes_title#one" = "Giveaway Prize";
"lng_prizes_title#other" = "Giveaway Prizes";
"lng_prizes_additional#one" = "**{count}** {prize}";
"lng_prizes_additional#other" = "**{count}** {prize}";
"lng_prizes_additional_with" = "with";
"lng_prizes_about#one" = "**{count}** Telegram Premium Subscription {duration}.";
"lng_prizes_about#other" = "**{count}** Telegram Premium Subscriptions {duration}.";
"lng_prizes_participants" = "Participants";
@@ -2175,6 +2261,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_prizes_end_text" = "This giveaway was sponsored by {admins}.";
"lng_prizes_admins#one" = "the admins of {channel}, who aquired **{count} Telegram Premium** subscription {duration} for its followers";
"lng_prizes_admins#other" = "the admins of {channel}, who aquired **{count} Telegram Premium** subscriptions {duration} for its followers.";
"lng_prizes_additional_added#one" = "{channel} also included **{count} {prize}** in the prize. Admins of the channel are responsible for delivering this prize.";
"lng_prizes_additional_added#other" = "{channel} also included **{count} {prize}** in the prizes. Admins of the channel are responsible for delivering these prizes.";
"lng_prizes_how_when_finish" = "On {date}, Telegram will automatically select {winners}.";
"lng_prizes_end_when_finish" = "On {date}, Telegram automatically selected {winners}.";
"lng_prizes_end_activated#one" = "**{count}** of the winners already used their gift link.";
@@ -2200,6 +2288,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_prizes_cancelled" = "The channel cancelled the prizes by reversing the payment for them.";
"lng_prizes_badge" = "x{amount}";
"lng_prizes_results_title" = "Winners Selected!";
"lng_prizes_results_about#one" = "**{count}** winner of the {link} was randomly selected by Telegram.";
"lng_prizes_results_about#other" = "**{count}** winners of the {link} were randomly selected by Telegram.";
"lng_prizes_results_link" = "Giveaway";
"lng_prizes_results_winners" = "Winners";
"lng_prizes_results_more#one" = "and {count} more!";
"lng_prizes_results_more#other" = "and {count} more!";
"lng_prizes_results_all" = "All winners received gift links in private messages.";
"lng_prizes_results_some" = "Some winners couldn't be selected.";
"lng_gift_link_title" = "Gift Link";
"lng_gift_link_about" = "This link allows you to activate\na **Telegram Premium** subscription.";
"lng_gift_link_label_from" = "From";
@@ -2403,6 +2501,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_saved_short" = "Save";
"lng_saved_forward_here" = "Forward messages here for quick access";
"lng_saved_quote_here" = "Quote here to save";
"lng_saved_open_chat" = "Open Chat";
"lng_saved_open_channel" = "Open Channel";
"lng_saved_open_group" = "Open Group";
"lng_saved_about_hidden" = "Senders of this messages restricted to link their name when forwarding.";
"lng_scheduled_messages" = "Scheduled Messages";
"lng_scheduled_messages_empty" = "No scheduled messages here yet...";
@@ -2429,6 +2531,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_comments_open_none" = "Leave a comment";
"lng_replies_view_original" = "View in chat";
"lng_replies_messages" = "Replies";
"lng_hidden_author_messages" = "Author Hidden";
"lng_my_notes" = "My Notes";
"lng_replies_discussion_started" = "Discussion started";
"lng_replies_no_comments" = "No comments here yet...";
@@ -2714,6 +2818,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_forwarding_from_two" = "{user} and {second_user}";
"lng_inline_switch_choose" = "Choose conversation...";
"lng_inline_switch_cant" = "Sorry, no way to write here :(";
"lng_preview_reply_to" = "Reply to {name}";
"lng_preview_reply_to_quote" = "Reply to quote by {name}";
"lng_reply_in_another_title" = "Reply in...";
"lng_reply_in_another_chat" = "Reply in Another Chat";
@@ -2744,6 +2850,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_share_wrong_user" = "This game was opened from a different user.";
"lng_share_game_link_copied" = "Game link copied to clipboard.";
"lng_share_done" = "Done!";
"lng_share_message_to_saved_messages" = "Message forwarded to **Saved Messages**.";
"lng_share_messages_to_saved_messages" = "Messages forwarded to **Saved Messages**.";
"lng_share_message_to_chat" = "Message forwarded to **{chat}**.";
"lng_share_messages_to_chat" = "Messages forwarded to **{chat}**.";
"lng_share_message_to_two_chats" = "Message forwarded to **{user}** and **{chat}**.";
"lng_share_messages_to_two_chats" = "Messages forwarded to **{user}** and **{chat}**.";
"lng_share_message_to_many_chats#one" = "Message forwarded to **{count} chat**.";
"lng_share_message_to_many_chats#other" = "Message forwarded to **{count} chats**.";
"lng_share_messages_to_many_chats#one" = "Messages forwarded to **{count} chat**.";
"lng_share_messages_to_many_chats#other" = "Messages forwarded to **{count} chats**.";
"lng_contact_phone" = "Phone Number";
"lng_enter_contact_data" = "New Contact";
@@ -2757,6 +2873,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_edit_sign_messages" = "Sign messages";
"lng_edit_group" = "Edit group";
"lng_edit_channel_color" = "Change name color";
"lng_edit_channel_level_min" = "Level 1+";
"lng_edit_channel_wallpaper" = "Channel wallpaper";
"lng_edit_channel_wallpaper_about" = "Set a wallpaper that will be visible for everyone reading your channel.";
"lng_edit_channel_status" = "Channel emoji status";
"lng_edit_channel_status_about" = "Choose a status that will be shown next to the channel's name.";
"lng_edit_self_title" = "Edit your name";
"lng_confirm_contact_data" = "New Contact";
"lng_add_contact" = "Create";
@@ -3292,6 +3413,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_audio_player_reverse" = "Reverse order";
"lng_audio_player_shuffle" = "Shuffle";
"lng_audio_transcribe_long" = "This voice message is too long.";
"lng_audio_transcribe_trials_left#one" = "You have {count} free transcription left until {date}.";
"lng_audio_transcribe_trials_left#other" = "You have {count} free transcriptions left until {date}.";
"lng_audio_transcribe_trials_over" = "You have used all your free transcriptions this week. Wait until {date} to use it again or subscribe to {link} now.";
"lng_rights_edit_admin" = "Manage permissions";
"lng_rights_edit_admin_header" = "What can this admin do?";
@@ -3568,6 +3692,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_admin_log_set_background_emoji" = "{from} set channel background emoji to {emoji}";
"lng_admin_log_change_background_emoji" = "{from} changed channel background emoji from {previous} to {emoji}";
"lng_admin_log_removed_background_emoji" = "{from} removed channel background emoji {emoji}";
"lng_admin_log_change_profile_color" = "{from} changed channel profile color from {previous} to {color}";
"lng_admin_log_set_profile_background_emoji" = "{from} set channel profile background emoji to {emoji}";
"lng_admin_log_change_profile_background_emoji" = "{from} changed channel profile background emoji from {previous} to {emoji}";
"lng_admin_log_removed_profile_background_emoji" = "{from} removed channel profile background emoji {emoji}";
"lng_admin_log_change_wallpaper" = "{from} changed channel wallpaper";
"lng_admin_log_set_status" = "{from} set channel emoji status to {emoji}";
"lng_admin_log_change_status" = "{from} changed channel emoji status from {previous} to {emoji}";
"lng_admin_log_removed_status" = "{from} removed channel emoji status {emoji}";
"lng_admin_log_set_status_until" = "{from} set channel emoji status to {emoji} until {date}";
"lng_admin_log_change_status_until" = "{from} changed channel emoji status from {previous} to {emoji} until {date}";
"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}";
@@ -4094,6 +4228,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_view_button_request_join" = "Request to Join";
"lng_view_button_external_link" = "Open link";
"lng_view_button_boost" = "Boost";
"lng_view_button_giftcode" = "Open";
"lng_sponsored_hide_ads" = "Hide";
"lng_sponsored_title" = "What are sponsored messages?";
@@ -4139,10 +4274,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_forum_topics_no_discussion" = "Topics can't be enabled in discussion groups at the moment.";
"lng_forum_choose_title_and_icon" = "Choose title and icon for your topic";
"lng_forum_replies_only" = "You can reply to messages in topics.";
"lng_forum_message_in" = "Message in {topic}";
"lng_forum_reply_in" = "Reply in {topic}";
"lng_forum_no_topics" = "No topics currently created in this forum.";
"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_view_as_topics" = "View as Topics";
"lng_forum_no_messages" = "No messages";
"lng_forum_messages#one" = "{count} message";
"lng_forum_messages#other" = "{count} messages";
@@ -4156,6 +4294,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_request_peer_confirm_rights" = "This will also add {bot} to {chat} with the following rights: {rights}.";
"lng_request_peer_confirm_send" = "Send";
"lng_request_user_title" = "Choose User";
"lng_request_users_title" = "Choose Users";
"lng_request_user_premium_yes" = "The user should have a Premium subscription.";
"lng_request_user_premium_no" = "The user shouldn't have a Premium subscription.";
"lng_request_user_no" = "No such users";
@@ -4284,12 +4423,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_stats_title" = "Statistics";
"lng_stats_message_title" = "Message Statistic";
"lng_stats_story_title" = "Story Statistic";
"lng_stats_zoom_out" = "Zoom Out";
"lng_stats_day_month_year" = "{days_count} {month} {year}";
"lng_stats_day_month" = "{days_count} {month}";
"lng_stats_weekday_day_month_year" = "{day}, {days_count} {month} {year}";
"lng_stats_weekday_day_month_time" = "{day}, {days_count} {month} {time}";
"lng_stats_overview_title" = "Overview";
"lng_stats_overview_member_count" = "Followers";
"lng_stats_overview_mean_view_count" = "Views Per Post";
"lng_stats_overview_mean_share_count" = "Shared Per Post";
"lng_stats_overview_mean_reactions_count" = "Reactions Per Post";
"lng_stats_overview_mean_story_view_count" = "Views Per Story";
"lng_stats_overview_mean_story_share_count" = "Shared Per Story";
"lng_stats_overview_mean_story_reactions_count" = "Reactions Per Story";
"lng_stats_overview_enabled_notifications" = "Enabled Notifications";
"lng_stats_overview_messages" = "Messages";
"lng_stats_overview_group_mean_view_count" = "Viewing Members";
@@ -4319,8 +4468,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_stats_recent_messages_title" = "Recent posts";
"lng_stats_recent_messages_views#one" = "{count} view";
"lng_stats_recent_messages_views#other" = "{count} views";
"lng_stats_recent_messages_shares#one" = "{count} share";
"lng_stats_recent_messages_shares#other" = "{count} shares";
"lng_stats_loading" = "Loading stats...";
"lng_stats_loading_subtext" = "Please wait a few moments while we generate your stats.";
@@ -4334,6 +4481,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_chart_title_language" = "Languages";
"lng_chart_title_message_interaction" = "Interactions";
"lng_chart_title_instant_view_interaction" = "IV Interactions";
"lng_chart_title_reactions_by_emotion" = "Reactions";
"lng_chart_title_story_interactions" = "Story Interactions";
"lng_chart_title_story_reactions_by_emotion" = "Story reactions";
"lng_chart_title_group_join" = "Group members";
"lng_chart_title_group_join_by_source" = "New members by source";
@@ -4461,7 +4611,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_SpyEssentialsHeader" = "Spy essentials";
"ayu_SaveDeletedMessages" = "Save deleted messages";
"ayu_SaveMessagesHistory" = "Save edits history";
"ayu_MessageSavingBtn" = "Message Saving Preferences";
"ayu_MessageSavingActionBarHeader" = "Message Saving Preferences";
"ayu_MessageSavingBtn" = "Preferences";
"ayu_MessageSavingSubTitle" = "Configure media & per dialog saving";
"ayu_MessageSavingMediaHeader" = "Media";
"ayu_MessageSavingSaveMedia" = "Save media";
"ayu_MessageSavingSaveMediaHint" = "Click for more";
@@ -4473,9 +4625,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_MaximumMediaSizeCellular" = "Media size limit (cellular data)";
"ayu_MaximumMediaSizeWiFi" = "Media size limit (WiFi)";
"ayu_MessageSavingOtherHeader" = "Other";
"ayu_MessageSavingSaveFormatting" = "Save formatting";
"ayu_MessageSavingSaveReactions" = "Save reactions";
"ayu_MessageSavingSaveForBots" = "Save in bot dialogs";
"ayu_MessageSavingSavePath" = "Attachments folder";
"ayu_MessageSavingSavePathTitle" = "Choose folder";
"ayu_SpyAllToggle" = "Spy on people";
"ayu_SpySaveReadMarks" = "Save read date";
"ayu_SpySaveLastActivity" = "Save last activity";
"ayu_QoLTogglesHeader" = "Useful features";
"ayu_KeepAliveService" = "AyuGram Push Service";
"ayu_DisableAds" = "Disable ads";
@@ -4486,6 +4642,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_CustomizationHeader" = "Customization";
"ayu_DeletedMarkText" = "Deleted mark";
"ayu_EditedMarkText" = "Edited mark";
"ayu_HideNotificationCounters" = "Hide notification counters";
"ayu_HideAllChats" = "Hide \"All chats\" folder";
"ayu_ShowGhostToggleInDrawer" = "Show ghost mode toggle";
"ayu_ShowKllButtonInDrawer" = "Show kill app button";
@@ -4493,12 +4650,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_SettingsShowID_Hide" = "Hide";
"ayu_SettingsRecentStickersCount" = "Recent stickers count";
"ayu_SettingsCustomizationHint" = "After making changes to the \"Customization\" section, you must restart the application.";
"ayu_SettingsContextMenuTitle" = "Select item show type";
"ayu_SettingsContextMenuDescription" = "Extended menu items will be displayed if you hold CTRL or SHIFT while right-clicking on the message.";
"ayu_SettingsContextMenuItemHidden" = "Hidden";
"ayu_SettingsContextMenuItemShown" = "Shown";
"ayu_SettingsContextMenuItemExtended" = "Extended menu";
"ayu_SettingsContextMenuReactionsPanel" = "Reactions Panel";
"ayu_SettingsContextMenuViewsPanel" = "Views Panel";
"ayu_ContextMenuElementsHeader" = "Context Menu Elements";
"ayu_DrawerElementsHeader" = "Drawer Elements";
"ayu_TrayElementsHeader" = "Tray Elements";
"ayu_RegexFilters" = "Message Filters";
"ayu_RegexFiltersAmount" = "filters";
"ayu_RegexFiltersHeader" = "Filters";
"ayu_RegexFiltersShared" = "Shared filters";
"ayu_RegexFiltersExcluded" = "Excluded filters";
"ayu_FiltersHideFromBlocked" = "Hide from blocked users";
"ayu_FiltersHideFromBlockedNote" = "Message filters were enabled.";
"ayu_RegexFiltersEnableSharedInChats" = "Enable shared filters in chats";
@@ -4509,6 +4675,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_CaseInsensitiveExpression" = "Case insensitive expression";
"ayu_RegexFiltersAddError" = "Regex syntax error";
"ayu_RegexFilterQuickAdd" = "Add filter";
"ayu_RegexFilterBulletinText" = "Filter added to the **Shared filters**.";
"ayu_RegexFilterBulletinAction" = "Move to current chat";
"ayu_AyuSyncHeader" = "AyuSync";
"ayu_AyuSyncStatusTitle" = "Sync status";
"ayu_AyuSyncStatusOk" = "connected";
@@ -4548,6 +4716,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_StickerConfirmation" = "For stickers";
"ayu_GIFConfirmation" = "For GIFs";
"ayu_VoiceConfirmation" = "For voice messages";
"ayu_MessageDetailsPC" = "Details";
"ayu_MessageDetailsViewsPC" = "Views";
"ayu_MessageDetailsSharesPC" = "Shares";
"ayu_MessageDetailsDatePC" = "Date";
"ayu_MessageDetailsEditedDatePC" = "Edit Date";
"ayu_MessageDetailsForwardedDatePC" = "Forward Date";
"ayu_MessageDetailsFileSizePC" = "File Size";
"ayu_MessageDetailsFileNamePC" = "File Name";
"ayu_MessageDetailsFilePathPC" = "File Path";
"ayu_MessageDetailsResolutionPC" = "Resolution";
"ayu_MessageDetailsBitratePC" = "Bitrate";
"ayu_MessageDetailsMimeTypePC" = "Mime Type";
"ayu_MessageDetailsDatacenterPC" = "Datacenter";
"ayu_MessageDetailsPackOwnerPC" = "Pack Owner";
"ayu_MessageDetailsPackOwnerFetchingPC" = "fetching...";
"ayu_MessageDetailsPackOwnerNotFoundPC" = "not found";
"ayu_KillApp" = "Kill App";
"ayu_LReadMessages" = "Read on Local";
"ayu_SReadMessages" = "Read on Server";
@@ -4568,6 +4752,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_ViewFiltersMenuText" = "View Filters";
"ayu_PeekOnlineSuccess" = "Peeked via";
"ayu_OneViewTTL" = "one view";
"ayu_OnePlayTTL" = "one play";
"ayu_UserMessagesMenuText" = "User Messages";
"ayu_ReadUntilMenuText" = "Read Message";
"ayu_DeleteKeepLocally" = "Keep locally";
"ayu_BoxActionReset" = "Reset";
@@ -4583,7 +4769,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_HideNextViewsDescriptionAyu" = "Hide my views forever, until Ghost Mode disabled.";
"ayu_EnableGhostModeStories" = "Enable Ghost Mode";
"ayu_GhostModeIsActive" = "Ghost Mode Is Active";
"ayu_SimpleQuotesAndReplies" = "Simple quotes & replies";
"ayu_SimpleQuotesAndReplies" = "Disable colorful replies";
"ayu_DisableSimilarChannels" = "Disable similar channels";
"ayu_CollapseSimilarChannels" = "Collapse similar channels";
"ayu_HideSimilarChannelsTab" = "Hide similar channels tab";
"ayu_UploadSpeedBoostPC" = "Upload speed boost";
"ayu_MainFont" = "Application font";
"ayu_MonospaceFont" = "Monospace font";
"ayu_FontDefault" = "Default";
@@ -4592,7 +4782,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_AyuForwardStatusLoadingMedia" = "Loading media…";
"ayu_AyuForwardForwardingDescription" = "Please keep this window open while AyuGram is forwarding your messages.";
"ayu_AyuForwardLoadingMediaDescription" = "Please keep this window open while AyuGram is downloading media from your messages.";
"ayu_UserNotFoundMessage" = "User not found.";
"ayu_DeleteDateMenuText" = "Delete Date";
"ayu_ReadDateMenuText" = "Read Date";
"ayu_ContentsReadDateMenuText" = "Contents Read Date";
"ayu_ForwardableMenuText" = "Forwardable";
"ayu_ForwardableMenuTextNo" = "No";
"ayu_LikelyOfflineStatus" = "offline ?";
@@ -11,5 +11,7 @@
<file alias="ttl.tgs">../../animations/ttl.tgs</file>
<file alias="discussion.tgs">../../animations/discussion.tgs</file>
<file alias="stats.tgs">../../animations/stats.tgs</file>
<file alias="voice_ttl_idle.tgs">../../animations/voice_ttl_idle.tgs</file>
<file alias="voice_ttl_start.tgs">../../animations/voice_ttl_start.tgs</file>
</qresource>
</RCC>
+2 -1
View File
@@ -15,6 +15,7 @@
<file alias="art/slot_2_idle.tgs">../../art/slot_2_idle.tgs</file>
<file alias="art/slot_back.tgs">../../art/slot_back.tgs</file>
<file alias="art/slot_pull.tgs">../../art/slot_pull.tgs</file>
<file alias="art/winners.tgs">../../art/winners.tgs</file>
<file alias="day-blue.tdesktop-theme">../../day-blue.tdesktop-theme</file>
<file alias="night.tdesktop-theme">../../night.tdesktop-theme</file>
<file alias="night-green.tdesktop-theme">../../night-green.tdesktop-theme</file>
@@ -55,6 +56,6 @@
</qresource>
<qresource prefix="/misc">
<file alias="default_shortcuts-custom.json">../../default_shortcuts-custom.json</file>
<file alias="ayugram.desktop.desktop">../../../../lib/xdg/ayugram.desktop.desktop</file>
<file alias="com.ayugram.desktop.desktop">../../../../lib/xdg/com.ayugram.desktop.desktop</file>
</qresource>
</RCC>
+1 -1
View File
@@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="4.11.6.0" />
Version="4.14.2.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
+5 -5
View File
@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,11,6,0
PRODUCTVERSION 4,11,6,0
FILEVERSION 4,14,2,0
PRODUCTVERSION 4,14,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Radolyn Labs"
VALUE "FileDescription", "AyuGram Desktop"
VALUE "FileVersion", "4.11.6.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2023"
VALUE "FileVersion", "4.14.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "AyuGram Desktop"
VALUE "ProductVersion", "4.11.6.0"
VALUE "ProductVersion", "4.14.2.0"
END
END
BLOCK "VarFileInfo"
+5 -5
View File
@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,11,6,0
PRODUCTVERSION 4,11,6,0
FILEVERSION 4,14,2,0
PRODUCTVERSION 4,14,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Radolyn Labs"
VALUE "FileDescription", "AyuGram Desktop Updater"
VALUE "FileVersion", "4.11.6.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2023"
VALUE "FileVersion", "4.14.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "AyuGram Desktop"
VALUE "ProductVersion", "4.11.6.0"
VALUE "ProductVersion", "4.14.2.0"
END
END
BLOCK "VarFileInfo"
@@ -6,6 +6,7 @@ For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include <windows.h>
#include <shellapi.h>
#include <array>
#include <string>
+7 -6
View File
@@ -537,11 +537,12 @@ HANDLE _generateDumpFileAtPath(const WCHAR *path) {
GetLocalTime(&stLocalTime);
wsprintf(szFileName, L"%s%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp",
szPath, szExeName, updaterVersionStr,
stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay,
stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond,
GetCurrentProcessId(), GetCurrentThreadId());
wsprintf(
szFileName, L"%s%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp",
szPath, szExeName, updaterVersionStr,
stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay,
stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond,
GetCurrentProcessId(), GetCurrentThreadId());
return CreateFile(szFileName, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
}
@@ -562,7 +563,7 @@ void _generateDump(EXCEPTION_POINTERS* pExceptionPointers) {
DWORD len = GetModuleFileName(GetModuleHandle(0), szPath, maxFileLen);
if (!len) return;
WCHAR *pathEnd = szPath + len;
WCHAR *pathEnd = szPath + len;
if (!_wcsicmp(pathEnd - wcslen(_exeName), _exeName)) {
wsprintf(pathEnd - wcslen(_exeName), L"");
+6 -2
View File
@@ -415,12 +415,16 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
const auto peer = item->history()->peer;
const auto itemId = item->id;
const auto id = int32(button->buttonId);
const auto chosen = [=](not_null<PeerData*> result) {
const auto chosen = [=](std::vector<not_null<PeerData*>> result) {
peer->session().api().request(MTPmessages_SendBotRequestedPeer(
peer->input,
MTP_int(itemId),
MTP_int(id),
result->input
MTP_vector_from_range(
result
| ranges::views::transform([](
not_null<PeerData*> peer) {
return MTPInputPeer(peer->input); }))
)).done([=](const MTPUpdates &result) {
peer->session().api().applyUpdates(result);
}).send();
@@ -20,12 +20,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history.h"
#include "lang/lang_keys.h"
#include "main/main_session.h"
#include "settings/settings_common.h"
#include "ui/boxes/confirm_box.h"
#include "ui/controls/filter_link_header.h"
#include "ui/text/text_utilities.h"
#include "ui/widgets/buttons.h"
#include "ui/filter_icons.h"
#include "ui/vertical_list.h"
#include "window/window_session_controller.h"
#include "styles/style_filter_icons.h"
#include "styles/style_layers.h"
@@ -341,7 +341,7 @@ void ToggleChatsController::setupAboveWidget() {
_addedTopWidget = container->add(object_ptr<Ui::RpWidget>(container));
const auto realAbove = container->add(
object_ptr<Ui::VerticalLayout>(container));
AddDivider(realAbove);
Ui::AddDivider(realAbove);
const auto totalCount = [&] {
if (_chats.empty()) {
return _additional.size();
@@ -422,7 +422,7 @@ void ToggleChatsController::setupBelowWidget() {
auto widget = object_ptr<Ui::DividerLabel>(
(QWidget*)nullptr,
std::move(layout),
st::settingsDividerLabelPadding);
st::defaultBoxDividerLabelPadding);
raw->add(object_ptr<Ui::FlatLabel>(
raw,
(_action == ToggleAction::Removing
@@ -211,6 +211,29 @@ void ApplyBotsList(
Data::PeerUpdate::Flag::FullInfo);
}
[[nodiscard]] ChatParticipants::Channels ParseSimilar(
not_null<ChannelData*> channel,
const MTPmessages_Chats &chats) {
auto result = ChatParticipants::Channels();
std::vector<not_null<ChannelData*>>();
chats.match([&](const auto &data) {
const auto &list = data.vchats().v;
result.list.reserve(list.size());
for (const auto &chat : list) {
const auto peer = channel->owner().processChat(chat);
if (const auto channel = peer->asChannel()) {
result.list.push_back(channel);
}
}
if constexpr (MTPDmessages_chatsSlice::Is<decltype(data)>()) {
if (channel->session().premiumPossible()) {
result.more = data.vcount().v - data.vchats().v.size();
}
}
});
return result;
}
} // namespace
ChatParticipant::ChatParticipant(
@@ -685,4 +708,50 @@ void ChatParticipants::unblock(
_kickRequests.emplace(kick, requestId);
}
void ChatParticipants::loadSimilarChannels(not_null<ChannelData*> channel) {
if (!channel->isBroadcast()) {
return;
} else if (const auto i = _similar.find(channel); i != end(_similar)) {
if (i->second.requestId
|| !i->second.channels.more
|| !channel->session().premium()) {
return;
}
}
_similar[channel].requestId = _api.request(
MTPchannels_GetChannelRecommendations(channel->inputChannel)
).done([=](const MTPmessages_Chats &result) {
auto &similar = _similar[channel];
similar.requestId = 0;
auto parsed = ParseSimilar(channel, result);
if (similar.channels == parsed) {
return;
}
similar.channels = std::move(parsed);
if (const auto history = channel->owner().historyLoaded(channel)) {
if (const auto item = history->joinedMessageInstance()) {
history->owner().requestItemResize(item);
}
}
_similarLoaded.fire_copy(channel);
}).send();
}
auto ChatParticipants::similar(not_null<ChannelData*> channel)
-> const Channels & {
const auto i = channel->isBroadcast()
? _similar.find(channel)
: end(_similar);
if (i != end(_similar)) {
return i->second.channels;
}
static const auto empty = Channels();
return empty;
}
auto ChatParticipants::similarLoaded() const
-> rpl::producer<not_null<ChannelData*>> {
return _similarLoaded.events();
}
} // namespace Api
@@ -120,7 +120,26 @@ public:
not_null<ChannelData*> channel,
not_null<PeerData*> participant);
void loadSimilarChannels(not_null<ChannelData*> channel);
struct Channels {
std::vector<not_null<ChannelData*>> list;
int more = 0;
friend inline bool operator==(
const Channels &,
const Channels &) = default;
};
[[nodiscard]] const Channels &similar(not_null<ChannelData*> channel);
[[nodiscard]] auto similarLoaded() const
-> rpl::producer<not_null<ChannelData*>>;
private:
struct SimilarChannels {
Channels channels;
mtpRequestId requestId = 0;
};
MTP::Sender _api;
using PeerRequests = base::flat_map<PeerData*, mtpRequestId>;
@@ -143,6 +162,9 @@ private:
not_null<PeerData*>>;
base::flat_map<KickRequest, mtpRequestId> _kickRequests;
base::flat_map<not_null<ChannelData*>, SimilarChannels> _similar;
rpl::event_stream<not_null<ChannelData*>> _similarLoaded;
};
} // namespace Api
@@ -90,6 +90,7 @@ void MessagesSearch::searchRequest() {
(_from
? _from->input
: MTP_inputPeerEmpty()),
MTPInputPeer(), // saved_peer_id
MTPint(), // top_msg_id
MTP_inputMessagesFilterEmpty(),
MTP_int(0), // min_date
@@ -0,0 +1,141 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_peer_colors.h"
#include "apiwrap.h"
#include "data/data_peer.h"
#include "ui/chat/chat_style.h"
namespace Api {
namespace {
constexpr auto kRequestEach = 3600 * crl::time(1000);
} // namespace
PeerColors::PeerColors(not_null<ApiWrap*> api)
: _api(&api->instance())
, _timer([=] { request(); }) {
request();
_timer.callEach(kRequestEach);
}
PeerColors::~PeerColors() = default;
void PeerColors::request() {
if (_requestId) {
return;
}
_requestId = _api.request(MTPhelp_GetPeerColors(
MTP_int(_hash)
)).done([=](const MTPhelp_PeerColors &result) {
_requestId = 0;
result.match([&](const MTPDhelp_peerColors &data) {
_hash = data.vhash().v;
apply(data);
}, [](const MTPDhelp_peerColorsNotModified &) {
});
}).fail([=] {
_requestId = 0;
}).send();
}
std::vector<uint8> PeerColors::suggested() const {
return _suggested.current();
}
rpl::producer<std::vector<uint8>> PeerColors::suggestedValue() const {
return _suggested.value();
}
auto PeerColors::indicesValue() const
-> rpl::producer<Ui::ColorIndicesCompressed> {
return rpl::single(_colorIndicesCurrent
? *_colorIndicesCurrent
: Ui::ColorIndicesCompressed()
) | rpl::then(_colorIndicesChanged.events() | rpl::map([=] {
return *_colorIndicesCurrent;
}));
}
int PeerColors::requiredLevelFor(PeerId channel, uint8 index) const {
if (Data::DecideColorIndex(channel) == index) {
return 0;
} else if (const auto i = _requiredLevels.find(index)
; i != end(_requiredLevels)) {
return i->second;
}
return 1;
}
void PeerColors::apply(const MTPDhelp_peerColors &data) {
auto suggested = std::vector<uint8>();
auto colors = std::make_shared<
std::array<Ui::ColorIndexData, Ui::kColorIndexCount>>();
using ParsedColor = std::array<uint32, Ui::kColorPatternsCount>;
const auto parseColors = [](const MTPhelp_PeerColorSet &set) {
return set.match([&](const MTPDhelp_peerColorSet &data) {
auto result = ParsedColor();
const auto &list = data.vcolors().v;
if (list.empty() || list.size() > Ui::kColorPatternsCount) {
LOG(("API Error: Bad count for PeerColorSet.colors: %1"
).arg(list.size()));
return ParsedColor();
}
auto fill = result.data();
for (const auto &color : list) {
*fill++ = (uint32(1) << 24) | uint32(color.v);
}
return result;
}, [](const MTPDhelp_peerColorProfileSet &) {
LOG(("API Error: peerColorProfileSet in colors result!"));
return ParsedColor();
});
};
const auto &list = data.vcolors().v;
_requiredLevels.clear();
suggested.reserve(list.size());
for (const auto &color : list) {
const auto &data = color.data();
const auto colorIndexBare = data.vcolor_id().v;
if (colorIndexBare < 0 || colorIndexBare >= Ui::kColorIndexCount) {
LOG(("API Error: Bad color index: %1").arg(colorIndexBare));
continue;
}
const auto colorIndex = uint8(colorIndexBare);
if (const auto min = data.vchannel_min_level()) {
_requiredLevels[colorIndex] = min->v;
}
if (!data.is_hidden()) {
suggested.push_back(colorIndex);
}
if (const auto light = data.vcolors()) {
auto &fields = (*colors)[colorIndex];
fields.light = parseColors(*light);
if (const auto dark = data.vdark_colors()) {
fields.dark = parseColors(*dark);
} else {
fields.dark = fields.light;
}
}
}
if (!_colorIndicesCurrent) {
_colorIndicesCurrent = std::make_unique<Ui::ColorIndicesCompressed>(
Ui::ColorIndicesCompressed{ std::move(colors) });
_colorIndicesChanged.fire({});
} else if (*_colorIndicesCurrent->colors != *colors) {
_colorIndicesCurrent->colors = std::move(colors);
_colorIndicesChanged.fire({});
}
_suggested = std::move(suggested);
}
} // namespace Api
@@ -0,0 +1,51 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/timer.h"
#include "mtproto/sender.h"
class ApiWrap;
namespace Ui {
struct ColorIndicesCompressed;
} // namespace Ui
namespace Api {
class PeerColors final {
public:
explicit PeerColors(not_null<ApiWrap*> api);
~PeerColors();
[[nodiscard]] std::vector<uint8> suggested() const;
[[nodiscard]] rpl::producer<std::vector<uint8>> suggestedValue() const;
[[nodiscard]] auto indicesValue() const
-> rpl::producer<Ui::ColorIndicesCompressed>;
[[nodiscard]] int requiredLevelFor(
PeerId channel,
uint8 index) const;
private:
void request();
void apply(const MTPDhelp_peerColors &data);
MTP::Sender _api;
int32 _hash = 0;
mtpRequestId _requestId = 0;
base::Timer _timer;
rpl::variable<std::vector<uint8>> _suggested;
base::flat_map<uint8, int> _requiredLevels;
rpl::event_stream<> _colorIndicesChanged;
std::unique_ptr<Ui::ColorIndicesCompressed> _colorIndicesCurrent;
};
} // namespace Api
@@ -515,6 +515,7 @@ auto PeerPhoto::emojiList(EmojiListType type) -> EmojiListData & {
case EmojiListType::Profile: return _profileEmojiList;
case EmojiListType::Group: return _groupEmojiList;
case EmojiListType::Background: return _backgroundEmojiList;
case EmojiListType::NoChannelStatus: return _noChannelStatusEmojiList;
}
Unexpected("Type in PeerPhoto::emojiList.");
}
@@ -551,6 +552,8 @@ void PeerPhoto::requestEmojiList(EmojiListType type) {
? send(MTPaccount_GetDefaultProfilePhotoEmojis())
: (type == EmojiListType::Group)
? send(MTPaccount_GetDefaultGroupPhotoEmojis())
: (type == EmojiListType::NoChannelStatus)
? send(MTPaccount_GetChannelRestrictedStatusEmojis())
: send(MTPaccount_GetDefaultBackgroundEmojis());
}
@@ -32,6 +32,7 @@ public:
Profile,
Group,
Background,
NoChannelStatus,
};
struct UserPhoto {
@@ -112,6 +113,7 @@ private:
EmojiListData _profileEmojiList;
EmojiListData _groupEmojiList;
EmojiListData _backgroundEmojiList;
EmojiListData _noChannelStatusEmojiList;
};
+3 -3
View File
@@ -21,7 +21,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_session.h"
// AyuGram includes
#include "ayu/ayu_state.h"
#include "ayu/ayu_settings.h"
#include "ayu/utils/telegram_helpers.h"
namespace Api {
@@ -156,8 +157,7 @@ void Polls::sendVotes(
const auto settings = &AyuSettings::getInstance();
if (!settings->sendReadMessages && settings->markReadAfterPoll && item)
{
AyuState::setAllowSendReadPacket(true);
item->history()->session().data().histories().readInboxOnNewMessage(item);
readHistory(item);
}
}).fail([=] {
_pollVotesRequestIds.erase(itemId);
+6 -7
View File
@@ -26,7 +26,7 @@ namespace {
[[nodiscard]] GiftCode Parse(const MTPDpayments_checkedGiftCode &data) {
return {
.from = peerFromMTP(data.vfrom_id()),
.from = data.vfrom_id() ? peerFromMTP(*data.vfrom_id()) : PeerId(),
.to = data.vto_id() ? peerFromUser(*data.vto_id()) : PeerId(),
.giveawayId = data.vgiveaway_msg_id().value_or_empty(),
.date = data.vdate().v,
@@ -342,15 +342,12 @@ PremiumGiftCodeOptions::PremiumGiftCodeOptions(not_null<PeerData*> peer)
rpl::producer<rpl::no_value, QString> PremiumGiftCodeOptions::request() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
const auto channel = _peer->asChannel();
if (!channel) {
return lifetime;
}
using TLOption = MTPPremiumGiftCodeOption;
_api.request(MTPpayments_GetPremiumGiftCodeOptions(
MTP_flags(
MTPpayments_GetPremiumGiftCodeOptions::Flag::f_boost_peer),
MTP_flags(_peer->isChannel()
? MTPpayments_GetPremiumGiftCodeOptions::Flag::f_boost_peer
: MTPpayments_GetPremiumGiftCodeOptions::Flag(0)),
_peer->input
)).done([=](const MTPVector<TLOption> &result) {
auto tlMapOptions = base::flat_map<Amount, QVector<TLOption>>();
@@ -420,6 +417,8 @@ const std::vector<int> &PremiumGiftCodeOptions::availablePresets() const {
}
[[nodiscard]] int PremiumGiftCodeOptions::monthsFromPreset(int monthsIndex) {
Expects(monthsIndex >= 0 && monthsIndex < _availablePresets.size());
return _optionsForOnePerson.months[monthsIndex];
}
+258 -150
View File
@@ -9,8 +9,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h"
#include "data/data_channel.h"
#include "data/data_peer.h"
#include "data/data_session.h"
#include "data/data_stories.h"
#include "data/data_story.h"
#include "history/history.h"
#include "main/main_session.h"
#include "statistics/statistics_data_deserialize.h"
@@ -18,6 +19,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Api {
namespace {
constexpr auto kCheckRequestsTimer = 10 * crl::time(1000);
[[nodiscard]] Data::StatisticalGraph StatisticalGraphFromTL(
const MTPStatsGraph &tl) {
return tl.match([&](const MTPDstatsGraph &d) {
@@ -60,15 +63,25 @@ namespace {
tlUnmuted.vpart().v / tlUnmuted.vtotal().v * 100.,
0.,
100.);
using Recent = MTPMessageInteractionCounters;
using Recent = MTPPostInteractionCounters;
auto recentMessages = ranges::views::all(
data.vrecent_message_interactions().v
data.vrecent_posts_interactions().v
) | ranges::views::transform([&](const Recent &tl) {
return Data::StatisticsMessageInteractionInfo{
.messageId = tl.data().vmsg_id().v,
.viewsCount = tl.data().vviews().v,
.forwardsCount = tl.data().vforwards().v,
};
return tl.match([&](const MTPDpostInteractionCountersStory &data) {
return Data::StatisticsMessageInteractionInfo{
.storyId = data.vstory_id().v,
.viewsCount = data.vviews().v,
.forwardsCount = data.vforwards().v,
.reactionsCount = data.vreactions().v,
};
}, [&](const MTPDpostInteractionCountersMessage &data) {
return Data::StatisticsMessageInteractionInfo{
.messageId = data.vmsg_id().v,
.viewsCount = data.vviews().v,
.forwardsCount = data.vforwards().v,
.reactionsCount = data.vreactions().v,
};
});
}) | ranges::to_vector;
return {
@@ -78,6 +91,15 @@ namespace {
.memberCount = StatisticalValueFromTL(data.vfollowers()),
.meanViewCount = StatisticalValueFromTL(data.vviews_per_post()),
.meanShareCount = StatisticalValueFromTL(data.vshares_per_post()),
.meanReactionCount = StatisticalValueFromTL(
data.vreactions_per_post()),
.meanStoryViewCount = StatisticalValueFromTL(
data.vviews_per_story()),
.meanStoryShareCount = StatisticalValueFromTL(
data.vshares_per_story()),
.meanStoryReactionCount = StatisticalValueFromTL(
data.vreactions_per_story()),
.enabledNotificationsPercentage = unmuted,
@@ -108,6 +130,15 @@ namespace {
.instantViewInteractionGraph = StatisticalGraphFromTL(
data.viv_interactions_graph()),
.reactionsByEmotionGraph = StatisticalGraphFromTL(
data.vreactions_by_emotion_graph()),
.storyInteractionsGraph = StatisticalGraphFromTL(
data.vstory_interactions_graph()),
.storyReactionsByEmotionGraph = StatisticalGraphFromTL(
data.vstory_reactions_by_emotion_graph()),
.recentMessageInteractions = std::move(recentMessages),
};
}
@@ -187,23 +218,73 @@ namespace {
} // namespace
Statistics::Statistics(not_null<ApiWrap*> api)
: _api(&api->instance()) {
Statistics::Statistics(not_null<ChannelData*> channel)
: StatisticsRequestSender(channel) {
}
rpl::producer<rpl::no_value, QString> Statistics::request(
not_null<PeerData*> peer) {
StatisticsRequestSender::StatisticsRequestSender(not_null<ChannelData *> channel)
: _channel(channel)
, _api(&_channel->session().api().instance())
, _timer([=] { checkRequests(); }) {
}
StatisticsRequestSender::~StatisticsRequestSender() {
for (const auto &[dcId, ids] : _requests) {
for (const auto id : ids) {
_channel->session().api().unregisterStatsRequest(dcId, id);
}
}
}
void StatisticsRequestSender::checkRequests() {
for (auto i = begin(_requests); i != end(_requests);) {
for (auto j = begin(i->second); j != end(i->second);) {
if (_api.pending(*j)) {
++j;
} else {
_channel->session().api().unregisterStatsRequest(
i->first,
*j);
j = i->second.erase(j);
}
}
if (i->second.empty()) {
i = _requests.erase(i);
} else {
++i;
}
}
if (_requests.empty()) {
_timer.cancel();
}
}
template <typename Request, typename, typename>
auto StatisticsRequestSender::makeRequest(Request &&request) {
const auto id = _api.allocateRequestId();
const auto dcId = _channel->owner().statsDcId(_channel);
if (dcId) {
_channel->session().api().registerStatsRequest(dcId, id);
_requests[dcId].emplace(id);
if (!_timer.isActive()) {
_timer.callEach(kCheckRequestsTimer);
}
}
return std::move(_api.request(
std::forward<Request>(request)
).toDC(
dcId ? MTP::ShiftDcId(dcId, MTP::kStatsDcShift) : 0
).overrideId(id));
}
rpl::producer<rpl::no_value, QString> Statistics::request() {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
const auto channel = peer->asChannel();
if (!channel) {
return lifetime;
}
if (!channel->isMegagroup()) {
_api.request(MTPstats_GetBroadcastStats(
if (!channel()->isMegagroup()) {
makeRequest(MTPstats_GetBroadcastStats(
MTP_flags(MTPstats_GetBroadcastStats::Flags(0)),
channel->inputChannel
channel()->inputChannel
)).done([=](const MTPstats_BroadcastStats &result) {
_channelStats = ChannelStatisticsFromTL(result.data());
consumer.put_done();
@@ -211,12 +292,13 @@ rpl::producer<rpl::no_value, QString> Statistics::request(
consumer.put_error_copy(error.type());
}).send();
} else {
_api.request(MTPstats_GetMegagroupStats(
makeRequest(MTPstats_GetMegagroupStats(
MTP_flags(MTPstats_GetMegagroupStats::Flags(0)),
channel->inputChannel
channel()->inputChannel
)).done([=](const MTPstats_MegagroupStats &result) {
_supergroupStats = SupergroupStatisticsFromTL(result.data());
peer->owner().processUsers(result.data().vusers());
const auto &data = result.data();
_supergroupStats = SupergroupStatisticsFromTL(data);
channel()->owner().processUsers(data.vusers());
consumer.put_done();
}).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
@@ -228,18 +310,13 @@ rpl::producer<rpl::no_value, QString> Statistics::request(
}
Statistics::GraphResult Statistics::requestZoom(
not_null<PeerData*> peer,
const QString &token,
float64 x) {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
const auto channel = peer->asChannel();
if (!channel) {
return lifetime;
}
const auto wasEmpty = _zoomDeque.empty();
_zoomDeque.push_back([=] {
_api.request(MTPstats_LoadAsyncGraph(
makeRequest(MTPstats_LoadAsyncGraph(
MTP_flags(x
? MTPstats_LoadAsyncGraph::Flag::f_x
: MTPstats_LoadAsyncGraph::Flag(0)),
@@ -266,32 +343,6 @@ Statistics::GraphResult Statistics::requestZoom(
};
}
Statistics::GraphResult Statistics::requestMessage(
not_null<PeerData*> peer,
MsgId msgId) {
return [=](auto consumer) {
auto lifetime = rpl::lifetime();
const auto channel = peer->asChannel();
if (!channel) {
return lifetime;
}
_api.request(MTPstats_GetMessageStats(
MTP_flags(MTPstats_GetMessageStats::Flags(0)),
channel->inputChannel,
MTP_int(msgId.bare)
)).done([=](const MTPstats_MessageStats &result) {
consumer.put_next(
StatisticalGraphFromTL(result.data().vviews_graph()));
consumer.put_done();
}).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type());
}).send();
return lifetime;
};
}
Data::ChannelStatistics Statistics::channelStats() const {
return _channelStats;
}
@@ -302,10 +353,9 @@ Data::SupergroupStatistics Statistics::supergroupStats() const {
PublicForwards::PublicForwards(
not_null<ChannelData*> channel,
FullMsgId fullId)
: _channel(channel)
, _fullId(fullId)
, _api(&channel->session().api().instance()) {
Data::RecentPostId fullId)
: StatisticsRequestSender(channel)
, _fullId(fullId) {
}
void PublicForwards::request(
@@ -314,98 +364,92 @@ void PublicForwards::request(
if (_requestId) {
return;
}
const auto offsetPeer = _channel->owner().peer(token.fullId.peer);
const auto tlOffsetPeer = offsetPeer
? offsetPeer->input
: MTP_inputPeerEmpty();
constexpr auto kLimit = tl::make_int(100);
_requestId = _api.request(MTPstats_GetMessagePublicForwards(
_channel->inputChannel,
MTP_int(_fullId.msg),
MTP_int(token.rate),
tlOffsetPeer,
MTP_int(token.fullId.msg),
kLimit
)).done([=, channel = _channel](const MTPmessages_Messages &result) {
using Messages = QVector<FullMsgId>;
const auto channel = StatisticsRequestSender::channel();
const auto processResult = [=](const MTPstats_PublicForwards &tl) {
using Messages = QVector<Data::RecentPostId>;
_requestId = 0;
auto nextToken = Data::PublicForwardsSlice::OffsetToken();
const auto process = [&](const MTPVector<MTPMessage> &messages) {
auto result = Messages();
for (const auto &message : messages.v) {
const auto &data = tl.data();
auto &owner = channel->owner();
owner.processUsers(data.vusers());
owner.processChats(data.vchats());
const auto nextToken = data.vnext_offset()
? qs(*data.vnext_offset())
: Data::PublicForwardsSlice::OffsetToken();
const auto fullCount = data.vcount().v;
auto recentList = Messages(data.vforwards().v.size());
for (const auto &tlForward : data.vforwards().v) {
tlForward.match([&](const MTPDpublicForwardMessage &data) {
const auto &message = data.vmessage();
const auto msgId = IdFromMessage(message);
const auto peerId = PeerFromMessage(message);
const auto lastDate = DateFromMessage(message);
if (const auto peer = channel->owner().peerLoaded(peerId)) {
if (lastDate) {
channel->owner().addNewMessage(
message,
MessageFlags(),
NewMessageType::Existing);
nextToken.fullId = { peerId, msgId };
result.push_back(nextToken.fullId);
if (const auto peer = owner.peerLoaded(peerId)) {
if (!lastDate) {
return;
}
owner.addNewMessage(
message,
MessageFlags(),
NewMessageType::Existing);
recentList.push_back({ .messageId = { peerId, msgId } });
}
}
return result;
};
auto allLoaded = false;
auto fullCount = 0;
auto messages = result.match([&](const MTPDmessages_messages &data) {
channel->owner().processUsers(data.vusers());
channel->owner().processChats(data.vchats());
auto list = process(data.vmessages());
allLoaded = true;
fullCount = list.size();
return list;
}, [&](const MTPDmessages_messagesSlice &data) {
channel->owner().processUsers(data.vusers());
channel->owner().processChats(data.vchats());
auto list = process(data.vmessages());
if (const auto nextRate = data.vnext_rate()) {
const auto rateUpdated = (nextRate->v != token.rate);
if (rateUpdated) {
nextToken.rate = nextRate->v;
} else {
allLoaded = true;
}, [&](const MTPDpublicForwardStory &data) {
const auto story = owner.stories().applySingle(
peerFromMTP(data.vpeer()),
data.vstory());
if (story) {
recentList.push_back({ .storyId = story->fullId() });
}
}
fullCount = data.vcount().v;
return list;
}, [&](const MTPDmessages_channelMessages &data) {
channel->owner().processUsers(data.vusers());
channel->owner().processChats(data.vchats());
auto list = process(data.vmessages());
allLoaded = true;
fullCount = data.vcount().v;
return list;
}, [&](const MTPDmessages_messagesNotModified &) {
allLoaded = true;
return Messages();
});
});
}
const auto allLoaded = nextToken.isEmpty() || (nextToken == token);
_lastTotal = std::max(_lastTotal, fullCount);
done({
.list = std::move(messages),
.list = std::move(recentList),
.total = _lastTotal,
.allLoaded = allLoaded,
.token = nextToken,
});
}).fail([=] {
_requestId = 0;
}).send();
};
constexpr auto kLimit = tl::make_int(100);
if (_fullId.messageId) {
_requestId = makeRequest(MTPstats_GetMessagePublicForwards(
channel->inputChannel,
MTP_int(_fullId.messageId.msg),
MTP_string(token),
kLimit
)).done(processResult).fail([=] { _requestId = 0; }).send();
} else if (_fullId.storyId) {
_requestId = makeRequest(MTPstats_GetStoryPublicForwards(
channel->input,
MTP_int(_fullId.storyId.story),
MTP_string(token),
kLimit
)).done(processResult).fail([=] { _requestId = 0; }).send();
}
}
MessageStatistics::MessageStatistics(
not_null<ChannelData*> channel,
FullMsgId fullId)
: _publicForwards(channel, fullId)
, _channel(channel)
, _fullId(fullId)
, _api(&channel->session().api().instance()) {
: StatisticsRequestSender(channel)
, _publicForwards(channel, { .messageId = fullId })
, _fullId(fullId) {
}
MessageStatistics::MessageStatistics(
not_null<ChannelData*> channel,
FullStoryId storyId)
: StatisticsRequestSender(channel)
, _publicForwards(channel, { .storyId = storyId })
, _storyId(storyId) {
}
Data::PublicForwardsSlice MessageStatistics::firstSlice() const {
@@ -413,29 +457,33 @@ Data::PublicForwardsSlice MessageStatistics::firstSlice() const {
}
void MessageStatistics::request(Fn<void(Data::MessageStatistics)> done) {
if (_channel->isMegagroup()) {
if (channel()->isMegagroup()) {
return;
}
const auto requestFirstPublicForwards = [=](
const Data::StatisticalGraph &messageGraph,
const Data::StatisticalGraph &reactionsGraph,
const Data::StatisticsMessageInteractionInfo &info) {
_publicForwards.request({}, [=](Data::PublicForwardsSlice slice) {
const auto callback = [=](Data::PublicForwardsSlice slice) {
const auto total = slice.total;
_firstSlice = std::move(slice);
done({
.messageInteractionGraph = messageGraph,
.reactionsByEmotionGraph = reactionsGraph,
.publicForwards = total,
.privateForwards = info.forwardsCount - total,
.views = info.viewsCount,
.reactions = info.reactionsCount,
});
});
};
_publicForwards.request({}, callback);
};
const auto requestPrivateForwards = [=](
const Data::StatisticalGraph &messageGraph) {
_api.request(MTPchannels_GetMessages(
_channel->inputChannel,
const Data::StatisticalGraph &messageGraph,
const Data::StatisticalGraph &reactionsGraph) {
api().request(MTPchannels_GetMessages(
channel()->inputChannel,
MTP_vector<MTPInputMessage>(
1,
MTP_inputMessageID(MTP_int(_fullId.msg))))
@@ -443,6 +491,13 @@ void MessageStatistics::request(Fn<void(Data::MessageStatistics)> done) {
const auto process = [&](const MTPVector<MTPMessage> &messages) {
const auto &message = messages.v.front();
return message.match([&](const MTPDmessage &data) {
auto reactionsCount = 0;
if (const auto tlReactions = data.vreactions()) {
const auto &tlCounts = tlReactions->data().vresults();
for (const auto &tlCount : tlCounts.v) {
reactionsCount += tlCount.data().vcount().v;
}
}
return Data::StatisticsMessageInteractionInfo{
.messageId = IdFromMessage(message),
.viewsCount = data.vviews()
@@ -451,6 +506,7 @@ void MessageStatistics::request(Fn<void(Data::MessageStatistics)> done) {
.forwardsCount = data.vforwards()
? data.vforwards()->v
: 0,
.reactionsCount = reactionsCount,
};
}, [](const MTPDmessageEmpty &) {
return Data::StatisticsMessageInteractionInfo();
@@ -469,23 +525,74 @@ void MessageStatistics::request(Fn<void(Data::MessageStatistics)> done) {
return Data::StatisticsMessageInteractionInfo();
});
requestFirstPublicForwards(messageGraph, std::move(info));
requestFirstPublicForwards(
messageGraph,
reactionsGraph,
std::move(info));
}).fail([=](const MTP::Error &error) {
requestFirstPublicForwards(messageGraph, {});
requestFirstPublicForwards(messageGraph, reactionsGraph, {});
}).send();
};
_api.request(MTPstats_GetMessageStats(
MTP_flags(MTPstats_GetMessageStats::Flags(0)),
_channel->inputChannel,
MTP_int(_fullId.msg.bare)
)).done([=](const MTPstats_MessageStats &result) {
requestPrivateForwards(
StatisticalGraphFromTL(result.data().vviews_graph()));
}).fail([=](const MTP::Error &error) {
requestPrivateForwards({});
}).send();
const auto requestStoryPrivateForwards = [=](
const Data::StatisticalGraph &messageGraph,
const Data::StatisticalGraph &reactionsGraph) {
api().request(MTPstories_GetStoriesByID(
channel()->input,
MTP_vector<MTPint>(1, MTP_int(_storyId.story)))
).done([=](const MTPstories_Stories &result) {
const auto &storyItem = result.data().vstories().v.front();
auto info = storyItem.match([&](const MTPDstoryItem &data) {
if (!data.vviews()) {
return Data::StatisticsMessageInteractionInfo();
}
const auto &tlViews = data.vviews()->data();
return Data::StatisticsMessageInteractionInfo{
.storyId = data.vid().v,
.viewsCount = tlViews.vviews_count().v,
.forwardsCount = tlViews.vforwards_count().value_or(0),
.reactionsCount = tlViews.vreactions_count().value_or(0),
};
}, [](const auto &) {
return Data::StatisticsMessageInteractionInfo();
});
requestFirstPublicForwards(
messageGraph,
reactionsGraph,
std::move(info));
}).fail([=](const MTP::Error &error) {
requestFirstPublicForwards(messageGraph, reactionsGraph, {});
}).send();
};
if (_storyId) {
makeRequest(MTPstats_GetStoryStats(
MTP_flags(MTPstats_GetStoryStats::Flags(0)),
channel()->input,
MTP_int(_storyId.story)
)).done([=](const MTPstats_StoryStats &result) {
const auto &data = result.data();
requestStoryPrivateForwards(
StatisticalGraphFromTL(data.vviews_graph()),
StatisticalGraphFromTL(data.vreactions_by_emotion_graph()));
}).fail([=](const MTP::Error &error) {
requestStoryPrivateForwards({}, {});
}).send();
} else {
makeRequest(MTPstats_GetMessageStats(
MTP_flags(MTPstats_GetMessageStats::Flags(0)),
channel()->inputChannel,
MTP_int(_fullId.msg.bare)
)).done([=](const MTPstats_MessageStats &result) {
const auto &data = result.data();
requestPrivateForwards(
StatisticalGraphFromTL(data.vviews_graph()),
StatisticalGraphFromTL(data.vreactions_by_emotion_graph()));
}).fail([=](const MTP::Error &error) {
requestPrivateForwards({}, {});
}).send();
}
}
Boosts::Boosts(not_null<PeerData*> peer)
@@ -505,6 +612,7 @@ rpl::producer<rpl::no_value, QString> Boosts::request() {
_peer->input
)).done([=](const MTPpremium_BoostsStatus &result) {
const auto &data = result.data();
channel->updateLevelHint(data.vlevel().v);
const auto hasPremium = !!data.vpremium_audience();
const auto premiumMemberCount = hasPremium
? std::max(0, int(data.vpremium_audience()->data().vpart().v))
+43 -20
View File
@@ -7,30 +7,53 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/timer.h"
#include "data/data_boosts.h"
#include "data/data_statistics.h"
#include "mtproto/sender.h"
class ApiWrap;
class ChannelData;
class PeerData;
namespace Api {
class Statistics final {
public:
explicit Statistics(not_null<ApiWrap*> api);
class StatisticsRequestSender {
protected:
explicit StatisticsRequestSender(not_null<ChannelData*> channel);
~StatisticsRequestSender();
[[nodiscard]] rpl::producer<rpl::no_value, QString> request(
not_null<PeerData*> peer);
template <
typename Request,
typename = std::enable_if_t<!std::is_reference_v<Request>>,
typename = typename Request::Unboxed>
[[nodiscard]] auto makeRequest(Request &&request);
[[nodiscard]] MTP::Sender &api() {
return _api;
}
[[nodiscard]] not_null<ChannelData*> channel() {
return _channel;
}
private:
void checkRequests();
const not_null<ChannelData*> _channel;
MTP::Sender _api;
base::Timer _timer;
base::flat_map<MTP::DcId, base::flat_set<mtpRequestId>> _requests;
};
class Statistics final : public StatisticsRequestSender {
public:
explicit Statistics(not_null<ChannelData*> channel);
[[nodiscard]] rpl::producer<rpl::no_value, QString> request();
using GraphResult = rpl::producer<Data::StatisticalGraph, QString>;
[[nodiscard]] GraphResult requestZoom(
not_null<PeerData*> peer,
const QString &token,
float64 x);
[[nodiscard]] GraphResult requestMessage(
not_null<PeerData*> peer,
MsgId msgId);
[[nodiscard]] Data::ChannelStatistics channelStats() const;
[[nodiscard]] Data::SupergroupStatistics supergroupStats() const;
@@ -38,35 +61,36 @@ public:
private:
Data::ChannelStatistics _channelStats;
Data::SupergroupStatistics _supergroupStats;
MTP::Sender _api;
std::deque<Fn<void()>> _zoomDeque;
};
class PublicForwards final {
class PublicForwards final : public StatisticsRequestSender {
public:
explicit PublicForwards(not_null<ChannelData*> channel, FullMsgId fullId);
PublicForwards(
not_null<ChannelData*> channel,
Data::RecentPostId fullId);
void request(
const Data::PublicForwardsSlice::OffsetToken &token,
Fn<void(Data::PublicForwardsSlice)> done);
private:
const not_null<ChannelData*> _channel;
const FullMsgId _fullId;
const Data::RecentPostId _fullId;
mtpRequestId _requestId = 0;
int _lastTotal = 0;
MTP::Sender _api;
};
class MessageStatistics final {
class MessageStatistics final : public StatisticsRequestSender {
public:
explicit MessageStatistics(
not_null<ChannelData*> channel,
FullMsgId fullId);
explicit MessageStatistics(
not_null<ChannelData*> channel,
FullStoryId storyId);
void request(Fn<void(Data::MessageStatistics)> done);
@@ -74,13 +98,12 @@ public:
private:
PublicForwards _publicForwards;
const not_null<ChannelData*> _channel;
const FullMsgId _fullId;
const FullStoryId _storyId;
Data::PublicForwardsSlice _firstSlice;
mtpRequestId _requestId = 0;
MTP::Sender _api;
};
+64 -6
View File
@@ -7,13 +7,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_transcribes.h"
#include "history/history_item.h"
#include "history/history.h"
#include "main/main_session.h"
#include "data/data_document.h"
#include "data/data_session.h"
#include "data/data_peer.h"
#include "apiwrap.h"
#include "data/data_document.h"
#include "data/data_peer.h"
#include "data/data_session.h"
#include "history/history.h"
#include "history/history_item.h"
#include "history/history_item_helpers.h"
#include "main/main_account.h"
#include "main/main_app_config.h"
#include "main/main_session.h"
namespace Api {
@@ -22,6 +25,44 @@ Transcribes::Transcribes(not_null<ApiWrap*> api)
, _api(&api->instance()) {
}
bool Transcribes::trialsSupport() {
if (!_trialsSupport) {
const auto count = _session->account().appConfig().get<int>(
u"transcribe_audio_trial_weekly_number"_q,
0);
const auto until = _session->account().appConfig().get<int>(
u"transcribe_audio_trial_cooldown_until"_q,
0);
_trialsSupport = (count > 0) || (until > 0);
}
return *_trialsSupport;
}
TimeId Transcribes::trialsRefreshAt() {
if (_trialsRefreshAt < 0) {
_trialsRefreshAt = _session->account().appConfig().get<int>(
u"transcribe_audio_trial_cooldown_until"_q,
0);
}
return _trialsRefreshAt;
}
int Transcribes::trialsCount() {
if (_trialsCount < 0) {
_trialsCount = _session->account().appConfig().get<int>(
u"transcribe_audio_trial_weekly_number"_q,
-1);
return std::max(_trialsCount, 0);
}
return _trialsCount;
}
crl::time Transcribes::trialsMaxLengthMs() const {
return 1000 * _session->account().appConfig().get<int>(
u"transcribe_audio_trial_duration_max"_q,
300);
}
void Transcribes::toggle(not_null<HistoryItem*> item) {
const auto id = item->fullId();
auto i = _map.find(id);
@@ -86,6 +127,23 @@ void Transcribes::load(not_null<HistoryItem*> item) {
MTP_int(item->id)
)).done([=](const MTPmessages_TranscribedAudio &result) {
const auto &data = result.data();
{
const auto trialsCountChanged = data.vtrial_remains_num()
&& (_trialsCount != data.vtrial_remains_num()->v);
if (trialsCountChanged) {
_trialsCount = data.vtrial_remains_num()->v;
}
const auto refreshAtChanged = data.vtrial_remains_until_date()
&& (_trialsRefreshAt != data.vtrial_remains_until_date()->v);
if (refreshAtChanged) {
_trialsRefreshAt = data.vtrial_remains_until_date()->v;
}
if (trialsCountChanged) {
ShowTrialTranscribesToast(_trialsCount, _trialsRefreshAt);
}
}
auto &entry = _map[id];
entry.requestId = 0;
entry.pending = data.is_pending();
@@ -36,12 +36,21 @@ public:
void apply(const MTPDupdateTranscribedAudio &update);
[[nodiscard]] bool trialsSupport();
[[nodiscard]] TimeId trialsRefreshAt();
[[nodiscard]] int trialsCount();
[[nodiscard]] crl::time trialsMaxLengthMs() const;
private:
void load(not_null<HistoryItem*> item);
const not_null<Main::Session*> _session;
MTP::Sender _api;
int _trialsCount = -1;
std::optional<bool> _trialsSupport;
TimeId _trialsRefreshAt = -1;
base::flat_map<FullMsgId, Entry> _map;
base::flat_map<uint64, FullMsgId> _ids;
+41 -5
View File
@@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mtproto/mtproto_dc_options.h"
#include "data/notify/data_notify_settings.h"
#include "data/stickers/data_stickers.h"
#include "data/data_saved_messages.h"
#include "data/data_session.h"
#include "data/data_user.h"
#include "data/data_chat.h"
@@ -44,6 +45,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_cloud_manager.h"
#include "history/history.h"
#include "history/history_item.h"
#include "history/history_item_helpers.h"
#include "history/history_unread_things.h"
#include "core/application.h"
#include "storage/storage_account.h"
@@ -1143,6 +1145,7 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) {
? peerToMTP(_session->userPeerId())
: MTP_peerUser(d.vuser_id())),
MTP_peerUser(d.vuser_id()),
MTPPeer(), // saved_peer_id
d.vfwd_from() ? *d.vfwd_from() : MTPMessageFwdHeader(),
MTP_long(d.vvia_bot_id().value_or_empty()),
d.vreply_to() ? *d.vreply_to() : MTPMessageReplyHeader(),
@@ -1174,6 +1177,7 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) {
d.vid(),
MTP_peerUser(d.vfrom_id()),
MTP_peerChat(d.vchat_id()),
MTPPeer(), // saved_peer_id
d.vfwd_from() ? *d.vfwd_from() : MTPMessageFwdHeader(),
MTP_long(d.vvia_bot_id().value_or_empty()),
d.vreply_to() ? *d.vreply_to() : MTPMessageReplyHeader(),
@@ -1234,11 +1238,12 @@ void Updates::applyUpdateNoPtsCheck(const MTPUpdate &update) {
item->markMediaAndMentionRead();
_session->data().requestItemRepaint(item);
if (item->out()
&& item->history()->peer->isUser()
&& !requestingDifference()) {
item->history()->peer->asUser()->madeAction(
base::unixtime::now());
if (item->out()) {
const auto user = item->history()->peer->asUser();
if (user && !requestingDifference()) {
user->madeAction(base::unixtime::now());
}
ClearMediaAsExpired(item);
}
}
} else {
@@ -2023,6 +2028,19 @@ void Updates::feedUpdate(const MTPUpdate &update) {
}
} break;
case mtpc_updatePeerWallpaper: {
const auto &d = update.c_updatePeerWallpaper();
if (const auto peer = session().data().peerLoaded(peerFromMTP(d.vpeer()))) {
if (const auto paper = d.vwallpaper()) {
peer->setWallPaper(
Data::WallPaper::Create(&session(), *paper),
d.is_wallpaper_overridden());
} else {
peer->setWallPaper({});
}
}
} break;
case mtpc_updateBotCommands: {
const auto &d = update.c_updateBotCommands();
if (const auto peer = session().data().peerLoaded(peerFromMTP(d.vpeer()))) {
@@ -2223,6 +2241,16 @@ void Updates::feedUpdate(const MTPUpdate &update) {
}
} break;
case mtpc_updatePinnedSavedDialogs: {
session().data().savedMessages().apply(
update.c_updatePinnedSavedDialogs());
} break;
case mtpc_updateSavedDialogPinned: {
session().data().savedMessages().apply(
update.c_updateSavedDialogPinned());
} break;
case mtpc_updateChannel: {
auto &d = update.c_updateChannel();
if (const auto channel = session().data().channelLoaded(d.vchannel_id())) {
@@ -2358,6 +2386,14 @@ void Updates::feedUpdate(const MTPUpdate &update) {
}
} break;
case mtpc_updateChannelViewForumAsMessages: {
const auto &d = update.c_updateChannelViewForumAsMessages();
const auto id = ChannelId(d.vchannel_id());
if (const auto channel = session().data().channelLoaded(id)) {
channel->setViewAsMessagesFlag(mtpIsTrue(d.venabled()));
}
} break;
// Pinned message.
case mtpc_updatePinnedMessages: {
const auto &d = update.c_updatePinnedMessages();
+110 -50
View File
@@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_hash.h"
#include "api/api_invite_links.h"
#include "api/api_media.h"
#include "api/api_peer_colors.h"
#include "api/api_peer_photo.h"
#include "api/api_polls.h"
#include "api/api_sending.h"
@@ -33,50 +34,36 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_user_names.h"
#include "api/api_websites.h"
#include "data/notify/data_notify_settings.h"
#include "data/stickers/data_stickers.h"
#include "data/data_drafts.h"
#include "data/data_changes.h"
#include "data/data_photo.h"
#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_saved_sublist.h"
#include "data/data_search_controller.h"
#include "data/data_scheduled_messages.h"
#include "data/data_channel_admins.h"
#include "data/data_session.h"
#include "data/data_stories.h"
#include "data/data_channel.h"
#include "data/data_chat.h"
#include "data/data_user.h"
#include "data/data_cloud_themes.h"
#include "data/data_chat_filters.h"
#include "data/data_histories.h"
#include "data/data_wall_paper.h"
#include "data/stickers/data_stickers.h"
#include "dialogs/dialogs_key.h"
#include "core/core_cloud_password.h"
#include "core/application.h"
#include "base/unixtime.h"
#include "base/random.h"
#include "base/qt/qt_common_adapters.h"
#include "base/call_delayed.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "mainwidget.h"
#include "boxes/add_contact_box.h"
#include "mtproto/mtproto_config.h"
#include "history/history.h"
#include "history/history_item.h"
#include "history/history_item_components.h"
#include "history/history_item_helpers.h"
#include "main/main_session.h"
#include "main/main_session_settings.h"
#include "main/main_account.h"
#include "ui/boxes/confirm_box.h"
#include "boxes/stickers_box.h"
#include "boxes/sticker_set_box.h"
#include "boxes/premium_limits_box.h"
#include "window/notifications_manager.h"
@@ -87,7 +74,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "chat_helpers/message_field.h"
#include "ui/item_text_options.h"
#include "ui/text/text_utilities.h"
#include "ui/emoji_config.h"
#include "ui/chat/attach/attach_prepare.h"
#include "ui/toast/toast.h"
#include "support/support_helper.h"
@@ -95,9 +81,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/localimageloader.h"
#include "storage/download_manager_mtproto.h"
#include "storage/file_upload.h"
#include "storage/storage_facade.h"
#include "storage/storage_shared_media.h"
#include "storage/storage_media_prepare.h"
#include "storage/storage_account.h"
// AyuGram includes
@@ -118,6 +101,7 @@ constexpr auto kStickersByEmojiInvalidateTimeout = crl::time(6 * 1000);
constexpr auto kNotifySettingSaveTimeout = crl::time(1000);
constexpr auto kDialogsFirstLoad = 20;
constexpr auto kDialogsPerPage = 500;
constexpr auto kStatsSessionKillTimeout = 10 * crl::time(1000);
using PhotoFileLocationId = Data::PhotoFileLocationId;
using DocumentFileLocationId = Data::DocumentFileLocationId;
@@ -150,6 +134,15 @@ void ShowChannelsLimitBox(not_null<PeerData*> peer) {
}
}
[[nodiscard]] FileLoadTo FileLoadTaskOptions(const Api::SendAction &action) {
const auto peer = action.history->peer;
return FileLoadTo(
peer->id,
action.options,
action.replyTo,
action.replaceMediaOf);
}
} // namespace
ApiWrap::ApiWrap(not_null<Main::Session*> session)
@@ -163,6 +156,7 @@ ApiWrap::ApiWrap(not_null<Main::Session*> session)
, _fileLoader(std::make_unique<TaskQueue>(kFileLoaderQueueStopTimeout))
, _topPromotionTimer([=] { refreshTopPromotion(); })
, _updateNotifyTimer([=] { sendNotifySettingsUpdates(); })
, _statsSessionKillTimer([=] { checkStatsSessions(); })
, _authorizations(std::make_unique<Api::Authorizations>(this))
, _attachedStickers(std::make_unique<Api::AttachedStickers>(this))
, _blockedPeers(std::make_unique<Api::BlockedPeers>(this))
@@ -182,7 +176,8 @@ ApiWrap::ApiWrap(not_null<Main::Session*> session)
, _transcribes(std::make_unique<Api::Transcribes>(this))
, _premium(std::make_unique<Api::Premium>(this))
, _usernames(std::make_unique<Api::Usernames>(this))
, _websites(std::make_unique<Api::Websites>(this)) {
, _websites(std::make_unique<Api::Websites>(this))
, _peerColors(std::make_unique<Api::PeerColors>(this)) {
crl::on_main(session, [=] {
// You can't use _session->lifetime() in the constructor,
// only queued, because it is not constructed yet.
@@ -231,11 +226,11 @@ void ApiWrap::setupSupportMode() {
void ApiWrap::requestChangelog(
const QString &sinceVersion,
Fn<void(const MTPUpdates &result)> callback) {
request(MTPhelp_GetAppChangelog(
MTP_string(sinceVersion)
)).done(
callback
).send();
//request(MTPhelp_GetAppChangelog(
// MTP_string(sinceVersion)
//)).done(
// callback
//).send();
}
void ApiWrap::refreshTopPromotion() {
@@ -450,6 +445,26 @@ void ApiWrap::savePinnedOrder(not_null<Data::Forum*> forum) {
}).send();
}
void ApiWrap::savePinnedOrder(not_null<Data::SavedMessages*> saved) {
const auto &order = _session->data().pinnedChatsOrder(saved);
const auto input = [](Dialogs::Key key) {
if (const auto sublist = key.sublist()) {
return MTP_inputDialogPeer(sublist->peer()->input);
}
Unexpected("Key type in pinnedDialogsOrder().");
};
auto peers = QVector<MTPInputDialogPeer>();
peers.reserve(order.size());
ranges::transform(
order,
ranges::back_inserter(peers),
input);
request(MTPmessages_ReorderPinnedSavedDialogs(
MTP_flags(MTPmessages_ReorderPinnedSavedDialogs::Flag::f_force),
MTP_vector(peers)
)).send();
}
void ApiWrap::toggleHistoryArchived(
not_null<History*> history,
bool archived,
@@ -1339,6 +1354,12 @@ void ApiWrap::markContentsRead(
markedIds.push_back(MTP_int(item->id));
}
}
const auto settings = &AyuSettings::getInstance();
if (!settings->sendReadMessages) {
return;
}
if (!markedIds.isEmpty()) {
request(MTPmessages_ReadMessageContents(
MTP_vector<MTPint>(markedIds)
@@ -1358,6 +1379,12 @@ void ApiWrap::markContentsRead(not_null<HistoryItem*> item) {
if (!item->markContentsRead(true) || !item->isRegular()) {
return;
}
const auto settings = &AyuSettings::getInstance();
if (!settings->sendReadMessages) {
return;
}
const auto ids = MTP_vector<MTPint>(1, MTP_int(item->id));
if (const auto channel = item->history()->peer->asChannel()) {
request(MTPchannels_ReadMessageContents(
@@ -1752,6 +1779,14 @@ void ApiWrap::joinChannel(not_null<ChannelData*> channel) {
}).send();
_channelAmInRequests.emplace(channel, requestId);
using Flag = ChannelDataFlag;
chatParticipants().loadSimilarChannels(channel);
const auto settings = &AyuSettings::getInstance();
if (!settings->collapseSimilarChannels) {
channel->setFlags(channel->flags() | Flag::SimilarExpanded);
}
}
}
@@ -2068,13 +2103,13 @@ void ApiWrap::deleteHistory(
void ApiWrap::applyUpdates(
const MTPUpdates &updates,
uint64 sentMessageRandomId) {
uint64 sentMessageRandomId) const {
this->updates().applyUpdates(updates, sentMessageRandomId);
}
int ApiWrap::applyAffectedHistory(
PeerData *peer,
const MTPmessages_AffectedHistory &result) {
const MTPmessages_AffectedHistory &result) const {
const auto &data = result.c_messages_affectedHistory();
if (const auto channel = peer ? peer->asChannel() : nullptr) {
channel->ptsUpdateAndApply(data.vpts().v, data.vpts_count().v);
@@ -2096,7 +2131,7 @@ void ApiWrap::applyAffectedMessages(
}
void ApiWrap::applyAffectedMessages(
const MTPmessages_AffectedMessages &result) {
const MTPmessages_AffectedMessages &result) const {
const auto &data = result.c_messages_affectedMessages();
updates().updateAndApply(data.vpts().v, data.vpts_count().v);
}
@@ -2555,8 +2590,8 @@ void ApiWrap::refreshFileReference(
request(MTPhelp_GetPremiumPromo());
}, [&](Data::FileOriginStory data) {
request(MTPstories_GetStoriesByID(
_session->data().peer(data.peerId)->input,
MTP_vector<MTPint>(1, MTP_int(data.storyId))));
_session->data().peer(data.peer)->input,
MTP_vector<MTPint>(1, MTP_int(data.story))));
}, [&](v::null_t) {
fail();
});
@@ -3442,7 +3477,7 @@ void ApiWrap::sendVoiceMessage(
crl::time duration,
const SendAction &action) {
const auto caption = TextWithTags();
const auto to = fileLoadTaskOptions(action);
const auto to = FileLoadTaskOptions(action);
_fileLoader->addTask(std::make_unique<FileLoadTask>(
&session(),
result,
@@ -3460,7 +3495,7 @@ void ApiWrap::editMedia(
if (list.files.empty()) return;
auto &file = list.files.front();
const auto to = fileLoadTaskOptions(action);
const auto to = FileLoadTaskOptions(action);
_fileLoader->addTask(std::make_unique<FileLoadTask>(
&session(),
file.path,
@@ -3489,7 +3524,7 @@ void ApiWrap::sendFiles(
sendMessage(std::move(message));
}
const auto to = fileLoadTaskOptions(action);
const auto to = FileLoadTaskOptions(action);
if (album) {
album->options = to.options;
}
@@ -3528,7 +3563,7 @@ void ApiWrap::sendFile(
const QByteArray &fileContent,
SendMediaType type,
const SendAction &action) {
const auto to = fileLoadTaskOptions(action);
const auto to = FileLoadTaskOptions(action);
auto caption = TextWithTags();
const auto spoiler = false;
const auto information = nullptr;
@@ -3614,11 +3649,12 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
sendAction(action);
const auto clearCloudDraft = action.clearDraft;
const auto draftTopicRootId = action.replyTo.topicRootId;
const auto replyTo = action.replyTo.messageId
? peer->owner().message(action.replyTo.messageId)
: nullptr;
const auto topicRootId = action.replyTo.topicRootId
? action.replyTo.topicRootId
const auto topicRootId = draftTopicRootId
? draftTopicRootId
: replyTo
? replyTo->topicRootId()
: Data::ForumTopic::kGeneralId;
@@ -3658,7 +3694,10 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
TextUtilities::Trim(sending);
_session->data().registerMessageRandomId(randomId, newId);
_session->data().registerMessageSentData(randomId, peer->id, sending.text);
_session->data().registerMessageSentData(
randomId,
peer->id,
sending.text);
MTPstring msgText(MTP_string(sending.text));
auto flags = NewMessageFlags(peer);
@@ -3720,8 +3759,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
if (clearCloudDraft) {
sendFlags |= MTPmessages_SendMessage::Flag::f_clear_draft;
mediaFlags |= MTPmessages_SendMedia::Flag::f_clear_draft;
history->clearCloudDraft(topicRootId);
history->startSavingCloudDraft(topicRootId);
history->clearCloudDraft(draftTopicRootId);
history->startSavingCloudDraft(draftTopicRootId);
}
const auto sendAs = action.options.sendAs;
const auto messageFromId = sendAs
@@ -3758,7 +3797,7 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
const MTP::Response &response) {
if (clearCloudDraft) {
history->finishSavingCloudDraft(
topicRootId,
draftTopicRootId,
UnixtimeFromMsgId(response.outerMsgId));
}
};
@@ -3772,7 +3811,7 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
}
if (clearCloudDraft) {
history->finishSavingCloudDraft(
topicRootId,
draftTopicRootId,
UnixtimeFromMsgId(response.outerMsgId));
}
};
@@ -4221,15 +4260,6 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
});
}
FileLoadTo ApiWrap::fileLoadTaskOptions(const SendAction &action) const {
const auto peer = action.history->peer;
return FileLoadTo(
peer->id,
action.options,
action.replyTo,
action.replaceMediaOf);
}
void ApiWrap::reloadContactSignupSilent() {
if (_contactSignupSilentRequestId) {
return;
@@ -4340,6 +4370,32 @@ void ApiWrap::saveSelfBio(const QString &text) {
}).send();
}
void ApiWrap::registerStatsRequest(MTP::DcId dcId, mtpRequestId id) {
_statsRequests[dcId].emplace(id);
}
void ApiWrap::unregisterStatsRequest(MTP::DcId dcId, mtpRequestId id) {
const auto i = _statsRequests.find(dcId);
Assert(i != end(_statsRequests));
const auto removed = i->second.remove(id);
Assert(removed);
if (i->second.empty()) {
_statsSessionKillTimer.callOnce(kStatsSessionKillTimeout);
}
}
void ApiWrap::checkStatsSessions() {
for (auto i = begin(_statsRequests); i != end(_statsRequests);) {
if (i->second.empty()) {
instance().killSession(
MTP::ShiftDcId(i->first, MTP::kStatsDcShift));
i = _statsRequests.erase(i);
} else {
++i;
}
}
}
Api::Authorizations &ApiWrap::authorizations() {
return *_authorizations;
}
@@ -4419,3 +4475,7 @@ Api::Usernames &ApiWrap::usernames() {
Api::Websites &ApiWrap::websites() {
return *_websites;
}
Api::PeerColors &ApiWrap::peerColors() {
return *_peerColors;
}
+16 -6
View File
@@ -9,8 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "api/api_common.h"
#include "base/timer.h"
#include "base/flat_map.h"
#include "base/flat_set.h"
#include "mtproto/sender.h"
#include "data/stickers/data_stickers_set.h"
#include "data/data_messages.h"
@@ -36,6 +34,7 @@ class Forum;
class ForumTopic;
class Thread;
class Story;
class SavedMessages;
} // namespace Data
namespace InlineBots {
@@ -73,6 +72,7 @@ class InviteLinks;
class ViewsManager;
class ConfirmPhone;
class PeerPhoto;
class PeerColors;
class Polls;
class ChatParticipants;
class UnreadThings;
@@ -141,10 +141,10 @@ public:
void applyUpdates(
const MTPUpdates &updates,
uint64 sentMessageRandomId = 0);
uint64 sentMessageRandomId = 0) const;
int applyAffectedHistory(
PeerData *peer, // May be nullptr, like for deletePhoneCallHistory.
const MTPmessages_AffectedHistory &result);
const MTPmessages_AffectedHistory &result) const;
void registerModifyRequest(const QString &key, mtpRequestId requestId);
void clearModifyRequest(const QString &key);
@@ -153,6 +153,7 @@ public:
void savePinnedOrder(Data::Folder *folder);
void savePinnedOrder(not_null<Data::Forum*> forum);
void savePinnedOrder(not_null<Data::SavedMessages*> saved);
void toggleHistoryArchived(
not_null<History*> history,
bool archived,
@@ -369,6 +370,9 @@ public:
void saveSelfBio(const QString &text);
void registerStatsRequest(MTP::DcId dcId, mtpRequestId id);
void unregisterStatsRequest(MTP::DcId dcId, mtpRequestId id);
[[nodiscard]] Api::Authorizations &authorizations();
[[nodiscard]] Api::AttachedStickers &attachedStickers();
[[nodiscard]] Api::BlockedPeers &blockedPeers();
@@ -389,6 +393,7 @@ public:
[[nodiscard]] Api::Premium &premium();
[[nodiscard]] Api::Usernames &usernames();
[[nodiscard]] Api::Websites &websites();
[[nodiscard]] Api::PeerColors &peerColors();
void updatePrivacyLastSeens();
@@ -500,7 +505,7 @@ private:
not_null<PeerData*> peer,
bool justClear,
bool revoke);
void applyAffectedMessages(const MTPmessages_AffectedMessages &result);
void applyAffectedMessages(const MTPmessages_AffectedMessages &result) const;
void deleteAllFromParticipantSend(
not_null<ChannelData*> channel,
@@ -529,7 +534,6 @@ private:
Api::SendOptions options,
uint64 randomId,
Fn<void(bool)> done = nullptr);
FileLoadTo fileLoadTaskOptions(const SendAction &action) const;
void getTopPromotionDelayed(TimeId now, TimeId next);
void topPromotionDone(const MTPhelp_PromoData &proxy);
@@ -547,6 +551,8 @@ private:
not_null<ChannelData*> channel);
void migrateFail(not_null<PeerData*> peer, const QString &error);
void checkStatsSessions();
const not_null<Main::Session*> _session;
base::flat_map<QString, int> _modifyRequests;
@@ -683,6 +689,9 @@ private:
QString requestedText;
} _bio;
base::flat_map<MTP::DcId, base::flat_set<mtpRequestId>> _statsRequests;
base::Timer _statsSessionKillTimer;
const std::unique_ptr<Api::Authorizations> _authorizations;
const std::unique_ptr<Api::AttachedStickers> _attachedStickers;
const std::unique_ptr<Api::BlockedPeers> _blockedPeers;
@@ -703,6 +712,7 @@ private:
const std::unique_ptr<Api::Premium> _premium;
const std::unique_ptr<Api::Usernames> _usernames;
const std::unique_ptr<Api::Websites> _websites;
const std::unique_ptr<Api::PeerColors> _peerColors;
mtpRequestId _wallPaperRequestId = 0;
QString _wallPaperSlug;
+14 -7
View File
@@ -11,6 +11,15 @@
#include "core/core_settings.h"
#include "lang/lang_instance.h"
// hard-coded languages
std::map<QString, QString> langMapping = {
{"pt-br", "pt"},
{"zh-hans-beta", "zh-hans"},
{"zh-hant-beta", "zh-hant"},
{"zh-hans-raw", "zh-hans"},
{"zh-hant-raw", "zh-hant"},
};
CustomLangPack *CustomLangPack::instance = nullptr;
CustomLangPack::CustomLangPack() = default;
@@ -30,11 +39,7 @@ void CustomLangPack::fetchCustomLangPack(const QString &langPackId, const QStrin
{
LOG(("Current Language pack ID: %1, Base ID: %2").arg(langPackId, langPackBaseId));
auto finalLangPackId = langPackId;
if (finalLangPackId == qsl("pt-br")) {
// meh
finalLangPackId = qsl("pt");
}
auto finalLangPackId = langMapping.contains(langPackId) ? langMapping[langPackId] : langPackId;
const auto proxy = Core::App().settings().proxy().isEnabled()
? Core::App().settings().proxy().selected()
@@ -44,13 +49,15 @@ void CustomLangPack::fetchCustomLangPack(const QString &langPackId, const QStrin
networkManager.setProxy(LocaleProxy);
}
// using `jsdelivr` since China (...and maybe other?) users have some problems with GitHub
// https://crowdin.com/project/ayugram/discussions/6
QUrl url;
if (!finalLangPackId.isEmpty() && !langPackBaseId.isEmpty() && !needFallback) {
url.setUrl(qsl("https://raw.githubusercontent.com/AyuGram/Languages/l10n_main/values/langs/%1/Shared.json").arg(
url.setUrl(qsl("https://cdn.jsdelivr.net/gh/AyuGram/Languages@l10n_main/values/langs/%1/Shared.json").arg(
finalLangPackId));
}
else {
url.setUrl(qsl("https://raw.githubusercontent.com/AyuGram/Languages/l10n_main/values/langs/%1/Shared.json").arg(
url.setUrl(qsl("https://cdn.jsdelivr.net/gh/AyuGram/Languages@l10n_main/values/langs/%1/Shared.json").arg(
needFallback ? langPackBaseId : finalLangPackId));
}
_chkReply = networkManager.get(QNetworkRequest(url));
+116 -55
View File
@@ -59,54 +59,64 @@ void initialize()
settings = AyuGramSettings();
sendReadMessagesReactive.value() | rpl::filter([=](bool val)
{
return (val != settings->sendReadMessages);
}) | start_with_next([=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(settings.value());
}, lifetime);
sendReadMessagesReactive.value() | rpl::filter(
[=](bool val)
{
return (val != settings->sendReadMessages);
}) | start_with_next(
[=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(settings.value());
}, lifetime);
// ..
sendReadStoriesReactive.value() | rpl::filter([=](bool val)
{
return (val != settings->sendReadStories);
}) | start_with_next([=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(settings.value());
}, lifetime);
sendReadStoriesReactive.value() | rpl::filter(
[=](bool val)
{
return (val != settings->sendReadStories);
}) | start_with_next(
[=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(settings.value());
}, lifetime);
// ..
sendOnlinePacketsReactive.value() | rpl::filter([=](bool val)
{
return (val != settings->sendOnlinePackets);
}) | start_with_next([=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(settings
.value());
}, lifetime);
sendOnlinePacketsReactive.value() | rpl::filter(
[=](bool val)
{
return (val != settings->sendOnlinePackets);
}) | start_with_next(
[=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(settings
.value());
}, lifetime);
// ..
sendUploadProgressReactive.value() | rpl::filter([=](bool val)
{
return (val != settings->sendUploadProgress);
}) | start_with_next([=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(settings
.value());
}, lifetime);
sendUploadProgressReactive.value() | rpl::filter(
[=](bool val)
{
return (val != settings->sendUploadProgress);
}) | start_with_next(
[=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(settings
.value());
}, lifetime);
// ..
sendOfflinePacketAfterOnlineReactive.value() | rpl::filter([=](bool val)
{
return (val
!= settings->sendOfflinePacketAfterOnline);
}) | start_with_next([=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(
settings.value());
}, lifetime);
sendOfflinePacketAfterOnlineReactive.value() | rpl::filter(
[=](bool val)
{
return (val
!= settings->sendOfflinePacketAfterOnline);
}) | start_with_next(
[=](bool val)
{
ghostModeEnabled =
ghostModeEnabled_util(
settings.value());
}, lifetime);
}
void postinitialize()
@@ -139,15 +149,20 @@ void load()
initialize();
json p;
file >> p;
file.close();
try {
settings = p.get<AyuGramSettings>();
json p;
file >> p;
file.close();
try {
settings = p.get<AyuGramSettings>();
}
catch (...) {
LOG(("AyuGramSettings: failed to parse settings file"));
}
}
catch (...) {
LOG(("AyuGramSettings: failed to parse settings file"));
LOG(("AyuGramSettings: failed to read settings file (not json-like)"));
}
postinitialize();
}
@@ -225,12 +240,12 @@ void AyuGramSettings::set_useScheduledMessages(bool val)
useScheduledMessages = val;
}
void AyuGramSettings::set_keepDeletedMessages(bool val)
void AyuGramSettings::set_saveDeletedMessages(bool val)
{
saveDeletedMessages = val;
}
void AyuGramSettings::set_keepMessagesHistory(bool val)
void AyuGramSettings::set_saveMessagesHistory(bool val)
{
saveMessagesHistory = val;
}
@@ -245,6 +260,21 @@ void AyuGramSettings::set_disableStories(bool val)
disableStories = val;
}
void AyuGramSettings::set_collapseSimilarChannels(bool val)
{
collapseSimilarChannels = val;
}
void AyuGramSettings::set_hideSimilarChannels(bool val)
{
hideSimilarChannels = val;
}
void AyuGramSettings::set_uploadSpeedBoost(bool val)
{
uploadSpeedBoost = val;
}
void AyuGramSettings::set_disableNotificationsDelay(bool val)
{
disableNotificationsDelay = val;
@@ -265,7 +295,8 @@ void AyuGramSettings::set_appIcon(QString val)
appIcon = std::move(val);
}
void AyuGramSettings::set_simpleQuotesAndReplies(bool val) {
void AyuGramSettings::set_simpleQuotesAndReplies(bool val)
{
simpleQuotesAndReplies = val;
}
@@ -286,6 +317,31 @@ void AyuGramSettings::set_recentStickersCount(int val)
recentStickersCount = val;
}
void AyuGramSettings::set_showReactionsPanelInContextMenu(int val)
{
showReactionsPanelInContextMenu = val;
}
void AyuGramSettings::set_showViewsPanelInContextMenu(int val)
{
showViewsPanelInContextMenu = val;
}
void AyuGramSettings::set_showHideMessageInContextMenu(int val)
{
showHideMessageInContextMenu = val;
}
void AyuGramSettings::set_showUserMessagesInContextMenu(int val)
{
showUserMessagesInContextMenu = val;
}
void AyuGramSettings::set_showMessageDetailsInContextMenu(int val)
{
showMessageDetailsInContextMenu = val;
}
void AyuGramSettings::set_showLReadToggleInDrawer(bool val)
{
showLReadToggleInDrawer = val;
@@ -332,9 +388,9 @@ void AyuGramSettings::set_showPeerId(int val)
showPeerIdReactive = val;
}
void AyuGramSettings::set_showMessageSeconds(bool val)
void AyuGramSettings::set_hideNotificationCounters(bool val)
{
showMessageSeconds = val;
hideNotificationCounters = val;
}
void AyuGramSettings::set_hideAllChatsFolder(bool val)
@@ -342,6 +398,11 @@ void AyuGramSettings::set_hideAllChatsFolder(bool val)
hideAllChatsFolder = val;
}
void AyuGramSettings::set_showMessageSeconds(bool val)
{
showMessageSeconds = val;
}
void AyuGramSettings::set_stickerConfirmation(bool val)
{
stickerConfirmation = val;
+70 -53
View File
@@ -9,27 +9,12 @@
#include "lang_auto.h"
#include "ayu/libs/json.hpp"
#include "ayu/libs/json_ext.hpp"
#include "ayu/ui/ayu_assets.h"
#include "rpl/producer.h"
namespace AyuSettings
{
const auto DEFAULT_ICON = QString("default");
const auto ALT_ICON = QString("alt");
const auto DISCORD_ICON = QString("discord");
const auto SPOTIFY_ICON = QString("spotify");
const auto EXTERA_ICON = QString("extera");
const auto NOTHING_ICON = QString("nothing");
const auto BARD_ICON = QString("bard");
const auto YAPLUS_ICON = QString("yaplus");
class AyuGramSettings
{
public:
@@ -48,23 +33,38 @@ public:
useScheduledMessages = false;
// ~ Message edits & deletion history
saveDeletedMessages = true;
saveDeletedMessages = false;
saveMessagesHistory = true;
// ~ QoL toggles
disableAds = true;
disableStories = false;
collapseSimilarChannels = true;
hideSimilarChannels = false;
uploadSpeedBoost = false;
disableNotificationsDelay = false;
localPremium = false;
copyUsernameAsLink = true;
// ~ Customization
appIcon = DEFAULT_ICON;
appIcon = AyuAssets::DEFAULT_ICON;
simpleQuotesAndReplies = true;
deletedMark = "🧹";
editedMark = tr::lng_edited(tr::now);
recentStickersCount = 50;
// context menu items
// 0 - hide
// 1 - show normally
// 2 - show with SHIFT or CTRL pressed
showReactionsPanelInContextMenu = 1;
showViewsPanelInContextMenu = 1;
showHideMessageInContextMenu = 0;
showUserMessagesInContextMenu = 2;
showMessageDetailsInContextMenu = 2;
showLReadToggleInDrawer = true;
showSReadToggleInDrawer = true;
showGhostToggleInDrawer = true;
@@ -76,14 +76,15 @@ public:
mainFont = "";
monoFont = "";
hideNotificationCounters = false;
hideAllChatsFolder = false;
/*
* showPeerId = 0 means no ID shown
* showPeerId = 1 means ID shown as for Telegram API devs
* showPeerId = 2 means ID shown as for Bot API devs (-100)
*/
showPeerId = 2;
hideAllChatsFolder = false;
showMessageSeconds = false;
// ~ Confirmations
@@ -97,108 +98,118 @@ public:
bool sendOnlinePackets;
bool sendUploadProgress;
bool sendOfflinePacketAfterOnline;
bool markReadAfterSend;
bool markReadAfterReaction;
bool markReadAfterPoll;
bool useScheduledMessages;
bool saveDeletedMessages;
bool saveMessagesHistory;
bool disableAds;
bool disableStories;
bool collapseSimilarChannels;
bool hideSimilarChannels;
bool uploadSpeedBoost;
bool disableNotificationsDelay;
bool localPremium;
bool copyUsernameAsLink;
QString appIcon;
bool simpleQuotesAndReplies;
QString deletedMark;
QString editedMark;
int recentStickersCount;
int showReactionsPanelInContextMenu;
int showViewsPanelInContextMenu;
int showHideMessageInContextMenu;
int showUserMessagesInContextMenu;
int showMessageDetailsInContextMenu;
bool showLReadToggleInDrawer;
bool showSReadToggleInDrawer;
bool showGhostToggleInDrawer;
bool showStreamerToggleInDrawer;
bool showGhostToggleInTray;
bool showStreamerToggleInTray;
QString mainFont;
QString monoFont;
int showPeerId;
bool hideNotificationCounters;
bool hideAllChatsFolder;
int showPeerId;
bool showMessageSeconds;
bool stickerConfirmation;
bool gifConfirmation;
bool voiceConfirmation;
public:
void set_sendReadMessages(bool val);
void set_sendReadStories(bool val);
void set_sendOnlinePackets(bool val);
void set_sendUploadProgress(bool val);
void set_sendOfflinePacketAfterOnline(bool val);
void set_ghostModeEnabled(bool val);
void set_markReadAfterSend(bool val);
void set_markReadAfterReaction(bool val);
void set_markReadAfterPoll(bool val);
void set_useScheduledMessages(bool val);
void set_keepDeletedMessages(bool val);
void set_keepMessagesHistory(bool val);
void set_saveDeletedMessages(bool val);
void set_saveMessagesHistory(bool val);
void set_disableAds(bool val);
void set_disableStories(bool val);
void set_collapseSimilarChannels(bool val);
void set_hideSimilarChannels(bool val);
void set_uploadSpeedBoost(bool val);
void set_disableNotificationsDelay(bool val);
void set_localPremium(bool val);
void set_copyUsernameAsLink(bool val);
void set_appIcon(QString val);
void set_simpleQuotesAndReplies(bool val);
void set_deletedMark(QString val);
void set_editedMark(QString val);
void set_recentStickersCount(int val);
void set_showReactionsPanelInContextMenu(int val);
void set_showViewsPanelInContextMenu(int val);
void set_showHideMessageInContextMenu(int val);
void set_showUserMessagesInContextMenu(int val);
void set_showMessageDetailsInContextMenu(int val);
void set_showLReadToggleInDrawer(bool val);
void set_showSReadToggleInDrawer(bool val);
void set_showGhostToggleInDrawer(bool val);
void set_showStreamerToggleInDrawer(bool val);
void set_showGhostToggleInTray(bool val);
void set_showStreamerToggleInTray(bool val);
void set_mainFont(QString val);
void set_monoFont(QString val);
void set_showPeerId(int val);
void set_showMessageSeconds(bool val);
void set_hideNotificationCounters(bool val);
void set_hideAllChatsFolder(bool val);
void set_showPeerId(int val);
void set_showMessageSeconds(bool val);
void set_stickerConfirmation(bool val);
void set_gifConfirmation(bool val);
void set_voiceConfirmation(bool val);
};
@@ -217,6 +228,9 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
saveMessagesHistory,
disableAds,
disableStories,
collapseSimilarChannels,
hideSimilarChannels,
uploadSpeedBoost,
disableNotificationsDelay,
localPremium,
copyUsernameAsLink,
@@ -225,6 +239,11 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
deletedMark,
editedMark,
recentStickersCount,
showReactionsPanelInContextMenu,
showViewsPanelInContextMenu,
showHideMessageInContextMenu,
showUserMessagesInContextMenu,
showMessageDetailsInContextMenu,
showLReadToggleInDrawer,
showSReadToggleInDrawer,
showGhostToggleInDrawer,
@@ -233,9 +252,10 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
showStreamerToggleInTray,
mainFont,
monoFont,
hideNotificationCounters,
hideAllChatsFolder,
showPeerId,
showMessageSeconds,
hideAllChatsFolder,
stickerConfirmation,
gifConfirmation,
voiceConfirmation
@@ -244,17 +264,14 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
AyuGramSettings &getInstance();
void load();
void save();
rpl::producer<QString> get_deletedMarkReactive();
rpl::producer<QString> get_editedMarkReactive();
rpl::producer<int> get_showPeerIdReactive();
bool get_ghostModeEnabled();
rpl::producer<bool> get_ghostModeEnabledReactive();
}

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