Export: Properly generate directory names for nameless groups (#1421)

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-09-01 07:33:30 -07:00 committed by GitHub
parent 94b63c39fd
commit 07abe2639f

View file

@ -404,25 +404,13 @@
// 1. Human-readable, for easy use and verification by user (names not just ids)
// 2. Sorted just like the list of conversations in the left-pan (active_at)
// 3. Disambiguated from other directories (active_at, truncated name, id)
function getPrivateConversationDirName(conversation) {
function getConversationDirName(conversation) {
var name = conversation.active_at || 'never';
if (conversation.name) {
return ' (' + conversation.name.slice(0, 30) + ' ' + conversation.id + ')';
} else {
return ' (' + conversation.id + ')';
}
}
function getGroupConversationDirName(conversation) {
return ' (' + conversation.name.slice(0, 30) + ' ' + conversation.id + ')';
}
function getConversationDirName(conversation) {
var name = conversation.active_at || 'never';
if (conversation.type === 'private') {
name += getPrivateConversationDirName(conversation);
} else {
name += getGroupConversationDirName(conversation);
}
return name;
}