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.entityCount = info.list.size() + addCount;
result.entityName = dialog.name;
result.entityType = (dialog.type == Data::DialogInfo::Type::Self)
? ProcessingState::EntityType::SavedMessages
: ProcessingState::EntityType::Chat;
result.itemIndex = _messagesWritten + progress.itemIndex;
result.itemCount = std::max(_messagesCount, result.itemIndex);
result.bytesType = ProcessingState::FileType::File; // TODO

View File

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

View File

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