mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 15:05:56 +00:00
Fixed statistics section of stories from megagroups.
This commit is contained in:
@@ -341,6 +341,10 @@ void PublicForwards::request(
|
|||||||
.token = nextToken,
|
.token = nextToken,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const auto processFail = [=] {
|
||||||
|
_requestId = 0;
|
||||||
|
done({});
|
||||||
|
};
|
||||||
|
|
||||||
constexpr auto kLimit = tl::make_int(100);
|
constexpr auto kLimit = tl::make_int(100);
|
||||||
if (_fullId.messageId) {
|
if (_fullId.messageId) {
|
||||||
@@ -349,14 +353,14 @@ void PublicForwards::request(
|
|||||||
MTP_int(_fullId.messageId.msg),
|
MTP_int(_fullId.messageId.msg),
|
||||||
MTP_string(token),
|
MTP_string(token),
|
||||||
kLimit
|
kLimit
|
||||||
)).done(processResult).fail([=] { _requestId = 0; }).send();
|
)).done(processResult).fail(processFail).send();
|
||||||
} else if (_fullId.storyId) {
|
} else if (_fullId.storyId) {
|
||||||
_requestId = makeRequest(MTPstats_GetStoryPublicForwards(
|
_requestId = makeRequest(MTPstats_GetStoryPublicForwards(
|
||||||
channel->input,
|
channel->input,
|
||||||
MTP_int(_fullId.storyId.story),
|
MTP_int(_fullId.storyId.story),
|
||||||
MTP_string(token),
|
MTP_string(token),
|
||||||
kLimit
|
kLimit
|
||||||
)).done(processResult).fail([=] { _requestId = 0; }).send();
|
)).done(processResult).fail(processFail).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,7 +385,7 @@ Data::PublicForwardsSlice MessageStatistics::firstSlice() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MessageStatistics::request(Fn<void(Data::MessageStatistics)> done) {
|
void MessageStatistics::request(Fn<void(Data::MessageStatistics)> done) {
|
||||||
if (channel()->isMegagroup()) {
|
if (channel()->isMegagroup() && !_storyId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto requestFirstPublicForwards = [=](
|
const auto requestFirstPublicForwards = [=](
|
||||||
|
@@ -224,6 +224,7 @@ void MessagePreview::processPreview() {
|
|||||||
auto image = QImage(
|
auto image = QImage(
|
||||||
rect.size() * style::DevicePixelRatio(),
|
rect.size() * style::DevicePixelRatio(),
|
||||||
QImage::Format_ARGB32_Premultiplied);
|
QImage::Format_ARGB32_Premultiplied);
|
||||||
|
image.setDevicePixelRatio(style::DevicePixelRatio());
|
||||||
image.fill(Qt::transparent);
|
image.fill(Qt::transparent);
|
||||||
{
|
{
|
||||||
auto p = QPainter(&image);
|
auto p = QPainter(&image);
|
||||||
|
Reference in New Issue
Block a user