mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 15:04:57 +00:00
Merge tag 'v4.16.0' into dev
# Conflicts: # README.md # Telegram/Resources/winrc/Telegram.rc # Telegram/Resources/winrc/Updater.rc # Telegram/SourceFiles/calls/calls_call.cpp # Telegram/SourceFiles/core/local_url_handlers.cpp # Telegram/SourceFiles/core/version.h # Telegram/SourceFiles/history/view/media/history_view_giveaway.cpp # Telegram/SourceFiles/history/view/media/history_view_sticker.cpp # Telegram/lib_ui # snap/snapcraft.yaml
This commit is contained in:
@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "api/api_authorizations.h"
|
||||
#include "api/api_attached_stickers.h"
|
||||
#include "api/api_blocked_peers.h"
|
||||
#include "api/api_chat_links.h"
|
||||
#include "api/api_chat_participants.h"
|
||||
#include "api/api_cloud_password.h"
|
||||
#include "api/api_hash.h"
|
||||
@@ -169,6 +170,7 @@ ApiWrap::ApiWrap(not_null<Main::Session*> session)
|
||||
, _globalPrivacy(std::make_unique<Api::GlobalPrivacy>(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))
|
||||
, _confirmPhone(std::make_unique<Api::ConfirmPhone>(this))
|
||||
, _peerPhoto(std::make_unique<Api::PeerPhoto>(this))
|
||||
@@ -1246,7 +1248,7 @@ void ApiWrap::requestPeerSettings(not_null<PeerData*> peer) {
|
||||
result.match([&](const MTPDmessages_peerSettings &data) {
|
||||
_session->data().processUsers(data.vusers());
|
||||
_session->data().processChats(data.vchats());
|
||||
peer->setSettings(data.vsettings());
|
||||
peer->setBarSettings(data.vsettings());
|
||||
_requestedPeerSettings.erase(peer);
|
||||
});
|
||||
}).fail([=] {
|
||||
@@ -1775,7 +1777,7 @@ void ApiWrap::joinChannel(not_null<ChannelData*> channel) {
|
||||
}
|
||||
return QString();
|
||||
}();
|
||||
if (!text.isEmpty()) {
|
||||
if (show && !text.isEmpty()) {
|
||||
show->showToast(text, kJoinErrorDuration);
|
||||
}
|
||||
}
|
||||
@@ -2581,6 +2583,10 @@ void ApiWrap::refreshFileReference(
|
||||
request(MTPaccount_GetSavedRingtones(MTP_long(0)));
|
||||
}, [&](Data::FileOriginPremiumPreviews data) {
|
||||
request(MTPhelp_GetPremiumPromo());
|
||||
}, [&](Data::FileOriginWebPage data) {
|
||||
request(MTPmessages_GetWebPage(
|
||||
MTP_string(data.url),
|
||||
MTP_int(0)));
|
||||
}, [&](Data::FileOriginStory data) {
|
||||
request(MTPstories_GetStoriesByID(
|
||||
_session->data().peer(data.peer)->input,
|
||||
@@ -3667,11 +3673,16 @@ void ApiWrap::cancelLocalItem(not_null<HistoryItem*> item) {
|
||||
void ApiWrap::sendShortcutMessages(
|
||||
not_null<PeerData*> peer,
|
||||
BusinessShortcutId id) {
|
||||
auto ids = QVector<MTPint>();
|
||||
auto randomIds = QVector<MTPlong>();
|
||||
request(MTPmessages_SendQuickReplyMessages(
|
||||
peer->input,
|
||||
MTP_int(id)
|
||||
MTP_int(id),
|
||||
MTP_vector<MTPint>(ids),
|
||||
MTP_vector<MTPlong>(randomIds)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
applyUpdates(result);
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
}).send();
|
||||
}
|
||||
|
||||
@@ -3903,13 +3914,14 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
|
||||
}
|
||||
|
||||
void ApiWrap::sendBotStart(
|
||||
std::shared_ptr<Ui::Show> show,
|
||||
not_null<UserData*> bot,
|
||||
PeerData *chat,
|
||||
const QString &startTokenForChat) {
|
||||
Expects(bot->isBot());
|
||||
|
||||
if (chat && chat->isChannel() && !chat->isMegagroup()) {
|
||||
ShowAddParticipantsError("USER_BOT", chat, { 1, bot });
|
||||
ShowAddParticipantsError(show, "USER_BOT", chat, bot);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3943,7 +3955,7 @@ void ApiWrap::sendBotStart(
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
if (chat) {
|
||||
const auto type = error.type();
|
||||
ShowAddParticipantsError(type, chat, { 1, bot });
|
||||
ShowAddParticipantsError(show, type, chat, bot);
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
@@ -4059,6 +4071,8 @@ void ApiWrap::uploadAlbumMedia(
|
||||
|
||||
};
|
||||
request(MTPmessages_UploadMedia(
|
||||
MTP_flags(0),
|
||||
MTPstring(), // business_connection_id
|
||||
item->history()->peer->input,
|
||||
media
|
||||
)).done([=](const MTPMessageMedia &result) {
|
||||
@@ -4495,6 +4509,10 @@ Api::InviteLinks &ApiWrap::inviteLinks() {
|
||||
return *_inviteLinks;
|
||||
}
|
||||
|
||||
Api::ChatLinks &ApiWrap::chatLinks() {
|
||||
return *_chatLinks;
|
||||
}
|
||||
|
||||
Api::ViewsManager &ApiWrap::views() {
|
||||
return *_views;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user