Skip to content

Commit

Permalink
Some export bugs fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jun 17, 2018
1 parent 2dc3ec9 commit e8d619c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Telegram/SourceFiles/export/export_api_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void ApiWrap::appendDialogsSlice(Data::DialogsInfo &&info) {
Expects(_dialogsProcess != nullptr);
Expects(_settings != nullptr);

const auto types = _settings->types | _settings->fullChats;
const auto types = _settings->types;
auto filtered = ranges::view::all(
info.list
) | ranges::view::filter([&](const Data::DialogInfo &info) {
Expand Down Expand Up @@ -519,7 +519,7 @@ void ApiWrap::requestNextDialog() {
Expects(_dialogsProcess->single == nullptr);

const auto index = ++_dialogsProcess->singleIndex;
if (index < 11) {// _dialogsProcess->info.list.size()) {
if (index < _dialogsProcess->info.list.size()) {
const auto &one = _dialogsProcess->info.list[index];
_dialogsProcess->single = std::make_unique<DialogsProcess::Single>(one);
_dialogsProcess->startOne(one);
Expand Down Expand Up @@ -631,7 +631,8 @@ void ApiWrap::loadNextMessageFile() {
}
const auto ready = processFileLoad(
list[index].file(),
[=](const QString &path) { loadMessageFileDone(path); });
[=](const QString &path) { loadMessageFileDone(path); },
&list[index]);
if (!ready) {
return;
}
Expand Down
12 changes: 8 additions & 4 deletions Telegram/SourceFiles/export/output/export_output_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ void SerializeMultiline(
offset = newline + 1;
newline = value.indexOf('\n', offset);
} while (newline > 0);
appendTo.append("> ");
appendTo.append(data + offset).append(kLineBreak);
}

QByteArray JoinList(
Expand Down Expand Up @@ -181,15 +183,17 @@ QByteArray SerializeMessage(
using SkipReason = Data::File::SkipReason;
const auto pushPath = [&](
const Data::File &file,
const QByteArray &label) {
const QByteArray &label,
const QByteArray &name = QByteArray()) {
Expects(!file.relativePath.isEmpty()
|| file.skipReason != SkipReason::None);

push(label, [&]() -> QByteArray {
const auto pre = name.isEmpty() ? QByteArray() : name + ' ';
switch (file.skipReason) {
case SkipReason::Unavailable: return "(file unavailable)";
case SkipReason::FileSize: return "(file too large)";
case SkipReason::FileType: return "(file skipped)";
case SkipReason::Unavailable: return pre + "(file unavailable)";
case SkipReason::FileSize: return pre + "(file too large)";
case SkipReason::FileType: return pre + "(file skipped)";
case SkipReason::None: return FormatFilePath(file);
}
Unexpected("Skip reason while writing file path.");
Expand Down

0 comments on commit e8d619c

Please sign in to comment.