Compare commits

...

401 Commits

Author SHA1 Message Date
John Preston
e0f20e9f82 Version 1.2.17: Add changelog entry. 2018-04-08 21:34:33 +04:00
John Preston
597a5c9d75 Version 1.2.17: Fix undefined behaviour on exit.
Core::Launcher didn't have virtual destructor it required.
2018-04-08 21:32:48 +04:00
John Preston
d055908f4f Version 1.2.16: Improve release build scripts. 2018-04-08 18:23:12 +04:00
John Preston
f3eac6b259 Version 1.2.16: Fix text processing crash in OS X 10.6. 2018-04-08 18:21:40 +04:00
John Preston
87d6081408 Version 1.2.16: Fix build in Xcode 9.3. 2018-04-07 12:47:08 +04:00
John Preston
dd53bd1c55 Version 1.2.16.
- Bug fixes and other minor improvements.
2018-04-07 12:20:46 +04:00
Kirsan
3ff033cdf3 Fix for https://github.com/telegramdesktop/tdesktop/issues/4544
(cherry picked from commit d99c757d44d7c31fbb0eb290f273ad4d2d464255)
2018-04-07 12:13:52 +04:00
John Preston
c1c3b6a7e5 Disable emoji suggestions for :-D/:-P 2018-04-07 11:51:17 +04:00
John Preston
64d5a6acd5 Fix game scores display. 2018-04-07 11:41:48 +04:00
John Preston
e5b2e0a6b5 Fix memory clearing from photos/documents. 2018-04-07 11:01:32 +04:00
John Preston
9895b45293 Fix calls supported layer arguments. 2018-04-07 11:00:43 +04:00
John Preston
811fc43b63 Fix Qt text processing crash.
Fixes #4551.
2018-03-30 18:18:35 +04:00
John Preston
9dcfa3ad6e Version 1.2.15.
- Bug fixes and other minor improvements.
2018-03-26 02:02:58 +04:00
John Preston
67bda19458 Fix inline bot messages with previews. 2018-03-26 02:01:13 +04:00
John Preston
6c38919c3d Scroll history to down when sharing contact. 2018-03-26 01:47:05 +04:00
John Preston
ce9445287c Extend huge local cache map crash annotations. 2018-03-26 00:56:41 +04:00
John Preston
d4bd8862bd Fix switching between stickers pan and panel.
Fixes #4537.
2018-03-26 00:54:02 +04:00
John Preston
6904e023d3 Increment dropdown emoji selection in recent list.
Fixes #4539.
2018-03-26 00:28:23 +04:00
John Preston
91a7a77bb0 Fix case-insensitive emoji suggestions.
Fixes #4528, fixes #4511, fixes #4535.
2018-03-26 00:18:14 +04:00
John Preston
d9306e3e30 Fix parent link refresh for GIF webpage preview.
Fixes #4534.
2018-03-26 00:18:14 +04:00
John Preston
efdd3df129 Fix working with webpage preview GIFs.
Fixes #4533.
2018-03-26 00:18:14 +04:00
John Preston
63098d3c7d Work better with 'unlimited' config time limits. 2018-03-26 00:18:14 +04:00
Vasilii Babich
aa5781b550 Update some details in Xcode build instructions. 2018-03-25 19:29:38 +04:00
John Preston
d6e1862c08 Fix crash in AdminLog view with deleted delegates. 2018-03-22 02:27:14 +04:00
John Preston
9aa2831fef Version 1.2.14.
- Discover new stickers.
Type one emoji to see suggestions from popular sticker sets.
Suggestions from your installed sticker sets will come first.
- Search for Stickers. Click on the new search icon
to access your sticker sets or find new ones.
- Quick Reply. Double click near a message for a quick reply.
2018-03-21 18:05:45 +04:00
John Preston
70eb29c1a9 Alpha version 1.2.13.
- Bug fixes and other minor improvements.
2018-03-21 13:46:32 +04:00
John Preston
13e07b1623 Add some debug information. 2018-03-21 13:46:22 +04:00
John Preston
27ce1f8d44 Show something inside an 'empty' message. 2018-03-20 18:51:51 +04:00
John Preston
38c20fc3c2 Return one old way for requesting special config. 2018-03-20 18:21:36 +04:00
John Preston
4a32b00068 Setting for cloud stickers suggestions. 2018-03-20 01:09:03 +04:00
John Preston
3406f88fdc Single place for joining channels, in ApiWrap. 2018-03-20 01:09:03 +04:00
Marco Trevisan
c96cb37680 Travis flags update (#4506)
* travis: don't build alsoft tools, examples and tests

* travis: don't try to build with mir client support
2018-03-16 17:39:29 +03:00
John Preston
0d415837a0 Destroy old info button in top bar widget.
Fixes #4503.
2018-03-15 18:22:55 +03:00
John Preston
9dc48522d8 Fix multi-forward notification layout (long name). 2018-03-15 03:12:00 +03:00
John Preston
31b82a5d92 Show audio file performer-title in dialogs list. 2018-03-15 03:12:00 +03:00
John Preston
87ab4d9dd1 Improve local search in sticker sets.
- Don't index special sticker sets, like "Favorite stickers".
- Show "Not found." if no local results and waiting for server-side.
2018-03-15 03:11:59 +03:00
John Preston
b6e7625016 Improve case-insensitive emoji suggestions. 2018-03-15 03:11:59 +03:00
Sven-Hendrik Haase
c5e6bfce95 Fix wrong uname flag used
This is required because uname -p actually returns "unknown" for some hardware. The uname help documents this by stating that -p is non-portable. The -m flag is the one to use.
2018-03-14 15:01:26 +03:00
John Preston
7a849b2899 Fix crash on album parts being deleted. 2018-03-13 13:54:24 +03:00
John Preston
999fa39d7c Fix shared links layout for webpage previews.
Fixes #4489.
2018-03-13 13:29:56 +03:00
John Preston
7de15ce5cf Fix inline bots with photos. 2018-03-13 13:29:42 +03:00
John Preston
f792b0052f Refresh caption Text after media is being sent.
Fixes #4488.
2018-03-13 13:19:06 +03:00
John Preston
57d0b1d215 Show error when joining a full group. 2018-03-12 10:55:30 +03:00
John Preston
7691654cb8 Alpha version 1.2.12.
- Bug fixes and other minor improvements.
2018-03-12 00:00:08 +03:00
John Preston
c76e4b6b3c Fix: cancel empty reply by Escape. 2018-03-11 23:58:14 +03:00
John Preston
bda39cc6f6 Cancel empty reply by Escape. 2018-03-11 23:48:18 +03:00
John Preston
060cdfea86 Cancel reply when setting a forwarding draft. 2018-03-11 23:42:03 +03:00
John Preston
b1cc7b25ba Add group/channel info limit in EditPeerInfoBox. 2018-03-11 23:22:43 +03:00
John Preston
1e0fe70dc3 Focus correct widget in intro steps.
The old way some random shown widget could've been focused.
2018-03-11 22:55:28 +03:00
John Preston
8ed167c5fa Change domain fronting url and host header. 2018-03-11 22:55:28 +03:00
John Preston
dabf8414be Remove old debug information. 2018-03-11 22:21:17 +03:00
John Preston
a0eb64428e Use new config fields for revoke settings. 2018-03-11 22:21:17 +03:00
Patrick Eigensatz
dd1beb1d91 Let emoji suggestions be case insensitive
Closes #3985
2018-03-11 22:01:18 +03:00
John Preston
bb35d71fdc Attempt to fix access to a deleted item view. 2018-03-10 15:47:19 +03:00
John Preston
42a7e86e51 Alpha version 1.2.11.
- Bug fixes and other minor improvements.
2018-03-10 00:56:36 +03:00
John Preston
2f3540dadc Fix sending an album after cancel of one media. 2018-03-10 00:55:59 +03:00
John Preston
eb00641dfa Mark autoplayed voice/video messages as read. 2018-03-10 00:55:58 +03:00
John Preston
bfe7bf2c11 Paste image to SendFilesBox even if it has an url.
Fixes #4483.
2018-03-10 00:55:58 +03:00
Marco Trevisan (Treviño)
e88c575d4a linux: use $HOME to determine actual user path
As it could be different in confined environments.
2018-03-10 00:55:24 +03:00
Marco Trevisan (Treviño)
0de9c62675 linux-desktop-environment: detect Ubuntu properly enabling features
In Ubuntu (running in GNOME) we support AppIndicator and
Unity counters still.
2018-03-10 00:52:06 +03:00
Sean
9dc3847dbe Fix Typo 2018-03-10 00:50:05 +03:00
Marco Trevisan
9dc03c4f0f Linux ARM compile fixes (#4399)
This fixes errors when compiling in ARM
2018-03-09 23:48:47 +03:00
John Preston
def21367a3 Allow to reply by double click on the timestamp. 2018-03-09 21:22:31 +03:00
John Preston
33fe1b6389 Show no results message in share box search. 2018-03-09 21:22:31 +03:00
John Preston
76cb5677b2 Fix webpage edit display in channel admin log. 2018-03-09 21:22:31 +03:00
John Preston
8c3b7f6417 Ignore second tray icon click in short time.
Fixes #4479.
2018-03-09 21:22:31 +03:00
John Preston
e6c0f0f774 Up arrow always edits last available message.
Fixes #4480.
2018-03-09 21:22:31 +03:00
John Preston
6bd5301828 Fix crash when accessing a deleted item view. 2018-03-09 21:22:31 +03:00
John
73c0c4507a fix build against libressl 2018-03-09 21:12:34 +03:00
John Preston
506b0806d6 Fix build instructions for Linux. 2018-03-09 01:55:18 +03:00
John Preston
054459d327 Alpha version 1.2.10.
- Bug fixes and other minor improvements.
2018-03-09 00:26:58 +03:00
John Preston
66ac4d6150 No fast reply and double click reply if selecting.
Also fix messages selection glitch.
2018-03-09 00:21:27 +03:00
John Preston
ab8e7897cc No search for peers when searching by a hashtag. 2018-03-08 17:14:26 +03:00
John Preston
2b9133be90 Don't remove field focus on empty text selection.
Fixes #4467.
2018-03-08 16:03:59 +03:00
John Preston
56fece6216 Move from req_pq to req_pq_multi in protocol impl. 2018-03-08 15:55:05 +03:00
John Preston
d381836f01 Don't add separate icon for faved pack.
Also update stickers search icons.
2018-03-08 15:54:55 +03:00
John Preston
c6efb588dc Fix crash in digit-only hashtag skipping. 2018-03-08 15:02:34 +03:00
John Preston
5404dfef08 Search sticker sets locally by short name. 2018-03-08 14:37:01 +03:00
John Preston
cba12980f9 Display correct amount of stickers in search. 2018-03-08 14:12:30 +03:00
John Preston
61700577d0 Fix possible crash with invalidated views. 2018-03-08 13:47:31 +03:00
John Preston
321f5d879d Fix crash in faving stickers.
Don't fill dates in any sets except CloudRecentSetId.
Otherwise some assertions will be violated later.
2018-03-08 12:57:05 +03:00
John Preston
f98fdeab3f Alpha version 1.2.9.
- Quick Reply. Double click near a message for a quick reply.
- Search for Stickers. Click on the new search icon to access
your sticker sets or find new ones.
2018-03-08 01:45:46 +03:00
John Preston
90179188b9 Improve sticker by emoji ordering.
First display recent by send/install date, then trending, then other.
2018-03-08 00:26:35 +03:00
John Preston
ccef155f7a Receive and track recent sticker usage date. 2018-03-07 20:43:26 +03:00
John Preston
f0a95032a5 Show cloud stickers by emoji. 2018-03-07 16:53:12 +03:00
John Preston
c3ff5f2603 Limit amount of displayed recent stickers. 2018-03-07 15:04:05 +03:00
John Preston
ee182ea684 API scheme downgraded to layer 76. 2018-03-06 20:48:24 +03:00
John Preston
7f73cc3085 Fix file media with views counter layout. 2018-03-06 19:14:39 +03:00
John Preston
dcf70b2847 Add ".download" for .lnk and .scf file names.
This is a workaround for some windows shell vulnerabilities.

See http://www.defensecode.com/whitepapers/
Stealing-Windows-Credentials-Using-Google-Chrome.pdf
2018-03-06 19:04:47 +03:00
John Preston
cb5ba7edda Use a separate lang key for sticker pack remove. 2018-03-06 18:41:52 +03:00
John Preston
7940ef24ab Disallow hashtags of digits only. 2018-03-06 18:29:45 +03:00
John Preston
0f901b3728 Update API and use WebDocument for inline bots. 2018-03-06 16:49:44 +03:00
John Preston
09aba596ac Open t.me/iv links in browser. 2018-03-04 15:52:00 +03:00
John Preston
b930ac7bf9 Don't add unread mentions in channels. 2018-03-03 16:09:31 +03:00
John Preston
7f1bc4635a Update libtgvoip. 2018-03-03 16:01:22 +03:00
John Preston
d4253d2025 Fix reply previews display. 2018-03-03 15:55:53 +03:00
John Preston
b007fcb537 Add sticker sets search. 2018-03-03 14:21:32 +03:00
John Preston
e6dd7d7684 Fix crash in item view refresh. 2018-03-01 20:17:39 +03:00
John Preston
128663d95b Reply by double clicking a message. 2018-02-28 15:07:15 +03:00
John Preston
ef8b6d1a3d Process currency amounts before display. 2018-02-28 15:06:57 +03:00
John Preston
b4baebc230 Fix mediaview download icon in night mode. 2018-02-24 16:38:51 +03:00
John Preston
b4581a7bbf Closed beta 1.2.8.11. 2018-02-24 02:47:33 +03:00
John Preston
a285dca39e Apply webpage media from sent message via bot. 2018-02-24 02:46:35 +03:00
John Preston
00aa6d5ac3 Allow monospace block to end on ellipsis. 2018-02-22 21:16:01 +03:00
John Preston
027db285bc Add Info::Channels section + feed channels search. 2018-02-22 20:38:00 +03:00
John Preston
c3c9ba7e51 Add feed icons. 2018-02-22 20:37:49 +03:00
John Preston
a1be63f890 Jump to date by date click in feed. 2018-02-22 15:35:46 +03:00
John Preston
f066f3f139 Enable jump to date in feed. 2018-02-22 00:17:36 +03:00
John Preston
e17dcbb8eb Closed beta 1.2.8.10: API updated to layer 77. 2018-02-21 16:56:43 +03:00
John Preston
1ae22c8606 Fix assertion violation when no feed. 2018-02-21 16:38:56 +03:00
John Preston
d5569487a4 Closed beta 1.2.8.9. 2018-02-20 20:55:20 +03:00
John Preston
336e691dbc Add unread counter from feed to common counter. 2018-02-20 20:53:55 +03:00
John Preston
17a4d19beb Add a create feed channels list box. 2018-02-20 19:56:41 +03:00
John Preston
74aa1ad71e Ungroup all feed channels from context menu. 2018-02-18 17:00:14 +03:00
John Preston
f8c2f339a0 Create changelogs after data in AuthSession. 2018-02-18 16:26:28 +03:00
John Preston
1dd66184a1 Fix assertion violation on hashtag click. 2018-02-18 16:23:30 +03:00
John Preston
ddab8c1473 Fix fast share button hover area. 2018-02-18 16:22:58 +03:00
John Preston
49d2c97ceb Closed beta 1.2.8.8. 2018-02-16 21:00:19 +03:00
John Preston
351a423337 Highlight found messages in feed. 2018-02-16 20:59:35 +03:00
John Preston
07528be1e6 Support search in feed + scroll to search result. 2018-02-16 19:45:58 +03:00
John Preston
bc171f625a Remove some more symbols from filenames. 2018-02-15 15:34:38 +03:00
John Preston
0f775e1e66 Support feeds search display in dialogs list. 2018-02-14 23:18:21 +03:00
John Preston
98fb874b29 Closed beta 1.2.8.7. 2018-02-13 19:11:32 +03:00
John Preston
cfd5c2a650 Add feed notifications edit box. 2018-02-13 19:11:00 +03:00
John Preston
22a5b7faf6 Fix GIF playback glitch after loading. 2018-02-13 12:48:42 +03:00
John Preston
fe262701c0 Add notification toggle in feed channels. 2018-02-12 18:52:55 +03:00
John Preston
e1f71d3919 Closed beta 1.2.8.6. 2018-02-10 01:15:16 +03:00
John Preston
906cb95e67 Channels list in feed info with leave channel. 2018-02-10 01:14:26 +03:00
John Preston
f23c23f696 Closed beta 1.2.8.5. 2018-02-08 12:20:55 +03:00
John Preston
99c686e3e1 Display feed channels list in feed info. 2018-02-08 12:20:55 +03:00
John Preston
a144e35f84 Add content to feed info cover widget. 2018-02-08 12:20:55 +03:00
John Preston
5a5c5782a9 Replace crl::on_main to InvokeQueued in some cases.
If the event loop is reentered from the call it is unsafe to crl::on_main.
For example NSOpenPanel lags terribly if it is shown from crl::on_main.
2018-02-08 12:20:55 +03:00
John Preston
a2a5c30e60 Closed beta 1.2.8.4. 2018-02-08 12:20:55 +03:00
John Preston
3c4c466f8e Add cashtags and bot allowed service messages. 2018-02-08 12:20:55 +03:00
John Preston
6726826c17 Display empty feed placeholder. 2018-02-08 12:20:55 +03:00
John Preston
e102cb1469 Handle channelDifferenceTooLong in media and feed. 2018-02-08 12:20:54 +03:00
John Preston
11671e85da Add scroll-to-down button to Feed. 2018-02-08 12:20:54 +03:00
John Preston
b8614c60f9 Closed beta 1.2.8.3. 2018-02-08 12:20:54 +03:00
John Preston
269defa82d Fix forwarded Saved Messages layout. 2018-02-08 12:20:54 +03:00
John Preston
8bacc74d8b Request dialog list entries when needed.
Also save the original server-side int32 date in HistoryItems.
2018-02-08 12:20:54 +03:00
John Preston
0c5efb935d Read feed while scrolling. 2018-02-08 12:20:54 +03:00
John Preston
a7f67c4bc9 Better chats list entries management.
Make unread counts and last message base::optional<>.
Remove ChannelHistory.
2018-02-08 12:20:54 +03:00
John Preston
edcaccba1f Limit media count in one HistoryGroupedMedia. 2018-02-08 12:20:54 +03:00
John Preston
5ebecb4de3 Display feed userpic in single column layout. 2018-02-08 12:20:53 +03:00
John Preston
9f3048c1dc Hide service messages from feed. 2018-02-08 12:20:53 +03:00
John Preston
2586268b81 Remove HistoryJoined, use plain HistoryService. 2018-02-08 12:20:53 +03:00
John Preston
280ddb4629 Request full feed channels list before messages. 2018-02-08 12:20:53 +03:00
John Preston
20889d7003 Mark history as having pending resized items. 2018-02-08 12:20:53 +03:00
John Preston
d4f4698c69 Closed beta 1.2.8.2. 2018-02-08 12:20:53 +03:00
John Preston
adcce61b52 Fix date/unread bar display in albums. 2018-02-08 12:20:53 +03:00
John Preston
17b913fb13 Fix feed messages loading both ways. 2018-02-08 12:20:53 +03:00
John Preston
366ea1edc3 Notify about feed channels list changes. 2018-02-08 12:20:53 +03:00
John Preston
3a5a002be2 Add crash debug information. 2018-02-08 12:20:53 +03:00
John Preston
533fba8c70 Improve message context menu in feed. 2018-02-08 12:20:53 +03:00
John Preston
7435bd7fb0 Implement drag-n-drop from HistoryView::ListWidget. 2018-02-08 12:20:53 +03:00
John Preston
681b9b5ba3 Improve text selection in bubbles. 2018-02-08 12:20:53 +03:00
John Preston
600737c44f Fix copy selected items text in old and new lists. 2018-02-08 12:20:53 +03:00
John Preston
e5f3bed801 Improve drag selection in HistoryView::ListWidget. 2018-02-08 12:20:52 +03:00
John Preston
2fdc3169ce Fix / improve support for album items selection. 2018-02-08 12:20:52 +03:00
John Preston
722264f634 Add /Qspectre Visual C++ compiler option. 2018-02-08 12:20:52 +03:00
John Preston
a858ab5d0b Fix crash in DocumentData destructor.
Keep AuthSession pointer in DocumentData for loader destruction.
2018-02-08 12:20:52 +03:00
John Preston
63c1212ef1 Allow multiple items selection in HistoryView. 2018-02-08 12:20:52 +03:00
John Preston
2aa477176c Fix build for Xcode / GCC. 2018-02-08 12:20:52 +03:00
John Preston
6bb39451ea Closed beta 1.2.8.1. 2018-02-08 12:20:52 +03:00
John Preston
099a3c4642 Fix paste of image from Firefox.
It sometimes adds a strange path to empty temp file to mime data.
2018-02-08 12:20:52 +03:00
John Preston
9515520088 Update API scheme. 2018-02-08 12:20:52 +03:00
John Preston
fe1a90bd39 Move message context menu to a separate module. 2018-02-08 12:20:52 +03:00
John Preston
65df137610 Add group/ungroup action in channel peer menu. 2018-02-08 12:20:51 +03:00
John Preston
ced0c4d8f0 Move HistoryMessageDate to view elements. 2018-02-08 12:20:51 +03:00
John Preston
f3804429e4 Update GSL submodule. 2018-02-08 12:20:51 +03:00
John Preston
a47981054f Feed info profile placeholder. 2018-02-08 12:20:51 +03:00
John Preston
b9ad8bb700 Feed top bar placeholder. 2018-02-08 12:20:51 +03:00
John Preston
47ad5ea98a Display active feed state in dialogs list. 2018-02-08 12:20:51 +03:00
John Preston
840b42934b Use server-side my_results in contacts.search. 2018-02-08 12:20:51 +03:00
John Preston
4527c03c0d Use "Feed" name for chats list index and search. 2018-02-08 12:20:51 +03:00
John Preston
89941a8e83 Fix layout update notifications in Info::Media. 2018-02-08 12:20:50 +03:00
John Preston
ebd4651ac2 Manage unread bar using HistoryView::Element-s. 2018-02-08 12:20:50 +03:00
John Preston
861ab85ca1 Fix voice/video messages in chats/feed. 2018-02-08 12:20:50 +03:00
John Preston
f9154c4ed0 Fix albums layout and editing in feed. 2018-02-08 12:20:50 +03:00
John Preston
b91ebad8be Improve items resize in history and feed. 2018-02-08 12:20:50 +03:00
John Preston
e6baf8ef5b Fix layout of some media, enable GIF autoplay. 2018-02-08 12:20:50 +03:00
John Preston
d326c7e3fa Remove HistoryItemInstantiated. 2018-02-08 12:20:49 +03:00
John Preston
950126865e Handle item view refresh, fix groups. 2018-02-08 12:20:49 +03:00
John Preston
91f369a0b3 Handle view resize/repaint requests for mainView. 2018-02-08 12:20:49 +03:00
John Preston
d1a9d3992b API scheme updated to layer 76. 2018-02-08 12:20:49 +03:00
John Preston
2dd2ad5cdb Replace peerMessagesUpdated with notifications. 2018-02-08 12:20:49 +03:00
John Preston
04c8c95634 Use notify* instead of mark* in Data::Session. 2018-02-08 12:20:49 +03:00
John Preston
8a56ede187 Move all (item/view/media) maps to Data::Session. 2018-02-08 12:20:49 +03:00
John Preston
7425e80f05 Use HistoryMedia as view, add Data::Media. 2018-02-08 12:20:48 +03:00
John Preston
97a9089ebf Move draw / getState code to HistoryView::Message.
Item dimensions broken for now.
Also remove history.h from pch.
2018-02-08 12:20:48 +03:00
John Preston
bee474f6e9 Remove history_item and layout from pch.
Also move some code to separate modules.
Also create history item views by Window::Controller.
2018-02-08 12:20:47 +03:00
John Preston
4740d44159 Make HistoryView::Message a ClickHandlerHost. 2018-02-08 12:20:47 +03:00
John Preston
062b0b2165 Save item views in App::*Item() variables.
Also remove App::contextItem.
Also use owning pointers for history context menus.
2018-02-08 12:20:47 +03:00
John Preston
8060cb7426 Start HistoryView::Message class for item view. 2018-02-08 12:20:47 +03:00
John Preston
794e31505b First version of feed section view. 2018-02-08 12:20:46 +03:00
John Preston
50b120bc22 Fix glitch in single column back button click. 2018-02-08 12:20:46 +03:00
John Preston
f0b2e445f6 Prepare dialogs to open feeds. 2018-02-08 12:20:46 +03:00
John Preston
782e70b171 Support basic feed display in chats list. 2018-02-08 12:20:46 +03:00
John Preston
9d2239291d Add support for pinned feeds management. 2018-02-08 12:20:46 +03:00
John Preston
a2891807f8 Prepare dialogs to hold a history or a feed. 2018-02-08 12:20:46 +03:00
John Preston
6a9556d42c Move non-settings session data to Data::Session.
Rename AuthSessionData to AuthSessionSettings, move data away.
2018-02-08 12:20:46 +03:00
John Preston
724fe65d72 Start feeds support. 2018-02-08 12:20:45 +03:00
John Preston
46612ef128 Remove Notify::userIsContactChanged().
Replace with Notify::peerUpdatedDelayed().
2018-02-08 12:20:45 +03:00
John Preston
139ef5411a Prepare code for dialogFeed handling. 2018-02-08 12:20:45 +03:00
John Preston
ac57000437 Move contacts list loading to ApiWrap. 2018-02-08 12:20:45 +03:00
John Preston
31234cb487 API scheme updated to layer 75. 2018-02-08 12:20:45 +03:00
John Preston
05e36a064f API scheme updated to layer 74. 2018-02-08 12:20:45 +03:00
John Preston
f88cbf3d4b Fix crash in case of incorrect Text entities. 2018-02-08 12:20:45 +03:00
John Preston
7814ee0f7a Fix building crashpad for macOS. Update instructions.
Some tests were disabled by a crashpad patch because the changes to make
them work with new SDK are relatively big and no need to backport them.

Fixes #4353.
2018-02-08 11:27:50 +03:00
Alexander Nestorov
9f4e5e4603 Fix xcode build instructions (#4345) 2018-01-26 03:55:31 +03:00
Vitaliy Rudnyh
810fb45750 building-xcode.md: Add depot_tools to $PATH (#4331)
Otherwise "crashpad" would not compile.
2018-01-23 04:08:33 +03:00
John Preston
55e56a6788 Alpha version 1.2.8.
- Bug fixes and other minor improvements.
2018-01-03 13:46:01 +03:00
John Preston
ea7441ae77 Use single LEGAL file with license and copyright. 2018-01-03 13:23:14 +03:00
John Preston
f65e8824fb Add single LEGAL file with license and copyright. 2018-01-03 13:04:34 +03:00
John Preston
2868899d81 Fix possible assertion violation.
Allow removing local HistoryItem's after the album was already sent.
2018-01-03 12:06:02 +03:00
John Preston
54dd05c556 Improve crash debug information. 2018-01-03 11:23:34 +03:00
John Preston
6b25160e3f Don't paint QPixmap-s in theme preview icons. 2018-01-02 22:23:54 +03:00
John Preston
0ef3e19bc2 Use QImage instead of QPixmap for theme preview.
Working with QPixmap from non-main thread is not defined.
2018-01-02 22:10:49 +03:00
John Preston
e89350d4b7 Reuse resample code from FFMpegLoader for video.
AbstractAudioFFMpegLoader used in FFMpegLoader and ChildFFMpegLoader.
2018-01-02 20:22:13 +03:00
John Preston
95399bef2b Improve swresample library usage.
It looks like different AVFrame-s can have different audio encoding
parameters, so now we setup/re-setup swr context using parameters
from current audio frame. Hopefully it will fix some audio crashes.
2018-01-02 19:18:53 +03:00
John Preston
06c724df01 Clear callbacks async in MTP::Instance.
Also fix previous build.
2018-01-02 16:44:12 +03:00
John Preston
3325106837 Add some debug information for crashes. 2018-01-01 23:23:18 +03:00
John Preston
9c72470c17 Fix possible crash in player closing. 2018-01-01 22:12:38 +03:00
John Preston
94cf307ae0 Alpha version 1.2.7.
- Use fast reply button in group chats.
- Select a message you want to reply to
by pressing Ctrl+Up and Ctrl+Down.
2017-12-31 17:55:09 +03:00
John Preston
2cc1fde5e4 Remove thumb glitch when uploading files. 2017-12-31 15:21:08 +03:00
John Preston
6796ac688a Apply web page media updates. 2017-12-31 12:55:08 +03:00
John Preston
9551cfaf9b Use more specific color keys for media overview parts.
File icons and radial animations should use derived keys instead of msgInBg.
Fixes #4246.
2017-12-31 01:28:25 +03:00
John Preston
8ef9ec0567 Fix glitches for transparent album preview parts. 2017-12-31 01:28:21 +03:00
John Preston
af552fb4c0 Replace base/task_queue with crl. 2017-12-31 00:28:38 +03:00
John Preston
ae7e5be5cd Add fast reply button in groups. 2017-12-30 21:54:15 +03:00
Matthew Tran
74b126f309 Add reply shortcut 2017-12-30 21:52:30 +03:00
John Preston
26e023058c Version 1.2.6.
- Grouped Photos. Group media into an album when sharing multiple photos and videos.
Choose the exact order of media you send.
2017-12-30 13:13:48 +03:00
John Preston
6236590ca4 Fix SendFilesWay radiobuttons when adding media.
Also add /LTCG flag for static libraries Release builds on Windows.
2017-12-30 00:06:43 +03:00
John Preston
ea51f976f2 Alpha version 1.2.5: Workaround GCC 7.2 ICE. 2017-12-29 21:47:49 +03:00
John Preston
719f3428ec Alpha version 1.2.5:
- When viewing a photo from an album, you'll see other pictures
from the same group as thumbnails in the lower part of the screen.
- When composing an album paste additional media from the clipboard.
- Bug fixes and other minor improvements.
2017-12-29 21:21:57 +03:00
John Preston
2df4d19474 Move changelogs from ApiWrap to a separate module. 2017-12-29 21:17:07 +03:00
John Preston
2a409e3734 Add files from clipboard to composed album.
Fixes #4243.
2017-12-29 20:02:23 +03:00
John Preston
0171a4e874 Handle click on group thumb item in MediaView. 2017-12-29 17:58:53 +03:00
John Preston
59e5ffe743 Don't insert mime text in field for url list.
Fixes #4241.
2017-12-29 17:58:32 +03:00
John Preston
2bcbb5a5be Display group / userpic thumbnails in MediaView. 2017-12-29 16:44:36 +03:00
John Preston
5b4694a4eb Move text options constant to a separate module.
Also start MediaView group thumbs code.
2017-12-28 16:06:06 +03:00
John Preston
54d6673d0b Display photos and videos together in MediaView. 2017-12-28 13:12:07 +03:00
John Preston
e07a7a4b4c Improve phrases. No Restricted Users in channels info. 2017-12-27 22:44:04 +03:00
John Preston
f2d11e7432 Fix video grouped thumb on Retina displays. 2017-12-27 22:16:26 +03:00
John Preston
1a115cc7e5 Fix file upload progress display.
Regression was introduced in 5d18d7c813.
2017-12-27 21:57:37 +03:00
John Preston
a00941f7ce Update crl and libtgvoip submodules. 2017-12-27 21:49:08 +03:00
John Preston
634d21e486 Fix animation in album reordering. 2017-12-27 14:00:32 +03:00
John Preston
95d8742e3c Fix round corners on Retina displays. 2017-12-27 13:08:18 +03:00
John Preston
bd8dee0972 Fix crash in audio player hiding. 2017-12-27 10:18:09 +03:00
John Preston
b34099f49e Alpha version 1.2.4: Fix phrases and box cursor. 2017-12-26 20:49:04 +03:00
John Preston
0380e66c30 Alpha version 1.2.4: Fix build for old OS X versions. 2017-12-26 19:53:51 +03:00
John Preston
907b6f0a78 Alpha version 1.2.4.
- Group media into an album when sharing multiple photos and videos.
- Bug fixes and other minor improvements.
2017-12-26 19:20:08 +03:00
John Preston
21f4bbbe7b Update kicked count in Channel Info box. 2017-12-26 19:20:08 +03:00
John Preston
69d9072ff0 Allow fast admin removing in supergroups/channels. 2017-12-26 19:20:08 +03:00
John Preston
d5ae9bcba2 Close box when showing a layer section from it. 2017-12-26 19:20:08 +03:00
John Preston
86c0dfb295 Read "participants_count" field from c_channel(). 2017-12-26 19:20:08 +03:00
John Preston
01821c30e5 Fix message field focus loss in Saved Messages. 2017-12-26 19:20:08 +03:00
John Preston
7f66e0fdfe Hide remove member button for supegroup admins. 2017-12-26 19:20:08 +03:00
John Preston
2569df9e5a Rename some Ui methods.
myEnsureResized -> Ui::SendPendingMoveResizeEvents.
myGrab -> Ui::GrabWidget.
myGrabImage -> Ui::GrabWidgetToImage.
2017-12-26 19:20:08 +03:00
John Preston
5f8143e6a4 Fix build in Xcode. 2017-12-26 19:20:08 +03:00
John Preston
1fc7dabd3e Allow media reordering when sending an album. 2017-12-26 19:20:08 +03:00
John Preston
5d18d7c813 Send album after cancel of some media uploads.
Also display checks when part of the album medias are uploaded.
2017-12-26 19:20:07 +03:00
John Preston
4e8f5541af Fix caption editing in grouped media. 2017-12-26 19:20:07 +03:00
John Preston
a8ac18e4fd Save send way (album, photos, files) to settings. 2017-12-26 19:20:07 +03:00
John Preston
a6c15217c0 Fix grouped layout algorithm to match other apps. 2017-12-26 19:20:07 +03:00
John Preston
57351dd42a Remove QTextLayout that appears to be not needed. 2017-12-26 19:20:07 +03:00
John Preston
58d21ff916 Add album support to SendFilesBox. 2017-12-26 19:20:07 +03:00
John Preston
8e45b09083 Use different indentation for rpl operators.
It works better with Visual Studio IDE.
2017-12-26 19:20:07 +03:00
John Preston
44014e62ba Move EditCaptionBox to a separate module. 2017-12-26 19:20:06 +03:00
John Preston
ff65daa9fe Remove special case in SendFilesBox for an image. 2017-12-26 19:20:06 +03:00
John Preston
ec515080b5 Improve saved messages search results display. 2017-12-26 19:20:06 +03:00
John Preston
255dbf9405 Fix indexing of shared media.
Add new messages to shared media index even if !loadedAtBottom().
2017-12-26 19:20:06 +03:00
John Preston
aebb40dc1e Fix volume control disappearing in audio player. 2017-12-26 19:20:06 +03:00
John Preston
b20c2b4774 Always allow group admins to edit invite link.
Show Group Info even if supergroup admin can't edit information.
2017-12-26 19:20:06 +03:00
John Preston
3b3a705a67 First working code for sending albums. 2017-12-26 19:20:06 +03:00
Friedrich von Never
711aa51046 Fix handling of dashes in the style directory path
Now Telegram Desktop could be built if a path to the source directory
contains dashes.
2017-12-26 19:16:11 +03:00
John Preston
4d54cf1370 Update crl submodule. 2017-12-19 10:33:47 +04:00
John Preston
e023092744 Use RectPart(s) instead of ImageRoundCorner(s). 2017-12-18 21:54:11 +04:00
John Preston
2e421e8aed Allow unicode quotes as markdown entry separators.
Fixes #3867.
2017-12-18 21:06:44 +04:00
John Preston
afe9d38c48 Don't ruin links by markdown parsing.
Fixes #3851.
2017-12-18 20:49:40 +04:00
John Preston
3f751bfbb0 Activate window on dropEvent. 2017-12-18 20:25:24 +04:00
John Preston
b1f33890d6 Workaround GCC segmentation fault. 2017-12-18 19:52:58 +04:00
John Preston
92333e982c Move message components to history_item_components.
Also fix channel signatures rendering.
2017-12-18 19:52:36 +04:00
John Preston
16ca2d39c5 Fix _height value in inline bot result Gif layout.
This fixes render glitches in GIFs column with opened MediaView.
2017-12-18 18:10:24 +04:00
John Preston
977dee3599 Fix fast sharing from channels.
Grouped flag is only allowed for grouped media in forward requests.

Fixes #4198.
2017-12-18 17:29:48 +04:00
John Preston
546766fb13 Update FullMsgId context in HistoryMedia links. 2017-12-18 17:13:41 +04:00
John Preston
ddf4a36bdc Remove mtproto/session.h from precompiled header. 2017-12-18 16:40:15 +04:00
John Preston
fa3a76b3d8 Fix layout bug in grouped media rendering.
Also remove st::mediaPadding.
2017-12-18 15:40:43 +04:00
John Preston
d5de064019 Shuffle code around a bit.
Crash reports point to addToUnreadMentions() call being corrupted.
New reports could show is it responsible or setLastMessage() call.
2017-12-18 15:17:58 +04:00
John Preston
37b018257e Replace some std::shared_ptr with std::unique_ptr. 2017-12-18 14:38:14 +04:00
John Preston
14034c255e Replace QSharedPointer with std::shared_ptr. 2017-12-18 13:07:18 +04:00
John Preston
cbbccd0364 Hide history visibility edit for public groups. 2017-12-18 10:18:51 +04:00
John Preston
b8204a317d Testing crl (concurrency runtime library). 2017-12-17 23:05:00 +04:00
John Preston
499e3113b9 Allow HistoryGroupedMedia cloning.
We use it for local forwarded message creation, it should be main().
2017-12-17 17:01:34 +04:00
John Preston
656e4869e6 Move UnreadBadge to ui/unread_badge. 2017-12-17 15:04:47 +04:00
John Preston
defec611e3 Alpha version 1.2.3.
- Several crash fixes.
2017-12-17 12:41:35 +04:00
John Preston
49def354bd Fix bug causing crash in group recounting. 2017-12-17 12:33:08 +04:00
John Preston
712b3f481c Move online phrase code from app module.
Also fix possible assertion violation in online change timeout.
2017-12-17 12:13:26 +04:00
John Preston
b3a723c871 Fix crash in message history context menu.
Regression was introduced in 6d48ca850e.
2017-12-17 11:25:02 +04:00
John Preston
de16a66a4a Alpha version 1.2.2: Fix build for Xcode. 2017-12-16 21:09:37 +04:00
John Preston
b0f191515a Alpha version 1.2.2.
- Grouped photos and videos are displayed as albums.
2017-12-16 20:52:41 +04:00
John Preston
89ccaccb88 Display right edited badge in group with caption. 2017-12-16 20:50:43 +04:00
John Preston
1f070da202 Recount grouping after leader caption edit. 2017-12-16 20:50:43 +04:00
John Preston
963e969d2a Fix selected messages copy with grouping. 2017-12-16 20:50:43 +04:00
John Preston
4734700ac5 Improve opening history with one loaded message.
When we add just one last item, like we do while loading dialogs,
we want to remove a single added grouped media, otherwise it will
jump once we open the message history (first we show only that
media, then we load the rest of the group and show the group).

That way when we open the message history we show nothing until a
whole history part is loaded, it certainly will contain the group.
2017-12-16 20:50:43 +04:00
John Preston
d9da2edd7c Improve grouped media display. 2017-12-16 20:50:43 +04:00
John Preston
6d48ca850e Correct reply/forward/delete for grouped items. 2017-12-16 20:50:43 +04:00
John Preston
3e7ac7eb26 Use first media caption for group caption. 2017-12-16 20:50:43 +04:00
John Preston
520a644150 Fix drag by date of grouped media. 2017-12-16 20:50:43 +04:00
John Preston
3a56b7cabd Forward grouped items. Fast share grouped items. 2017-12-16 20:50:43 +04:00
John Preston
efa72578cd Fix grouped media display in MediaView. 2017-12-16 20:50:43 +04:00
John Preston
b6087ce7ce Select/forward/delete group of messages. 2017-12-16 20:50:42 +04:00
John Preston
537400d8b2 Enable distinct selecting of grouped media. 2017-12-16 20:50:42 +04:00
John Preston
4c9931ab02 Support grouped media rendering. 2017-12-16 20:50:42 +04:00
John Preston
0a4038d061 Fix build with TDESKTOP_DISABLE_CRASH_REPORTS.
Regression was introduced in 97c15865a5.

Fixes #4173.
2017-12-13 00:25:14 +04:00
Christoph
2d5188b968 Remove wrong alpha version
Fix #4171
2017-12-12 21:43:01 +04:00
John Preston
4bab7583ba Version 1.2.1.
- Bug fixes and other minor improvements.
2017-12-12 18:56:38 +04:00
John Preston
b2f29b674d Send audio files with correct attributes.
Regression was introduced in 8b69e6ab99.

Fixes #4163.
2017-12-12 18:56:38 +04:00
John Preston
574f4a73cb Add some checks to video sound stream decoding. 2017-12-12 18:56:37 +04:00
John Preston
05e3ddce0c Fix userpic removing.
Regression was introduced in 68009b6fba.

Fixes #4152.
2017-12-12 18:56:37 +04:00
John Preston
3c101b0a50 Remove limit on chats list width.
Fixes #4146.
2017-12-12 18:56:37 +04:00
John Preston
e998bd0b3f Parse command line natively on Windows.
Use CommandLineToArgvW() so that unicode arguments are preserved.
This will fix path arguments with unicode symbols in them.
2017-12-12 18:56:37 +04:00
John Preston
251176df47 Move relaunch / update logic to Core::Launcher.
Also pass "-workdir" argument through relaunch / update.

Fixes #4149.
2017-12-12 18:56:36 +04:00
John Preston
97c15865a5 Move some code around.
Move logs:SignalHandlers to core/crash_reports:CrashReports.
Move all pre-launch windows to core/crash_report_window module.
Move some global code to core/launcher:Launcher.
It should replace settings / platform_specific module in some way.
2017-12-12 16:47:32 +04:00
John Preston
9d4558de2b Fix build in Visual Studio 15.5.1.
Looks like compiler had some regressions when updating from 15.4.5.

Range-V3-VS2015 also needs to cherry-pick this commit:
https://github.com/ericniebler/range-v3/commit/9f990c48d0
See https://github.com/Microsoft/Range-V3-VS2015/issues/26
2017-12-12 12:25:54 +04:00
John Preston
38f7f48c17 Open links in AboutBox without confirmation.
Fixes #4148.
2017-12-12 12:25:54 +04:00
John Preston
9534121676 Fix issue number :/ Fixes #4150. 2017-12-11 15:19:13 +04:00
John Preston
10b76d921b Fix window scaling issue on macOS.
Fixes #4149.
2017-12-11 15:06:05 +04:00
John Preston
8af058edc9 Version 1.2.0.
- Radically improved navigation. New side panel on the right
with quick access to shared media and group members.
- Saved Messages. Bookmark messages by forwarding them to "Saved
Messages". Access them from the Chats list or from the side menu.
- Pinned Messages. If you are a channel admin, pin messages to
focus your subscribers' attention on important announcements.
- Easily recognize messages from group admins by the new admin badge.
- Also supported clearing history in supergroups and
added a host of minor improvements.
2017-12-10 22:32:08 +04:00
John Preston
8b69e6ab99 Rename some methods in DocumentData.
Also fix voice message mark as read when autoplaying after previous.
Also show play icon and don't show playlist for audio files that do
not have shared music files attributes but have audio file mime type.
2017-12-10 14:28:04 +04:00
John Preston
4ef3de5287 Always specify seek position in TimeMs.
This way it won't rely on the sample rate of the audio file.

Fixes #4139.
2017-12-10 12:52:38 +04:00
John Preston
9fff2bf4c7 Fix one more crash in HistoryWidget. 2017-12-10 00:32:35 +04:00
John Preston
534058fe9b Alpha version 1.1.29. 2017-12-09 22:21:38 +04:00
John Preston
6d62673e9e Fix crash in HistoryWidget. 2017-12-09 22:21:38 +04:00
John Preston
677dbd5d6e Alpha version 1.1.28: Fix build for Xcode. 2017-12-09 20:01:40 +04:00
John Preston
452440f50b Alpha version 1.1.28.
- Bug fixes and other minor improvements.
2017-12-09 19:17:23 +04:00
John Preston
5a7d8bcffb Add audio playlist using Info::Media::ListWidget. 2017-12-09 19:13:06 +04:00
John Preston
63e89ddc9a Fix replies by stickers and inline bot results. 2017-12-09 16:39:41 +04:00
John Preston
4e2c8bbc26 Use SharedMediaMergedViewer() for audio player.
That way audio files and voice/video messages will play in context
(one after another with ability to go to next or previous in player)
almost always, no matter at what part of message history we are.
2017-12-09 14:02:51 +04:00
John Preston
9bbcbd4bb3 Remove all legacy media overview code. 2017-12-08 22:34:26 +04:00
John Preston
273ac5eaf1 Add some more public keys. 2017-12-08 20:26:27 +04:00
John Preston
951db83ab6 Index bad audio files to Shared Files Overview.
Fixes #4120.
2017-12-08 19:53:04 +04:00
chaplin89
a868c7bc8b Avoid generating multiple time the forward declarations in the headers generated by codegen_style. 2017-12-08 19:49:24 +04:00
John Preston
a403ad7d37 Always pass all users to add group member box. 2017-12-08 18:25:29 +04:00
John Preston
90f5f7dded Fix possible crash in timer timeout values. 2017-12-08 18:15:00 +04:00
John Preston
aef88559e8 Fix possible crash in HistoryWidget.
Stack in crash reports leads to something like that:
- HistoryWidget::showHistory
- _scroll->setOwnedWidget
- Ui::ScrollArea::onScrolled
- sendSynteticMouseEvent
- Info::Media::ListWidget::enterEventHook
- Info::Media::ListWidget::mouseAction?Update
- Overview::Layout::ItemBase::clickHandlerActiveChanged
- AuthSessionData::requestItemRepaint
- HistoryWidget::repaintHistoryItem

Workaround:
- Don't accept repaint item requests while _list is not set yet.
2017-12-08 17:54:55 +04:00
John Preston
6295d85ef2 Fix possible assertion violation in PeerListBox.
Very long stack in crash reports leads to something like that:
- PeerListBox::prepare
- PeerListBox::createMultiSelect
- PeerListBox::updateScrollSkips
- BoxContent::setInnerTopSkip
- _scroll->scrollToY
- sendSynteticMouseEvent
- ChatHelpers::TabbedPanel::showAnimated
- QWidget::render
- QWidgetPrivate::sendPendingMoveAndResizeEvents
- PeerListBox::resizeEvent
- _select->resizeToWidth(0)
- MultiSelect::Inner::computeItemsGeometry(0)

Workaround:
- Don't scrollToY if PeerListBox width was not yet set.
- Initial _scrollBottomFixed is false (at first createMultiSelect).
2017-12-08 17:36:17 +04:00
John Preston
a27ea2d631 Fix possible crash in mtpFileLoader.
If several cdn file parts hashes are received in getCdnFileHashesDone
and some middle one of them cancels the entire loader (for example
because of a file write error) a !_finished assert violation happens.
2017-12-08 17:13:13 +04:00
John Preston
de8de84a33 Fix possible crash in CalendarBox.
If month change notification was posted async there was a possibility
to get a mousePressEvent() with already new Context field values, but
with old _selected value. Those two could be inconsistent leading to
an assert violation in (_selected + _context->daysShift() >= 0).
2017-12-08 16:44:52 +04:00
John Preston
80bb6b65a7 Fix possible crash. 2017-12-08 15:53:28 +04:00
John Preston
f8963d7e4b Read silent flag from PeerData, not SilentToggle. 2017-12-08 15:52:12 +04:00
John Preston
c79d16a0d6 Auto-choose first search row in PeerListBox. 2017-12-08 13:30:30 +04:00
John Preston
aa16bcd604 Add a special key for saved messages userpic bg. 2017-12-08 13:23:55 +04:00
John Preston
935232eaa2 Don't use AEC on modern macOS. 2017-12-08 13:13:05 +04:00
John Preston
e273695cc9 Fix planar audio playback (for example .flac).
Also add some more crash information logging.

Fixes #4120.
2017-12-08 12:57:43 +04:00
John Preston
827784e3b2 Focus search field in Info layer. 2017-12-08 12:22:02 +04:00
John Preston
b501af0b8f Add search button to info members header. 2017-12-08 12:14:30 +04:00
John Preston
8f87cfe29d Fix explicit working dir by "-workdir" in Windows.
Regression was introduced in ff84962148.

Fixes #4129.
2017-12-08 12:13:42 +04:00
John Preston
79398fe6cf Add call button to Info::Profile top bar. 2017-12-07 19:17:53 +04:00
John Preston
355747d7bf Remove send actions in Saved Messages.
Fixes #4122.
2017-12-07 18:27:59 +04:00
John Preston
a032f24d58 Fix explicit working dir by "-workdir" argument.
Regression was introduced in ff84962148.

Fixes #4123.
2017-12-07 17:56:36 +04:00
John Preston
320105f201 Allow searching for '@' in the chats filter field.
Fixes #4121.
2017-12-07 17:43:06 +04:00
John Preston
54984efa0a Fix small files layout in Saved Messages.
Minimal message and media width are less because of the goto-button.
2017-12-07 17:43:05 +04:00
John Preston
d57f5460b7 Use ShowForwardMessageBox in Info::Media. 2017-12-07 17:43:05 +04:00
John Preston
5bc47e5203 Move shareContact and readServerHistory to ApiWrap.
Also allow non-confirming contact info sharing to Saved Messages.
2017-12-07 17:43:05 +04:00
John Preston
f0a03223e8 Share contact instantly to Saved Messages. 2017-12-07 12:56:10 +04:00
John Preston
007ab3b7b8 Fix crash in RSA public key wrapper. 2017-12-07 09:34:11 +04:00
Nicholas Guriev
f813bb704f Optimize key initialization
* Do not do redundant copying of numbers.
2017-12-07 09:15:10 +04:00
Nicholas Guriev
93809ec404 Fix build against OpenSSL 1.1
Closes: #3196
2017-12-07 09:15:10 +04:00
Mike Zueff
64e9958585 Fixed awesome WM tray icon. 2017-12-07 09:11:39 +04:00
John Preston
067138f1bf Alpha version 1.1.27: Update lang phrases. 2017-12-06 20:00:31 +04:00
John Preston
cfa88b840a Alpha 1.1.27: Fix build error. 2017-12-06 20:00:31 +04:00
John Preston
32f955404b Alpha version 1.1.27.
- Bookmark messages by forwarding them to "Saved Messages".
Access them from the Chats list or from the side menu.
2017-12-06 19:30:51 +04:00
John Preston
ff84962148 Stop using current working directory on Windows.
Links generated by system sometimes have weird working directories,
like C:\Windows\system32. Stop trying to use current working folder
as a place for program data. Instead always try to use current exe
folder and if we were unable use app data folder.
2017-12-06 19:07:19 +04:00
John Preston
727f8aec13 Fix admin/creator status in megagroup members list. 2017-12-06 18:55:10 +04:00
John Preston
d77afef8b0 Hide Share contact button in saved messages. 2017-12-06 18:41:37 +04:00
John Preston
775cede16f Use separate phrases for clearing saved messages. 2017-12-06 18:39:27 +04:00
John Preston
c6d3fd883a Display right action button not too high. 2017-12-06 18:15:41 +04:00
John Preston
1473c14668 Forward messages to Saved Messages instantly. 2017-12-06 17:56:40 +04:00
John Preston
6764a3cc86 Replace SelectedItemSet with MessageIdsList.
Use vector<FullMsgId> everywhere instead QMap<..,HistoryItem*>.
The old way the app crashed in case some messages were deleted.
If the items are needed use HistoryItemsList=vector<HistoryItem*>.
2017-12-06 14:13:38 +04:00
John Preston
3845985a6b Fix third column appearing on window resize. 2017-12-06 11:05:34 +04:00
John Preston
76a716007c Closed beta 1.1.26.2. 2017-12-05 20:49:45 +04:00
John Preston
993877b0d4 Change main menu cloud icon to saved messages. 2017-12-05 20:48:03 +04:00
John Preston
8b3d203861 Display saved messages senders correctly. 2017-12-05 20:38:13 +04:00
John Preston
85d8273009 Implement correct saved messages history layout.
Forwarded info is displayed as a message author info (name/photo).
Outgoing messages without forwarded info are displayed as out().
Messages with save_from_ info have a button for GoToOriginal().
2017-12-05 20:14:28 +04:00
John Preston
f8e094392f Fix ripple animation glitch in history top bar. 2017-12-05 20:14:15 +04:00
John Preston
46bafc2dcc Support Saved messages in chats list and forwards. 2017-12-05 18:07:01 +04:00
John Preston
e4ce08e64e Show other shared media links in Saved Photos. 2017-12-05 16:23:08 +04:00
John Preston
aebdc2fd94 Add custom userpic rendering for Saved Messages. 2017-12-05 15:50:32 +04:00
John Preston
1d85c8a6b6 API scheme updated to layer 73. 2017-12-05 12:44:27 +04:00
John Preston
5eeb8143b6 Move EmptyUserpic from data_peer to empty_userpic. 2017-12-05 12:44:27 +04:00
John Preston
68009b6fba Refactor userpic storage and access in PeerData. 2017-12-05 11:58:18 +04:00
John Preston
62568daffe Refactor NotifySettings in PeerData. 2017-12-04 21:48:45 +04:00
John Preston
116e3fd9c5 Fix admin stars disappearing in members list. 2017-12-04 16:08:43 +04:00
John Preston
76f951e3e6 Show members list in the third column. 2017-12-04 15:45:15 +04:00
John Preston
1a273702d3 Revert closed beta version. 2017-12-04 13:52:22 +04:00
John Preston
4678de0440 Closed beta 1.1.26.1. 2017-12-04 13:51:44 +04:00
John Preston
e1c68892d4 Show third column only when explicitly requested.
This allows you to show info in layer from mention links.
2017-12-04 13:42:05 +04:00
John Preston
629c216a7f Fix storage size variables, use qint64.
Fixes #4110.
2017-12-03 20:51:31 +04:00
John Preston
f3c8da4819 Request all admins when first opening a supergroup. 2017-12-03 20:43:42 +04:00
John Preston
9ba482f56f Fix crash in edit group info box. 2017-12-03 19:24:33 +04:00
960 changed files with 59591 additions and 41492 deletions

3
.gitmodules vendored
View File

@@ -10,3 +10,6 @@
[submodule "Telegram/ThirdParty/Catch"]
path = Telegram/ThirdParty/Catch
url = https://github.com/philsquared/Catch
[submodule "Telegram/ThirdParty/crl"]
path = Telegram/ThirdParty/crl
url = https://github.com/telegramdesktop/crl.git

View File

@@ -486,6 +486,9 @@ buildOpenAL() {
-D CMAKE_INSTALL_PREFIX=$OPENAL_PATH \
-D CMAKE_BUILD_TYPE=Release \
-D LIBTYPE=STATIC \
-D ALSOFT_EXAMPLES=OFF \
-D ALSOFT_TESTS=OFF \
-D ALSOFT_UTILS=OFF \
..
make $MAKE_ARGS
sudo make install
@@ -608,7 +611,7 @@ buildCustomQt() {
./configure -prefix $QT_PATH -release -opensource -confirm-license -qt-zlib \
-qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \
-qt-xkbcommon-x11 -no-opengl -no-gtkstyle -static \
-nomake examples -nomake tests \
-nomake examples -nomake tests -no-mirclient \
-dbus-runtime -no-gstreamer -no-mtdev # <- Not sure about these
make $MAKE_ARGS
sudo make install

View File

@@ -1,6 +1,7 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
Copyright (c) 2014-2018 John Preston, https://desktop.telegram.org
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
@@ -15,19 +16,6 @@ GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
More information about the Telegram project: https://telegram.org
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#pragma once
enum DragState {
DragStateNone = 0x00,
DragStateFiles = 0x01,
DragStatePhotoFiles = 0x02,
DragStateImage = 0x03,
};
enum class ReadServerHistoryChecks {
OnlyIfUnread,
ForceRequest,
};

View File

@@ -4,6 +4,7 @@ version 3 with the addition of the following special exception:
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the OpenSSL
library.
You must obey the GNU General Public License in all respects for all of
the code used other than OpenSSL. If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),

View File

@@ -0,0 +1,107 @@
diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc
index 436ac5ad..8e14fb9c 100644
--- a/client/capture_context_mac_test.cc
+++ b/client/capture_context_mac_test.cc
@@ -34,11 +34,11 @@ namespace {
// gtest assertions.
void SanityCheckContext(const NativeCPUContext& context) {
#if defined(ARCH_CPU_X86)
- ASSERT_EQ(x86_THREAD_STATE32, context.tsh.flavor);
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT), implicit_cast<uint32_t>(context.tsh.count));
#elif defined(ARCH_CPU_X86_64)
- ASSERT_EQ(x86_THREAD_STATE64, context.tsh.flavor);
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT), implicit_cast<uint32_t>(context.tsh.count));
#endif
#if defined(ARCH_CPU_X86_FAMILY)
diff --git a/client/simulate_crash_mac.cc b/client/simulate_crash_mac.cc
index 7e279015..27864388 100644
--- a/client/simulate_crash_mac.cc
+++ b/client/simulate_crash_mac.cc
@@ -177,12 +177,12 @@ bool DeliverException(thread_t thread,
void SimulateCrash(const NativeCPUContext& cpu_context) {
#if defined(ARCH_CPU_X86)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32));
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
x86_THREAD_STATE32_COUNT);
#elif defined(ARCH_CPU_X86_64)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64));
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
x86_THREAD_STATE64_COUNT);
diff --git a/client/simulate_crash_mac_test.cc b/client/simulate_crash_mac_test.cc
index 87c5f845..ca813e4c 100644
--- a/client/simulate_crash_mac_test.cc
+++ b/client/simulate_crash_mac_test.cc
@@ -130,12 +130,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_thread_state*>(old_state);
switch (state->tsh.flavor) {
case x86_THREAD_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->tsh.count));
break;
case x86_THREAD_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->tsh.count));
break;
default:
ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor;
@@ -149,12 +149,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_float_state*>(old_state);
switch (state->fsh.flavor) {
case x86_FLOAT_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE32_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->fsh.count));
break;
case x86_FLOAT_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE64_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->fsh.count));
break;
default:
ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor;
@@ -168,12 +168,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_debug_state*>(old_state);
switch (state->dsh.flavor) {
case x86_DEBUG_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE32_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->dsh.count));
break;
case x86_DEBUG_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE64_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->dsh.count));
break;
default:
ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor;
diff --git a/crashpad.gyp b/crashpad.gyp
index 42fe0a26..d8af1bf1 100644
--- a/crashpad.gyp
+++ b/crashpad.gyp
@@ -25,7 +25,7 @@
'minidump/minidump.gyp:*',
'minidump/minidump_test.gyp:*',
'snapshot/snapshot.gyp:*',
- 'snapshot/snapshot_test.gyp:*',
+# 'snapshot/snapshot_test.gyp:*',
'test/test.gyp:*',
'test/test_test.gyp:*',
'tools/tools.gyp:*',

View File

@@ -1,5 +1,5 @@
diff --git a/build/crashpad.gypi b/build/crashpad.gypi
index 027c7b6..4bfdfb5 100644
index 027c7b68..4bfdfb5a 100644
--- a/build/crashpad.gypi
+++ b/build/crashpad.gypi
@@ -25,5 +25,15 @@
@@ -18,3 +18,110 @@ index 027c7b6..4bfdfb5 100644
+ ],
},
}
diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc
index 436ac5ad..8e14fb9c 100644
--- a/client/capture_context_mac_test.cc
+++ b/client/capture_context_mac_test.cc
@@ -34,11 +34,11 @@ namespace {
// gtest assertions.
void SanityCheckContext(const NativeCPUContext& context) {
#if defined(ARCH_CPU_X86)
- ASSERT_EQ(x86_THREAD_STATE32, context.tsh.flavor);
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT), implicit_cast<uint32_t>(context.tsh.count));
#elif defined(ARCH_CPU_X86_64)
- ASSERT_EQ(x86_THREAD_STATE64, context.tsh.flavor);
- ASSERT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64), implicit_cast<thread_state_flavor_t>(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT), implicit_cast<uint32_t>(context.tsh.count));
#endif
#if defined(ARCH_CPU_X86_FAMILY)
diff --git a/client/simulate_crash_mac.cc b/client/simulate_crash_mac.cc
index 7e279015..27864388 100644
--- a/client/simulate_crash_mac.cc
+++ b/client/simulate_crash_mac.cc
@@ -177,12 +177,12 @@ bool DeliverException(thread_t thread,
void SimulateCrash(const NativeCPUContext& cpu_context) {
#if defined(ARCH_CPU_X86)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32));
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
x86_THREAD_STATE32_COUNT);
#elif defined(ARCH_CPU_X86_64)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast<thread_state_flavor_t>(cpu_context.tsh.flavor),
implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64));
DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context.tsh.count),
x86_THREAD_STATE64_COUNT);
diff --git a/client/simulate_crash_mac_test.cc b/client/simulate_crash_mac_test.cc
index 87c5f845..ca813e4c 100644
--- a/client/simulate_crash_mac_test.cc
+++ b/client/simulate_crash_mac_test.cc
@@ -130,12 +130,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_thread_state*>(old_state);
switch (state->tsh.flavor) {
case x86_THREAD_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE32_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->tsh.count));
break;
case x86_THREAD_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_THREAD_STATE64_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_THREAD_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->tsh.count));
break;
default:
ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor;
@@ -149,12 +149,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_float_state*>(old_state);
switch (state->fsh.flavor) {
case x86_FLOAT_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE32_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->fsh.count));
break;
case x86_FLOAT_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_FLOAT_STATE64_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_FLOAT_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->fsh.count));
break;
default:
ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor;
@@ -168,12 +168,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast<const x86_debug_state*>(old_state);
switch (state->dsh.flavor) {
case x86_DEBUG_STATE32:
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE32_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE32_COUNT),
+ implicit_cast<uint32_t>(state->dsh.count));
break;
case x86_DEBUG_STATE64:
- EXPECT_EQ(implicit_cast<int>(x86_DEBUG_STATE64_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast<uint32_t>(x86_DEBUG_STATE64_COUNT),
+ implicit_cast<uint32_t>(state->dsh.count));
break;
default:
ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor;
diff --git a/crashpad.gyp b/crashpad.gyp
index 42fe0a26..d8af1bf1 100644
--- a/crashpad.gyp
+++ b/crashpad.gyp
@@ -25,7 +25,7 @@
'minidump/minidump.gyp:*',
'minidump/minidump_test.gyp:*',
'snapshot/snapshot.gyp:*',
- 'snapshot/snapshot_test.gyp:*',
+# 'snapshot/snapshot_test.gyp:*',
'test/test.gyp:*',
'test/test_test.gyp:*',
'tools/tools.gyp:*',

View File

@@ -1,5 +1,5 @@
diff --git a/configure b/configure
index cb8d78f..cadb3f0 100755
index cb8d78fd3c..cadb3f0a88 100755
--- a/configure
+++ b/configure
@@ -511,7 +511,8 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then
@@ -13,7 +13,7 @@ index cb8d78f..cadb3f0 100755
echo " Xcode not set up properly. You may need to confirm the license" >&2
echo " agreement by running /usr/bin/xcodebuild without arguments." >&2
diff --git a/mkspecs/common/g++-macx.conf b/mkspecs/common/g++-macx.conf
index 086510d..c485967 100644
index 086510dd96..c485967863 100644
--- a/mkspecs/common/g++-macx.conf
+++ b/mkspecs/common/g++-macx.conf
@@ -14,7 +14,13 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2
@@ -32,7 +32,7 @@ index 086510d..c485967 100644
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvmgcc42
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index 0cc8cd6..ca9725b 100644
index 0cc8cd6dfd..ca9725b779 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -12,7 +12,9 @@ isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
@@ -47,7 +47,7 @@ index 0cc8cd6..ca9725b 100644
}
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index bb79a13..5d595bc 100644
index bb79a139b3..5d595bc3b3 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -220,6 +220,10 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
@@ -74,7 +74,7 @@ index bb79a13..5d595bc 100644
if (ncols > 0) { // read color table
uchar rgb[4];
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
index ebff950..4300ca4 100644
index ebff9509ab..4300ca4c0f 100644
--- a/src/gui/painting/qpaintengine_p.h
+++ b/src/gui/painting/qpaintengine_p.h
@@ -87,8 +87,18 @@ public:
@@ -98,7 +98,7 @@ index ebff950..4300ca4 100644
// Make sure we're inside the viewport.
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 4879ae5..56cdcba 100644
index 4879ae51d7..56cdcbaf01 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -654,6 +654,9 @@ int QTextLayout::nextCursorPosition(int oldPos, CursorMode mode) const
@@ -175,7 +175,7 @@ index 4879ae5..56cdcba 100644
inline void resetRightBearing()
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index cbe42c3..b273db7 100644
index cbe42c3844..b273db7e78 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -194,6 +194,9 @@ private:
@@ -189,7 +189,7 @@ index cbe42c3..b273db7 100644
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index ca7afb7..25ae500 100644
index ca7afb7d1b..25ae50008d 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -256,6 +256,13 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
@@ -207,7 +207,7 @@ index ca7afb7..25ae500 100644
fd->weight = QFont::Normal;
fd->style = QFont::StyleNormal;
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 92358ec..694fee7 100644
index 92358ecc74..694fee7350 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -213,7 +213,8 @@ static void cleanupCocoaApplicationDelegate()
@@ -244,7 +244,7 @@ index 92358ec..694fee7 100644
- (void)appleEventQuit:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index b81b9a0..4e59e83 100644
index b81b9a0b1c..4e59e833b1 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -81,7 +81,7 @@ void QCocoaCursor::setPos(const QPoint &position)
@@ -256,8 +256,41 @@ index b81b9a0..4e59e83 100644
CGEventPost(kCGHIDEventTap, e);
CFRelease(e);
}
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 9850f83dea..218ed7e81c 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -649,9 +649,10 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
// Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev)
OSStatus err = noErr;
- require_action(inContext != NULL, InvalidContext, err = paramErr);
- require_action(inBounds != NULL, InvalidBounds, err = paramErr);
- require_action(inImage != NULL, InvalidImage, err = paramErr);
+ // Patch: Fix build on latest Xcode.
+ //require_action(inContext != NULL, InvalidContext, err = paramErr);
+ //require_action(inBounds != NULL, InvalidBounds, err = paramErr);
+ //require_action(inImage != NULL, InvalidImage, err = paramErr);
CGContextSaveGState( inContext );
CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds));
@@ -660,9 +661,11 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
CGContextDrawImage(inContext, *inBounds, inImage);
CGContextRestoreGState(inContext);
-InvalidImage:
-InvalidBounds:
-InvalidContext:
+
+// Patch: Fix build on latest Xcode.
+//InvalidImage:
+//InvalidBounds:
+//InvalidContext:
return err;
}
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 9fd05a6..dea6072 100644
index 9fd05a65ee..dea60720e7 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -402,14 +402,24 @@ void QCocoaIntegration::updateScreens()
@@ -288,7 +321,7 @@ index 9fd05a6..dea6072 100644
QCocoaScreen *QCocoaIntegration::screenAtIndex(int index)
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
index e46eaff..c62db53 100644
index e46eaff6be..c62db534a2 100644
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
@@ -382,6 +382,12 @@ bool QCocoaKeyMapper::updateKeyboard()
@@ -315,7 +348,7 @@ index e46eaff..c62db53 100644
}
return ret;
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index 83c960d..03ae969 100755
index 83c960d931..03ae9696af 100755
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
@@ -102,7 +102,10 @@ QT_USE_NAMESPACE
@@ -483,7 +516,7 @@ index 83c960d..03ae969 100755
}
@end
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 4d0458a..3357a5e 100644
index 4d0458a4aa..3357a5ef81 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -167,7 +167,8 @@ static bool isMouseEvent(NSEvent *ev)
@@ -546,7 +579,7 @@ index 4d0458a..3357a5e 100644
[iconButton setImage:image];
[image release];
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index a18ee7f..1f91feb 100644
index a18ee7ff71..1f91feb0ae 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -393,7 +393,9 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
@@ -615,7 +648,7 @@ index a18ee7f..1f91feb 100644
}
return [super performKeyEquivalent:nsevent];
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
index c680764..e2a7aaf 100644
index c68076477f..e2a7aafa58 100644
--- a/src/tools/qlalr/lalr.cpp
+++ b/src/tools/qlalr/lalr.cpp
@@ -246,11 +246,13 @@ void Grammar::buildExtendedGrammar ()
@@ -655,7 +688,7 @@ index c680764..e2a7aaf 100644
continue;
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 7396808..7178aec 100644
index 7396808442..7178aecf80 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -4722,6 +4722,17 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
@@ -708,7 +741,7 @@ index 7396808..7178aec 100644
|| (k->key() == Qt::Key_Tab && (k->modifiers() & Qt::ShiftModifier)))
res = focusNextPrevChild(false);
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 0845a5e..5735cb6 100644
index 0845a5eb02..5735cb6b39 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -3667,9 +3667,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
@@ -726,7 +759,7 @@ index 0845a5e..5735cb6 100644
}
diff --git a/src/widgets/util/qsystemtrayicon_qpa.cpp b/src/widgets/util/qsystemtrayicon_qpa.cpp
index f98aeaf..00c0734 100644
index f98aeaf678..00c0734129 100644
--- a/src/widgets/util/qsystemtrayicon_qpa.cpp
+++ b/src/widgets/util/qsystemtrayicon_qpa.cpp
@@ -99,13 +99,18 @@ void QSystemTrayIconPrivate::updateIcon_sys()
@@ -755,7 +788,7 @@ index f98aeaf..00c0734 100644
}
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 75f3059..980f2be 100644
index 75f30599be..980f2be1e9 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -1867,7 +1867,8 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
@@ -769,7 +802,7 @@ index 75f3059..980f2be 100644
#ifndef QT_NO_COMPLETER
complete(event->key());
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index 96438a0..b0b7206 100644
index 96438a0bdf..b0b7206405 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -1342,7 +1342,8 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e)

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
using "colors.palette";
@@ -196,7 +183,6 @@ outSemiboldPalette: TextPalette(outTextPalette) {
selectLinkFg: msgOutServiceFgSelected;
}
mediaPadding: margins(0px, 0px, 0px, 0px);
mediaCaptionSkip: 5px;
mediaInBubbleSkip: 5px;
mediaThumbSize: 48px;

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
// basic
@@ -316,6 +303,7 @@ historyPeer8NameFg: #ce671b; // orange group member name
historyPeer8NameFgSelected: historyPeer8NameFg; // orange group member name in a selected message
historyPeer8UserpicBg: #faa774; // orange userpic background
historyPeerUserpicFg: windowFgActive; // default userpic initials
historyPeerSavedMessagesBg: historyPeer4UserpicBg; // saved messages userpic background
// Some values are marked as (adjusted), it means they're adjusted by
// hue and saturation of the average background color if user chooses

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

View File

@@ -1,17 +1,7 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/

View File

@@ -1,17 +1,7 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/

View File

@@ -1,17 +1,7 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/

View File

@@ -1,17 +1,7 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/

View File

@@ -1,17 +1,7 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/

View File

@@ -1,25 +1,12 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
"lng_language_name" = "English";
"lng_switch_to_this" = "Switch to English";
"lng_switch_to_this" = "Continue in English";
"lng_menu_contacts" = "Contacts";
"lng_menu_calls" = "Calls";
@@ -27,7 +14,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_menu_about" = "About";
"lng_menu_update" = "Update";
"lng_menu_back" = "Back";
"lng_menu_night_mode" = "Night mode";
"lng_menu_night_mode" = "Night Mode";
"lng_disable_notifications_from_tray" = "Disable notifications";
"lng_enable_notifications_from_tray" = "Enable notifications";
@@ -125,9 +112,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_flood_error" = "Too many tries. Please try again later.";
"lng_gif_error" = "An error has occurred while reading GIF animation :(";
"lng_edit_error" = "You cannot edit this message";
"lng_join_channel_error" = "Sorry, you have joined too many channels and supergroups. Please leave some before joining.";
"lng_join_channel_error" = "Sorry, you have joined too many channels and supergroups. Please leave some before joining this one.";
"lng_error_phone_flood" = "Sorry, you have deleted and re-created your account too many times recently. Please wait for a few days before signing up again.";
"lng_error_start_minimized_passcoded" = "You have set a local passcode, so the app can't be launched minimized. App will ask you to enter the passcode before it can start working.";
"lng_error_start_minimized_passcoded" = "You have set a local passcode, so Telegram Desktop can't be launched minimised; it will ask you to enter your passcode before it can start working.";
"lng_error_pinned_max#one" = "Sorry, you can pin no more than {count} chat to the top.";
"lng_error_pinned_max#other" = "Sorry, you can pin no more than {count} chats to the top.";
"lng_error_public_groups_denied" = "Unfortunately, you were banned from participating in public groups.\n{more_info}";
@@ -137,8 +124,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_error_cant_add_admin_unban" = "Sorry, you can't add this user as an admin because they are in the blacklist and you can't unban them.";
"lng_error_cant_ban_admin" = "Sorry, you can't ban this user because they are an admin in this group and you are not allowed to demote them.";
"lng_sure_add_admin_invite" = "This user is not a member of this group. Add them to the group and promote them to admin?";
"lng_sure_add_admin_unban" = "This user is currently restricted or banned in this group. Are you sure you want to unban and promote them?";
"lng_sure_ban_admin" = "This user is an admin in this group. Are you sure you want to go ahead and restrict them?";
"lng_sure_add_admin_invite_channel" = "This user is not a subscriber of this channel. Add them to the channel and promote them to admin?";
"lng_sure_add_admin_unban" = "This user is currently restricted or banned. Are you sure you want to unban and promote them?";
"lng_sure_ban_admin" = "This user is an admin. Are you sure you want to go ahead and restrict them?";
"lng_sure_ban_user_group" = "Ban {user} in the group?";
"lng_sure_enable_socks" = "Are you sure you want to enable this proxy?\n\nServer: {server}\nPort: {port}\n\nYou can change your proxy server later in the Settings (Connection Type).";
"lng_sure_enable" = "Enable";
@@ -166,8 +154,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_photo_caption" = "Caption";
"lng_photos_comment" = "Comment";
"lng_phone_title" = "Your Phone";
"lng_phone_desc" = "Please confirm your country code and\nenter your phone number.";
"lng_phone_title" = "Your Phone Number";
"lng_phone_desc" = "Please confirm your country code and\nenter your mobile phone number.";
"lng_phone_notreg" = "If you don't have a Telegram account yet,\nplease [b]sign up[/b] with {link_start}Android / iPhone{link_end} or {signup_start}here{signup_end}";
"lng_country_code" = "Country Code";
"lng_bad_country_code" = "Invalid Country Code";
@@ -179,7 +167,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_code_desc" = "We have sent you a message with activation\ncode to your phone. Please enter it below.";
"lng_code_telegram" = "Please enter the code you've just received\nin your previous [b]Telegram[/b] app.";
"lng_code_no_telegram" = "Send code via SMS";
"lng_code_call" = "Telegram will dial your number in {minutes}:{seconds}";
"lng_code_call" = "Telegram will call you in {minutes}:{seconds}";
"lng_code_calling" = "Requesting a call from Telegram...";
"lng_code_called" = "Telegram dialed your number";
@@ -187,7 +175,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_bad_phone_noreg" = "Phone number not registered.";
"lng_bad_code" = "You have entered an invalid code.";
"lng_bad_name" = "Please enter your first and last name.";
"lng_bad_photo" = "Bad image selected.";
"lng_bad_photo" = "Sorry, Telegram can't process that type of image.";
"lng_signin_title" = "Cloud password check";
"lng_signin_desc" = "Please enter your cloud password.";
@@ -201,8 +189,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_signin_bad_password" = "You have entered a wrong password.";
"lng_signin_wrong_code" = "You have entered an invalid code.";
"lng_signin_try_password" = "Having trouble accessing your e-mail?";
"lng_signin_password_removed" = "Your cloud password was disabled.\nYou can set a new one in Settings.";
"lng_signin_no_email_forgot" = "Since you haven't provided a recovery\ne-mail when setting up your password, your remaining options are either to remember your password or to reset your account.";
"lng_signin_password_removed" = "Your cloud password was disabled.\nYou can set up a new one in Settings.";
"lng_signin_no_email_forgot" = "Since you didn't provide a recovery e-mail when setting up your password, your remaining options are either to remember your password or to reset your account.";
"lng_signin_cant_email_forgot" = "If you can't restore access to the e-mail, your remaining options are either to remember your password or to reset your account.";
"lng_signin_reset_account" = "Reset your account";
"lng_signin_sure_reset" = "Warning!\n\nYou will lose all your chats and messages, along with any media and files you shared!\n\nDo you want to reset your account?";
@@ -251,10 +239,10 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_username_invalid" = "This username is invalid.";
"lng_username_occupied" = "This username is already occupied.";
"lng_username_too_short" = "This username is too short.";
"lng_username_bad_symbols" = "This username has bad symbols.";
"lng_username_bad_symbols" = "Only a-z, 0-9, and underscores allowed.";
"lng_username_available" = "This username is available.";
"lng_username_not_found" = "User @{user} not found.";
"lng_username_link_willbe" = "Such link will open a chat with you:";
"lng_username_link_willbe" = "This link will open a chat with you:";
"lng_username_link" = "This link opens a chat with you:";
"lng_username_copied" = "Link copied to clipboard.";
@@ -302,12 +290,13 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_settings_workmode_window" = "Show taskbar icon";
"lng_settings_auto_start" = "Launch Telegram when system starts";
"lng_settings_start_min" = "Launch minimized";
"lng_settings_add_sendto" = "Place Telegram in «Send to» menu";
"lng_settings_add_sendto" = "Place Telegram in \"Send to\" menu";
"lng_settings_section_scale" = "Interface Scale";
"lng_settings_scale_auto" = "Auto ({cur})";
"lng_settings_section_chat_settings" = "Chat Settings";
"lng_settings_replace_emojis" = "Replace emoji";
"lng_settings_suggest_by_emoji" = "Suggest popular stickers by emoji";
"lng_settings_view_emojis" = "View list";
"lng_settings_send_enter" = "Send by Enter";
"lng_settings_send_ctrlenter" = "Send by Ctrl+Enter";
@@ -322,9 +311,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_settings_adaptive_wide" = "Adaptive layout for wide screens";
"lng_backgrounds_header" = "Choose your new chat background";
"lng_theme_sure_keep" = "Keep this color theme?";
"lng_theme_reverting#one" = "Reverting to the old color theme in {count} second.";
"lng_theme_reverting#other" = "Reverting to the old color theme in {count} seconds.";
"lng_theme_sure_keep" = "Keep this theme?";
"lng_theme_reverting#one" = "Reverting to the old theme in {count} second.";
"lng_theme_reverting#other" = "Reverting to the old theme in {count} seconds.";
"lng_theme_keep_changes" = "Keep changes";
"lng_theme_revert" = "Revert";
@@ -339,7 +328,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_download_path_dir_radio" = "Custom folder, cleared only manually";
"lng_download_path_choose" = "Choose download path";
"lng_sure_clear_downloads" = "Do you want to remove all downloaded files from temp folder? It is done automatically on logout or program uninstall.";
"lng_download_path_failed" = "File download could not be started. It could happen because of a bad download location.\n\nYou can change download path in Settings.";
"lng_download_path_failed" = "File download could not be started.\n\nThis might be because the download location you've selected is invalid. Try changing the \"Download path\" in Settings.";
"lng_download_path_settings" = "Settings";
"lng_download_finish_failed" = "File download could not be finished.\n\nWould you like to try again?";
"lng_download_path_clearing" = "Clearing...";
@@ -404,7 +393,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_cloud_password_bad" = "Password and hint cannot be the same.";
"lng_cloud_password_email" = "Enter recovery e-mail";
"lng_cloud_password_bad_email" = "Incorrect e-mail, please try other.";
"lng_cloud_password_about" = "This password will be asked when you log in on a new device in addition to the pin code.";
"lng_cloud_password_about" = "This password will be asked when you log in on a new device in addition to the SMS code.";
"lng_cloud_password_about_recover" = "Warning! Are you sure you don't want to\nadd a password recovery e-mail?\n\nIf you forget your password, you will\nlose access to your Telegram account.";
"lng_cloud_password_skip_email" = "Skip e-mail";
"lng_cloud_password_almost" = "A confirmation link was sent to the\ne-mail you provided. Two-step verification will be enabled as soon as you follow that link.";
@@ -445,9 +434,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_settings_reset_button" = "Terminate";
"lng_settings_manage_local_storage" = "Manage local storage";
"lng_settings_ask_question" = "Ask a Question";
"lng_settings_ask_sure" = "Please note that Telegram Support is done by volunteers. We try to respond as quickly as possible, but it may take a while.\n\nPlease take a look at the Telegram FAQ: it has important troubleshooting tips and answers to most questions.";
"lng_settings_ask_sure" = "Please note that Telegram Support is run by volunteers. We try to respond as quickly as possible, but it may take a while.\n\nPlease take a look at the Telegram FAQ: it has important troubleshooting tips and answers to most questions.";
"lng_settings_faq_button" = "Go to FAQ";
"lng_settings_ask_ok" = "Ask";
"lng_settings_ask_ok" = "Ask a Volunteer";
"lng_settings_faq" = "Telegram FAQ";
"lng_settings_logout" = "Log Out";
"lng_sure_logout" = "Are you sure you want to log out?";
@@ -461,7 +450,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_sessions_terminate_all" = "Terminate all other sessions";
"lng_blocked_list_title" = "Blocked users";
"lng_blocked_list_unknown_phone" = "unknown phone";
"lng_blocked_list_unknown_phone" = "unknown phone number";
"lng_blocked_list_unblock" = "Unblock";
"lng_blocked_list_add" = "Block user";
"lng_blocked_list_add_title" = "Select user to block";
@@ -499,7 +488,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_edit_privacy_groups_always_title" = "Always allow";
"lng_edit_privacy_groups_never_title" = "Never allow";
"lng_edit_privacy_calls_title" = "Phone calls privacy";
"lng_edit_privacy_calls_title" = "Telegram call privacy";
"lng_edit_privacy_calls_description" = "You can restrict who can call you:";
"lng_edit_privacy_calls_always_empty" = "Always allow";
"lng_edit_privacy_calls_always#one" = "Always allow {count} user";
@@ -532,7 +521,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_mute_duration_hours#one" = "For {count} hour";
"lng_mute_duration_hours#other" = "For {count} hours";
"lng_mute_box_tip" = "Choose duration of turning off notifications from the following chat";
"lng_mute_box_tip" = "Choose for how long you would like to turn off notifications for the following chat";
"lng_preview_loading" = "Getting Link Info...";
@@ -567,7 +556,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_profile_block_bot" = "Stop and block bot";
"lng_profile_unblock_bot" = "Unblock bot";
"lng_profile_invite_to_group" = "Add to Group";
"lng_profile_delete_contact" = "Delete Contact";
"lng_profile_delete_contact" = "Delete";
"lng_profile_set_group_photo" = "Set Photo";
"lng_profile_add_participant" = "Add Members";
"lng_profile_view_channel" = "View Channel";
@@ -577,6 +566,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_profile_kick" = "Remove";
"lng_profile_sure_kick" = "Remove {user} from the group?";
"lng_profile_sure_kick_channel" = "Remove {user} from the channel?";
"lng_profile_sure_remove_admin" = "Remove {user} from admins?";
"lng_profile_loading" = "Loading...";
"lng_profile_photos#one" = "{count} photo";
"lng_profile_photos#other" = "{count} photos";
@@ -697,6 +687,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_channel_banned_status_restricted_by" = "Restricted by {user}";
"lng_group_blocked_list_about" = "Banned users are removed from the group and can only come back if invited by an admin.\nInvite links don't work for them.";
"lng_channel_blocked_list_about" = "Banned users are removed from the channel.\nInvite links don't work for them.";
"lng_chat_all_members_admins" = "All Members Are Admins";
"lng_chat_about_all_admins" = "Group members can add new members, edit name and photo of the group.";
@@ -724,7 +715,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_create_channel_link_invalid" = "This link is invalid";
"lng_create_channel_link_occupied" = "Sorry, this link is already occupied";
"lng_create_channel_link_too_short" = "Sorry, this link is too short";
"lng_create_channel_link_bad_symbols" = "Sorry, this link has bad symbols";
"lng_create_channel_link_bad_symbols" = "Only 0-9, a-z, and underscores allowed.";
"lng_create_channel_link_available" = "This link is available";
"lng_create_channel_link_copied" = "Link copied to clipboard";
@@ -735,17 +726,18 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_failed_add_not_mutual" = "Sorry, if a person leaves a group, only a mutual contact can bring them back (they need to have your phone number, and you need theirs).";
"lng_failed_add_not_mutual_channel" = "Sorry, if a person leaves a channel, only a mutual contact can bring them back (they need to have your phone number, and you need theirs).";
"lng_sure_delete_contact" = "Are you sure, you want to delete {contact} from your contact list?";
"lng_sure_delete_history" = "Are you sure, you want to delete all message history with {contact}?\n\nThis action cannot be undone.";
"lng_sure_delete_contact" = "Are you sure you want to delete {contact} from your contact list?";
"lng_sure_delete_history" = "Are you sure you want to delete all message history with {contact}?\n\nThis action cannot be undone.";
"lng_sure_delete_group_history" = "Are you sure, you want to delete all message history in «{group}»?\n\nThis action cannot be undone.";
"lng_sure_delete_and_exit" = "Are you sure, you want to delete all message history and leave «{group}»?\n\nThis action cannot be undone.";
"lng_sure_leave_channel" = "Are you sure, you want to leave\nthis channel?";
"lng_sure_delete_channel" = "Are you sure, you want to delete this channel? All members will be removed and all messages will be lost.";
"lng_sure_leave_group" = "Are you sure, you want to leave\nthis group?";
"lng_sure_leave_channel" = "Are you sure you want to leave\nthis channel?";
"lng_sure_delete_channel" = "Are you sure you want to delete this channel? All members will be removed and all messages will be lost.";
"lng_sure_leave_group" = "Are you sure you want to leave this group?";
"lng_sure_delete_group" = "Are you sure, you want to delete this group? All members will be removed and all messages will be lost.";
"lng_sure_delete_saved_messages" = "Are you sure, you want to delete all your saved messages?\n\nThis action cannot be undone.";
"lng_message_empty" = "Empty Message";
"lng_message_unsupported" = "This message is not supported by your version of Telegram Desktop. Please update to the last version in Settings or install it from {link}";
"lng_message_unsupported" = "This message is not supported by your version of Telegram Desktop. Please update to the latest version in Settings, or install it from {link}";
"lng_duration_seconds#one" = "{count} second";
"lng_duration_seconds#other" = "{count} seconds";
@@ -802,6 +794,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_action_payment_done_for" = "You have just successfully transferred {amount} to {user} for {invoice}";
"lng_action_took_screenshot" = "{from} took a screenshot!";
"lng_action_you_took_screenshot" = "You took a screenshot!";
"lng_action_bot_allowed_from_domain" = "You allowed this bot to message you when you logged in on {domain}.";
"lng_ttl_photo_received" = "{from} sent you a self-destructing photo. Please view it on your mobile.";
"lng_ttl_photo_sent" = "You sent a self-destructing photo.";
@@ -812,7 +805,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_profile_migrate_reached#one" = "{count} member limit reached";
"lng_profile_migrate_reached#other" = "{count} members limit reached";
"lng_profile_migrate_body" = "To get over this limit, you can upgrade your group to a supergroup.";
"lng_profile_migrate_body" = "To add more members, you can upgrade your group to a supergroup.";
"lng_profile_migrate_learn_more" = "Learn more »";
"lng_profile_migrate_button" = "Upgrade to supergroup";
"lng_profile_convert_title" = "Convert to supergroup";
@@ -827,6 +820,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_channel_not_accessible" = "Sorry, this channel is not accessible.";
"lng_group_not_accessible" = "Sorry, this group is not accessible.";
"lng_group_full" = "Sorry, this group is full.";
"lng_channels_too_much_public_about" = "Sorry, you have reserved too many public usernames. You can revoke the link from one of your older groups or channels.";
"lng_channels_too_much_public_revoke_confirm_group" = "Are you sure you want to revoke the link {link}?\n\nThe group «{group}» will become private.";
@@ -859,12 +853,13 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_edited" = "edited";
"lng_edited_date" = "Edited: {date}";
"lng_admin_badge" = "admin";
"lng_fast_reply" = "Reply";
"lng_cancel_edit_post_sure" = "Cancel editing?";
"lng_cancel_edit_post_yes" = "Yes";
"lng_cancel_edit_post_no" = "No";
"lng_bot_share_location_unavailable" = "Sorry, the location sharing is currently unavailable in Telegram Desktop.";
"lng_bot_share_phone" = "Share Phone Number?";
"lng_bot_share_location_unavailable" = "Sorry, location sharing is currently unavailable in Telegram Desktop.";
"lng_bot_share_phone" = "Do you want to share your phone number with this bot?";
"lng_bot_share_phone_confirm" = "Share";
"lng_attach_failed" = "Failed";
@@ -899,7 +894,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_faved_stickers_add" = "Add to Favorites";
"lng_faved_stickers_remove" = "Remove from Favorites";
"lng_group_stickers" = "Group stickers";
"lng_group_stickers_description" = "You can choose sticker set which will be available for every member while in the group chat.";
"lng_group_stickers_description" = "You can choose a sticker set which will be available for every member while in the group chat.";
"lng_group_stickers_add" = "Choose sticker set";
"lng_switch_stickers" = "Stickers";
@@ -932,9 +927,13 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_stickers_group_set" = "Group sticker set";
"lng_stickers_remove_group_set" = "Remove group sticker set?";
"lng_stickers_group_from_your" = "Choose from your stickers";
"lng_stickers_group_from_featured" = "Choose from featured stickers";
"lng_stickers_group_from_featured" = "Choose from trending stickers";
"lng_stickers_search_sets" = "Search sticker sets";
"lng_stickers_nothing_found" = "No stickers found";
"lng_stickers_remove_pack_confirm" = "Remove";
"lng_in_dlg_photo" = "Photo";
"lng_in_dlg_album" = "Album";
"lng_in_dlg_video" = "Video";
"lng_in_dlg_audio_file" = "Audio file";
"lng_in_dlg_contact" = "Contact";
@@ -975,6 +974,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_unblock_button" = "Unblock";
"lng_channel_mute" = "Mute";
"lng_channel_unmute" = "Unmute";
"lng_saved_messages" = "Saved Messages";
"lng_saved_short" = "Save";
"lng_saved_forward_here" = "Forward messages here for quick access";
"lng_dialogs_text_with_from" = "{from_part} {message}";
"lng_dialogs_text_from_wrapped" = "{from}:";
@@ -985,7 +987,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_open_this_link" = "Open this link?";
"lng_open_link" = "Open";
"lng_allow_bot_pass" = "Do you allow {bot_name} to pass your Telegram name and id to the web pages you open via this bot?";
"lng_allow_bot_pass" = "Allow {bot_name} to pass your Telegram name and ID to the web pages you open via this bot?";
"lng_allow_bot" = "Allow";
"lng_bot_start" = "Start";
@@ -994,7 +996,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_bot_groups_not_found" = "No groups found";
"lng_bot_sure_invite" = "Add the bot to «{group}»?";
"lng_bot_already_in_group" = "The bot is already a member of the group.";
"lng_bot_choose_chat" = "Select a Chat";
"lng_bot_choose_chat" = "Select a chat";
"lng_bot_no_chats" = "You have no chats";
"lng_bot_chats_not_found" = "No chats found";
"lng_bot_sure_share_game" = "Share the game with {user}?";
@@ -1028,6 +1030,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_user_action_upload_file" = "{user} is sending a file";
"lng_unread_bar#one" = "{count} unread message";
"lng_unread_bar#other" = "{count} unread messages";
"lng_unread_bar_some" = "Unread messages";
"lng_maps_point" = "Location";
"lng_save_photo" = "Save image";
@@ -1046,6 +1049,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_context_view_profile" = "View profile";
"lng_context_view_group" = "View group info";
"lng_context_view_channel" = "View channel info";
"lng_context_view_feed_info" = "View feed info";
"lng_context_pin_to_top" = "Pin to top";
"lng_context_unpin_from_top" = "Unpin from top";
@@ -1087,25 +1091,28 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_context_forward_selected" = "Forward Selected";
"lng_context_delete_selected" = "Delete Selected";
"lng_context_clear_selection" = "Clear Selection";
"lng_send_images_compress#one" = "Compress image";
"lng_send_images_compress#other" = "Compress images";
"lng_send_image_empty" = "Could not send an empty file: {name}";
"lng_send_image_too_large" = "Could not send a file, because it is larger than 1500 MB: {name}";
"lng_send_images_selected#one" = "{count} image selected";
"lng_send_images_selected#other" = "{count} images selected";
"lng_send_photos#one" = "Send {count} photo";
"lng_send_photos#other" = "Send {count} photos";
"lng_send_separate_photos" = "Send as separate photos";
"lng_send_separate_photos_videos" = "Send as separate media";
"lng_send_files_selected#one" = "{count} file selected";
"lng_send_files_selected#other" = "{count} files selected";
"lng_send_files#one" = "Send {count} file";
"lng_send_files#other" = "Send {count} files";
"lng_send_album" = "Send as an album";
"lng_send_photo" = "Send as a photo";
"lng_send_file" = "Send as a file";
"lng_forward_choose" = "Choose recipient...";
"lng_forward_cant" = "Sorry, no way to forward here :(";
"lng_forward_share_contact" = "Share contact to {recipient}?";
"lng_forward_share_cant" = "Sorry, no way to share contact here :(";
"lng_forward_send_file_confirm" = "Send «{name}» to {recipient}?";
"lng_forward_send_files_confirm" = "Send selected files to {recipient}?";
"lng_forward_send_files_cant" = "Sorry, no way to send media here :(";
"lng_forward_send" = "Send";
"lng_forward_messages#one" = "{count} forwarded message";
@@ -1118,7 +1125,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_share_cant" = "Sorry, no way to share here :(";
"lng_reply_cant" = "Sorry, no way to reply to an old message in supergroup :(";
"lng_reply_cant_forward" = "Sorry, no way to reply to an old message in supergroup :( Do you wish to forward it and add your comment?";
"lng_reply_cant_forward" = "Sorry, you can't reply to a message that was sent before the group was upgraded to a supergroup. Do you wish to forward it and add your comment?";
"lng_share_title" = "Share to";
"lng_share_copy_link" = "Copy share link";
@@ -1127,7 +1134,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_share_game_link_copied" = "Game link copied to clipboard.";
"lng_share_done" = "Done!";
"lng_contact_phone" = "Phone number";
"lng_contact_phone" = "Phone Number";
"lng_enter_contact_data" = "New Contact";
"lng_edit_contact_title" = "Edit contact name";
"lng_edit_channel_title" = "Edit channel";
@@ -1141,8 +1148,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_add_contact" = "Create";
"lng_add_contact_button" = "New contact";
"lng_contacts_header" = "Contacts";
"lng_contact_not_joined" = "Unfortunately {name} did not join Telegram yet, but you can send your friend an invitation.\n\nWe will notify you about any of your contacts who is joining Telegram.";
"lng_try_other_contact" = "Try other";
"lng_contact_not_joined" = "Unfortunately {name} has not joined Telegram yet, but you can send them an invitation.\n\nWe will notify you about any of your contacts who join Telegram.";
"lng_try_other_contact" = "Try someone else";
"lng_create_group_link" = "Link";
"lng_create_group_invite_link" = "Invite link";
"lng_create_group_description" = "Description (optional)";
@@ -1229,7 +1236,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_confirm_phone_enter_code" = "Please enter the code.";
"lng_theme_editor_no_keys" = "No keys in the palette yet";
"lng_theme_editor_cant_change_theme" = "You can not apply new themes while you're editing the color palette. Please close the theme editor first.";
"lng_theme_editor_cant_change_theme" = "You can't apply a new theme while you're editing the colour palette. Please close the theme editor first.";
"lng_theme_editor_new_keys" = "Not in the palette yet";
"lng_theme_editor_background_image" = "Background image";
"lng_theme_editor_saved_to_jpg" = "Saved to JPEG, {size}";
@@ -1270,7 +1277,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_call_bar_hangup" = "End call";
"lng_call_box_title" = "Calls";
"lng_call_box_about" = "You didn't make any calls yet.";
"lng_call_box_about" = "You haven't made any Telegram calls yet.";
"lng_call_box_status_today" = "{time}";
"lng_call_box_status_yesterday" = "Yesterday at {time}";
"lng_call_box_status_date" = "{date} at {time}";
@@ -1291,7 +1298,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_player_message_yesterday" = "Yesterday at {time}";
"lng_player_message_date" = "{date} at {time}";
"lng_rights_edit_admin" = "Edit administrator";
"lng_rights_edit_admin" = "Manage permissions";
"lng_rights_edit_admin_header" = "What can this admin do?";
"lng_rights_about_add_admins_yes" = "This admin will be able to add new admins with the same (or more limited) permissions.";
"lng_rights_about_add_admins_no" = "This admin will not be able to add new admins.";
@@ -1395,9 +1402,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_admin_log_banned" = "banned {user}";
"lng_admin_log_restricted" = "changed restrictions for {user} {until}";
"lng_admin_log_promoted" = "changed privileges for {user}";
"lng_admin_log_changed_stickers_group" = "{from} changed group {sticker_set}";
"lng_admin_log_changed_stickers_group" = "{from} changed the group's {sticker_set}";
"lng_admin_log_changed_stickers_set" = "sticker set";
"lng_admin_log_removed_stickers_group" = "{from} removed group sticker set";
"lng_admin_log_removed_stickers_group" = "{from} removed the group's sticker set";
"lng_admin_log_user_with_username" = "{name} ({mention})";
"lng_admin_log_restricted_forever" = "indefinitely";
"lng_admin_log_restricted_until" = "until {date}";
@@ -1416,6 +1423,33 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_admin_log_admin_pin_messages" = "Pin messages";
"lng_admin_log_admin_add_admins" = "Add new admins";
"lng_feed_name" = "Feed";
"lng_feed_show_next" = "Show Next";
"lng_feed_group" = "Group in feed";
"lng_feed_ungroup" = "Ungroup from feed";
"lng_feed_channel_added" = "Channel added to your feed.";
"lng_feed_channel_removed" = "Channel removed from your feed.";
"lng_feed_no_messages" = "No messages in this feed yet";
"lng_feed_channels#one" = "{count} channel";
"lng_feed_channels#other" = "{count} channels";
"lng_feed_notifications" = "Feed notifications";
"lng_feed_ungroup_all" = "Ungroup all channels";
"lng_feed_sure_ungroup_all" = "Are you sure you want to ungroup all channels from this feed?";
"lng_feed_ungroup_sure" = "Ungroup";
"lng_feed_create_new" = "New feed";
"lng_feed_too_few_channels#one" = "You need at least {count} channel to create a feed.";
"lng_feed_too_few_channels#other" = "You need at least {count} channels to create a feed.";
"lng_feed_select_more_channels#one" = "Select {count} channel or more.";
"lng_feed_select_more_channels#other" = "Select {count} channels or more.";
"lng_feed_create" = "Create";
"lng_feed_edit_title" = "Edit feed";
"lng_feed_channels_not_found" = "No channels found";
"lng_info_feed_title" = "Feed Info";
"lng_info_feed_is_default" = "Group new channels";
"lng_info_feed_channels" = "Channels";
// Wnd specific
"lng_wnd_choose_program_menu" = "Choose Default Program...";

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
"lng_language_name" = "Deutsch";
"lng_switch_to_this" = "Auf Deutsch zurücksetzen";

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
"lng_language_name" = "Español";
"lng_switch_to_this" = "Cambiar a español";

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
"lng_language_name" = "Italiano";
"lng_switch_to_this" = "Passa all'Italiano";

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
"lng_language_name" = "영어";
"lng_switch_to_this" = "영어로 변경";

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
"lng_language_name" = "Nederlands";
"lng_switch_to_this" = "Overschakelen naar Nederlands";

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
"lng_language_name" = "Português (Brasil)";
"lng_switch_to_this" = "Trocar para Português (Brasil)";

View File

@@ -1,17 +1,7 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/

View File

@@ -1,17 +1,7 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/

View File

@@ -0,0 +1,30 @@
import os, sys, requests, re
from os.path import expanduser
filename = ''
for arg in sys.argv:
if re.match(r'.*\.strings$', arg):
filename = expanduser(arg)
result = ''
if not os.path.isfile(filename):
print("File not found.")
sys.exit(1)
with open(filename) as f:
for line in f:
if re.match(r'\s*\/\* new from [a-zA-Z0-9\.]+ \*\/\s*', line):
continue
if re.match(r'\"lng_[a-z_]+\#(zero|two|few|many)\".+', line):
continue
result = result + line
remove = 0
while (len(result) > remove + 1) and (result[len(result) - remove - 1] == '\n') and (result[len(result) - remove - 2] == '\n'):
remove = remove + 1
result = result[:len(result) - remove]
with open('lang.strings', 'w') as out:
out.write(result)
sys.exit()

View File

@@ -0,0 +1,30 @@
set -e
FullExecPath=$PWD
pushd `dirname $0` > /dev/null
FullScriptPath=`pwd`
popd > /dev/null
FileName="$1"
if [ ! -d "$FullScriptPath/../../../../TelegramPrivate" ]; then
echo ""
echo "This script is for building the production version of Telegram Desktop."
echo ""
echo "For building custom versions please visit the build instructions page at:"
echo "https://github.com/telegramdesktop/tdesktop/#build-instructions"
exit
fi
Error () {
cd $FullExecPath
echo "$1"
exit 1
}
if [ ! -f "$FileName" ]; then
Error "File '$FileName' not found."
fi
cd "$FullScriptPath"
python refresh.py $FileName

View File

@@ -54,6 +54,7 @@ destroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;
---functions---
req_pq#60469778 nonce:int128 = ResPQ;
req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;
req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;
@@ -155,18 +156,18 @@ inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile
inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
inputMediaEmpty#9664f57f = InputMedia;
inputMediaUploadedPhoto#2f37e231 flags:# file:InputFile caption:string stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
inputMediaPhoto#81fa373a flags:# id:InputPhoto caption:string ttl_seconds:flags.0?int = InputMedia;
inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
inputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;
inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
inputMediaUploadedDocument#e39621fd flags:# nosound_video:flags.3?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> caption:string stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
inputMediaDocument#5acb668e flags:# id:InputDocument caption:string ttl_seconds:flags.0?int = InputMedia;
inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
inputMediaDocument#23ab23d2 flags:# id:InputDocument ttl_seconds:flags.0?int = InputMedia;
inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;
inputMediaGifExternal#4843b0fd url:string q:string = InputMedia;
inputMediaPhotoExternal#922aec1 flags:# url:string caption:string ttl_seconds:flags.0?int = InputMedia;
inputMediaDocumentExternal#b6f74335 flags:# url:string caption:string ttl_seconds:flags.0?int = InputMedia;
inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;
inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;
inputMediaGame#d33f43f3 id:InputGame = InputMedia;
inputMediaInvoice#92153685 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string start_param:string = InputMedia;
inputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;
inputMediaGeoLive#7b1a118f geo_point:InputGeoPoint period:int = InputMedia;
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
@@ -219,7 +220,7 @@ userStatusLastMonth#77ebc742 = UserStatus;
chatEmpty#9ba2d800 id:int = Chat;
chat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat;
chatForbidden#7328bdb id:int title:string = Chat;
channel#cb44b1c flags:# creator:flags.0?true left:flags.2?true editor:flags.3?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true democracy:flags.10?true signatures:flags.11?true min:flags.12?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string admin_rights:flags.14?ChannelAdminRights banned_rights:flags.15?ChannelBannedRights = Chat;
channel#450b7115 flags:# creator:flags.0?true left:flags.2?true editor:flags.3?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true democracy:flags.10?true signatures:flags.11?true min:flags.12?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string admin_rights:flags.14?ChannelAdminRights banned_rights:flags.15?ChannelBannedRights participants_count:flags.17?int = Chat;
channelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;
chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> = ChatFull;
@@ -236,15 +237,15 @@ chatPhotoEmpty#37c1011c = ChatPhoto;
chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
messageEmpty#83e5de54 id:int = Message;
message#90dddc11 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int edit_date:flags.15?int post_author:flags.16?string = Message;
message#44f9b43d flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long = Message;
messageService#9e19a1f6 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer reply_to_msg_id:flags.3?int date:int action:MessageAction = Message;
messageMediaEmpty#3ded6320 = MessageMedia;
messageMediaPhoto#b5223b0f flags:# photo:flags.0?Photo caption:flags.1?string ttl_seconds:flags.2?int = MessageMedia;
messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;
messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
messageMediaUnsupported#9f84f49e = MessageMedia;
messageMediaDocument#7c4414d3 flags:# document:flags.0?Document caption:flags.1?string ttl_seconds:flags.2?int = MessageMedia;
messageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;
messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;
messageMediaGame#fdb19008 game:Game = MessageMedia;
@@ -270,6 +271,7 @@ messageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAct
messageActionPhoneCall#80e11a7f flags:# call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;
messageActionScreenshotTaken#4792929b = MessageAction;
messageActionCustomAction#fae69f56 message:string = MessageAction;
messageActionBotAllowed#abe9affe domain:string = MessageAction;
dialog#e4def5db flags:# pinned:flags.2?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog;
@@ -422,8 +424,8 @@ updateRecentStickers#9a422c20 = Update;
updateConfig#a229dd06 = Update;
updatePtsChanged#3354678f = Update;
updateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;
updateDialogPinned#d711a2cc flags:# pinned:flags.0?true peer:Peer = Update;
updatePinnedDialogs#d8caf68d flags:# order:flags.0?Vector<Peer> = Update;
updateDialogPinned#19d27f3c flags:# pinned:flags.0?true peer:DialogPeer = Update;
updatePinnedDialogs#ea4cb65b flags:# order:flags.0?Vector<DialogPeer> = Update;
updateBotWebhookJSON#8317c0c3 data:DataJSON = Update;
updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;
updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;
@@ -457,11 +459,11 @@ photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> =
photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
upload.fileCdnRedirect#ea52fe5a dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes cdn_file_hashes:Vector<CdnFileHash> = upload.File;
upload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector<FileHash> = upload.File;
dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int = DcOption;
config#9c840964 flags:# phonecalls_enabled:flags.1?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string suggested_lang_code:flags.2?string lang_pack_version:flags.2?int disabled_features:Vector<DisabledFeature> = Config;
config#86b5778e flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string suggested_lang_code:flags.2?string lang_pack_version:flags.2?int = Config;
nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
@@ -522,7 +524,7 @@ sendMessageGamePlayAction#dd6a8f48 = SendMessageAction;
sendMessageRecordRoundAction#88f27fbc = SendMessageAction;
sendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;
contacts.found#1aa1f784 results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
contacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
inputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;
@@ -553,7 +555,7 @@ accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
documentAttributeAnimated#11b58939 = DocumentAttribute;
documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;
documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true duration:int w:int h:int = DocumentAttribute;
documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute;
documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;
documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
documentAttributeHasStickers#9801d2f7 = DocumentAttribute;
@@ -566,8 +568,6 @@ stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
messages.allStickersNotModified#e86602c3 = messages.AllStickers;
messages.allStickers#edfd405f hash:int sets:Vector<StickerSet> = messages.AllStickers;
disabledFeature#ae636f24 feature:string description:string = DisabledFeature;
messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
contactLinkUnknown#5f4f9247 = ContactLink;
@@ -605,7 +605,7 @@ inputStickerSetEmpty#ffb62b95 = InputStickerSet;
inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
stickerSet#cd303b41 flags:# installed:flags.0?true archived:flags.1?true official:flags.2?true masks:flags.3?true id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;
stickerSet#5585a139 flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;
messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
@@ -642,6 +642,8 @@ messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;
messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;
messageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;
inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;
messageEntityPhone#9b69e34b offset:int length:int = MessageEntity;
messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;
inputChannelEmpty#ee8c1e86 = InputChannel;
inputChannel#afeb712e channel_id:int access_hash:long = InputChannel;
@@ -685,32 +687,32 @@ messages.foundGifs#450a1c0a next_offset:int results:Vector<FoundGif> = messages.
messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;
messages.savedGifs#2e0709a5 hash:int gifs:Vector<Document> = messages.SavedGifs;
inputBotInlineMessageMediaAuto#292fed13 flags:# caption:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaGeo#c1b15d65 flags:# geo_point:InputGeoPoint period:int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaVenue#aaafadc8 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaContact#2daf01a7 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineResult#2cbbe15a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;
botInlineMessageMediaAuto#a74b15b flags:# caption:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaGeo#b722de65 flags:# geo:GeoPoint period:int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaVenue#4366232e flags:# geo:GeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaContact#35edb4d4 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineResult#9bebaeb9 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:BotInlineMessage = BotInlineResult;
botInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;
botInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;
messages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;
exportedMessageLink#1f486803 link:string = ExportedMessageLink;
exportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;
messageFwdHeader#fadff4ac flags:# from_id:flags.0?int date:int channel_id:flags.1?int channel_post:flags.2?int post_author:flags.3?string = MessageFwdHeader;
messageFwdHeader#559ebe6d flags:# from_id:flags.0?int date:int channel_id:flags.1?int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int = MessageFwdHeader;
auth.codeTypeSms#72a3158c = auth.CodeType;
auth.codeTypeCall#741cd3e3 = auth.CodeType;
@@ -752,7 +754,7 @@ messages.featuredStickersNotModified#4ede3cf = messages.FeaturedStickers;
messages.featuredStickers#f89d88e5 hash:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;
messages.recentStickersNotModified#b17f890 = messages.RecentStickers;
messages.recentStickers#5ce20970 hash:int stickers:Vector<Document> = messages.RecentStickers;
messages.recentStickers#22f3afb3 hash:int packs:Vector<StickerPack> stickers:Vector<Document> dates:Vector<int> = messages.RecentStickers;
messages.archivedStickers#4fcba9c8 count:int sets:Vector<StickerSetCovered> = messages.ArchivedStickers;
@@ -823,7 +825,7 @@ dataJSON#7d748d04 data:string = DataJSON;
labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
invoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true currency:string prices:Vector<LabeledPrice> = Invoice;
invoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> = Invoice;
paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;
@@ -834,6 +836,7 @@ paymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string e
paymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;
webDocument#c61acbd8 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> dc_id:int = WebDocument;
webDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
inputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;
@@ -855,7 +858,7 @@ payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_inf
inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;
inputPaymentCredentialsAndroidPay#795667a6 payment_token:DataJSON = InputPaymentCredentials;
inputPaymentCredentialsAndroidPay#ca05d50e payment_token:DataJSON google_transaction_id:string = InputPaymentCredentials;
account.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;
@@ -893,7 +896,7 @@ langPackDifference#f385c1f6 lang_code:string from_version:int version:int string
langPackLanguage#117698f1 name:string native_name:string lang_code:string = LangPackLanguage;
channelAdminRights#5d7ceba5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true invite_link:flags.6?true pin_messages:flags.7?true add_admins:flags.9?true = ChannelAdminRights;
channelAdminRights#5d7ceba5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true invite_link:flags.6?true pin_messages:flags.7?true add_admins:flags.9?true manage_call:flags.10?true = ChannelAdminRights;
channelBannedRights#58cf4249 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true until_date:int = ChannelBannedRights;
@@ -922,8 +925,6 @@ channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?tru
popularContact#5ce14175 client_id:long importers:int = PopularContact;
cdnFileHash#77eec38f offset:int limit:int hash:bytes = CdnFileHash;
messages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;
messages.favedStickers#f37f2f16 hash:int packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;
@@ -935,6 +936,25 @@ recentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;
help.recentMeUrls#e0310d7 urls:Vector<RecentMeUrl> chats:Vector<Chat> users:Vector<User> = help.RecentMeUrls;
inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector<MessageEntity> = InputSingleMedia;
webAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;
account.webAuthorizations#ed56c9fc authorizations:Vector<WebAuthorization> users:Vector<User> = account.WebAuthorizations;
inputMessageID#a676a322 id:int = InputMessage;
inputMessageReplyTo#bad88395 id:int = InputMessage;
inputMessagePinned#86872538 = InputMessage;
inputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;
dialogPeer#e56dbf05 peer:Peer = DialogPeer;
messages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;
messages.foundStickerSets#5108d648 hash:int sets:Vector<StickerSetCovered> = messages.FoundStickerSets;
fileHash#6242c773 offset:int limit:int hash:bytes = FileHash;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -961,8 +981,8 @@ auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentC
auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;
auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;
account.registerDevice#637ea878 token_type:int token:string = Bool;
account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
account.registerDevice#5cbea590 token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<int> = Bool;
account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector<int> = Bool;
account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
account.resetNotifySettings#db7e1747 = Bool;
@@ -988,6 +1008,9 @@ account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings
account.sendConfirmPhoneCode#1516d7bd flags:# allow_flashcall:flags.0?true hash:string current_number:flags.0?Bool = auth.SentCode;
account.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;
account.getTmpPassword#4a82327e password_hash:bytes period:int = account.TmpPassword;
account.getWebAuthorizations#182e6d6f = account.WebAuthorizations;
account.resetWebAuthorization#2d01b9ef hash:long = Bool;
account.resetWebAuthorizations#682d2594 = Bool;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
@@ -1008,21 +1031,22 @@ contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.
contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;
contacts.resetSaved#879537f1 = Bool;
messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#191ba9c5 flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs;
messages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
messages.search#39e9ea0 flags:# peer:InputPeer q:string from_id:flags.0?InputUser filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.search#8614ef68 flags:# peer:InputPeer q:string from_id:flags.0?InputUser filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true peer:InputPeer max_id:int = messages.AffectedHistory;
messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;
messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Updates;
messages.sendMedia#c8f16791 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates;
messages.forwardMessages#708e0195 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer = Updates;
messages.sendMedia#b8d1262b flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Updates;
messages.forwardMessages#708e0195 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true grouped:flags.9?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.hideReportSpam#a8f1709b peer:InputPeer = Bool;
messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings;
messages.report#bd82b658 peer:InputPeer id:Vector<int> reason:ReportReason = Bool;
messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
messages.editChatTitle#dc452855 chat_id:int title:string = Updates;
@@ -1030,7 +1054,6 @@ messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;
messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates;
messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates;
messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
@@ -1043,8 +1066,9 @@ messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long da
messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
messages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool;
messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
messages.getStickers#85cb5182 flags:# exclude_featured:flags.0?true emoticon:string hash:string = messages.Stickers;
messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;
messages.getWebPagePreview#25223e24 message:string = MessageMedia;
messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;
messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite;
messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
messages.importChatInvite#6c50051c hash:string = Updates;
@@ -1070,7 +1094,7 @@ messages.editMessage#5d1b8dd flags:# no_webpage:flags.1?true stop_geo_live:flags
messages.editInlineBotMessage#b0e08243 flags:# no_webpage:flags.1?true stop_geo_live:flags.12?true id:InputBotInlineMessageID message:flags.11?string reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> geo_point:flags.13?InputGeoPoint = Bool;
messages.getBotCallbackAnswer#810a9fec flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes = messages.BotCallbackAnswer;
messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool;
messages.getPeerDialogs#2d9776b9 peers:Vector<InputPeer> = messages.PeerDialogs;
messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;
messages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> = Bool;
messages.getAllDrafts#6a3f8d65 = Updates;
messages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers;
@@ -1088,8 +1112,8 @@ messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:Inpu
messages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats;
messages.getAllChats#eba80ff0 except_ids:Vector<int> = messages.Chats;
messages.getWebPage#32ca8f91 url:string hash:int = WebPage;
messages.toggleDialogPin#3289be6a flags:# pinned:flags.0?true peer:InputPeer = Bool;
messages.reorderPinnedDialogs#959ff644 flags:# force:flags.0?true order:Vector<InputPeer> = Bool;
messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;
messages.reorderPinnedDialogs#5b51d63f flags:# force:flags.0?true order:Vector<InputDialogPeer> = Bool;
messages.getPinnedDialogs#e254d64e = messages.PeerDialogs;
messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = Bool;
messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool;
@@ -1099,7 +1123,10 @@ messages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers;
messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;
messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory;
messages.getRecentLocations#249431e2 peer:InputPeer limit:int = messages.Messages;
messages.getRecentLocations#bbc45b09 peer:InputPeer limit:int hash:int = messages.Messages;
messages.sendMultiMedia#2095512f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector<InputSingleMedia> = Updates;
messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile;
messages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
@@ -1115,8 +1142,9 @@ upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload
upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
upload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile;
upload.reuploadCdnFile#1af91c09 file_token:bytes request_token:bytes = Vector<CdnFileHash>;
upload.getCdnFileHashes#f715c87b file_token:bytes offset:int = Vector<CdnFileHash>;
upload.reuploadCdnFile#9b2754a8 file_token:bytes request_token:bytes = Vector<FileHash>;
upload.getCdnFileHashes#4da54231 file_token:bytes offset:int = Vector<FileHash>;
upload.getFileHashes#c7025931 location:InputFileLocation offset:int = Vector<FileHash>;
help.getConfig#c4f9186b = Config;
help.getNearestDc#1fb33026 = NearestDc;
@@ -1134,7 +1162,7 @@ channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;
channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;
channels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory;
channels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector<int> = Bool;
channels.getMessages#93d7b347 channel:InputChannel id:Vector<int> = messages.Messages;
channels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;
channels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants;
channels.getParticipant#546dd7a6 channel:InputChannel user_id:InputUser = channels.ChannelParticipant;
channels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;
@@ -1152,7 +1180,7 @@ channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> =
channels.exportInvite#c7560885 channel:InputChannel = ExportedChatInvite;
channels.deleteChannel#c0111fe3 channel:InputChannel = Updates;
channels.toggleInvites#49609307 channel:InputChannel enabled:Bool = Updates;
channels.exportMessageLink#c846d22d channel:InputChannel id:int = ExportedMessageLink;
channels.exportMessageLink#ceb77163 channel:InputChannel id:int grouped:Bool = ExportedMessageLink;
channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;
channels.updatePinnedMessage#a72ded52 flags:# silent:flags.0?true channel:InputChannel id:int = Updates;
channels.getAdminedPublicChannels#8d8d82d7 = messages.Chats;
@@ -1192,4 +1220,4 @@ langpack.getStrings#2e1ee318 lang_code:string keys:Vector<string> = Vector<LangP
langpack.getDifference#b2e4d7d from_version:int = LangPackDifference;
langpack.getLanguages#800fd57d = Vector<LangPackLanguage>;
// LAYER 72
// LAYER 76

View File

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

View File

@@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,26,0
PRODUCTVERSION 1,1,26,0
FILEVERSION 1,2,17,0
PRODUCTVERSION 1,2,17,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -52,10 +52,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "1.1.26.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2017"
VALUE "FileVersion", "1.2.17.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2018"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.1.26.0"
VALUE "ProductVersion", "1.2.17.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,26,0
PRODUCTVERSION 1,1,26,0
FILEVERSION 1,2,17,0
PRODUCTVERSION 1,2,17,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -43,10 +43,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "1.1.26.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2017"
VALUE "FileVersion", "1.2.17.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2018"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.1.26.0"
VALUE "ProductVersion", "1.2.17.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "packer.h"
@@ -493,7 +480,7 @@ int main(int argc, char *argv[])
return 0;
}
QString countBetaVersionSignature(quint64 version) { // duplicated in autoupdate.cpp
QString countBetaVersionSignature(quint64 version) { // duplicated in autoupdater.cpp
QByteArray cBetaPrivateKey(BetaPrivateKey);
if (cBetaPrivateKey.isEmpty()) {
cout << "Error: Trying to count beta version signature without beta private key!\n";

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,28 +1,15 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "updater.h"
bool _debug = false;
wstring updaterName, updaterDir, updateTo, exeName;
wstring updaterName, updaterDir, updateTo, exeName, customWorkingDir, customKeyFile;
bool equal(const wstring &a, const wstring &b) {
return !_wcsicmp(a.c_str(), b.c_str());
@@ -356,6 +343,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
args = CommandLineToArgvW(GetCommandLine(), &argsCount);
if (args) {
for (int i = 1; i < argsCount; ++i) {
writeLog(std::wstring(L"Argument: ") + args[i]);
if (equal(args[i], L"-update")) {
needupdate = true;
} else if (equal(args[i], L"-autostart")) {
@@ -368,17 +356,25 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
} else if (equal(args[i], L"-testmode")) {
testmode = true;
} else if (equal(args[i], L"-writeprotected") && ++i < argsCount) {
writeLog(std::wstring(L"Argument: ") + args[i]);
writeprotected = true;
updateTo = args[i];
for (int i = 0, l = updateTo.size(); i < l; ++i) {
if (updateTo[i] == L'/') {
updateTo[i] = L'\\';
for (int j = 0, l = updateTo.size(); j < l; ++j) {
if (updateTo[j] == L'/') {
updateTo[j] = L'\\';
}
}
} else if (equal(args[i], L"-workdir") && ++i < argsCount) {
writeLog(std::wstring(L"Argument: ") + args[i]);
customWorkingDir = args[i];
} else if (equal(args[i], L"-key") && ++i < argsCount) {
writeLog(std::wstring(L"Argument: ") + args[i]);
customKeyFile = args[i];
} else if (equal(args[i], L"-exename") && ++i < argsCount) {
writeLog(std::wstring(L"Argument: ") + args[i]);
exeName = args[i];
for (int i = 0, l = exeName.size(); i < l; ++i) {
if (exeName[i] == L'/' || exeName[i] == L'\\') {
for (int j = 0, l = exeName.size(); j < l; ++j) {
if (exeName[j] == L'/' || exeName[j] == L'\\') {
exeName = L"Telegram.exe";
break;
}
@@ -391,6 +387,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
if (needupdate) writeLog(L"Need to update!");
if (autostart) writeLog(L"From autostart!");
if (writeprotected) writeLog(L"Write Protected folder!");
if (!customWorkingDir.empty()) writeLog(L"Will pass custom working dir: " + customWorkingDir);
updaterName = args[0];
writeLog(L"Updater name is: " + updaterName);
@@ -428,6 +425,13 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
if (debug) targs += L" -debug";
if (startintray) targs += L" -startintray";
if (testmode) targs += L" -testmode";
if (!customWorkingDir.empty()) {
targs += L" -workdir \"" + customWorkingDir + L"\"";
}
if (!customKeyFile.empty()) {
targs += L" -key \"" + customKeyFile + L"\"";
}
writeLog(L"Result arguments: " + targs);
bool executed = false;
if (writeprotected) { // run un-elevated

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include <cstdio>
#include <sys/stat.h>
@@ -344,9 +331,16 @@ string CurrentExecutablePath(int argc, char *argv[]) {
}
int main(int argc, char *argv[]) {
bool needupdate = true, autostart = false, debug = false, tosettings = false, startintray = false, testmode = false;
bool needupdate = true;
bool autostart = false;
bool debug = false;
bool tosettings = false;
bool startintray = false;
bool testmode = false;
bool customWorkingDir = false;
char *key = 0, *crashreport = 0;
char *key = 0;
char *workdir = 0;
for (int i = 1; i < argc; ++i) {
if (equal(argv[i], "-noupdate")) {
needupdate = false;
@@ -360,12 +354,12 @@ int main(int argc, char *argv[]) {
testmode = true;
} else if (equal(argv[i], "-tosettings")) {
tosettings = true;
} else if (equal(argv[i], "-workdir_custom")) {
customWorkingDir = true;
} else if (equal(argv[i], "-key") && ++i < argc) {
key = argv[i];
} else if (equal(argv[i], "-workpath") && ++i < argc) {
workDir = argv[i];
} else if (equal(argv[i], "-crashreport") && ++i < argc) {
crashreport = argv[i];
workDir = workdir = argv[i];
} else if (equal(argv[i], "-exename") && ++i < argc) {
exeName = argv[i];
} else if (equal(argv[i], "-exepath") && ++i < argc) {
@@ -401,6 +395,8 @@ int main(int argc, char *argv[]) {
}
if (needupdate) {
if (workDir.empty()) { // old app launched, update prepared in tupdates/ready (not in tupdates/temp)
customWorkingDir = false;
writeLog("No workdir, trying to figure it out");
struct passwd *pw = getpwuid(getuid());
if (pw && pw->pw_dir && strlen(pw->pw_dir)) {
@@ -446,22 +442,30 @@ int main(int argc, char *argv[]) {
string fullBinaryPath = exePath + exeName;
strcpy(path, fullBinaryPath.c_str());
char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key", p_startintray[] = "-startintray", p_testmode[] = "-testmode";
char *args[MaxArgsCount] = { 0 };
char p_noupdate[] = "-noupdate";
char p_autostart[] = "-autostart";
char p_debug[] = "-debug";
char p_tosettings[] = "-tosettings";
char p_key[] = "-key";
char p_startintray[] = "-startintray";
char p_testmode[] = "-testmode";
char p_workdir[] = "-workdir";
int argIndex = 0;
args[argIndex++] = path;
if (crashreport) {
args[argIndex++] = crashreport;
} else {
args[argIndex++] = p_noupdate;
if (autostart) args[argIndex++] = p_autostart;
if (debug) args[argIndex++] = p_debug;
if (startintray) args[argIndex++] = p_startintray;
if (testmode) args[argIndex++] = p_testmode;
if (tosettings) args[argIndex++] = p_tosettings;
if (key) {
args[argIndex++] = p_key;
args[argIndex++] = key;
}
args[argIndex++] = p_noupdate;
if (autostart) args[argIndex++] = p_autostart;
if (debug) args[argIndex++] = p_debug;
if (startintray) args[argIndex++] = p_startintray;
if (testmode) args[argIndex++] = p_testmode;
if (tosettings) args[argIndex++] = p_tosettings;
if (key) {
args[argIndex++] = p_key;
args[argIndex++] = key;
}
if (customWorkingDir && workdir) {
args[argIndex++] = p_workdir;
args[argIndex++] = workdir;
}
pid_t pid = fork();
switch (pid) {

View File

@@ -1,29 +1,15 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#import <Cocoa/Cocoa.h>
NSString *appName = @"Telegram.app";
NSString *appDir = nil;
NSString *workDir = nil;
NSString *crashReportArg = nil;
#ifdef _DEBUG
BOOL _debug = YES;
@@ -90,6 +76,7 @@ int main(int argc, const char * argv[]) {
openLog();
pid_t procId = 0;
BOOL update = YES, toSettings = NO, autoStart = NO, startInTray = NO, testMode = NO;
BOOL customWorkingDir = NO;
NSString *key = nil;
for (int i = 0; i < argc; ++i) {
if ([@"-workpath" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
@@ -102,10 +89,6 @@ int main(int argc, const char * argv[]) {
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
procId = [[formatter numberFromString:[NSString stringWithUTF8String:argv[i]]] intValue];
}
} else if ([@"-crashreport" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
if (++i < argc) {
crashReportArg = [NSString stringWithUTF8String:argv[i]];
}
} else if ([@"-noupdate" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
update = NO;
} else if ([@"-tosettings" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
@@ -118,11 +101,16 @@ int main(int argc, const char * argv[]) {
startInTray = YES;
} else if ([@"-testmode" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
testMode = YES;
} else if ([@"-workdir_custom" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
customWorkingDir = YES;
} else if ([@"-key" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
if (++i < argc) key = [NSString stringWithUTF8String:argv[i]];
}
}
if (!workDir) workDir = appDir;
if (!workDir) {
workDir = appDir;
customWorkingDir = NO;
}
openLog();
NSMutableArray *argsArr = [[NSMutableArray alloc] initWithCapacity:argc];
for (int i = 0; i < argc; ++i) {
@@ -242,17 +230,19 @@ int main(int argc, const char * argv[]) {
}
NSString *appPath = [[NSArray arrayWithObjects:appDir, appRealName, nil] componentsJoinedByString:@""];
NSMutableArray *args = [[NSMutableArray alloc] initWithObjects: crashReportArg ? crashReportArg : @"-noupdate", nil];
if (!crashReportArg) {
if (toSettings) [args addObject:@"-tosettings"];
if (_debug) [args addObject:@"-debug"];
if (startInTray) [args addObject:@"-startintray"];
if (testMode) [args addObject:@"-testmode"];
if (autoStart) [args addObject:@"-autostart"];
if (key) {
[args addObject:@"-key"];
[args addObject:key];
}
NSMutableArray *args = [[NSMutableArray alloc] initWithObjects: @"-noupdate", nil];
if (toSettings) [args addObject:@"-tosettings"];
if (_debug) [args addObject:@"-debug"];
if (startInTray) [args addObject:@"-startintray"];
if (testMode) [args addObject:@"-testmode"];
if (autoStart) [args addObject:@"-autostart"];
if (key) {
[args addObject:@"-key"];
[args addObject:key];
}
if (customWorkingDir) {
[args addObject:@"-workdir"];
[args addObject:workDir];
}
writeLog([[NSArray arrayWithObjects:@"Running application '", appPath, @"' with args '", [args componentsJoinedByString:@"' '"], @"'..", nil] componentsJoinedByString:@""]);
NSError *error = nil;

File diff suppressed because it is too large Load Diff

View File

@@ -1,40 +1,35 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <rpl/event_stream.h>
#include "base/timer.h"
#include "core/single_timer.h"
#include "mtproto/sender.h"
#include "base/flat_map.h"
#include "base/flat_set.h"
#include "core/single_timer.h"
#include "mtproto/sender.h"
#include "chat_helpers/stickers.h"
#include "data/data_messages.h"
class TaskQueue;
class AuthSession;
struct MessageGroupId;
struct SendingAlbum;
enum class SendMediaType;
namespace Storage {
enum class SharedMediaType : char;
enum class SharedMediaType : signed char;
struct PreparedList;
} // namespace Storage
enum class SparseIdsLoadDirection;
namespace Dialogs {
class Key;
} // namespace Dialogs
namespace Api {
@@ -46,24 +41,58 @@ inline const MTPVector<MTPChat> *getChatsFromMessagesChats(const MTPmessages_Cha
return nullptr;
}
template <typename IntRange>
inline int32 CountHash(IntRange &&range) {
uint32 acc = 0;
for (auto value : range) {
acc += (acc * 20261) + uint32(value);
}
return int32(acc & 0x7FFFFFFF);
}
} // namespace Api
class ApiWrap : private MTP::Sender, private base::Subscriber {
public:
ApiWrap(not_null<AuthSession*> session);
void start();
void applyUpdates(const MTPUpdates &updates, uint64 sentMessageRandomId = 0);
void savePinnedOrder();
//void toggleChannelGrouping( // #feed
// not_null<ChannelData*> channel,
// bool group,
// base::lambda<void()> callback);
//void ungroupAllFromFeed(not_null<Data::Feed*> feed);
using RequestMessageDataCallback = base::lambda<void(ChannelData*, MsgId)>;
void requestMessageData(ChannelData *channel, MsgId msgId, RequestMessageDataCallback callback);
void requestMessageData(
ChannelData *channel,
MsgId msgId,
RequestMessageDataCallback callback);
void requestContacts();
void requestDialogEntry(not_null<Data::Feed*> feed);
//void requestFeedDialogsEntries(not_null<Data::Feed*> feed);
void requestDialogEntry(not_null<History*> history);
//void applyFeedSources(const MTPDchannels_feedSources &data); // #feed
//void setFeedChannels(
// not_null<Data::Feed*> feed,
// const std::vector<not_null<ChannelData*>> &channels);
void requestFullPeer(PeerData *peer);
void requestPeer(PeerData *peer);
void requestPeers(const QList<PeerData*> &peers);
void requestLastParticipants(ChannelData *channel);
void requestBots(ChannelData *channel);
void requestParticipantsCountDelayed(ChannelData *channel);
void requestLastParticipants(not_null<ChannelData*> channel);
void requestBots(not_null<ChannelData*> channel);
void requestAdmins(not_null<ChannelData*> channel);
void requestParticipantsCountDelayed(not_null<ChannelData*> channel);
void requestChannelRangeDifference(not_null<History*> history);
void requestChangelog(
const QString &sinceVersion,
base::lambda<void(const MTPUpdates &result)> callback);
void requestChannelMembersForAdd(
not_null<ChannelData*> channel,
@@ -71,9 +100,21 @@ public:
void processFullPeer(PeerData *peer, const MTPmessages_ChatFull &result);
void processFullPeer(UserData *user, const MTPUserFull &result);
void markMediaRead(const base::flat_set<not_null<HistoryItem*>> &items);
void markMediaRead(not_null<HistoryItem*> item);
void requestSelfParticipant(ChannelData *channel);
void kickParticipant(PeerData *peer, UserData *user, const MTPChannelBannedRights &currentRights);
void unblockParticipant(PeerData *peer, UserData *user);
void kickParticipant(not_null<ChatData*> chat, not_null<UserData*> user);
void kickParticipant(
not_null<ChannelData*> channel,
not_null<UserData*> user,
const MTPChannelBannedRights &currentRights);
void unblockParticipant(
not_null<ChannelData*> channel,
not_null<UserData*> user);
void deleteAllFromUser(
not_null<ChannelData*> channel,
not_null<UserData*> from);
void requestWebPageDelayed(WebPageData *page);
void clearWebPageRequest(WebPageData *page);
@@ -81,12 +122,19 @@ public:
void scheduleStickerSetRequest(uint64 setId, uint64 access);
void requestStickerSets();
void saveStickerSets(const Stickers::Order &localOrder, const Stickers::Order &localRemoved);
void saveStickerSets(
const Stickers::Order &localOrder,
const Stickers::Order &localRemoved);
void updateStickers();
void setGroupStickerSet(not_null<ChannelData*> megagroup, const MTPInputStickerSet &set);
void requestRecentStickersForce();
void setGroupStickerSet(
not_null<ChannelData*> megagroup,
const MTPInputStickerSet &set);
std::vector<not_null<DocumentData*>> *stickersByEmoji(
not_null<EmojiPtr> emoji);
void joinChannel(ChannelData *channel);
void leaveChannel(ChannelData *channel);
void joinChannel(not_null<ChannelData*> channel);
void leaveChannel(not_null<ChannelData*> channel);
void blockUser(UserData *user);
void unblockUser(UserData *user);
@@ -111,7 +159,7 @@ public:
void applyUpdatesNoPtsCheck(const MTPUpdates &updates);
void applyUpdateNoPtsCheck(const MTPUpdate &update);
void jumpToDate(not_null<PeerData*> peer, const QDate &date);
void jumpToDate(Dialogs::Key chat, const QDate &date);
void preloadEnoughUnreadMentions(not_null<History*> history);
void checkForUnreadMentions(const base::flat_set<MsgId> &possiblyReadMentions, ChannelData *channel = nullptr);
@@ -121,7 +169,7 @@ public:
bool adminsEnabled,
base::flat_set<not_null<UserData*>> &&admins);
using SliceType = SparseIdsLoadDirection;
using SliceType = Data::LoadDirection;
void requestSharedMedia(
not_null<PeerData*> peer,
Storage::SharedMediaType type,
@@ -135,6 +183,14 @@ public:
not_null<UserData*> user,
PhotoId afterId);
//void requestFeedChannels( // #feed
// not_null<Data::Feed*> feed);
//void requestFeedMessages(
// not_null<Data::Feed*> feed,
// Data::MessagePosition messageId,
// SliceType slice);
//void saveDefaultFeedId(FeedId id, bool isDefaultFeedId);
void stickerSetInstalled(uint64 setId) {
_stickerSetInstalled.fire_copy(setId);
}
@@ -158,6 +214,63 @@ public:
const QVector<MTPChannelParticipant> &list)> callbackList,
base::lambda<void()> callbackNotModified = nullptr);
struct SendOptions {
SendOptions(not_null<History*> history) : history(history) {
}
not_null<History*> history;
MsgId replyTo = 0;
WebPageId webPageId = 0;
bool clearDraft = false;
bool generateLocal = true;
};
rpl::producer<SendOptions> sendActions() const {
return _sendActions.events();
}
void sendAction(const SendOptions &options);
void forwardMessages(
HistoryItemsList &&items,
const SendOptions &options,
base::lambda_once<void()> &&successCallback = nullptr);
void shareContact(
const QString &phone,
const QString &firstName,
const QString &lastName,
const SendOptions &options);
void shareContact(not_null<UserData*> user, const SendOptions &options);
void readServerHistory(not_null<History*> history);
void readServerHistoryForce(not_null<History*> history);
void readFeed(
not_null<Data::Feed*> feed,
Data::MessagePosition position);
void sendVoiceMessage(
QByteArray result,
VoiceWaveform waveform,
int duration,
const SendOptions &options);
void sendFiles(
Storage::PreparedList &&list,
SendMediaType type,
QString caption,
std::shared_ptr<SendingAlbum> album,
const SendOptions &options);
void sendFile(
const QByteArray &fileContent,
SendMediaType type,
const SendOptions &options);
void sendUploadedPhoto(
FullMsgId localId,
const MTPInputFile &file,
bool silent);
void sendUploadedDocument(
FullMsgId localId,
const MTPInputFile &file,
const base::optional<MTPInputFile> &thumb,
bool silent);
void cancelLocalItem(not_null<HistoryItem*> item);
~ApiWrap();
private:
@@ -169,8 +282,12 @@ private:
using MessageDataRequests = QMap<MsgId, MessageDataRequest>;
using SharedMediaType = Storage::SharedMediaType;
void requestAppChangelogs();
void addLocalChangelogs(int oldAppVersion);
struct StickersByEmoji {
std::vector<not_null<DocumentData*>> list;
QString hash;
TimeMs received = 0;
};
void updatesReceived(const MTPUpdates &updates);
void checkQuitPreventFinished();
@@ -182,32 +299,54 @@ private:
ChannelData *channel,
mtpRequestId requestId);
QVector<MTPint> collectMessageIds(const MessageDataRequests &requests);
QVector<MTPInputMessage> collectMessageIds(const MessageDataRequests &requests);
MessageDataRequests *messageDataRequests(ChannelData *channel, bool onlyExisting = false);
void applyPeerDialogs(const MTPmessages_PeerDialogs &dialogs);
void historyDialogEntryApplied(not_null<History*> history);
void applyFeedDialogs(
not_null<Data::Feed*> feed,
const MTPmessages_Dialogs &dialogs);
void gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mtpRequestId req);
void gotUserFull(UserData *user, const MTPUserFull &result, mtpRequestId req);
void lastParticipantsDone(
ChannelData *peer,
const MTPchannels_ChannelParticipants &result,
mtpRequestId req);
void applyLastParticipantsList(
ChannelData *peer,
not_null<ChannelData*> channel,
int availableCount,
const QVector<MTPChannelParticipant> &list,
bool bots,
bool fromStart);
const QVector<MTPChannelParticipant> &list);
void applyBotsList(
not_null<ChannelData*> channel,
int availableCount,
const QVector<MTPChannelParticipant> &list);
void applyAdminsList(
not_null<ChannelData*> channel,
int availableCount,
const QVector<MTPChannelParticipant> &list);
void resolveWebPages();
void gotWebPages(ChannelData *channel, const MTPmessages_Messages &result, mtpRequestId req);
void gotWebPages(
ChannelData *channel,
const MTPmessages_Messages &result,
mtpRequestId req);
void gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result);
PeerData *notifySettingReceived(MTPInputNotifyPeer peer, const MTPPeerNotifySettings &settings);
void channelRangeDifferenceSend(
not_null<ChannelData*> channel,
MsgRange range,
int32 pts);
void channelRangeDifferenceDone(
not_null<ChannelData*> channel,
MsgRange range,
const MTPupdates_ChannelDifference &result);
PeerData *notifySettingReceived(
MTPInputNotifyPeer peer,
const MTPPeerNotifySettings &settings);
void stickerSetDisenabled(mtpRequestId requestId);
void stickersSaveOrder();
void requestStickers(TimeId now);
void requestRecentStickers(TimeId now);
void requestRecentStickersWithHash(int32 hash);
void requestFavedStickers(TimeId now);
void requestFeaturedStickers(TimeId now);
void requestSavedGifs(TimeId now);
@@ -220,15 +359,19 @@ private:
not_null<ChannelData*> channel,
const QVector<MTPChannelParticipant> &participants);
void jumpToHistoryDate(not_null<PeerData*> peer, const QDate &date);
void jumpToFeedDate(not_null<Data::Feed*> feed, const QDate &date);
template <typename Callback>
void requestMessageAfterDate(
not_null<PeerData*> peer,
const QDate &date,
Callback &&callback);
int applyAffectedHistory(
not_null<PeerData*> peer,
const MTPmessages_AffectedHistory &result);
template <typename Callback>
void requestMessageAfterDate(
not_null<Data::Feed*> feed,
const QDate &date,
Callback &&callback);
void sharedMediaDone(
not_null<PeerData*> peer,
@@ -242,8 +385,59 @@ private:
PhotoId photoId,
const MTPphotos_Photos &result);
//void feedChannelsDone(not_null<Data::Feed*> feed); // #feed
//void feedMessagesDone(
// not_null<Data::Feed*> feed,
// Data::MessagePosition messageId,
// SliceType slice,
// const MTPmessages_FeedMessages &result);
void sendSharedContact(
const QString &phone,
const QString &firstName,
const QString &lastName,
UserId userId,
const SendOptions &options);
void sendReadRequest(not_null<PeerData*> peer, MsgId upTo);
int applyAffectedHistory(
not_null<PeerData*> peer,
const MTPmessages_AffectedHistory &result);
void applyAffectedMessages(const MTPmessages_AffectedMessages &result);
void applyAffectedMessages(
not_null<PeerData*> peer,
const MTPmessages_AffectedMessages &result);
void deleteAllFromUserSend(
not_null<ChannelData*> channel,
not_null<UserData*> from);
void sendMessageFail(const RPCError &error);
void uploadAlbumMedia(
not_null<HistoryItem*> item,
const MessageGroupId &groupId,
const MTPInputMedia &media);
void sendAlbumWithUploaded(
not_null<HistoryItem*> item,
const MessageGroupId &groupId,
const MTPInputMedia &media);
void sendAlbumWithCancelled(
not_null<HistoryItem*> item,
const MessageGroupId &groupId);
void sendAlbumIfReady(not_null<SendingAlbum*> album);
void sendMedia(
not_null<HistoryItem*> item,
const MTPInputMedia &media,
bool silent);
void sendMediaWithRandomId(
not_null<HistoryItem*> item,
const MTPInputMedia &media,
bool silent,
uint64 randomId);
void readFeeds();
not_null<AuthSession*> _session;
mtpRequestId _changelogSubscription = 0;
MessageDataRequests _messageDataRequests;
QMap<ChannelData*, MessageDataRequests> _channelMessageDataRequests;
@@ -255,18 +449,28 @@ private:
PeerRequests _participantsRequests;
PeerRequests _botsRequests;
PeerRequests _adminsRequests;
base::DelayedCallTimer _participantsCountRequestTimer;
ChannelData *_channelMembersForAdd = nullptr;
mtpRequestId _channelMembersForAddRequestId = 0;
base::lambda<void(const MTPchannels_ChannelParticipants&)> _channelMembersForAddCallback;
base::lambda<void(
const MTPchannels_ChannelParticipants&)> _channelMembersForAddCallback;
base::flat_map<
not_null<ChannelData*>,
std::pair<mtpRequestId,base::lambda<void()>>> _channelGroupingRequests;
typedef QPair<PeerData*, UserData*> KickRequest;
typedef QMap<KickRequest, mtpRequestId> KickRequests;
KickRequests _kickRequests;
using KickRequest = std::pair<
not_null<ChannelData*>,
not_null<UserData*>>;
base::flat_map<KickRequest, mtpRequestId> _kickRequests;
QMap<ChannelData*, mtpRequestId> _selfParticipantRequests;
base::flat_map<
not_null<ChannelData*>,
mtpRequestId> _rangeDifferenceRequests;
QMap<WebPageData*, mtpRequestId> _webPagesPending;
base::Timer _webPagesTimer;
@@ -295,9 +499,14 @@ private:
base::Timer _featuredSetsReadTimer;
base::flat_set<uint64> _featuredSetsRead;
QMap<mtpTypeId, mtpRequestId> _privacySaveRequests;
base::flat_map<not_null<EmojiPtr>, StickersByEmoji> _stickersByEmoji;
base::flat_map<mtpTypeId, mtpRequestId> _privacySaveRequests;
mtpRequestId _contactsRequestId = 0;
mtpRequestId _contactsStatusesRequestId = 0;
base::flat_set<not_null<Data::Feed*>> _dialogFeedRequests;
base::flat_set<not_null<History*>> _dialogRequests;
base::flat_map<not_null<History*>, mtpRequestId> _unreadMentionsRequests;
@@ -319,8 +528,43 @@ private:
base::flat_map<not_null<UserData*>, mtpRequestId> _userPhotosRequests;
base::flat_set<not_null<Data::Feed*>> _feedChannelsGetRequests;
base::flat_map<
not_null<Data::Feed*>,
mtpRequestId> _feedChannelsSetRequests;
base::flat_set<std::tuple<
not_null<Data::Feed*>,
Data::MessagePosition,
SliceType>> _feedMessagesRequests;
base::flat_set<std::tuple<
not_null<Data::Feed*>,
Data::MessagePosition,
SliceType>> _feedMessagesRequestsPending;
mtpRequestId _saveDefaultFeedIdRequest = 0;
rpl::event_stream<SendOptions> _sendActions;
struct ReadRequest {
ReadRequest(mtpRequestId requestId, MsgId upTo)
: requestId(requestId)
, upTo(upTo) {
}
mtpRequestId requestId = 0;
MsgId upTo = 0;
};
base::flat_map<not_null<PeerData*>, ReadRequest> _readRequests;
base::flat_map<not_null<PeerData*>, MsgId> _readRequestsPending;
std::unique_ptr<TaskQueue> _fileLoader;
base::flat_map<uint64, std::shared_ptr<SendingAlbum>> _sendingAlbums;
base::Observable<PeerData*> _fullPeerUpdated;
rpl::event_stream<uint64> _stickerSetInstalled;
base::flat_map<not_null<Data::Feed*>, TimeMs> _feedReadsDelayed;
base::flat_map<not_null<Data::Feed*>, mtpRequestId> _feedReadRequests;
base::Timer _feedReadTimer;
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,47 +1,67 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "core/basic_types.h"
#include "history/history.h"
#include "history/history_item.h"
#include "layout.h"
#include "data/data_types.h"
#include "data/data_peer.h"
enum NewMessageType : char;
class Messenger;
class MainWindow;
class MainWidget;
using HistoryItemsMap = OrderedSet<HistoryItem*>;
using PhotoItems = QHash<PhotoData*, HistoryItemsMap>;
using DocumentItems = QHash<DocumentData*, HistoryItemsMap>;
using WebPageItems = QHash<WebPageData*, HistoryItemsMap>;
using GameItems = QHash<GameData*, HistoryItemsMap>;
using SharedContactItems = QHash<int32, HistoryItemsMap>;
using GifItems = QHash<Media::Clip::Reader*, HistoryItem*>;
using PhotosData = QHash<PhotoId, PhotoData*>;
using DocumentsData = QHash<DocumentId, DocumentData*>;
class LocationCoords;
struct LocationData;
class HistoryItem;
class History;
class Histories;
namespace HistoryView {
class Element;
} // namespace HistoryView
using HistoryItemsMap = base::flat_set<not_null<HistoryItem*>>;
using GifItems = QHash<Media::Clip::Reader*, HistoryItem*>;
enum RoundCorners {
SmallMaskCorners = 0x00, // for images
LargeMaskCorners,
BoxCorners,
MenuCorners,
BotKbOverCorners,
StickerCorners,
StickerSelectedCorners,
SelectedOverlaySmallCorners,
SelectedOverlayLargeCorners,
DateCorners,
DateSelectedCorners,
ForwardCorners,
MediaviewSaveCorners,
EmojiHoverCorners,
StickerHoverCorners,
BotKeyboardCorners,
PhotoSelectOverlayCorners,
Doc1Corners,
Doc2Corners,
Doc3Corners,
Doc4Corners,
InShadowCorners, // for photos without bg
InSelectedShadowCorners,
MessageInCorners, // with shadow
MessageInSelectedCorners,
MessageOutCorners,
MessageOutSelectedCorners,
RoundCornersCount
};
namespace App {
MainWindow *wnd();
@@ -52,14 +72,6 @@ namespace App {
QString formatPhone(QString phone);
TimeId onlineForSort(UserData *user, TimeId now);
int32 onlineWillChangeIn(UserData *user, TimeId now);
int32 onlineWillChangeIn(TimeId online, TimeId now);
QString onlineText(UserData *user, TimeId now, bool precise = false);
QString onlineText(TimeId online, TimeId now, bool precise = false);
bool onlineColorUse(UserData *user, TimeId now);
bool onlineColorUse(TimeId online, TimeId now);
UserData *feedUser(const MTPUser &user);
UserData *feedUsers(const MTPVector<MTPUser> &users); // returns last user
PeerData *feedChat(const MTPChat &chat);
@@ -82,20 +94,6 @@ namespace App {
void feedUserLink(MTPint userId, const MTPContactLink &myLink, const MTPContactLink &foreignLink);
ImagePtr image(const MTPPhotoSize &size);
StorageImageLocation imageLocation(int32 w, int32 h, const MTPFileLocation &loc);
StorageImageLocation imageLocation(const MTPPhotoSize &size);
PhotoData *feedPhoto(const MTPPhoto &photo, const PreparedPhotoThumbs &thumbs);
PhotoData *feedPhoto(const MTPPhoto &photo, PhotoData *convert = nullptr);
PhotoData *feedPhoto(const MTPDphoto &photo, PhotoData *convert = nullptr);
DocumentData *feedDocument(const MTPdocument &document, const QPixmap &thumb);
DocumentData *feedDocument(const MTPdocument &document, DocumentData *convert = nullptr);
DocumentData *feedDocument(const MTPDdocument &document, DocumentData *convert = nullptr);
WebPageData *feedWebPage(const MTPDwebPage &webpage, WebPageData *convert = nullptr);
WebPageData *feedWebPage(const MTPDwebPagePending &webpage, WebPageData *convert = nullptr);
WebPageData *feedWebPage(const MTPWebPage &webpage);
WebPageData *feedWebPage(WebPageId webPageId, const QString &siteName, const TextWithEntities &content);
GameData *feedGame(const MTPDgame &game, GameData *convert = nullptr);
PeerData *peer(const PeerId &id, PeerData::LoadedStatus restriction = PeerData::NotLoaded);
inline UserData *user(const PeerId &id, PeerData::LoadedStatus restriction = PeerData::NotLoaded) {
@@ -142,14 +140,7 @@ namespace App {
UserData *self();
PeerData *peerByName(const QString &username);
QString peerName(const PeerData *peer, bool forDialogs = false);
PhotoData *photo(const PhotoId &photo);
PhotoData *photoSet(const PhotoId &photo, PhotoData *convert, const uint64 &access, int32 date, const ImagePtr &thumb, const ImagePtr &medium, const ImagePtr &full);
DocumentData *document(const DocumentId &document);
DocumentData *documentSet(const DocumentId &document, DocumentData *convert, const uint64 &access, int32 version, int32 date, const QVector<MTPDocumentAttribute> &attributes, const QString &mime, const ImagePtr &thumb, int32 dc, int32 size, const StorageImageLocation &thumbLocation);
WebPageData *webPage(const WebPageId &webPage);
WebPageData *webPageSet(const WebPageId &webPage, WebPageData *convert, const QString &type, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const TextWithEntities &description, PhotoData *photo, DocumentData *doc, int32 duration, const QString &author, int32 pendingTill);
GameData *game(const GameId &game);
GameData *gameSet(const GameId &game, GameData *convert, const uint64 &accessHash, const QString &shortName, const QString &title, const QString &description, PhotoData *photo, DocumentData *doc);
LocationData *location(const LocationCoords &coords);
void forgetMedia();
@@ -157,7 +148,6 @@ namespace App {
Histories &histories();
not_null<History*> history(const PeerId &peer);
History *historyFromDialog(const PeerId &peer, int32 unreadCnt, int32 maxInboxRead, int32 maxOutboxRead);
History *historyLoaded(const PeerId &peer);
HistoryItem *histItemById(ChannelId channelId, MsgId itemId);
inline not_null<History*> history(const PeerData *peer) {
@@ -173,10 +163,9 @@ namespace App {
inline HistoryItem *histItemById(const FullMsgId &msgId) {
return histItemById(msgId.channel, msgId.msg);
}
void historyRegItem(HistoryItem *item);
void historyItemDetached(HistoryItem *item);
void historyUnregItem(HistoryItem *item);
void historyUpdateDependent(HistoryItem *item);
void historyRegItem(not_null<HistoryItem*> item);
void historyUnregItem(not_null<HistoryItem*> item);
void historyUpdateDependent(not_null<HistoryItem*> item);
void historyClearMsgs();
void historyClearItems();
void historyRegDependency(HistoryItem *dependent, HistoryItem *dependency);
@@ -189,18 +178,16 @@ namespace App {
void historyUnregSentData(uint64 randomId);
void histSentDataByItem(uint64 randomId, PeerId &peerId, QString &text);
void hoveredItem(HistoryItem *item);
HistoryItem *hoveredItem();
void pressedItem(HistoryItem *item);
HistoryItem *pressedItem();
void hoveredLinkItem(HistoryItem *item);
HistoryItem *hoveredLinkItem();
void pressedLinkItem(HistoryItem *item);
HistoryItem *pressedLinkItem();
void contextItem(HistoryItem *item);
HistoryItem *contextItem();
void mousedItem(HistoryItem *item);
HistoryItem *mousedItem();
void hoveredItem(HistoryView::Element *item);
HistoryView::Element *hoveredItem();
void pressedItem(HistoryView::Element *item);
HistoryView::Element *pressedItem();
void hoveredLinkItem(HistoryView::Element *item);
HistoryView::Element *hoveredLinkItem();
void pressedLinkItem(HistoryView::Element *item);
HistoryView::Element *pressedLinkItem();
void mousedItem(HistoryView::Element *item);
HistoryView::Element *mousedItem();
void clearMousedItems();
const style::font &monofont();
@@ -234,36 +221,8 @@ namespace App {
QImage readImage(const QString &file, QByteArray *format = nullptr, bool opaque = true, bool *animated = nullptr, QByteArray *content = 0);
QPixmap pixmapFromImageInPlace(QImage &&image);
void regPhotoItem(PhotoData *data, HistoryItem *item);
void unregPhotoItem(PhotoData *data, HistoryItem *item);
const PhotoItems &photoItems();
const PhotosData &photosData();
void regDocumentItem(DocumentData *data, HistoryItem *item);
void unregDocumentItem(DocumentData *data, HistoryItem *item);
const DocumentItems &documentItems();
const DocumentsData &documentsData();
void regWebPageItem(WebPageData *data, HistoryItem *item);
void unregWebPageItem(WebPageData *data, HistoryItem *item);
const WebPageItems &webPageItems();
void regGameItem(GameData *data, HistoryItem *item);
void unregGameItem(GameData *data, HistoryItem *item);
const GameItems &gameItems();
void regSharedContactItem(int32 userId, HistoryItem *item);
void unregSharedContactItem(int32 userId, HistoryItem *item);
const SharedContactItems &sharedContactItems();
QString phoneFromSharedContact(int32 userId);
void regGifItem(Media::Clip::Reader *reader, HistoryItem *item);
void unregGifItem(Media::Clip::Reader *reader);
void stopRoundVideoPlayback();
void stopGifItems();
void regMuted(PeerData *peer, int32 changeIn);
void unregMuted(PeerData *peer);
void regMuted(not_null<PeerData*> peer, TimeMs changeIn);
void unregMuted(not_null<PeerData*> peer);
void updateMuted();
void setProxySettings(QNetworkAccessManager &manager);
@@ -272,8 +231,8 @@ namespace App {
#endif // !TDESKTOP_DISABLE_NETWORK_PROXY
void setProxySettings(QTcpSocket &socket);
void complexOverlayRect(Painter &p, QRect rect, ImageRoundRadius radius, ImageRoundCorners corners);
void complexLocationRect(Painter &p, QRect rect, ImageRoundRadius radius, ImageRoundCorners corners);
void complexOverlayRect(Painter &p, QRect rect, ImageRoundRadius radius, RectParts corners);
void complexLocationRect(Painter &p, QRect rect, ImageRoundRadius radius, RectParts corners);
QImage *cornersMask(ImageRoundRadius radius);
void roundRect(Painter &p, int32 x, int32 y, int32 w, int32 h, style::color bg, RoundCorners index, const style::color *shadow = nullptr, RectParts parts = RectPart::Full);

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "application.h"
@@ -26,8 +13,10 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "storage/localstorage.h"
#include "autoupdater.h"
#include "window/notifications_manager.h"
#include "core/crash_reports.h"
#include "messenger.h"
#include "base/timer.h"
#include "core/crash_report_window.h"
namespace {
@@ -71,8 +60,13 @@ QString _escapeFrom7bit(const QString &str) {
} // namespace
Application::Application(int &argc, char **argv) : QApplication(argc, argv) {
QByteArray d(QFile::encodeName(QDir(cWorkingDir()).absolutePath()));
Application::Application(
not_null<Core::Launcher*> launcher,
int &argc,
char **argv)
: QApplication(argc, argv)
, _launcher(launcher) {
const auto d = QFile::encodeName(QDir(cWorkingDir()).absolutePath());
char h[33] = { 0 };
hashMd5Hex(d.constData(), d.size(), h);
#ifndef OS_MAC_STORE
@@ -206,12 +200,12 @@ void Application::singleInstanceChecked() {
if (!Logs::started() || (!cManyInstance() && !Logs::instanceChecked())) {
new NotStartedWindow();
} else {
SignalHandlers::Status status = SignalHandlers::start();
if (status == SignalHandlers::CantOpen) {
const auto status = CrashReports::Start();
if (status == CrashReports::CantOpen) {
new NotStartedWindow();
} else if (status == SignalHandlers::LastCrashed) {
} else if (status == CrashReports::LastCrashed) {
if (Sandbox::LastCrashDump().isEmpty()) { // don't handle bad closing for now
if (SignalHandlers::restart() == SignalHandlers::CantOpen) {
if (CrashReports::Restart() == CrashReports::CantOpen) {
new NotStartedWindow();
} else {
Sandbox::launch();
@@ -313,7 +307,7 @@ void Application::startApplication() {
void Application::createMessenger() {
Expects(!App::quitting());
_messengerInstance = std::make_unique<Messenger>();
_messengerInstance = std::make_unique<Messenger>(_launcher);
}
void Application::closeApplication() {

View File

@@ -1,31 +1,23 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
class UpdateChecker;
namespace Core {
class Launcher;
} // namespace Core
class Application : public QApplication {
Q_OBJECT
public:
Application(int &argc, char **argv);
Application(not_null<Core::Launcher*> launcher, int &argc, char **argv);
bool event(QEvent *e) override;
@@ -55,6 +47,7 @@ private:
typedef QPair<QLocalSocket*, QByteArray> LocalClient;
typedef QList<LocalClient> LocalClients;
not_null<Core::Launcher*> _launcher;
std::unique_ptr<Messenger> _messengerInstance;
QString _localServerName, _localSocketReadData;

View File

@@ -1,37 +1,28 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "auth_session.h"
#include "apiwrap.h"
#include "messenger.h"
#include "core/changelogs.h"
#include "storage/file_download.h"
#include "storage/file_upload.h"
#include "storage/localstorage.h"
#include "storage/storage_facade.h"
#include "storage/serialize_common.h"
#include "data/data_session.h"
#include "window/notifications_manager.h"
#include "window/themes/window_theme.h"
#include "platform/platform_specific.h"
#include "calls/calls_instance.h"
#include "window/section_widget.h"
#include "chat_helpers/tabbed_selector.h"
#include "boxes/send_files_box.h"
namespace {
@@ -39,13 +30,14 @@ constexpr auto kAutoLockTimeoutLateMs = TimeMs(3000);
} // namespace
AuthSessionData::Variables::Variables()
: selectorTab(ChatHelpers::SelectorTab::Emoji)
AuthSessionSettings::Variables::Variables()
: sendFilesWay(SendFilesWay::Album)
, selectorTab(ChatHelpers::SelectorTab::Emoji)
, floatPlayerColumn(Window::Column::Second)
, floatPlayerCorner(RectPart::TopRight) {
}
QByteArray AuthSessionData::serialize() const {
QByteArray AuthSessionSettings::serialize() const {
auto size = sizeof(qint32) * 10;
for (auto i = _variables.soundOverrides.cbegin(), e = _variables.soundOverrides.cend(); i != e; ++i) {
size += Serialize::stringSize(i.key()) + Serialize::stringSize(i.value());
@@ -79,11 +71,12 @@ QByteArray AuthSessionData::serialize() const {
1000000));
stream << qint32(_variables.thirdColumnWidth.current());
stream << qint32(_variables.thirdSectionExtendedBy);
stream << qint32(_variables.sendFilesWay);
}
return result;
}
void AuthSessionData::constructFromSerialized(const QByteArray &serialized) {
void AuthSessionSettings::constructFromSerialized(const QByteArray &serialized) {
if (serialized.isEmpty()) {
return;
}
@@ -103,6 +96,7 @@ void AuthSessionData::constructFromSerialized(const QByteArray &serialized) {
float64 dialogsWidthRatio = _variables.dialogsWidthRatio.current();
int thirdColumnWidth = _variables.thirdColumnWidth.current();
int thirdSectionExtendedBy = _variables.thirdSectionExtendedBy;
qint32 sendFilesWay = static_cast<qint32>(_variables.sendFilesWay);
stream >> selectorTab;
stream >> lastSeenWarningSeen;
if (!stream.atEnd()) {
@@ -152,7 +146,8 @@ void AuthSessionData::constructFromSerialized(const QByteArray &serialized) {
thirdSectionExtendedBy = value;
}
if (stream.status() != QDataStream::Ok) {
LOG(("App Error: Bad data for AuthSessionData::constructFromSerialized()"));
LOG(("App Error: "
"Bad data for AuthSessionSettings::constructFromSerialized()"));
return;
}
@@ -188,91 +183,15 @@ void AuthSessionData::constructFromSerialized(const QByteArray &serialized) {
if (_variables.thirdSectionInfoEnabled) {
_variables.tabbedSelectorSectionEnabled = false;
}
auto uncheckedSendFilesWay = static_cast<SendFilesWay>(sendFilesWay);
switch (uncheckedSendFilesWay) {
case SendFilesWay::Album:
case SendFilesWay::Photos:
case SendFilesWay::Files: _variables.sendFilesWay = uncheckedSendFilesWay;
}
}
void AuthSessionData::markItemLayoutChanged(not_null<const HistoryItem*> item) {
_itemLayoutChanged.fire_copy(item);
}
rpl::producer<not_null<const HistoryItem*>> AuthSessionData::itemLayoutChanged() const {
return _itemLayoutChanged.events();
}
void AuthSessionData::requestItemRepaint(not_null<const HistoryItem*> item) {
_itemRepaintRequest.fire_copy(item);
}
rpl::producer<not_null<const HistoryItem*>> AuthSessionData::itemRepaintRequest() const {
return _itemRepaintRequest.events();
}
void AuthSessionData::markItemRemoved(not_null<const HistoryItem*> item) {
_itemRemoved.fire_copy(item);
}
rpl::producer<not_null<const HistoryItem*>> AuthSessionData::itemRemoved() const {
return _itemRemoved.events();
}
void AuthSessionData::markHistoryUnloaded(not_null<const History*> history) {
_historyUnloaded.fire_copy(history);
}
rpl::producer<not_null<const History*>> AuthSessionData::historyUnloaded() const {
return _historyUnloaded.events();
}
void AuthSessionData::markHistoryCleared(not_null<const History*> history) {
_historyCleared.fire_copy(history);
}
rpl::producer<not_null<const History*>> AuthSessionData::historyCleared() const {
return _historyCleared.events();
}
void AuthSessionData::removeMegagroupParticipant(
not_null<ChannelData*> channel,
not_null<UserData*> user) {
_megagroupParticipantRemoved.fire({ channel, user });
}
auto AuthSessionData::megagroupParticipantRemoved() const -> rpl::producer<MegagroupParticipant> {
return _megagroupParticipantRemoved.events();
}
rpl::producer<not_null<UserData*>> AuthSessionData::megagroupParticipantRemoved(
not_null<ChannelData*> channel) const {
return megagroupParticipantRemoved()
| rpl::filter([channel](auto updateChannel, auto user) {
return (updateChannel == channel);
})
| rpl::map([](auto updateChannel, auto user) {
return user;
});
}
void AuthSessionData::addNewMegagroupParticipant(
not_null<ChannelData*> channel,
not_null<UserData*> user) {
_megagroupParticipantAdded.fire({ channel, user });
}
auto AuthSessionData::megagroupParticipantAdded() const -> rpl::producer<MegagroupParticipant> {
return _megagroupParticipantAdded.events();
}
rpl::producer<not_null<UserData*>> AuthSessionData::megagroupParticipantAdded(
not_null<ChannelData*> channel) const {
return megagroupParticipantAdded()
| rpl::filter([channel](auto updateChannel, auto user) {
return (updateChannel == channel);
})
| rpl::map([](auto updateChannel, auto user) {
return user;
});
}
void AuthSessionData::setTabbedSelectorSectionEnabled(bool enabled) {
void AuthSessionSettings::setTabbedSelectorSectionEnabled(bool enabled) {
_variables.tabbedSelectorSectionEnabled = enabled;
if (enabled) {
setThirdSectionInfoEnabled(false);
@@ -280,12 +199,12 @@ void AuthSessionData::setTabbedSelectorSectionEnabled(bool enabled) {
setTabbedReplacedWithInfo(false);
}
rpl::producer<bool> AuthSessionData::tabbedReplacedWithInfoValue() const {
rpl::producer<bool> AuthSessionSettings::tabbedReplacedWithInfoValue() const {
return _tabbedReplacedWithInfoValue.events_starting_with(
tabbedReplacedWithInfo());
}
void AuthSessionData::setThirdSectionInfoEnabled(bool enabled) {
void AuthSessionSettings::setThirdSectionInfoEnabled(bool enabled) {
if (_variables.thirdSectionInfoEnabled != enabled) {
_variables.thirdSectionInfoEnabled = enabled;
if (enabled) {
@@ -296,19 +215,19 @@ void AuthSessionData::setThirdSectionInfoEnabled(bool enabled) {
}
}
rpl::producer<bool> AuthSessionData::thirdSectionInfoEnabledValue() const {
rpl::producer<bool> AuthSessionSettings::thirdSectionInfoEnabledValue() const {
return _thirdSectionInfoEnabledValue.events_starting_with(
thirdSectionInfoEnabled());
}
void AuthSessionData::setTabbedReplacedWithInfo(bool enabled) {
void AuthSessionSettings::setTabbedReplacedWithInfo(bool enabled) {
if (_tabbedReplacedWithInfo != enabled) {
_tabbedReplacedWithInfo = enabled;
_tabbedReplacedWithInfoValue.fire_copy(enabled);
}
}
QString AuthSessionData::getSoundPath(const QString &key) const {
QString AuthSessionSettings::getSoundPath(const QString &key) const {
auto it = _variables.soundOverrides.constFind(key);
if (it != _variables.soundOverrides.end()) {
return it.value();
@@ -316,46 +235,30 @@ QString AuthSessionData::getSoundPath(const QString &key) const {
return qsl(":/sounds/") + key + qsl(".mp3");
}
void AuthSessionData::setDialogsWidthRatio(float64 ratio) {
void AuthSessionSettings::setDialogsWidthRatio(float64 ratio) {
_variables.dialogsWidthRatio = ratio;
}
float64 AuthSessionData::dialogsWidthRatio() const {
float64 AuthSessionSettings::dialogsWidthRatio() const {
return _variables.dialogsWidthRatio.current();
}
rpl::producer<float64> AuthSessionData::dialogsWidthRatioChanges() const {
rpl::producer<float64> AuthSessionSettings::dialogsWidthRatioChanges() const {
return _variables.dialogsWidthRatio.changes();
}
void AuthSessionData::setThirdColumnWidth(int width) {
void AuthSessionSettings::setThirdColumnWidth(int width) {
_variables.thirdColumnWidth = width;
}
int AuthSessionData::thirdColumnWidth() const {
int AuthSessionSettings::thirdColumnWidth() const {
return _variables.thirdColumnWidth.current();
}
rpl::producer<int> AuthSessionData::thirdColumnWidthChanges() const {
rpl::producer<int> AuthSessionSettings::thirdColumnWidthChanges() const {
return _variables.thirdColumnWidth.changes();
}
void AuthSessionData::markStickersUpdated() {
_stickersUpdated.fire({});
}
rpl::producer<> AuthSessionData::stickersUpdated() const {
return _stickersUpdated.events();
}
void AuthSessionData::markSavedGifsUpdated() {
_savedGifsUpdated.fire({});
}
rpl::producer<> AuthSessionData::savedGifsUpdated() const {
return _savedGifsUpdated.events();
}
AuthSession &Auth() {
auto result = Messenger::Instance().authSession();
Assert(result != nullptr);
@@ -370,16 +273,19 @@ AuthSession::AuthSession(UserId userId)
, _downloader(std::make_unique<Storage::Downloader>())
, _uploader(std::make_unique<Storage::Uploader>())
, _storage(std::make_unique<Storage::Facade>())
, _notifications(std::make_unique<Window::Notifications::System>(this)) {
, _notifications(std::make_unique<Window::Notifications::System>(this))
, _data(std::make_unique<Data::Session>(this))
, _changelogs(Core::Changelogs::Create(this)) {
Expects(_userId != 0);
_saveDataTimer.setCallback([this] {
_saveDataTimer.setCallback([=] {
Local::writeUserSettings();
});
subscribe(Messenger::Instance().passcodedChanged(), [this] {
subscribe(Messenger::Instance().passcodedChanged(), [=] {
_shouldLockAt = 0;
notifications().updateAll();
});
_api->start();
Window::Theme::Background()->start();
}
bool AuthSession::Exists() {
@@ -406,7 +312,7 @@ bool AuthSession::validateSelf(const MTPUser &user) {
return true;
}
void AuthSession::saveDataDelayed(TimeMs delay) {
void AuthSession::saveSettingsDelayed(TimeMs delay) {
Expects(this == &Auth());
_saveDataTimer.callOnce(delay);
}
@@ -418,7 +324,7 @@ void AuthSession::checkAutoLock() {
auto now = getms(true);
auto shouldLockInMs = Global::AutoLock() * 1000LL;
auto idleForMs = psIdleTime();
auto notPlayingVideoForMs = now - data().lastTimeVideoPlayedAt();
auto notPlayingVideoForMs = now - settings().lastTimeVideoPlayedAt();
auto checkTimeMs = qMin(idleForMs, notPlayingVideoForMs);
if (checkTimeMs >= shouldLockInMs || (_shouldLockAt > 0 && now > _shouldLockAt + kAutoLockTimeoutLateMs)) {
Messenger::Instance().setupPasscode();

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
@@ -24,7 +11,13 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include <rpl/filter.h>
#include <rpl/variable.h>
#include "base/timer.h"
#include "chat_helpers/stickers.h"
class ApiWrap;
enum class SendFilesWay;
namespace Data {
class Session;
} // namespace Data
namespace Storage {
class Downloader;
@@ -47,66 +40,29 @@ namespace ChatHelpers {
enum class SelectorTab;
} // namespace ChatHelpers
class ApiWrap;
namespace Core {
class Changelogs;
} // namespace Core
class AuthSessionData final {
class AuthSessionSettings final {
public:
base::Variable<bool> &contactsLoaded() {
return _contactsLoaded;
}
base::Variable<bool> &allChatsLoaded() {
return _allChatsLoaded;
}
base::Observable<void> &moreChatsLoaded() {
return _moreChatsLoaded;
}
base::Observable<void> &pendingHistoryResize() {
return _pendingHistoryResize;
}
struct ItemVisibilityQuery {
not_null<HistoryItem*> item;
not_null<bool*> isVisible;
};
base::Observable<ItemVisibilityQuery> &queryItemVisibility() {
return _queryItemVisibility;
}
void markItemLayoutChanged(not_null<const HistoryItem*> item);
rpl::producer<not_null<const HistoryItem*>> itemLayoutChanged() const;
void requestItemRepaint(not_null<const HistoryItem*> item);
rpl::producer<not_null<const HistoryItem*>> itemRepaintRequest() const;
void markItemRemoved(not_null<const HistoryItem*> item);
rpl::producer<not_null<const HistoryItem*>> itemRemoved() const;
void markHistoryUnloaded(not_null<const History*> history);
rpl::producer<not_null<const History*>> historyUnloaded() const;
void markHistoryCleared(not_null<const History*> history);
rpl::producer<not_null<const History*>> historyCleared() const;
using MegagroupParticipant = std::tuple<
not_null<ChannelData*>,
not_null<UserData*>>;
void removeMegagroupParticipant(
not_null<ChannelData*> channel,
not_null<UserData*> user);
rpl::producer<MegagroupParticipant> megagroupParticipantRemoved() const;
rpl::producer<not_null<UserData*>> megagroupParticipantRemoved(
not_null<ChannelData*> channel) const;
void addNewMegagroupParticipant(
not_null<ChannelData*> channel,
not_null<UserData*> user);
rpl::producer<MegagroupParticipant> megagroupParticipantAdded() const;
rpl::producer<not_null<UserData*>> megagroupParticipantAdded(
not_null<ChannelData*> channel) const;
void moveFrom(AuthSessionData &&other) {
void moveFrom(AuthSessionSettings &&other) {
_variables = std::move(other._variables);
}
QByteArray serialize() const;
void constructFromSerialized(const QByteArray &serialized);
void setLastSeenWarningSeen(bool lastSeenWarningSeen) {
_variables.lastSeenWarningSeen = lastSeenWarningSeen;
}
bool lastSeenWarningSeen() const {
return _variables.lastSeenWarningSeen;
}
void setLastSeenWarningSeen(bool lastSeenWarningSeen) {
_variables.lastSeenWarningSeen = lastSeenWarningSeen;
void setSendFilesWay(SendFilesWay way) {
_variables.sendFilesWay = way;
}
SendFilesWay sendFilesWay() const {
return _variables.sendFilesWay;
}
ChatHelpers::SelectorTab selectorTab() const {
return _variables.selectorTab;
@@ -178,10 +134,6 @@ public:
int thirdColumnWidth() const;
rpl::producer<int> thirdColumnWidthChanges() const;
void markStickersUpdated();
rpl::producer<> stickersUpdated() const;
void markSavedGifsUpdated();
rpl::producer<> savedGifsUpdated() const;
void setGroupStickersSectionHidden(PeerId peerId) {
_variables.groupStickersSectionHidden.insert(peerId);
}
@@ -191,75 +143,6 @@ public:
void removeGroupStickersSectionHidden(PeerId peerId) {
_variables.groupStickersSectionHidden.remove(peerId);
}
bool stickersUpdateNeeded(TimeMs now) const {
return stickersUpdateNeeded(_lastStickersUpdate, now);
}
void setLastStickersUpdate(TimeMs update) {
_lastStickersUpdate = update;
}
bool recentStickersUpdateNeeded(TimeMs now) const {
return stickersUpdateNeeded(_lastRecentStickersUpdate, now);
}
void setLastRecentStickersUpdate(TimeMs update) {
_lastRecentStickersUpdate = update;
}
bool favedStickersUpdateNeeded(TimeMs now) const {
return stickersUpdateNeeded(_lastFavedStickersUpdate, now);
}
void setLastFavedStickersUpdate(TimeMs update) {
_lastFavedStickersUpdate = update;
}
bool featuredStickersUpdateNeeded(TimeMs now) const {
return stickersUpdateNeeded(_lastFeaturedStickersUpdate, now);
}
void setLastFeaturedStickersUpdate(TimeMs update) {
_lastFeaturedStickersUpdate = update;
}
bool savedGifsUpdateNeeded(TimeMs now) const {
return stickersUpdateNeeded(_lastSavedGifsUpdate, now);
}
void setLastSavedGifsUpdate(TimeMs update) {
_lastSavedGifsUpdate = update;
}
int featuredStickerSetsUnreadCount() const {
return _featuredStickerSetsUnreadCount.current();
}
void setFeaturedStickerSetsUnreadCount(int count) {
_featuredStickerSetsUnreadCount = count;
}
rpl::producer<int> featuredStickerSetsUnreadCountValue() const {
return _featuredStickerSetsUnreadCount.value();
}
const Stickers::Sets &stickerSets() const {
return _stickerSets;
}
Stickers::Sets &stickerSetsRef() {
return _stickerSets;
}
const Stickers::Order &stickerSetsOrder() const {
return _stickerSetsOrder;
}
Stickers::Order &stickerSetsOrderRef() {
return _stickerSetsOrder;
}
const Stickers::Order &featuredStickerSetsOrder() const {
return _featuredStickerSetsOrder;
}
Stickers::Order &featuredStickerSetsOrderRef() {
return _featuredStickerSetsOrder;
}
const Stickers::Order &archivedStickerSetsOrder() const {
return _archivedStickerSetsOrder;
}
Stickers::Order &archivedStickerSetsOrderRef() {
return _archivedStickerSetsOrder;
}
const Stickers::SavedGifs &savedGifs() const {
return _savedGifs;
}
Stickers::SavedGifs &savedGifsRef() {
return _savedGifs;
}
private:
struct Variables {
@@ -269,6 +152,7 @@ private:
static constexpr auto kDefaultThirdColumnWidth = 0;
bool lastSeenWarningSeen = false;
SendFilesWay sendFilesWay;
ChatHelpers::SelectorTab selectorTab; // per-window
bool tabbedSelectorSectionEnabled = false; // per-window
int tabbedSelectorSectionTooltipShown = 0;
@@ -285,39 +169,6 @@ private:
= kDefaultThirdColumnWidth; // per-window
};
bool stickersUpdateNeeded(TimeMs lastUpdate, TimeMs now) const {
constexpr auto kStickersUpdateTimeout = TimeMs(3600'000);
return (lastUpdate == 0)
|| (now >= lastUpdate + kStickersUpdateTimeout);
}
base::Variable<bool> _contactsLoaded = { false };
base::Variable<bool> _allChatsLoaded = { false };
base::Observable<void> _moreChatsLoaded;
base::Observable<void> _pendingHistoryResize;
base::Observable<ItemVisibilityQuery> _queryItemVisibility;
rpl::event_stream<not_null<const HistoryItem*>> _itemLayoutChanged;
rpl::event_stream<not_null<const HistoryItem*>> _itemRepaintRequest;
rpl::event_stream<not_null<const HistoryItem*>> _itemRemoved;
rpl::event_stream<not_null<const History*>> _historyUnloaded;
rpl::event_stream<not_null<const History*>> _historyCleared;
rpl::event_stream<MegagroupParticipant> _megagroupParticipantRemoved;
rpl::event_stream<MegagroupParticipant> _megagroupParticipantAdded;
rpl::event_stream<> _stickersUpdated;
rpl::event_stream<> _savedGifsUpdated;
TimeMs _lastStickersUpdate = 0;
TimeMs _lastRecentStickersUpdate = 0;
TimeMs _lastFavedStickersUpdate = 0;
TimeMs _lastFeaturedStickersUpdate = 0;
TimeMs _lastSavedGifsUpdate = 0;
rpl::variable<int> _featuredStickerSetsUnreadCount = 0;
Stickers::Sets _stickerSets;
Stickers::Order _stickerSetsOrder;
Stickers::Order _featuredStickerSetsOrder;
Stickers::Order _archivedStickerSetsOrder;
Stickers::SavedGifs _savedGifs;
rpl::event_stream<bool> _thirdSectionInfoEnabledValue;
bool _tabbedReplacedWithInfo = false;
rpl::event_stream<bool> _tabbedReplacedWithInfoValue;
@@ -331,7 +182,9 @@ private:
class AuthSession;
AuthSession &Auth();
class AuthSession final : private base::Subscriber {
class AuthSession final
: public base::has_weak_ptr
, private base::Subscriber {
public:
AuthSession(UserId userId);
@@ -365,10 +218,13 @@ public:
return *_notifications;
}
AuthSessionData &data() {
return _data;
Data::Session &data() {
return *_data;
}
void saveDataDelayed(TimeMs delay = kDefaultSaveDelay);
AuthSessionSettings &settings() {
return _settings;
}
void saveSettingsDelayed(TimeMs delay = kDefaultSaveDelay);
ApiWrap &api() {
return *_api;
@@ -390,7 +246,7 @@ private:
static constexpr auto kDefaultSaveDelay = TimeMs(1000);
const UserId _userId = 0;
AuthSessionData _data;
AuthSessionSettings _settings;
base::Timer _saveDataTimer;
TimeMs _shouldLockAt = 0;
@@ -403,4 +259,12 @@ private:
const std::unique_ptr<Storage::Facade> _storage;
const std::unique_ptr<Window::Notifications::System> _notifications;
// _data depends on _downloader / _uploader, including destructor.
const std::unique_ptr<Data::Session> _data;
// _changelogs depends on _data, subscribes on chats loading event.
const std::unique_ptr<Core::Changelogs> _changelogs;
rpl::lifetime _lifetime;
};

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "autoupdater.h"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "catch.hpp"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
@@ -60,6 +47,10 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86 1
#define ARCH_CPU_32_BITS 1
#elif defined(__aarch64__)
#define ARCH_CPU_64_BITS 1
#elif defined(_M_ARM) || defined(__arm__)
#define ARCH_CPU_32_BITS 1
#else
#error Please add support for your architecture in base/build_config.h
#endif

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "catch.hpp"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
@@ -103,24 +90,16 @@ public:
using value_type = pair_type;
using difference_type = typename iterator_impl::difference_type;
using pointer = pointer_impl;
using const_pointer = const pair_type*;
using reference = reference_impl;
using const_reference = const pair_type&;
flat_multi_map_iterator_base_impl(iterator_impl impl = iterator_impl())
: _impl(impl) {
}
reference operator*() {
reference operator*() const {
return *_impl;
}
const_reference operator*() const {
return *_impl;
}
pointer operator->() {
return std::addressof(**this);
}
const_pointer operator->() const {
pointer operator->() const {
return std::addressof(**this);
}
Me &operator++() {
@@ -166,10 +145,7 @@ public:
other_reference_impl> &right) const {
return _impl - right._impl;
}
reference operator[](difference_type offset) {
return _impl[offset];
}
const_reference operator[](difference_type offset) const {
reference operator[](difference_type offset) const {
return _impl[offset];
}

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "catch.hpp"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "catch.hpp"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "base/observer.h"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
@@ -46,7 +33,6 @@ struct SubscriptionHandlerHelper<void> {
template <typename EventType>
using SubscriptionHandler = typename SubscriptionHandlerHelper<EventType>::type;
// Required because QShared/WeakPointer can't point to void.
class BaseObservableData {
};
@@ -84,14 +70,17 @@ public:
private:
struct Node {
Node(const QSharedPointer<internal::BaseObservableData> &observable) : observable(observable) {
Node(const std::shared_ptr<internal::BaseObservableData> &observable)
: observable(observable) {
}
Node *next = nullptr;
Node *prev = nullptr;
QWeakPointer<internal::BaseObservableData> observable;
std::weak_ptr<internal::BaseObservableData> observable;
};
using RemoveAndDestroyMethod = void(*)(Node*);
Subscription(Node *node, RemoveAndDestroyMethod removeAndDestroyMethod) : _node(node), _removeAndDestroyMethod(removeAndDestroyMethod) {
Subscription(Node *node, RemoveAndDestroyMethod removeAndDestroyMethod)
: _node(node)
, _removeAndDestroyMethod(removeAndDestroyMethod) {
}
Node *_node = nullptr;
@@ -115,13 +104,13 @@ class CommonObservable {
public:
Subscription add_subscription(Handler &&handler) {
if (!_data) {
_data = MakeShared<ObservableData<EventType, Handler>>(this);
_data = std::make_shared<ObservableData<EventType, Handler>>(this);
}
return _data->append(std::move(handler));
}
private:
QSharedPointer<ObservableData<EventType, Handler>> _data;
std::shared_ptr<ObservableData<EventType, Handler>> _data;
friend class CommonObservableData<EventType, Handler>;
friend class BaseObservable<EventType, Handler, base::type_traits<EventType>::is_fast_copy_type::value>;
@@ -184,7 +173,11 @@ public:
private:
struct Node : public Subscription::Node {
Node(const QSharedPointer<BaseObservableData> &observer, Handler &&handler) : Subscription::Node(observer), handler(std::move(handler)) {
Node(
const std::shared_ptr<BaseObservableData> &observer,
Handler &&handler)
: Subscription::Node(observer)
, handler(std::move(handler)) {
}
Handler handler;
};
@@ -210,8 +203,8 @@ private:
}
static void removeAndDestroyNode(Subscription::Node *node) {
if (auto that = node->observable.toStrongRef()) {
static_cast<CommonObservableData*>(that.data())->remove(node);
if (const auto that = node->observable.lock()) {
static_cast<CommonObservableData*>(that.get())->remove(node);
}
delete static_cast<Node*>(node);
}

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
@@ -55,8 +42,7 @@ private:
class BigNum {
public:
BigNum() {
BN_init(raw());
BigNum() : _data(BN_new()) {
}
BigNum(const BigNum &other) : BigNum() {
*this = other;
@@ -84,11 +70,18 @@ public:
}
}
void setBytes(base::const_byte_span bytes) {
if (!BN_bin2bn(reinterpret_cast<const unsigned char*>(bytes.data()), bytes.size(), raw())) {
if (!BN_bin2bn(
reinterpret_cast<const unsigned char*>(bytes.data()),
bytes.size(),
raw())) {
_failed = true;
}
}
void setModExp(const BigNum &a, const BigNum &p, const BigNum &m, const Context &context = Context()) {
void setModExp(
const BigNum &a,
const BigNum &p,
const BigNum &m,
const Context &context = Context()) {
if (a.failed() || p.failed() || m.failed()) {
_failed = true;
} else if (a.isNegative() || p.isNegative() || m.isNegative()) {
@@ -135,7 +128,11 @@ public:
return false;
}
constexpr auto kMillerRabinIterationCount = 30;
auto result = BN_is_prime_ex(raw(), kMillerRabinIterationCount, context.raw(), NULL);
auto result = BN_is_prime_ex(
raw(),
kMillerRabinIterationCount,
context.raw(),
NULL);
if (result == 1) {
return true;
} else if (result != 0) {
@@ -170,16 +167,21 @@ public:
}
auto length = BN_num_bytes(raw());
auto result = base::byte_vector(length, gsl::byte());
auto resultSize = BN_bn2bin(raw(), reinterpret_cast<unsigned char*>(result.data()));
auto resultSize = BN_bn2bin(
raw(),
reinterpret_cast<unsigned char*>(result.data()));
Assert(resultSize == length);
return result;
}
BIGNUM *raw() {
return &_data;
return _data;
}
const BIGNUM *raw() const {
return &_data;
return _data;
}
BIGNUM *takeRaw() {
return base::take(_data);
}
bool failed() const {
@@ -193,7 +195,7 @@ public:
}
private:
BIGNUM _data;
BIGNUM *_data = nullptr;
mutable bool _failed = false;
};

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "base/parse_helper.h"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "base/qthelp_url.h"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "base/runtime_composer.h"
@@ -44,7 +31,7 @@ const RuntimeComposerMetadata *GetRuntimeComposerMetadata(uint64 mask) {
return i.value();
}
const RuntimeComposerMetadata *RuntimeComposer::ZeroRuntimeComposerMetadata = GetRuntimeComposerMetadata(0);
const RuntimeComposerMetadata *RuntimeComposerBase::ZeroRuntimeComposerMetadata = GetRuntimeComposerMetadata(0);
RuntimeComponentWrapStruct RuntimeComponentWraps[64];

View File

@@ -1,27 +1,17 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
template <typename Base>
class RuntimeComposer;
typedef void(*RuntimeComponentConstruct)(void *location, RuntimeComposer *composer);
class RuntimeComposerBase;
typedef void(*RuntimeComponentConstruct)(void *location, RuntimeComposerBase *composer);
typedef void(*RuntimeComponentDestruct)(void *location);
typedef void(*RuntimeComponentMove)(void *location, void *waslocation);
@@ -51,8 +41,10 @@ struct CeilDivideMinimumOne {
extern RuntimeComponentWrapStruct RuntimeComponentWraps[64];
extern QAtomicInt RuntimeComponentIndexLast;
template <typename Type>
template <typename Type, typename Base>
struct RuntimeComponent {
using RuntimeComponentBase = Base;
RuntimeComponent() {
// While there is no std::aligned_alloc().
static_assert(alignof(Type) <= alignof(std::max_align_t), "Components should align to std::max_align_t!");
@@ -89,7 +81,7 @@ struct RuntimeComponent {
}
protected:
static void RuntimeComponentConstruct(void *location, RuntimeComposer *composer) {
static void RuntimeComponentConstruct(void *location, RuntimeComposerBase *composer) {
new (location) Type();
}
static void RuntimeComponentDestruct(void *location) {
@@ -147,9 +139,9 @@ private:
const RuntimeComposerMetadata *GetRuntimeComposerMetadata(uint64 mask);
class RuntimeComposer {
class RuntimeComposerBase {
public:
RuntimeComposer(uint64 mask = 0) : _data(zerodata()) {
RuntimeComposerBase(uint64 mask = 0) : _data(zerodata()) {
if (mask) {
auto meta = GetRuntimeComposerMetadata(mask);
@@ -182,9 +174,9 @@ public:
}
}
}
RuntimeComposer(const RuntimeComposer &other) = delete;
RuntimeComposer &operator=(const RuntimeComposer &other) = delete;
~RuntimeComposer() {
RuntimeComposerBase(const RuntimeComposerBase &other) = delete;
RuntimeComposerBase &operator=(const RuntimeComposerBase &other) = delete;
~RuntimeComposerBase() {
if (_data != zerodata()) {
auto meta = _meta();
for (int i = 0; i < meta->last; ++i) {
@@ -197,45 +189,40 @@ public:
}
}
template <typename Type>
bool Has() const {
return (_meta()->offsets[Type::Index()] >= sizeof(_meta()));
}
template <typename Type>
Type *Get() {
return static_cast<Type*>(_dataptr(_meta()->offsets[Type::Index()]));
}
template <typename Type>
const Type *Get() const {
return static_cast<const Type*>(_dataptr(_meta()->offsets[Type::Index()]));
}
protected:
void UpdateComponents(uint64 mask = 0) {
if (!_meta()->equals(mask)) {
RuntimeComposer tmp(mask);
tmp.swap(*this);
if (_data != zerodata() && tmp._data != zerodata()) {
auto meta = _meta(), wasmeta = tmp._meta();
for (int i = 0; i < meta->last; ++i) {
auto offset = meta->offsets[i];
auto wasoffset = wasmeta->offsets[i];
if (offset >= sizeof(_meta()) && wasoffset >= sizeof(_meta())) {
RuntimeComponentWraps[i].Move(_dataptrunsafe(offset), tmp._dataptrunsafe(wasoffset));
}
bool UpdateComponents(uint64 mask = 0) {
if (_meta()->equals(mask)) {
return false;
}
RuntimeComposerBase result(mask);
result.swap(*this);
if (_data != zerodata() && result._data != zerodata()) {
const auto meta = _meta();
const auto wasmeta = result._meta();
for (auto i = 0; i != meta->last; ++i) {
const auto offset = meta->offsets[i];
const auto wasoffset = wasmeta->offsets[i];
if (offset >= sizeof(_meta())
&& wasoffset >= sizeof(_meta())) {
RuntimeComponentWraps[i].Move(
_dataptrunsafe(offset),
result._dataptrunsafe(wasoffset));
}
}
}
return true;
}
void AddComponents(uint64 mask = 0) {
UpdateComponents(_meta()->maskadd(mask));
bool AddComponents(uint64 mask = 0) {
return UpdateComponents(_meta()->maskadd(mask));
}
void RemoveComponents(uint64 mask = 0) {
UpdateComponents(_meta()->maskremove(mask));
bool RemoveComponents(uint64 mask = 0) {
return UpdateComponents(_meta()->maskremove(mask));
}
private:
template <typename Base>
friend class RuntimeComposer;
static const RuntimeComposerMetadata *ZeroRuntimeComposerMetadata;
static void *zerodata() {
return &ZeroRuntimeComposerMetadata;
@@ -252,8 +239,41 @@ private:
}
void *_data = nullptr;
void swap(RuntimeComposer &other) {
void swap(RuntimeComposerBase &other) {
std::swap(_data, other._data);
}
};
template <typename Base>
class RuntimeComposer : public RuntimeComposerBase {
public:
using RuntimeComposerBase::RuntimeComposerBase;
template <
typename Type,
typename = std::enable_if_t<std::is_same_v<
typename Type::RuntimeComponentBase,
Base>>>
bool Has() const {
return (_meta()->offsets[Type::Index()] >= sizeof(_meta()));
}
template <
typename Type,
typename = std::enable_if_t<std::is_same_v<
typename Type::RuntimeComponentBase,
Base>>>
Type *Get() {
return static_cast<Type*>(_dataptr(_meta()->offsets[Type::Index()]));
}
template <
typename Type,
typename = std::enable_if_t<std::is_same_v<
typename Type::RuntimeComponentBase,
Base>>>
const Type *Get() const {
return static_cast<const Type*>(_dataptr(_meta()->offsets[Type::Index()]));
}
};

View File

@@ -1,393 +0,0 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "base/task_queue.h"
#include <thread>
#include <condition_variable>
namespace base {
namespace {
auto MainThreadId = std::this_thread::get_id();
const auto MaxThreadsCount = qMax(std::thread::hardware_concurrency(), 2U);
} // namespace
class TaskQueue::TaskQueueList {
public:
TaskQueueList();
void Register(TaskQueue *queue);
void Unregister(TaskQueue *queue);
bool IsInList(TaskQueue *queue) const;
void Clear();
bool Empty(int list_index_) const;
TaskQueue *TakeFirst(int list_index_);
private:
void Insert(TaskQueue *queue, int list_index_);
void Remove(TaskQueue *queue, int list_index_);
TaskQueue *Tail() { return &tail_; }
const TaskQueue *Tail() const { return &tail_; }
TaskQueue tail_ = { Type::Special, Priority::Normal };
TaskQueue *(lists_[kQueuesListsCount]);
};
class TaskQueue::TaskThreadPool {
struct Private {
};
public:
TaskThreadPool(const Private &) { }
static const std::shared_ptr<TaskThreadPool> &Instance();
void AddQueueTask(TaskQueue *queue, Task &&task);
void RemoveQueue(TaskQueue *queue);
~TaskThreadPool();
private:
void ThreadFunction();
std::vector<std::thread> threads_;
QMutex queues_mutex_;
// queues_mutex_ must be locked when working with the list.
TaskQueueList queue_list_;
QWaitCondition thread_condition_;
bool stopped_ = false;
int tasks_in_process_ = 0;
int background_tasks_in_process_ = 0;
};
TaskQueue::TaskQueueList::TaskQueueList() {
for (auto &list : lists_) {
list = &tail_;
}
}
void TaskQueue::TaskQueueList::Register(TaskQueue *queue) {
Assert(!queue->SerialTaskInProcess());
Insert(queue, kAllQueuesList);
if (queue->priority_ == Priority::Normal) {
Insert(queue, kOnlyNormalQueuesList);
}
}
void TaskQueue::TaskQueueList::Unregister(TaskQueue *queue) {
Remove(queue, kAllQueuesList);
if (queue->priority_ == Priority::Normal) {
Remove(queue, kOnlyNormalQueuesList);
}
}
void TaskQueue::TaskQueueList::Insert(TaskQueue *queue, int list_index_) {
Assert(list_index_ < kQueuesListsCount);
auto tail = Tail();
if (lists_[list_index_] == tail) {
lists_[list_index_] = queue;
}
auto &list_entry = queue->list_entries_[list_index_];
Assert(list_entry.after == nullptr);
if ((list_entry.before = tail->list_entries_[list_index_].before)) {
list_entry.before->list_entries_[list_index_].after = queue;
}
list_entry.after = tail;
tail->list_entries_[list_index_].before = queue;
}
void TaskQueue::TaskQueueList::Remove(TaskQueue *queue, int list_index_) {
Assert(list_index_ < kQueuesListsCount);
auto &list_entry = queue->list_entries_[list_index_];
Assert(list_entry.after != nullptr);
if (lists_[list_index_] == queue) {
lists_[list_index_] = list_entry.after;
} else {
Assert(list_entry.before != nullptr);
list_entry.before->list_entries_[list_index_].after = list_entry.after;
}
list_entry.after->list_entries_[list_index_].before = list_entry.before;
list_entry.before = list_entry.after = nullptr;
}
bool TaskQueue::TaskQueueList::IsInList(TaskQueue *queue) const {
if (queue->list_entries_[kAllQueuesList].after) {
return true;
}
Assert(queue->list_entries_[kOnlyNormalQueuesList].after == nullptr);
return false;
}
void TaskQueue::TaskQueueList::Clear() {
auto tail = Tail();
for (int i = 0; i < kQueuesListsCount; ++i) {
for (auto j = lists_[i], next = j; j != tail; j = next) {
auto &list_entry = j->list_entries_[i];
next = list_entry.after;
list_entry.before = list_entry.after = nullptr;
}
lists_[i] = tail;
}
}
bool TaskQueue::TaskQueueList::Empty(int list_index_) const {
Assert(list_index_ < kQueuesListsCount);
auto list = lists_[list_index_];
Assert(list != nullptr);
return (list->list_entries_[list_index_].after == nullptr);
}
TaskQueue *TaskQueue::TaskQueueList::TakeFirst(int list_index_) {
Assert(!Empty(list_index_));
auto queue = lists_[list_index_];
Unregister(queue);
// log_msgs.push_back("Unregistered from list in TakeFirst");
return queue;
}
void TaskQueue::TaskThreadPool::AddQueueTask(TaskQueue *queue, Task &&task) {
QMutexLocker lock(&queues_mutex_);
queue->tasks_.push_back(std::move(task));
auto list_was_empty = queue_list_.Empty(kAllQueuesList);
auto threads_count = threads_.size();
auto all_threads_processing = (threads_count == tasks_in_process_);
auto some_threads_are_vacant = !all_threads_processing && list_was_empty;
auto will_create_thread = !some_threads_are_vacant && (threads_count < MaxThreadsCount);
if (!queue->SerialTaskInProcess()) {
if (!queue_list_.IsInList(queue)) {
queue_list_.Register(queue);
}
}
if (will_create_thread) {
threads_.emplace_back([this]() {
ThreadFunction();
});
} else if (some_threads_are_vacant) {
Assert(threads_count > tasks_in_process_);
thread_condition_.wakeOne();
}
}
void TaskQueue::TaskThreadPool::RemoveQueue(TaskQueue *queue) {
QMutexLocker lock(&queues_mutex_);
if (queue_list_.IsInList(queue)) {
queue_list_.Unregister(queue);
}
if (queue->destroyed_flag_) {
*queue->destroyed_flag_ = true;
}
}
TaskQueue::TaskThreadPool::~TaskThreadPool() {
{
QMutexLocker lock(&queues_mutex_);
queue_list_.Clear();
stopped_ = true;
}
thread_condition_.wakeAll();
for (auto &thread : threads_) {
thread.join();
}
}
const std::shared_ptr<TaskQueue::TaskThreadPool> &TaskQueue::TaskThreadPool::Instance() { // static
static auto Pool = std::make_shared<TaskThreadPool>(Private());
return Pool;
}
void TaskQueue::TaskThreadPool::ThreadFunction() {
// Flag marking that the previous processed task was
// with a Background priority. We count all the background
// tasks being processed.
bool background_task = false;
// Saved serial queue pointer. When we process a serial
// queue task we don't return the queue to the list until
// the task is processed and we return it on the next cycle.
TaskQueue *serial_queue = nullptr;
bool serial_queue_destroyed = false;
bool task_was_processed = false;
while (true) {
Task task;
{
QMutexLocker lock(&queues_mutex_);
// Finish the previous task processing.
if (task_was_processed) {
--tasks_in_process_;
}
if (background_task) {
--background_tasks_in_process_;
background_task = false;
}
if (serial_queue) {
if (!serial_queue_destroyed) {
serial_queue->destroyed_flag_ = nullptr;
if (!serial_queue->tasks_.empty()) {
queue_list_.Register(serial_queue);
}
}
serial_queue = nullptr;
serial_queue_destroyed = false;
}
// Wait for a task to appear in the queues list.
while (queue_list_.Empty(kAllQueuesList)) {
if (stopped_) {
return;
}
thread_condition_.wait(&queues_mutex_);
}
// Select a task we will be processing.
auto processing_background = (background_tasks_in_process_ > 0);
auto take_only_normal = processing_background && !queue_list_.Empty(kOnlyNormalQueuesList);
auto take_from_list_ = take_only_normal ? kOnlyNormalQueuesList : kAllQueuesList;
auto queue = queue_list_.TakeFirst(take_from_list_);
Assert(!queue->tasks_.empty());
task = std::move(queue->tasks_.front());
queue->tasks_.pop_front();
if (queue->type_ == Type::Serial) {
// Serial queues are returned in the list for processing
// only after the task is finished.
serial_queue = queue;
Assert(serial_queue->destroyed_flag_ == nullptr);
serial_queue->destroyed_flag_ = &serial_queue_destroyed;
} else if (!queue->tasks_.empty()) {
queue_list_.Register(queue);
}
++tasks_in_process_;
task_was_processed = true;
if (queue->priority_ == Priority::Background) {
++background_tasks_in_process_;
background_task = true;
}
}
task();
}
}
TaskQueue::TaskQueue(Type type, Priority priority)
: type_(type)
, priority_(priority) {
if (type_ != Type::Main && type_ != Type::Special) {
weak_thread_pool_ = TaskThreadPool::Instance();
}
}
TaskQueue::~TaskQueue() {
if (type_ != Type::Main && type_ != Type::Special) {
if (auto thread_pool = weak_thread_pool_.lock()) {
thread_pool->RemoveQueue(this);
}
}
}
void TaskQueue::Put(Task &&task) {
if (type_ == Type::Main) {
QMutexLocker lock(&tasks_mutex_);
tasks_.push_back(std::move(task));
Sandbox::MainThreadTaskAdded();
} else {
Assert(type_ != Type::Special);
TaskThreadPool::Instance()->AddQueueTask(this, std::move(task));
}
}
void TaskQueue::ProcessMainTasks() { // static
Assert(std::this_thread::get_id() == MainThreadId);
while (ProcessOneMainTask()) {
}
}
void TaskQueue::ProcessMainTasks(TimeMs max_time_spent) { // static
Assert(std::this_thread::get_id() == MainThreadId);
auto start_time = getms();
while (ProcessOneMainTask()) {
if (getms() >= start_time + max_time_spent) {
break;
}
}
}
bool TaskQueue::ProcessOneMainTask() { // static
Task task;
{
QMutexLocker lock(&Main().tasks_mutex_);
auto &tasks = Main().tasks_;
if (tasks.empty()) {
return false;
}
task = std::move(tasks.front());
tasks.pop_front();
}
task();
return true;
}
bool TaskQueue::IsMyThread() const {
if (type_ == Type::Main) {
return (std::this_thread::get_id() == MainThreadId);
}
Assert(type_ != Type::Special);
return false;
}
// Default queues.
TaskQueue &TaskQueue::Main() { // static
static TaskQueue MainQueue { Type::Main, Priority::Normal };
return MainQueue;
}
TaskQueue &TaskQueue::Normal() { // static
static TaskQueue NormalQueue { Type::Concurrent, Priority::Normal };
return NormalQueue;
}
TaskQueue &TaskQueue::Background() { // static
static TaskQueue BackgroundQueue { Type::Concurrent, Priority::Background };
return BackgroundQueue;
}
} // namespace base

View File

@@ -1,102 +0,0 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
namespace base {
using Task = lambda_once<void()>;
// An attempt to create/use a TaskQueue or one of the default queues
// after the main() has returned leads to an undefined behaviour.
class TaskQueue {
enum class Type {
Main, // Unique queue for main thread tasks.
Serial,
Concurrent,
Special, // Unique special queue for thread pool lists terminal item.
};
public:
enum class Priority {
Normal,
Background,
};
// Creating custom serial queues.
TaskQueue(Priority priority) : TaskQueue(Type::Serial, priority) {
}
// Default main and two concurrent queues.
static TaskQueue &Main();
static TaskQueue &Normal();
static TaskQueue &Background();
void Put(Task &&task);
static void ProcessMainTasks();
static void ProcessMainTasks(TimeMs max_time_spent);
~TaskQueue();
private:
static bool ProcessOneMainTask();
TaskQueue(Type type, Priority priority);
bool IsMyThread() const;
bool SerialTaskInProcess() const {
return (destroyed_flag_ != nullptr);
}
const Type type_;
const Priority priority_;
std::deque<Task> tasks_;
QMutex tasks_mutex_; // Only for the main queue.
// Only for the other queues, not main.
class TaskThreadPool;
std::weak_ptr<TaskThreadPool> weak_thread_pool_;
class TaskQueueList;
struct TaskQueueListEntry {
TaskQueue *before = nullptr;
TaskQueue *after = nullptr;
};
// Thread pool queues linked list.
static constexpr int kAllQueuesList = 0;
// Thread pool queues linked list with excluded Background queues.
static constexpr int kOnlyNormalQueuesList = 1;
static constexpr int kQueuesListsCount = 2;
TaskQueueListEntry list_entries_[kQueuesListsCount];
// Only for Serial queues: non-null value means a task is currently processed.
bool *destroyed_flag_ = nullptr;
};
} // namespace base

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#define CATCH_CONFIG_RUNNER
#include "catch.hpp"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "base/timer.h"

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
@@ -280,6 +267,55 @@ weak_ptr<T> make_weak(const std::weak_ptr<T> &value) {
} // namespace base
namespace crl {
template <typename T, typename Enable>
struct guard_traits;
template <typename T>
struct guard_traits<base::weak_ptr<T>, void> {
static base::weak_ptr<T> create(const base::weak_ptr<T> &value) {
return value;
}
static base::weak_ptr<T> create(base::weak_ptr<T> &&value) {
return std::move(value);
}
static bool check(const base::weak_ptr<T> &guard) {
return guard.get() != nullptr;
}
};
template <typename T>
struct guard_traits<
T*,
std::enable_if_t<
std::is_base_of_v<base::has_weak_ptr, std::remove_cv_t<T>>>> {
static base::weak_ptr<T> create(T *value) {
return value;
}
static bool check(const base::weak_ptr<T> &guard) {
return guard.get() != nullptr;
}
};
template <typename T>
struct guard_traits<
gsl::not_null<T*>,
std::enable_if_t<
std::is_base_of_v<base::has_weak_ptr, std::remove_cv_t<T>>>> {
static base::weak_ptr<T> create(gsl::not_null<T*> value) {
return value.get();
}
static bool check(const base::weak_ptr<T> &guard) {
return guard.get() != nullptr;
}
};
} // namespace crl
#ifdef QT_VERSION
template <typename Lambda>
inline void InvokeQueued(const base::has_weak_ptr *context, Lambda &&lambda) {

View File

@@ -3,23 +3,10 @@ WARNING! All changes made in this file will be lost!
Created from 'colors.palette' by 'codegen_style'
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "boxes/about_box.h"
@@ -30,6 +17,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/labels.h"
#include "styles/style_boxes.h"
#include "platform/platform_file_utilities.h"
#include "core/click_handler_types.h"
AboutBox::AboutBox(QWidget *parent)
: _version(this, lng_about_version(lt_version, QString::fromLatin1(AppVersionStr.c_str()) + (cAlphaVersion() ? " alpha" : "") + (cBetaVersion() ? qsl(" beta %1").arg(cBetaVersion()) : QString())), st::aboutVersionLink)
@@ -43,7 +31,18 @@ void AboutBox::prepare() {
addButton(langFactory(lng_close), [this] { closeBox(); });
const auto linkHook = [](const ClickHandlerPtr &link, auto button) {
if (const auto url = dynamic_cast<UrlClickHandler*>(link.get())) {
url->UrlClickHandler::onClick(button);
return false;
}
return true;
};
_text3->setRichText(lng_about_text_3(lt_faq_open, qsl("[a href=\"%1\"]").arg(telegramFaqLink()), lt_faq_close, qsl("[/a]")));
_text1->setClickHandlerHook(linkHook);
_text2->setClickHandlerHook(linkHook);
_text3->setClickHandlerHook(linkHook);
_version->setClickedCallback([this] { showVersionHistory(); });

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "boxes/abstract_box.h"
@@ -148,7 +135,7 @@ void BoxContent::setInnerTopSkip(int innerTopSkip, bool scrollBottomFixed) {
if (_innerTopSkip != innerTopSkip) {
auto delta = innerTopSkip - _innerTopSkip;
_innerTopSkip = innerTopSkip;
if (_scroll) {
if (_scroll && width() > 0) {
auto scrollTopWas = _scroll->scrollTop();
updateScrollAreaGeometry();
if (scrollBottomFixed) {
@@ -169,7 +156,7 @@ QPixmap BoxContent::grabInnerCache() {
auto isBottomShadowVisible = !_bottomShadow->isHidden();
if (isTopShadowVisible) _topShadow->setVisible(false);
if (isBottomShadowVisible) _bottomShadow->setVisible(false);
auto result = myGrab(this, _scroll->geometry());
auto result = Ui::GrabWidget(this, _scroll->geometry());
if (isTopShadowVisible) _topShadow->setVisible(true);
if (isBottomShadowVisible) _bottomShadow->setVisible(true);
return result;
@@ -250,7 +237,6 @@ void AbstractBox::paintEvent(QPaintEvent *e) {
auto paintBottomRounded = clip.intersects(QRect(0, height() - st::boxRadius, width(), st::boxRadius));
if (paintTopRounded || paintBottomRounded) {
auto parts = RectPart::None | 0;
parts |= RectPart::None;
if (paintTopRounded) parts |= RectPart::FullTop;
if (paintBottomRounded) parts |= RectPart::FullBottom;
App::roundRect(p, rect(), st::boxBg, BoxCorners, nullptr, parts);

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

View File

@@ -1,22 +1,9 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
the official desktop application for the Telegram messaging service.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "boxes/add_contact_box.h"
@@ -36,6 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/labels.h"
#include "ui/toast/toast.h"
#include "ui/special_buttons.h"
#include "ui/text_options.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "apiwrap.h"
@@ -45,8 +33,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
namespace {
constexpr auto kMaxGroupChannelTitle = 255;
constexpr auto kMaxChannelDescription = 255;
constexpr auto kMaxChannelDescription = 255; // See also edit_peer_info_box.
constexpr auto kMaxBioLength = 70;
constexpr auto kMinUsernameLength = 5;
style::InputField CreateBioFieldStyle() {
auto result = st::newGroupDescription;
@@ -253,19 +242,23 @@ bool AddContactBox::onSaveUserFail(const RPCError &error) {
void AddContactBox::onImportDone(const MTPcontacts_ImportedContacts &res) {
if (!isBoxShown() || !App::main()) return;
auto &d = res.c_contacts_importedContacts();
const auto &d = res.c_contacts_importedContacts();
App::feedUsers(d.vusers);
auto &v = d.vimported.v;
UserData *user = nullptr;
if (!v.isEmpty()) {
auto &c = v.front().c_importedContact();
if (c.vclient_id.v != _contactId) return;
user = App::userLoaded(c.vuser_id.v);
}
const auto &v = d.vimported.v;
const auto user = [&]() -> UserData* {
if (!v.isEmpty()) {
auto &c = v.front().c_importedContact();
if (c.vclient_id.v == _contactId) {
return App::userLoaded(c.vuser_id.v);
}
}
return nullptr;
}();
if (user) {
Notify::userIsContactChanged(user, true);
if (user->contactStatus() == UserData::ContactStatus::Contact) {
Ui::showPeerHistory(user, ShowAtTheEndMsgId);
}
Ui::hideLayer();
} else {
hideChildren();
@@ -775,7 +768,7 @@ void SetupChannelBox::onChange() {
return;
}
}
if (name.size() < MinUsernameLength) {
if (name.size() < kMinUsernameLength) {
if (_errorText != lang(lng_create_channel_link_too_short)) {
_errorText = lang(lng_create_channel_link_too_short);
update();
@@ -796,9 +789,14 @@ void SetupChannelBox::onCheck() {
MTP::cancel(_checkRequestId);
}
QString link = _link->text().trimmed();
if (link.size() >= MinUsernameLength) {
if (link.size() >= kMinUsernameLength) {
_checkUsername = link;
_checkRequestId = MTP::send(MTPchannels_CheckUsername(_channel->inputChannel, MTP_string(link)), rpcDone(&SetupChannelBox::onCheckDone), rpcFail(&SetupChannelBox::onCheckFail));
_checkRequestId = MTP::send(
MTPchannels_CheckUsername(
_channel->inputChannel,
MTP_string(link)),
rpcDone(&SetupChannelBox::onCheckDone),
rpcFail(&SetupChannelBox::onCheckFail));
}
}
@@ -1378,8 +1376,15 @@ RevokePublicLinkBox::Inner::Inner(QWidget *parent, base::lambda<void()> revokeCa
auto row = ChatRow(peer);
row.peer = peer;
row.name.setText(st::contactsNameStyle, peer->name, _textNameOptions);
row.status.setText(st::defaultTextStyle, Messenger::Instance().createInternalLink(textcmdLink(1, peer->userName())), _textDlgOptions);
row.name.setText(
st::contactsNameStyle,
peer->name,
Ui::NameTextOptions());
row.status.setText(
st::defaultTextStyle,
Messenger::Instance().createInternalLink(
textcmdLink(1, peer->userName())),
Ui::DialogTextOptions());
_rows.push_back(std::move(row));
}
}

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