diff --git a/Telegram/Resources/export_html/css/style.css b/Telegram/Resources/export_html/css/style.css
index 0e0aa9d9e..74f36842d 100644
--- a/Telegram/Resources/export_html/css/style.css
+++ b/Telegram/Resources/export_html/css/style.css
@@ -275,7 +275,7 @@ div.selected {
padding: 10px;
}
.default.joined {
- padding-top: 0;
+ margin-top: -10px;
}
.default .from_name {
color: #3892db;
diff --git a/Telegram/SourceFiles/export/output/export_output_html.cpp b/Telegram/SourceFiles/export/output/export_output_html.cpp
index de26882a2..ebdfc686f 100644
--- a/Telegram/SourceFiles/export/output/export_output_html.cpp
+++ b/Telegram/SourceFiles/export/output/export_output_html.cpp
@@ -958,6 +958,9 @@ auto HtmlWriter::Wrap::pushMessage(
return wrapMessageLink(message.replyToMsgId, text);
};
+ using DialogType = Data::DialogInfo::Type;
+ const auto isChannel = (dialog.type == DialogType::PrivateChannel)
+ || (dialog.type == DialogType::PublicChannel);
const auto serviceFrom = peers.wrapUserName(message.fromId);
const auto serviceText = message.action.content.match(
[&](const ActionChatCreate &data) {
@@ -967,14 +970,20 @@ auto HtmlWriter::Wrap::pushMessage(
? QByteArray()
: " with members " + peers.wrapUserNames(data.userIds));
}, [&](const ActionChatEditTitle &data) {
- return serviceFrom
- + " changed group title to «" + data.title + "»";
+ return isChannel
+ ? ("Channel title changed to «" + data.title + "»")
+ : (serviceFrom
+ + " changed group title to «"
+ + data.title
+ + "»");
}, [&](const ActionChatEditPhoto &data) {
- return serviceFrom
- + " changed group photo";
+ return isChannel
+ ? QByteArray("Channel photo changed")
+ : (serviceFrom + " changed group photo");
}, [&](const ActionChatDeletePhoto &data) {
- return serviceFrom
- + " deleted group photo";
+ return isChannel
+ ? QByteArray("Channel photo removed")
+ : (serviceFrom + " removed group photo");
}, [&](const ActionChatAddUser &data) {
return serviceFrom
+ " invited "
@@ -2263,7 +2272,9 @@ Result HtmlWriter::writeDialogSlice(const Data::MessagesSlice &data) {
const auto messageLinkWrapper = [&](int messageId, QByteArray text) {
return wrapMessageLink(messageId, text);
};
- auto oldIndex = (_messagesCount / kMessagesInFile);
+ auto oldIndex = (_messagesCount > 0)
+ ? ((_messagesCount - 1) / kMessagesInFile)
+ : 0;
auto previous = _lastMessageInfo.get();
auto saved = base::optional();
auto block = QByteArray();
diff --git a/Telegram/SourceFiles/export/view/export_view_content.cpp b/Telegram/SourceFiles/export/view/export_view_content.cpp
index 4d00c5d9d..4c5444ce5 100644
--- a/Telegram/SourceFiles/export/view/export_view_content.cpp
+++ b/Telegram/SourceFiles/export/view/export_view_content.cpp
@@ -41,10 +41,16 @@ Content ContentFromState(const ProcessingState &state) {
const auto done = state.substepsPassed;
const auto add = state.substepsNow;
const auto doneProgress = done / float64(substepsTotal);
- const auto addProgress = (state.entityCount > 0)
- ? ((float64(add) * state.entityIndex)
- / (float64(substepsTotal) * state.entityCount))
- : 0.;
+ const auto addPart = [&](int index, int count) {
+ return (count > 0)
+ ? ((float64(add) * index)
+ / (float64(substepsTotal) * count))
+ : 0.;
+ };
+ const auto addProgress = (state.entityCount == 1
+ && !state.entityIndex)
+ ? addPart(state.itemIndex, state.itemCount)
+ : addPart(state.entityIndex, state.entityCount);
push("main", label, info, doneProgress + addProgress);
};
const auto pushBytes = [&](const QString &id, const QString &label) {