2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Pass MTP::Instance to MTP::Sender.

This commit is contained in:
John Preston
2019-11-27 11:02:56 +03:00
parent a0152557ec
commit e943264823
65 changed files with 406 additions and 275 deletions

View File

@@ -661,6 +661,7 @@ StickersBox::Inner::Inner(
StickersBox::Section section)
: RpWidget(parent)
, _session(session)
, _api(_session->api().instance())
, _section(section)
, _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom())
, _shiftingAnimation([=](crl::time now) {
@@ -677,6 +678,7 @@ StickersBox::Inner::Inner(
StickersBox::Inner::Inner(QWidget *parent, not_null<ChannelData*> megagroup)
: RpWidget(parent)
, _session(&megagroup->session())
, _api(_session->api().instance())
, _section(StickersBox::Section::Installed)
, _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom())
, _shiftingAnimation([=](crl::time now) {
@@ -1469,11 +1471,13 @@ void StickersBox::Inner::handleMegagroupSetAddressChange() {
}
}
} else if (!_megagroupSetRequestId) {
_megagroupSetRequestId = request(MTPmessages_GetStickerSet(MTP_inputStickerSetShortName(MTP_string(text)))).done([this](const MTPmessages_StickerSet &result) {
_megagroupSetRequestId = _api.request(MTPmessages_GetStickerSet(
MTP_inputStickerSetShortName(MTP_string(text))
)).done([=](const MTPmessages_StickerSet &result) {
_megagroupSetRequestId = 0;
auto set = Stickers::FeedSetFull(result);
setMegagroupSelectedSet(MTP_inputStickerSetID(MTP_long(set->id), MTP_long(set->access)));
}).fail([this](const RPCError &error) {
}).fail([=](const RPCError &error) {
_megagroupSetRequestId = 0;
setMegagroupSelectedSet(MTP_inputStickerSetEmpty());
}).send();