Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
349 commits
Select commit Hold shift + click to select a range
f033f17
Migrated GroupInfoBox from MTP to TDLib.
23rd Nov 27, 2021
af78082
Migrated SetupChannelBox from MTP to TDLib.
23rd Nov 27, 2021
0603184
Fixed uploading of profile photo for groups and channels.
23rd Nov 28, 2021
856c21d
Fixed PeerListGlobalSearchController request.
23rd Nov 28, 2021
9028b09
Migrated chat migration to supergroup from MTP to TDLib.
23rd Nov 28, 2021
7e0e03c
Migrated sending of callback query to bots from MTP to TDLib.
23rd Nov 28, 2021
d4cb712
Replaced Ui::FormatPhone with Tdb::FormatPhone.
23rd Nov 28, 2021
69b5699
Migrated Countries::Manager from MTP to TDLib.
23rd Nov 28, 2021
de9ef49
Migrated generating groups of phone patterns from MTP to TDLib.
23rd Nov 28, 2021
7bc2760
Update TDLib to 1.8.1.
john-preston Feb 2, 2022
4927aef
Fix possible crash in Tdb streaming.
john-preston Feb 2, 2022
3dc86e5
Track available reactions list.
john-preston Feb 4, 2022
1664507
Track message reactions. Cut out some code.
john-preston Feb 4, 2022
4bf2597
Fix possible crash in file downloader.
john-preston Feb 4, 2022
5948e53
Add sending reactions to messages.
john-preston Feb 4, 2022
cb475a6
Load list of unread reactions.
john-preston Feb 4, 2022
0d49fba
Migrate support chat preload to TDLib.
john-preston Feb 10, 2022
cae05a1
Migrate favorite reaction read / write to TDLib.
john-preston Feb 10, 2022
485fc33
Migrate edit chat reactions / read all reactions to TDLib.
john-preston Feb 10, 2022
d1b0618
Migrate WhoRead / WhoReacted to TDLib.
john-preston Feb 10, 2022
dd30e83
Rebase and fix the build.
john-preston Mar 10, 2022
628a956
Update TDLib to 1.8.2 and fix the build.
john-preston Mar 16, 2022
b125da6
Fix RTMP streams using TDLib.
john-preston Jun 26, 2024
8d6a762
Migrate toggleHistoryArchived to TDLib.
john-preston Mar 17, 2022
589abf1
Migrate some stickers management to TDLib.
john-preston Mar 21, 2022
37d122c
Migrate block from replies / reportSpam to TDLib.
john-preston Mar 21, 2022
217113e
Fix build after rebase.
john-preston Apr 11, 2022
8eecf34
Resolve username / phone / message links.
john-preston Apr 20, 2022
ca9af3e
Request the comments thread information.
john-preston Apr 21, 2022
14d0bea
Migrate unpin all messages to TDLib.
john-preston Apr 27, 2022
2979991
Migrate scheduled messages to TDLib.
john-preston Apr 27, 2022
85db6d5
Migrate sending inline bot results to TDLib.
john-preston Jun 21, 2022
2d80524
Update TDLib to 1.8.4 and fix td_tdb target build.
john-preston Jun 21, 2022
4654095
Set botInfo for users.
john-preston Jul 5, 2022
ec853b3
Migrate deleteChatHistory to TDLib.
john-preston Jul 5, 2022
0a8866e
Rebase onto v4.0.2.
john-preston Jul 19, 2022
f6b4ffc
Show correct set title in StickerToast.
john-preston Jul 20, 2022
caaede2
Fix logging in with a 2sv password.
john-preston Jul 20, 2022
7b487f8
Use scoped Tdb::Sender for a Main::Session.
john-preston Jul 20, 2022
dea664d
Use domain _localKey for Tdb encryption.
john-preston Jul 20, 2022
6c88e7e
Fix flickering online members count.
john-preston Jul 20, 2022
554c6fd
Migrate mute / notification sound settings to TDLib.
john-preston Jul 21, 2022
23a353d
Migrate peer settings / contact status to TDLib.
john-preston Jul 28, 2022
37ff7c6
Migrated ability to start livestream with RTMP from MTP to TDLib.
23rd May 12, 2022
d040d49
Migrated Api::Ringtones from MTP to TDLib.
23rd May 12, 2022
bc152bb
Migrated ShareBox from MTP to TDLib.
23rd May 13, 2022
38cd844
Migrated sharing of bot game from MTP to TDLib.
23rd May 13, 2022
2106086
Migrated ability to use previous peer userpics from MTP to TDLib.
23rd May 13, 2022
f88f4ee
Migrated ttl support from MTP to TDLib.
23rd May 13, 2022
82a4c8d
Migrated toggling media from MTP to TDLib.
23rd May 13, 2022
ac6e2e1
Migrated support of saved GIFs from MTP to TDLib.
23rd May 13, 2022
f2f76dd
Migrated support of bot commands from MTP to TDLib.
23rd May 14, 2022
5db554d
Migrated draft support from MTP to TDLib.
23rd May 15, 2022
bc4bf87
Migrated requesting of full peer info from MTP to TDLib.
23rd May 16, 2022
8b14954
Completely migrated cloud password from MTP to TDLib after redesign.
23rd Jul 31, 2022
b587685
Fixed build after rebase.
23rd Jul 31, 2022
8cc3510
Implement leaving channels through TDLib.
john-preston Jul 31, 2022
9dd8203
Request webpage preview through TDLib.
john-preston Aug 2, 2022
45ca4fc
Implement text / caption edit using TDLib.
john-preston Aug 5, 2022
3c7bc17
Cut some more MTP + getMessage + reschedule.
john-preston Aug 5, 2022
abc430a
Migrate reporting to TDLib.
john-preston Aug 5, 2022
9d17c15
Send stickers / GIFs / dices.
john-preston Aug 5, 2022
7e2afd6
Request recent / featured / faved stickers from TDLib.
john-preston Aug 5, 2022
3dfcdde
Send bot start through TDLib.
john-preston Aug 5, 2022
32dae0f
Migrate forwardMessages call to TDLib.
john-preston Aug 5, 2022
b5b21ad
Fill dice / slot machine stickers from TDLib.
john-preston Aug 8, 2022
0ff3054
Check photo null-ness not by date field.
john-preston Aug 8, 2022
bfb899e
Process full chat photos, userpic videos.
john-preston Aug 10, 2022
e2e6d85
Migrate invite link check / join to TDLib.
john-preston Aug 10, 2022
02cfe21
Cut out a lot more of MTP code.
john-preston Aug 10, 2022
a5f21ab
Remove MTP::Sender from ApiWrap interface.
john-preston Aug 10, 2022
9ec7252
Remove MTP::Sender completely.
john-preston Aug 10, 2022
ad39833
Migrate AttachWebView to TDLib.
john-preston Aug 10, 2022
09cccc9
Read CanDeleteForAll and CanEdit from TDLib.
john-preston Aug 10, 2022
6c57b1c
Fix sending screenshots and photos.
john-preston Aug 10, 2022
fe6b411
Remove tdb_tl_scheme include from headers.
john-preston Aug 11, 2022
70700d8
Migrated some types of inline bot results from MTP to TDLib.
23rd May 15, 2022
929f90c
Migrated user photos from MTP to TDLib.
23rd May 16, 2022
d39fc21
Migrated shared media from MTP to TDLib.
23rd May 16, 2022
e7ef5fa
Fix build.
john-preston Aug 12, 2022
aacc09a
Use local copy of td_api.tl scheme.
john-preston Aug 14, 2022
a49d8a7
Update TDLib to 1.8.5 and fix the build.
john-preston Aug 15, 2022
af8c298
Migrated flags for full user info from MTP to TDLib.
23rd Aug 16, 2022
9512912
Migrated polls support from MTP to TDLib.
23rd Aug 17, 2022
b5a056f
Migrated AddContactBox from MTP to TDLib.
23rd Aug 17, 2022
d164c3b
Migrated dummy user for quick reactions settings from MTP to TDLib.
23rd Aug 17, 2022
9387fc1
Migrated ability to revoke RTMP credentials from MTP to TDLib.
23rd Aug 17, 2022
1afc7a3
Implement some // todo-s.
john-preston Sep 14, 2022
5d44dbf
Fix build with MSVC.
john-preston Sep 14, 2022
cf491ba
Add gperf to instructions and prepare.
john-preston Sep 28, 2022
28707ea
Update TDLib to 1.8.6 and fix the build.
john-preston Sep 28, 2022
8b9287f
Resolve default reactions data from TDLib.
john-preston Sep 28, 2022
9c625ba
Always update available reactions async.
john-preston Sep 28, 2022
91e8476
Request possible reactions for a message.
john-preston Nov 3, 2022
6d9545e
Migrate (sort-of) chats filters to TDLib.
john-preston Nov 4, 2022
06d6642
Improve archive / main list chat tracking.
john-preston Nov 4, 2022
f77d95a
Fix sending spoilers.
john-preston Nov 9, 2022
0a2760e
Improve stickers support.
john-preston Nov 9, 2022
f8ddc9a
Improve tracking of unread messages.
john-preston Nov 9, 2022
845f8f5
Migrate chats / messages search to TDLib.
john-preston Nov 10, 2022
aaa927d
Migrate typing sending to TDLib.
john-preston Nov 10, 2022
75f54ca
Unify cloud draft save / clear handling.
john-preston Nov 10, 2022
b1af037
Abstract away MTP in SendActionPainter.
john-preston Dec 8, 2022
059fe41
Now handle even more updates.
john-preston Dec 8, 2022
4ed408d
Show connecting state in the corner.
john-preston Dec 8, 2022
191809b
Process connection state and incoming emoji interactions.
john-preston Dec 8, 2022
3e2ab59
Update TDLib to 1.8.9 and fix the build.
john-preston Dec 11, 2022
b2cdd7d
Update TDLib revision with a bugfix.
john-preston Dec 23, 2022
854b111
Send message thread loading requests.
john-preston Dec 23, 2022
899e2f1
Fix last message clearing, global messages search.
john-preston Dec 23, 2022
a1712c2
Migrate jump-to-date to TDLib.
john-preston Dec 23, 2022
9d808ad
Migrate Api::MessagesSearch to TDLib.
john-preston Dec 25, 2022
409078d
Migrate SingleMessageSearch to TDLib.
john-preston Dec 26, 2022
4499e41
Implement copy topic link.
john-preston Dec 26, 2022
7a4daf0
Migrate audio transcribe to TDLib.
john-preston Dec 26, 2022
9c428bc
Migrate ChannelsLimitBox to TDLib.
john-preston Dec 26, 2022
30a317f
Migrate PublicLinksLimitBox to TDLib.
john-preston Dec 26, 2022
8e6037e
Fix self-destruct media display.
john-preston Dec 27, 2022
b07cd20
Migrate mark-as-read/unread to TDLib.
john-preston Dec 27, 2022
ea283ce
Use uniform "// later" and "// tdlib" comments.
john-preston Dec 27, 2022
89b4774
Migrate unavailable reasons to TDLib.
john-preston Dec 27, 2022
082b345
Migrate aggressive antispam to TDLib.
john-preston Dec 27, 2022
4c09941
Support internal links through TDLib.
john-preston Dec 27, 2022
19c1e7a
Migrate premium state request to TDLib.
john-preston Dec 30, 2022
4ae4f52
Fix phone formatting.
john-preston Dec 30, 2022
402fab4
Wait for chat filters after logging in.
john-preston Dec 30, 2022
0498660
Update TDLib to 1.8.10 and fix the build.
john-preston Jan 3, 2023
54c56fd
Fix fragment phones logins.
john-preston Jan 4, 2023
1bad96e
Implement purging invalid TDLib instances.
john-preston Jan 4, 2023
b8a2d69
Migrate backgrounds list and support user to TDLib.
john-preston Jan 11, 2023
7c7d18d
Allow synchronous requests to Tdb::Instance.
john-preston Jan 11, 2023
2bd288a
Migrate premium sections order to TDLib.
john-preston Jan 11, 2023
b5e19f6
Compose wallpaper link using TDLib.
john-preston Jan 11, 2023
277ecd2
Migrate premium / gift payments to TDLib.
john-preston Jan 13, 2023
662c5e9
Always apply unread count from update.
john-preston Jan 14, 2023
01b3a14
Show near dates in a shorter format.
john-preston Jan 25, 2023
2ec93c5
Fix upload progress display / cancel.
john-preston Feb 8, 2023
b28d0e7
Support upload pause and map thumbnail download.
john-preston Feb 8, 2023
37218d2
Migrate bot auto login / login buttons to TDLib.
john-preston Feb 8, 2023
b888bf5
Handle terms of service accept requests.
john-preston Feb 9, 2023
1fb5927
Migrate custom chat themes to TDLib.
john-preston Feb 15, 2023
d893000
Migrate background setting to TDLib.
john-preston Feb 15, 2023
e7a0b34
Request page previews and inline bot results.
john-preston Feb 15, 2023
d7fc54e
Rebase & Update TDLib to 1.8.11 & Fix the build.
john-preston Sep 15, 2023
c43e669
Correctly support animated single-emoji messages.
john-preston Feb 16, 2023
760b472
Migrate GIF search emoji sections to TDLib.
john-preston Feb 16, 2023
8ca2aec
Migrate sponsored messages to TDLib.
john-preston Feb 20, 2023
aa21b62
Migrate game score display to TDLib.
john-preston Feb 20, 2023
4183b6a
Migrate local changelogs to TDLib.
john-preston Feb 20, 2023
c69c1a0
Set some more chat fields from TDLib.
john-preston Feb 20, 2023
24482ef
Use TDLib notifications API.
john-preston Feb 21, 2023
2a14ccc
Implement generating files by downloading from web.
john-preston Feb 22, 2023
c7fcf86
Migrate proxy management to TDLib.
john-preston Feb 22, 2023
52cbde9
Show group photo change recent action from TDLib.
john-preston Feb 22, 2023
7b3f4f8
Support recurring payment terms from TDLib.
john-preston Feb 22, 2023
6c95793
Mark channel as forbidden locally.
john-preston Feb 22, 2023
6245aa4
Mark topic mentions / reactions as read.
john-preston Feb 22, 2023
a961983
Show connecting state in top bar widget.
john-preston Feb 22, 2023
deeac21
Just remove some more todo-s.
john-preston Feb 22, 2023
677073c
Migrate emoji interactions through TDLib.
john-preston Feb 22, 2023
4640fc0
Migrate delete messages by date to TDLib.
john-preston Feb 22, 2023
e3ea385
Migrate sponsored messages viewing to TDLib.
john-preston Feb 22, 2023
510fb4a
Remove folder dialogs entry request.
john-preston Feb 22, 2023
3016f96
Fix build with Visual Studio 17.5.1.
john-preston Mar 1, 2023
3891669
Fix comments, fix search in topic.
john-preston Mar 2, 2023
f6855f5
Load albums around the last album-part message.
john-preston Mar 2, 2023
96ec821
Fix service messages in topics.
john-preston Mar 2, 2023
2ed67f7
Allow Tdb::Sender::request(TL..., requestId).send()
john-preston Mar 2, 2023
c3500a6
Migrate emoji keyword search to TDLib.
john-preston Mar 2, 2023
cb9ab42
Pause/unpause all Tdb while short animation plays.
john-preston Mar 2, 2023
fabba91
Support collages of media in webpage previews.
john-preston Mar 4, 2023
c9896e2
Remove setattributes(), add local DocumentData generation.
john-preston Mar 5, 2023
2080fac
Don't try to implement fake last message for now.
john-preston Mar 9, 2023
36f3d25
Track ConnectionState destructor for debugging.
john-preston Mar 9, 2023
60346b6
Fix Downloads section with TDLib.
john-preston Mar 9, 2023
4af308b
Use common language_pack_database_path.
john-preston Mar 9, 2023
0edeed1
Cancel chat actions only by chatActionCancel.
john-preston Mar 9, 2023
3e88cbd
Implement requestDialogEntry somehow for histories.
john-preston Mar 9, 2023
63a87ec
Update TDLib to 1.8.12 and fix the build.
john-preston Apr 26, 2023
1fccb7f
Request history / search with existing message ids.
john-preston Mar 16, 2023
895a610
Fix possible crash in Tdb unpausing.
john-preston Mar 16, 2023
ea14438
Implement sending animations for stickers / gifs.
john-preston Mar 16, 2023
2a09152
Remove verbose logging in streaming Tdb loader.
john-preston Mar 17, 2023
655f0af
Always pass "use_pfs" option.
john-preston Mar 17, 2023
5d59535
Use t_me_url option.
john-preston Mar 17, 2023
3d60788
Stick to an explicit TDLib commit in Dockerfile.
john-preston Mar 18, 2023
d66b6ef
[tdx] Update cmake_helpers, lib_base submodules.
john-preston Mar 18, 2023
830c7f1
[tdx] Use a distinct backup folder.
john-preston Mar 18, 2023
dd511c0
Fix build on macOS.
john-preston Mar 20, 2023
ce8fb9b
[tdx] Use new setup / update file names.
john-preston Mar 22, 2023
5df5956
Migrate support user info to TDLib.
john-preston Mar 22, 2023
bb27e03
Support separate screencast audio ssrc.
john-preston Mar 22, 2023
92e2a8f
Fix working after abnormal TDLib closing.
john-preston Mar 22, 2023
38420a6
Update code for chatId <> peerId conversions.
john-preston Mar 22, 2023
08b66d9
Migrate cloud changelogs to TDLib.
john-preston Mar 23, 2023
c0409a7
Proof-of-concept secret chat implementation.
john-preston Mar 22, 2023
70f85f6
Show key fingerprint image.
john-preston Mar 22, 2023
cf47bfe
Don't use negative UserId as a flag.
john-preston Mar 24, 2023
0b844dc
Migrated dedicated file loader to TDLib.
john-preston Mar 24, 2023
717eef2
[tdx] Force portable or distinct appdata path.
john-preston Apr 11, 2023
d85ad98
Mark td_tdb target as non-host in macOS build.
john-preston Apr 11, 2023
3e12122
[tdx] Don't build and deploy Windows setup.
john-preston Apr 11, 2023
40d2eca
[tdx] Use Tdx.app name in macOS dmg setup.
john-preston Apr 11, 2023
8a1616a
[tdx] Fix build in Docker.
john-preston Apr 11, 2023
d043df3
[tdx] Update deploy script to use correct folder.
john-preston Apr 11, 2023
1b9bfc6
Update TDLib to 1.8.14 and fix the build.
john-preston Apr 25, 2023
5cb0afc
Mess less with unread count from TDLib.
john-preston Apr 26, 2023
d333316
Select first emoji suggestion result.
john-preston Apr 26, 2023
e84d8a2
Allow calling between accounts of the same app.
john-preston Apr 26, 2023
e2cc00f
Display connecting / updating state in title.
john-preston Apr 26, 2023
b25dd44
Update TDLib to 1.8.15 and fix the build.
john-preston Jul 26, 2023
e62b95d
Fix media caption editing.
john-preston Jul 27, 2023
58e87f2
Fix login with a phone number.
john-preston Jul 27, 2023
ab59001
Fix attach bot icons loaded to local files.
john-preston Jul 28, 2023
08acfb7
Support entering code from email on test server.
john-preston Jul 28, 2023
b7fe6ad
Update TDLib to 1.8.16 and fix the build.
john-preston Aug 16, 2023
b8dcaa8
Use canRevokeFullHistory from TDLib.
john-preston Aug 16, 2023
2d0a0ad
Fix pinned messages bar appearance.
john-preston Aug 16, 2023
6f9c6ed
Fix showing last message as pinned.
john-preston Aug 16, 2023
9d4dee6
Fix admin log media opening.
john-preston Aug 16, 2023
c7d30ce
Fix message delete revoke checkbox.
john-preston Aug 16, 2023
3e41e17
Update TDLib to 1.8.18 and fix the build.
john-preston Sep 15, 2023
0cc7310
[tdx] Version 4.9.7.
john-preston Sep 15, 2023
f6fee52
Update TDLib to 1.8.19.
john-preston Sep 26, 2023
13a6e54
[tdx] Version 4.10.1.
john-preston Sep 26, 2023
edd75c3
Update TDLib to 1.8.21.
john-preston Nov 17, 2023
6e663f8
Migrated API for channel statistics from MTP to TDLib.
23rd Nov 17, 2023
4309b5e
Migrated API for giveaways from MTP to TDLib.
23rd Nov 17, 2023
8805c69
[tdx] Version 4.8.11.
john-preston Nov 18, 2023
91787e8
Update TDLib code to 1.8.31. Build broken.
john-preston Apr 10, 2024
3597c06
Fixing the build for 1.8.31.
john-preston Sep 11, 2024
5a8e15c
Update TDLib code to 1.8.36. Build broken.
john-preston Sep 11, 2024
e77141f
Migrate ChatLinks to TDLib.
john-preston Sep 11, 2024
7d35f05
Migrate collectible resolve to TDLib.
john-preston Sep 11, 2024
9d160f6
Migrate ResolvePhoneAction to TDLib.
john-preston Sep 11, 2024
56a22ca
Migrate top peers to TDLib.
john-preston Sep 18, 2024
7ceb363
Migrate report spam from admin to TDLib.
john-preston Sep 18, 2024
dc202b3
Migrate subscribe for invite to TDLib.
john-preston Sep 18, 2024
8f1b7e7
Migrate factchecks to TDLib.
john-preston Sep 18, 2024
16c28ec
Skip mobile-only constructors.
john-preston Sep 18, 2024
99bbac3
Migrate location sending to TDLib.
john-preston Oct 16, 2024
566c152
Migrate location picker to TDLib.
john-preston Oct 16, 2024
0d241db
Migrate IV to TDLib.
john-preston Oct 16, 2024
6f4d0ca
Fixed the build for 1.8.36.
john-preston Sep 11, 2024
2f2f9d9
Update TDLib to 1.8.38. Build broken.
john-preston Oct 16, 2024
e7b6506
Migrate star gifts to TDLib.
john-preston Oct 23, 2024
5ef56e8
Migrate credits value to TDLib.
john-preston Oct 23, 2024
e943011
Migrate paid reactions to TDLib.
john-preston Oct 23, 2024
eb6ae62
Migrate grossing apps and main app to TDLib.
john-preston Oct 23, 2024
7bbfc07
Update User-Agent for DNS to Chrome 130.0.0.0.
actions-user Nov 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ PRIVATE
data/data_saved_sublist.h
data/data_search_controller.cpp
data/data_search_controller.h
data/data_secret_chat.cpp
data/data_secret_chat.h
data/data_send_action.cpp
data/data_send_action.h
data/data_session.cpp
Expand Down Expand Up @@ -1160,6 +1162,8 @@ PRIVATE
media/streaming/media_streaming_loader_local.h
media/streaming/media_streaming_loader_mtproto.cpp
media/streaming/media_streaming_loader_mtproto.h
media/streaming/media_streaming_loader_tdb.cpp
media/streaming/media_streaming_loader_tdb.h
media/streaming/media_streaming_player.cpp
media/streaming/media_streaming_player.h
media/streaming/media_streaming_reader.cpp
Expand Down Expand Up @@ -1231,6 +1235,7 @@ PRIVATE
overview/overview_layout.cpp
overview/overview_layout.h
overview/overview_layout_delegate.h
passport/passport_common.h
passport/passport_encryption.cpp
passport/passport_encryption.h
passport/passport_form_controller.cpp
Expand Down Expand Up @@ -1449,6 +1454,8 @@ PRIVATE
storage/file_download.h
storage/file_download_mtproto.cpp
storage/file_download_mtproto.h
storage/file_download_tdb.cpp
storage/file_download_tdb.h
storage/file_download_web.cpp
storage/file_download_web.h
storage/file_upload.cpp
Expand Down
6 changes: 3 additions & 3 deletions Telegram/SourceFiles/_other/packer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,11 @@ int main(int argc, char *argv[])
cout << "Signature verified!\n";
RSA_free(pbKey);
#ifdef Q_OS_WIN
QString outName((targetwinarm ? QString("tarm64upd%1") : targetwin64 ? QString("tx64upd%1") : QString("tupdate%1")).arg(AlphaVersion ? AlphaVersion : version));
QString outName((targetwinarm ? QString("update-win-arm-%1") : targetwin64 ? QString("update-win-x64-%1") : QString("update-win-x86-%1")).arg(AlphaVersion ? AlphaVersion : version));
#elif defined Q_OS_MAC
QString outName((targetarmac ? QString("tarmacupd%1") : QString("tmacupd%1")).arg(AlphaVersion ? AlphaVersion : version));
QString outName((targetarmac ? QString("update-mac-arm-%1") : QString("update-mac-x64-%1")).arg(AlphaVersion ? AlphaVersion : version));
#else
QString outName(QString("tlinuxupd%1").arg(AlphaVersion ? AlphaVersion : version));
QString outName(QString("update-linux-x64-%1").arg(AlphaVersion ? AlphaVersion : version));
#endif
if (AlphaVersion) {
outName += "_" + AlphaSignature;
Expand Down
62 changes: 62 additions & 0 deletions Telegram/SourceFiles/api/api_attached_stickers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ For license and copyright information please follow this link:
#include "lang/lang_keys.h"
#include "window/window_session_controller.h"

#include "tdb/tdb_tl_scheme.h"

namespace Api {

using namespace Tdb;

AttachedStickers::AttachedStickers(not_null<ApiWrap*> api)
: _api(&api->instance()) {
}

#if 0 // mtp
void AttachedStickers::request(
not_null<Window::SessionController*> controller,
MTPmessages_GetAttachedStickers &&mtpRequest) {
Expand Down Expand Up @@ -70,23 +75,80 @@ void AttachedStickers::request(
}
}).send();
}
#endif

void AttachedStickers::request(
not_null<Window::SessionController*> controller,
FileId fileId) {
const auto weak = base::make_weak(controller.get());
_api.request(_requestId).cancel();
_requestId = _api.request(TLgetAttachedStickerSets(
tl_int32(fileId)
)).done([=](const TLstickerSets &result) {
_requestId = 0;
const auto strongController = weak.get();
if (!strongController) {
return;
}
const auto &data = result.data();
const auto &list = data.vsets().v;
if (list.isEmpty()) {
strongController->show(
Ui::MakeInformBox(tr::lng_stickers_not_found()));
return;
} else if (list.size() > 1) {
strongController->show(
Box<StickersBox>(
strongController->uiShow(),
data.vsets().v));
return;
}
// Single attached sticker pack.
const auto setId = StickerSetIdentifier{
.id = uint64(list.front().data().vid().v),
};
strongController->show(
Box<StickerSetBox>(
strongController->uiShow(),
setId,
Data::TypeFromTL(list.front().data().vsticker_type())),
Ui::LayerOption::KeepOther);
}).fail([=] {
_requestId = 0;
if (const auto strongController = weak.get()) {
strongController->show(
Ui::MakeInformBox(tr::lng_stickers_not_found()));
}
}).send();
}

void AttachedStickers::requestAttachedStickerSets(
not_null<Window::SessionController*> controller,
not_null<PhotoData*> photo) {
#if 0 // mtp
request(
controller,
MTPmessages_GetAttachedStickers(
MTP_inputStickeredMediaPhoto(photo->mtpInput())));
#endif
const auto &location = photo->location(Data::PhotoSize::Large).file();
if (const auto tdb = std::get_if<TdbFileLocation>(&location.data)) {
request(controller, tdb->fileId);
}
}

void AttachedStickers::requestAttachedStickerSets(
not_null<Window::SessionController*> controller,
not_null<DocumentData*> document) {
#if 0 // mtp
request(
controller,
MTPmessages_GetAttachedStickers(
MTP_inputStickeredMediaDocument(document->mtpInput())));
#endif
if (const auto fileId = document->tdbFileId()) {
request(controller, fileId);
}
}

} // namespace Api
8 changes: 8 additions & 0 deletions Telegram/SourceFiles/api/api_attached_stickers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ For license and copyright information please follow this link:

#include "mtproto/sender.h"

#include "tdb/tdb_request_id.h"

class ApiWrap;
class DocumentData;
class PhotoData;
Expand All @@ -32,13 +34,19 @@ class AttachedStickers final {
not_null<DocumentData*> document);

private:
#if 0 // mtp
void request(
not_null<Window::SessionController*> controller,
MTPmessages_GetAttachedStickers &&mtpRequest);
#endif

MTP::Sender _api;
mtpRequestId _requestId = 0;

void request(
not_null<Window::SessionController*> controller,
FileId fileId);

};

} // namespace Api
131 changes: 131 additions & 0 deletions Telegram/SourceFiles/api/api_authorizations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ For license and copyright information please follow this link:
#include "core/core_settings.h"
#include "lang/lang_keys.h"

#include "tdb/tdb_tl_scheme.h"

namespace Api {
namespace {

using namespace Tdb;

constexpr auto TestApiId = 17349;
constexpr auto SnapApiId = 611335;
constexpr auto DesktopApiId = 2040;

#if 0 // goodToRemove
Authorizations::Entry ParseEntry(const MTPDauthorization &data) {
auto result = Authorizations::Entry();

Expand Down Expand Up @@ -79,6 +84,72 @@ Authorizations::Entry ParseEntry(const MTPDauthorization &data) {

return result;
}
#endif

Authorizations::Entry ParseEntry(const Tdb::TLDsession &data) {
auto result = Authorizations::Entry();

result.hash = data.vis_current().v ? 0 : data.vid().v;
result.incomplete = data.vis_password_pending().v;

const auto apiId = data.vapi_id().v;
const auto isTest = (apiId == TestApiId);
const auto isDesktop = (apiId == DesktopApiId) || isTest;

const auto appName = isDesktop
? QString("Telegram Desktop%1").arg(isTest ? " (GitHub)" : QString())
: data.vapplication_name().v;
const auto appVer = [&] {
const auto version = data.vapplication_version().v;
if (isDesktop) {
const auto verInt = version.toInt();
if (version == QString::number(verInt)) {
return Core::FormatVersionDisplay(verInt);
}
} else {
if (const auto index = version.indexOf('('); index >= 0) {
return version.mid(index);
}
}
return version;
}();

result.name = result.hash
? data.vdevice_model().v
: Core::App().settings().deviceModel();
result.system = data.vsystem_version().v;
result.platform = data.vplatform().v;
result.activeTime = data.vlast_active_date().v
? data.vlast_active_date().v
: data.vlog_in_date().v;
result.info = QString("%1%2").arg(
appName,
appVer.isEmpty() ? QString() : (' ' + appVer));
result.ip = data.vip_address().v;
if (!result.hash) {
result.active = tr::lng_status_online(tr::now);
} else {
const auto now = QDateTime::currentDateTime();
const auto lastTime = base::unixtime::parse(result.activeTime);
const auto nowDate = now.date();
const auto lastDate = lastTime.date();
if (lastDate == nowDate) {
result.active = QLocale().toString(
lastTime.time(),
QLocale::ShortFormat);
} else if (lastDate.year() == nowDate.year()
&& lastDate.weekNumber() == nowDate.weekNumber()) {
result.active = langDayOfWeek(lastDate);
} else {
result.active = QLocale().toString(
lastDate,
QLocale::ShortFormat);
}
}
result.location = data.vlocation().v;

return result;
}

} // namespace

Expand Down Expand Up @@ -108,6 +179,7 @@ void Authorizations::reload() {
return;
}

#if 0 // goodToRemove
_requestId = _api.request(MTPaccount_GetAuthorizations(
)).done([=](const MTPaccount_Authorizations &result) {
_requestId = 0;
Expand All @@ -124,10 +196,30 @@ void Authorizations::reload() {
}).fail([=] {
_requestId = 0;
}).send();
#endif

using namespace Tdb;
_requestId = _api.request(TLgetActiveSessions(
)).done([=](const TLDsessions &data) {
_requestId = 0;
_lastReceived = crl::now();
_ttlDays = data.vinactive_session_ttl_days().v;
_list = (
data.vsessions().v
) | ranges::views::transform([](const TLsession &d) {
return ParseEntry(d.c_session());
}) | ranges::to<List>;
refreshCallsDisabledHereFromCloud();
_listChanges.fire({});
}).fail([=](const Error &error) {
_requestId = 0;
}).send();
}

void Authorizations::cancelCurrentRequest() {
#if 0 // goodToRemove
_api.request(base::take(_requestId)).cancel();
#endif
}

void Authorizations::refreshCallsDisabledHereFromCloud() {
Expand All @@ -138,6 +230,7 @@ void Authorizations::refreshCallsDisabledHereFromCloud() {
}
}

#if 0 // goodToRemove
void Authorizations::requestTerminate(
Fn<void(const MTPBool &result)> &&done,
Fn<void(const MTP::Error &error)> &&fail,
Expand Down Expand Up @@ -167,6 +260,35 @@ void Authorizations::requestTerminate(
send(MTPauth_ResetAuthorizations());
}
}
#endif

void Authorizations::requestTerminate(
Fn<void()> &&done,
Fn<void()> &&fail,
std::optional<uint64> hash) {
const auto send = [&](auto request) {
_api.request(
std::move(request)
).done([=, done = std::move(done)] {
done();
if (hash) {
_list.erase(
ranges::remove(_list, *hash, &Entry::hash),
end(_list));
} else {
_list.clear();
}
_listChanges.fire({});
}).fail(
std::move(fail)
).send();
};
if (hash) {
send(Tdb::TLterminateSession(Tdb::tl_int64(*hash)));
} else {
send(Tdb::TLterminateAllOtherSessions());
}
}

Authorizations::List Authorizations::list() const {
return _list;
Expand All @@ -191,8 +313,12 @@ rpl::producer<int> Authorizations::totalValue() const {

void Authorizations::updateTTL(int days) {
_api.request(_ttlRequestId).cancel();
#if 0 // mtp
_ttlRequestId = _api.request(MTPaccount_SetAuthorizationTTL(
MTP_int(days)
#endif
_ttlRequestId = _api.request(TLsetInactiveSessionTtl(
tl_int32(days)
)).done([=] {
_ttlRequestId = 0;
}).fail([=] {
Expand All @@ -209,12 +335,17 @@ void Authorizations::toggleCallsDisabled(uint64 hash, bool disabled) {
if (const auto sent = _toggleCallsDisabledRequests.take(hash)) {
_api.request(*sent).cancel();
}
#if 0 // mtp
using Flag = MTPaccount_ChangeAuthorizationSettings::Flag;
const auto id = _api.request(MTPaccount_ChangeAuthorizationSettings(
MTP_flags(Flag::f_call_requests_disabled),
MTP_long(hash),
MTPBool(), // encrypted_requests_disabled
MTP_bool(disabled)
#endif
const auto id = _api.request(TLtoggleSessionCanAcceptCalls(
tl_int64(hash),
tl_bool(!disabled)
)).done([=] {
_toggleCallsDisabledRequests.remove(hash);
}).fail([=] {
Expand Down
Loading