Show "Saved messages" chat name in export UI.

This commit is contained in:
John Preston 2018-06-28 18:12:13 +01:00
parent 5cdc563c9e
commit efb3e92525
3 changed files with 12 additions and 1 deletions

View file

@ -655,6 +655,9 @@ void Controller::fillMessagesState(
result.entityIndex = index + addIndex; result.entityIndex = index + addIndex;
result.entityCount = info.list.size() + addCount; result.entityCount = info.list.size() + addCount;
result.entityName = dialog.name; result.entityName = dialog.name;
result.entityType = (dialog.type == Data::DialogInfo::Type::Self)
? ProcessingState::EntityType::SavedMessages
: ProcessingState::EntityType::Chat;
result.itemIndex = _messagesWritten + progress.itemIndex; result.itemIndex = _messagesWritten + progress.itemIndex;
result.itemCount = std::max(_messagesCount, result.itemIndex); result.itemCount = std::max(_messagesCount, result.itemIndex);
result.bytesType = ProcessingState::FileType::File; // TODO result.bytesType = ProcessingState::FileType::File; // TODO

View file

@ -48,6 +48,11 @@ struct ProcessingState {
GIF, GIF,
File, File,
}; };
enum class EntityType {
Chat,
SavedMessages,
Other,
};
Step step = Step::Initializing; Step step = Step::Initializing;
@ -55,6 +60,7 @@ struct ProcessingState {
int substepsNow = 0; int substepsNow = 0;
int substepsTotal = 0; int substepsTotal = 0;
EntityType entityType = EntityType::Other;
QString entityName; QString entityName;
int entityIndex = 0; int entityIndex = 0;
int entityCount = 0; int entityCount = 0;

View file

@ -90,7 +90,9 @@ Content ContentFromState(const ProcessingState &state) {
"chat" + QString::number(state.entityIndex), "chat" + QString::number(state.entityIndex),
(state.entityName.isEmpty() (state.entityName.isEmpty()
? lang(lng_deleted) ? lang(lng_deleted)
: state.entityName), : (state.entityType == ProcessingState::EntityType::Chat)
? state.entityName
: lang(lng_saved_messages)),
(state.itemCount > 0 (state.itemCount > 0
? (QString::number(state.itemIndex) ? (QString::number(state.itemIndex)
+ " / " + " / "