1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-19 20:32:58 +00:00

Added experimental merging for contacts with multiple numbers

This commit is contained in:
Loic Blot
2014-10-09 18:27:13 +02:00
parent 667118310d
commit 1138512dc8
4 changed files with 80 additions and 25 deletions
+7 -1
View File
@@ -143,8 +143,11 @@ function changeSelectedConversation(item) {
function fetchInitialPeerList(jsondata) {
// Use a buffer for better jQuery performance
var peerListBuf = "";
var bufferedContacts = [];
$.each(jsondata['phonelist'], function(id, val) {
var fn, peerLabel;
if (typeof jsondata['contacts'][val] == 'undefined') {
fn = '';
@@ -154,7 +157,10 @@ function fetchInitialPeerList(jsondata) {
fn = jsondata['contacts'][val];
peerLabel = fn;
}
peerListBuf += '<li><a href="#" mailbox-navigation="' + val + '">' + peerLabel + '</a></li>';
if (!$.inArray(peerLabel, bufferedContacts)) {
peerListBuf += '<li><a href="#" mailbox-navigation="' + val + '">' + peerLabel + '</a></li>';
bufferedContacts.push(peerLabel);
}
});
// Only modify peerList if there is peers