2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Update API scheme to layer 133.

This commit is contained in:
John Preston
2021-08-25 11:15:05 +03:00
parent ce7a3c354c
commit a6c98f4bb4
61 changed files with 618 additions and 615 deletions

View File

@@ -434,14 +434,15 @@ void InnerWidget::applySearch(const QString &query) {
}
void InnerWidget::requestAdmins() {
auto participantsHash = 0;
const auto offset = 0;
const auto participantsHash = uint64(0);
_api.request(MTPchannels_GetParticipants(
_channel->inputChannel,
MTP_channelParticipantsAdmins(),
MTP_int(0),
MTP_int(offset),
MTP_int(kMaxChannelAdmins),
MTP_int(participantsHash)
)).done([this](const MTPchannels_ChannelParticipants &result) {
MTP_long(participantsHash)
)).done([=](const MTPchannels_ChannelParticipants &result) {
session().api().parseChannelParticipants(_channel, result, [&](
int availableCount,
const QVector<MTPChannelParticipant> &list) {

View File

@@ -97,7 +97,7 @@ MTPMessage PrepareLogMessage(
data.vfrom_id() ? *data.vfrom_id() : MTPPeer(),
data.vpeer_id(),
data.vfwd_from() ? *data.vfwd_from() : MTPMessageFwdHeader(),
MTP_int(data.vvia_bot_id().value_or_empty()),
MTP_long(data.vvia_bot_id().value_or_empty()),
MTPMessageReplyHeader(),
MTP_int(newDate),
data.vmessage(),
@@ -1076,6 +1076,12 @@ void GenerateItems(
addSimpleServiceMessage(text);
};
auto createChangeTheme = [&](const MTPDchannelAdminLogEventActionChangeTheme &data) {
const auto was = qs(data.vprev_value());
const auto now = qs(data.vnew_value());
// #TODO themes
};
action.match([&](const MTPDchannelAdminLogEventActionChangeTitle &data) {
createChangeTitle(data);
}, [&](const MTPDchannelAdminLogEventActionChangeAbout &data) {
@@ -1140,6 +1146,8 @@ void GenerateItems(
createParticipantVolume(data);
}, [&](const MTPDchannelAdminLogEventActionChangeHistoryTTL &data) {
createChangeHistoryTTL(data);
}, [&](const MTPDchannelAdminLogEventActionChangeTheme &data) {
createChangeTheme(data);
});
}

View File

@@ -1104,7 +1104,7 @@ void HistoryMessage::createComponents(const CreateConfig &config) {
MTP_int(0),
MTP_int(0),
MTPVector<MTPPeer>(), // recent_repliers
MTP_int(peerToChannel(linked->id).bare),
MTP_long(peerToChannel(linked->id).bare),
MTP_int(0), // max_id
MTP_int(0))); // read_max_id
}

View File

@@ -618,7 +618,7 @@ bool HistoryService::updateDependent(bool force) {
}
HistoryService::PreparedText HistoryService::prepareInvitedToCallText(
const QVector<MTPint> &users,
const QVector<MTPlong> &users,
uint64 linkCallId) {
const auto owner = &history()->owner();
auto chatText = tr::lng_action_invite_user_chat(tr::now);

View File

@@ -161,7 +161,7 @@ private:
PreparedText prepareGameScoreText();
PreparedText preparePaymentSentText();
PreparedText prepareInvitedToCallText(
const QVector<MTPint> &users,
const QVector<MTPlong> &users,
uint64 linkCallId);
PreparedText prepareCallScheduledText(
TimeId scheduleDate);

View File

@@ -2795,10 +2795,10 @@ void HistoryWidget::firstLoadMessages() {
}
}
auto offsetDate = 0;
auto maxId = 0;
auto minId = 0;
auto historyHash = 0;
const auto offsetDate = 0;
const auto maxId = 0;
const auto minId = 0;
const auto historyHash = uint64(0);
const auto history = from;
const auto type = Data::Histories::RequestType::History;
@@ -2812,7 +2812,7 @@ void HistoryWidget::firstLoadMessages() {
MTP_int(loadCount),
MTP_int(maxId),
MTP_int(minId),
MTP_int(historyHash)
MTP_long(historyHash)
)).done([=](const MTPmessages_Messages &result) {
messagesReceived(history->peer, result, _firstLoadRequest);
finish();
@@ -2836,20 +2836,20 @@ void HistoryWidget::loadMessages() {
&& (_history->isEmpty()
|| _history->loadedAtTop()
|| (!_migrated->isEmpty() && !_migrated->loadedAtBottom()));
auto from = loadMigrated ? _migrated : _history;
const auto from = loadMigrated ? _migrated : _history;
if (from->loadedAtTop()) {
return;
}
auto offsetId = from->minMsgId();
auto addOffset = 0;
auto loadCount = offsetId
const auto offsetId = from->minMsgId();
const auto addOffset = 0;
const auto loadCount = offsetId
? kMessagesPerPage
: kMessagesPerPageFirst;
auto offsetDate = 0;
auto maxId = 0;
auto minId = 0;
auto historyHash = 0;
const auto offsetDate = 0;
const auto maxId = 0;
const auto minId = 0;
const auto historyHash = uint64(0);
const auto history = from;
const auto type = Data::Histories::RequestType::History;
@@ -2863,7 +2863,7 @@ void HistoryWidget::loadMessages() {
MTP_int(loadCount),
MTP_int(maxId),
MTP_int(minId),
MTP_int(historyHash)
MTP_long(historyHash)
)).done([=](const MTPmessages_Messages &result) {
messagesReceived(history->peer, result, _preloadRequest);
finish();
@@ -2889,7 +2889,7 @@ void HistoryWidget::loadMessagesDown() {
return;
}
auto loadCount = kMessagesPerPage;
const auto loadCount = kMessagesPerPage;
auto addOffset = -loadCount;
auto offsetId = from->maxMsgId();
if (!offsetId) {
@@ -2897,10 +2897,10 @@ void HistoryWidget::loadMessagesDown() {
++offsetId;
++addOffset;
}
auto offsetDate = 0;
auto maxId = 0;
auto minId = 0;
auto historyHash = 0;
const auto offsetDate = 0;
const auto maxId = 0;
const auto minId = 0;
const auto historyHash = uint64(0);
const auto history = from;
const auto type = Data::Histories::RequestType::History;
@@ -2914,7 +2914,7 @@ void HistoryWidget::loadMessagesDown() {
MTP_int(loadCount),
MTP_int(maxId),
MTP_int(minId),
MTP_int(historyHash)
MTP_long(historyHash)
)).done([=](const MTPmessages_Messages &result) {
messagesReceived(history->peer, result, _preloadDownRequest);
finish();
@@ -2961,10 +2961,10 @@ void HistoryWidget::delayedShowAt(MsgId showAtMsgId) {
offsetId = -_delayedShowAtMsgId;
}
}
auto offsetDate = 0;
auto maxId = 0;
auto minId = 0;
auto historyHash = 0;
const auto offsetDate = 0;
const auto maxId = 0;
const auto minId = 0;
const auto historyHash = uint64(0);
const auto history = from;
const auto type = Data::Histories::RequestType::History;
@@ -2978,7 +2978,7 @@ void HistoryWidget::delayedShowAt(MsgId showAtMsgId) {
MTP_int(loadCount),
MTP_int(maxId),
MTP_int(minId),
MTP_int(historyHash)
MTP_long(historyHash)
)).done([=](const MTPmessages_Messages &result) {
messagesReceived(history->peer, result, _delayedShowAtRequest);
finish();