Chrome export fixes: too-long names, redact group ids (#1402)

* On export, don't print out entire group id, just last three chars

FREEBIE

* Export: Limit conversation dirs to 30 characters of original name

FREEBIE

* Redact groups ids on import as well

FREEBIE

* InboxView: Protect against nonexistent loading screen

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-08-30 09:30:21 -07:00 committed by GitHub
parent 6190ad794a
commit 548586b934
2 changed files with 12 additions and 6 deletions

View file

@ -403,16 +403,20 @@
function getConversationDirName(conversation) { function getConversationDirName(conversation) {
var name = conversation.active_at || 'never'; var name = conversation.active_at || 'never';
if (conversation.type === 'private') { if (conversation.type === 'private') {
name += ' (' + (conversation.name || conversation.id) + ')'; name += ' (' + (conversation.name || conversation.id).slice(0, 30) + ')';
} else { } else {
name += ' (' + conversation.name + ')'; name += ' (' + conversation.name.slice(0, 30) + ')';
} }
return name; return name;
} }
function getConversationLoggingName(conversation) { function getConversationLoggingName(conversation) {
var name = conversation.active_at || 'never'; var name = conversation.active_at || 'never';
name += ' (' + conversation.id + ')'; if (conversation.type === 'private') {
name += ' (' + conversation.id + ')';
} else {
name += ' ([REDACTED_GROUP]' + conversation.id.slice(-3) + ')';
}
return name; return name;
} }
@ -539,7 +543,7 @@
'Done importing', 'Done importing',
messages.length, messages.length,
'messages for conversation', 'messages for conversation',
conversationId '[REDACTED]' + conversationId.slice(-3)
); );
resolve(); resolve();
} }

View file

@ -150,8 +150,10 @@
banner.$el.prependTo(this.$el); banner.$el.prependTo(this.$el);
this.$el.addClass('expired'); this.$el.addClass('expired');
} else if (Whisper.Migration.inProgress()) { } else if (Whisper.Migration.inProgress()) {
this.appLoadingScreen.remove(); if (this.appLoadingScreen) {
this.appLoadingScreen = null; this.appLoadingScreen.remove();
this.appLoadingScreen = null;
}
this.showMigrationScreen(); this.showMigrationScreen();
} else if (storage.get('migrationEnabled')) { } else if (storage.get('migrationEnabled')) {
var migrationBanner = new Whisper.MigrationAlertBanner().render(); var migrationBanner = new Whisper.MigrationAlertBanner().render();