Export: Properly generate directory names for nameless groups (#1421)
FREEBIE
This commit is contained in:
parent
94b63c39fd
commit
07abe2639f
1 changed files with 2 additions and 14 deletions
16
js/backup.js
16
js/backup.js
|
@ -404,25 +404,13 @@
|
||||||
// 1. Human-readable, for easy use and verification by user (names not just ids)
|
// 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)
|
// 2. Sorted just like the list of conversations in the left-pan (active_at)
|
||||||
// 3. Disambiguated from other directories (active_at, truncated name, id)
|
// 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) {
|
if (conversation.name) {
|
||||||
return ' (' + conversation.name.slice(0, 30) + ' ' + conversation.id + ')';
|
return ' (' + conversation.name.slice(0, 30) + ' ' + conversation.id + ')';
|
||||||
} else {
|
} else {
|
||||||
return ' (' + conversation.id + ')';
|
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;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue