2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Add some javascript handlers to HTML export.

This commit is contained in:
John Preston
2018-07-24 21:28:04 +03:00
parent a99ae76ad4
commit aaa1245430
7 changed files with 329 additions and 47 deletions

View File

@@ -972,6 +972,13 @@ void ApiWrap::cancelExportFast() {
}
void ApiWrap::requestSinglePeerDialog() {
const auto isChannelType = [](Data::DialogInfo::Type type) {
using Type = Data::DialogInfo::Type;
return (type == Type::PrivateSupergroup)
|| (type == Type::PublicSupergroup)
|| (type == Type::PrivateChannel)
|| (type == Type::PublicChannel);
};
auto doneSinglePeer = [=](const auto &result) {
auto info = Data::ParseDialogsInfo(_settings->singlePeer, result);
@@ -980,6 +987,9 @@ void ApiWrap::requestSinglePeerDialog() {
const auto last = _dialogsProcess->splitIndexPlusOne - 1;
for (auto &info : _dialogsProcess->info.chats) {
if (isChannelType(info.type)) {
continue;
}
for (auto i = last; i != 0; --i) {
info.splits.push_back(i - 1);
info.messagesCountPerSplit.push_back(0);