mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-22 05:43:07 +00:00
v1.6.2: Fix owncloud 9 contact app which break our frontend
This commit is contained in:
+8
-1
@@ -46,6 +46,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
|
||||
$scope.contacts = [];
|
||||
$scope.messages = [];
|
||||
$scope.totalMessageCount = 0;
|
||||
$scope.photoVersion = 1;
|
||||
// Settings
|
||||
$scope.sendCountry = function () {
|
||||
$.post(OC.generateUrl('/apps/ocsms/set/country'),{'country': $('select[name=intl_phone]').val()});
|
||||
@@ -299,8 +300,14 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
|
||||
$scope.fetchInitialPeerList = function (jsondata) {
|
||||
// Use a buffer for better jQuery performance
|
||||
var peerListBuf = "";
|
||||
var photoPrefix = "";
|
||||
var bufferedContacts = [];
|
||||
|
||||
$scope.photoVersion = jsondata["photo_version"];
|
||||
if ($scope.photoVersion >= 2) {
|
||||
photoPrefix = "data:image/png;base64,";
|
||||
}
|
||||
|
||||
$.each(jsondata['phonelist'], function(id, val) {
|
||||
var fn, peerLabel, idxVal;
|
||||
idxVal = id.replace(/\//g,' ');
|
||||
@@ -314,7 +321,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
|
||||
peerLabel = fn;
|
||||
}
|
||||
if (!inArray(peerLabel, bufferedContacts)) {
|
||||
$scope.addContact({'label': peerLabel, 'nav': idxVal2, 'avatar': jsondata['photos'][peerLabel], 'unread' : 0});
|
||||
$scope.addContact({'label': peerLabel, 'nav': idxVal2, 'avatar': photoPrefix + jsondata['photos'][peerLabel], 'unread' : 0});
|
||||
bufferedContacts.push(peerLabel);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user