mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Merge tag 'v6.7.2' into dev
This commit is contained in:
@@ -25,12 +25,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "api/api_self_destruct.h"
|
||||
#include "api/api_sensitive_content.h"
|
||||
#include "api/api_global_privacy.h"
|
||||
#include "api/api_reactions_notify_settings.h"
|
||||
#include "api/api_updates.h"
|
||||
#include "api/api_user_privacy.h"
|
||||
#include "api/api_read_metrics.h"
|
||||
#include "api/api_views.h"
|
||||
#include "api/api_confirm_phone.h"
|
||||
#include "api/api_unread_things.h"
|
||||
#include "api/api_ringtones.h"
|
||||
#include "api/api_compose_with_ai.h"
|
||||
#include "api/api_transcribes.h"
|
||||
#include "api/api_premium.h"
|
||||
#include "api/api_user_names.h"
|
||||
@@ -184,10 +187,13 @@ ApiWrap::ApiWrap(not_null<Main::Session*> session)
|
||||
, _selfDestruct(std::make_unique<Api::SelfDestruct>(this))
|
||||
, _sensitiveContent(std::make_unique<Api::SensitiveContent>(this))
|
||||
, _globalPrivacy(std::make_unique<Api::GlobalPrivacy>(this))
|
||||
, _reactionsNotifySettings(
|
||||
std::make_unique<Api::ReactionsNotifySettings>(this))
|
||||
, _userPrivacy(std::make_unique<Api::UserPrivacy>(this))
|
||||
, _inviteLinks(std::make_unique<Api::InviteLinks>(this))
|
||||
, _chatLinks(std::make_unique<Api::ChatLinks>(this))
|
||||
, _views(std::make_unique<Api::ViewsManager>(this))
|
||||
, _readMetrics(std::make_unique<Api::ReadMetrics>(this))
|
||||
, _confirmPhone(std::make_unique<Api::ConfirmPhone>(this))
|
||||
, _peerPhoto(std::make_unique<Api::PeerPhoto>(this))
|
||||
, _polls(std::make_unique<Api::Polls>(this))
|
||||
@@ -195,6 +201,7 @@ ApiWrap::ApiWrap(not_null<Main::Session*> session)
|
||||
, _chatParticipants(std::make_unique<Api::ChatParticipants>(this))
|
||||
, _unreadThings(std::make_unique<Api::UnreadThings>(this))
|
||||
, _ringtones(std::make_unique<Api::Ringtones>(this))
|
||||
, _composeWithAi(std::make_unique<Api::ComposeWithAi>(this))
|
||||
, _transcribes(std::make_unique<Api::Transcribes>(this))
|
||||
, _premium(std::make_unique<Api::Premium>(this))
|
||||
, _usernames(std::make_unique<Api::Usernames>(this))
|
||||
@@ -210,6 +217,7 @@ ApiWrap::ApiWrap(not_null<Main::Session*> session)
|
||||
requestMoreDialogsIfNeeded();
|
||||
}, _session->lifetime());
|
||||
|
||||
_reactionsNotifySettings->reload();
|
||||
setupSupportMode();
|
||||
});
|
||||
}
|
||||
@@ -3882,6 +3890,7 @@ void ApiWrap::editMedia(
|
||||
.spoiler = false,
|
||||
.album = nullptr,
|
||||
.forceFile = false,
|
||||
.sendLargePhotos = false,
|
||||
.idOverride = 0,
|
||||
})
|
||||
: nullptr),
|
||||
@@ -3891,6 +3900,7 @@ void ApiWrap::editMedia(
|
||||
.spoiler = file.spoiler,
|
||||
.album = nullptr,
|
||||
.forceFile = forceFile,
|
||||
.sendLargePhotos = file.sendLargePhotos,
|
||||
.idOverride = 0,
|
||||
.displayName = file.displayName,
|
||||
}));
|
||||
@@ -3899,32 +3909,8 @@ void ApiWrap::editMedia(
|
||||
void ApiWrap::sendFiles(
|
||||
Ui::PreparedList &&list,
|
||||
SendMediaType type,
|
||||
TextWithTags &&caption,
|
||||
std::shared_ptr<SendingAlbum> album,
|
||||
const SendAction &action) {
|
||||
const auto haveCaption = !caption.text.isEmpty();
|
||||
const auto captionAttached = !haveCaption
|
||||
? false
|
||||
: (list.files.size() == 1)
|
||||
? list.canAddCaption(
|
||||
album != nullptr,
|
||||
type == SendMediaType::Photo)
|
||||
: Ui::CaptionWillBeAttached(
|
||||
list,
|
||||
[&] {
|
||||
auto way = Ui::SendFilesWay();
|
||||
way.setGroupFiles(album != nullptr);
|
||||
way.setSendImagesAsPhotos(type == SendMediaType::Photo);
|
||||
return way;
|
||||
}(),
|
||||
false);
|
||||
if (haveCaption && !captionAttached) {
|
||||
auto message = MessageToSend(action);
|
||||
message.textWithTags = base::take(caption);
|
||||
message.action.clearDraft = false;
|
||||
sendMessage(std::move(message));
|
||||
}
|
||||
|
||||
const auto to = FileLoadTaskOptions(action);
|
||||
if (album) {
|
||||
album->options = to.options;
|
||||
@@ -3958,19 +3944,20 @@ void ApiWrap::sendFiles(
|
||||
.spoiler = false,
|
||||
.album = nullptr,
|
||||
.forceFile = false,
|
||||
.sendLargePhotos = false,
|
||||
.idOverride = 0,
|
||||
})
|
||||
: nullptr),
|
||||
.type = uploadWithType,
|
||||
.to = to,
|
||||
.caption = caption,
|
||||
.caption = std::move(file.caption),
|
||||
.spoiler = file.spoiler,
|
||||
.album = album,
|
||||
.forceFile = forceFile,
|
||||
.sendLargePhotos = file.sendLargePhotos,
|
||||
.idOverride = 0,
|
||||
.displayName = file.displayName,
|
||||
}));
|
||||
caption = TextWithTags();
|
||||
}
|
||||
if (album) {
|
||||
_sendingAlbums.emplace(album->groupId, album);
|
||||
@@ -4543,7 +4530,8 @@ void ApiWrap::uploadAlbumMedia(
|
||||
fields.vid(),
|
||||
fields.vaccess_hash(),
|
||||
fields.vfile_reference()),
|
||||
MTP_int(data.vttl_seconds().value_or_empty()));
|
||||
MTP_int(data.vttl_seconds().value_or_empty()),
|
||||
MTPInputDocument()); // video
|
||||
sendAlbumWithUploaded(item, groupId, media);
|
||||
} break;
|
||||
|
||||
@@ -5072,6 +5060,10 @@ Api::GlobalPrivacy &ApiWrap::globalPrivacy() {
|
||||
return *_globalPrivacy;
|
||||
}
|
||||
|
||||
Api::ReactionsNotifySettings &ApiWrap::reactionsNotifySettings() {
|
||||
return *_reactionsNotifySettings;
|
||||
}
|
||||
|
||||
Api::UserPrivacy &ApiWrap::userPrivacy() {
|
||||
return *_userPrivacy;
|
||||
}
|
||||
@@ -5088,6 +5080,10 @@ Api::ViewsManager &ApiWrap::views() {
|
||||
return *_views;
|
||||
}
|
||||
|
||||
Api::ReadMetrics &ApiWrap::readMetrics() {
|
||||
return *_readMetrics;
|
||||
}
|
||||
|
||||
Api::ConfirmPhone &ApiWrap::confirmPhone() {
|
||||
return *_confirmPhone;
|
||||
}
|
||||
@@ -5116,6 +5112,10 @@ Api::Ringtones &ApiWrap::ringtones() {
|
||||
return *_ringtones;
|
||||
}
|
||||
|
||||
Api::ComposeWithAi &ApiWrap::composeWithAi() {
|
||||
return *_composeWithAi;
|
||||
}
|
||||
|
||||
Api::Transcribes &ApiWrap::transcribes() {
|
||||
return *_transcribes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user