Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #58 from v1r0x/profile-pi
Browse files Browse the repository at this point in the history
use url of contacts app for contact pictures
  • Loading branch information
jancborchardt committed Aug 12, 2015
2 parents a82fdfb + bed4e08 commit 61354cc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ Array.prototype.unique = function() {
}
if (contact.location) {
if (contact.thumbnail) {
var imagePath = 'data:image/png;base64,' + contact.thumbnail
var imagePath = contact.thumbnail;
var iconImage = L.icon({
iconUrl : imagePath,
iconSize : [42, 49],
Expand Down Expand Up @@ -964,6 +964,13 @@ Array.prototype.unique = function() {
var contact = {};

$.each(vcard.data, function(k, v) {
if(vcard.data.photo == true){
var uid = vcard.metadata['id'];
var parent = vcard.metadata['parent'];
var backend = vcard.metadata['backend'];
contact.thumbnail = 'apps/contacts/addressbook/' + backend + '/' + parent + '/contact/' + uid + '/photo';
contact.thumbnail = OC.generateUrl(contact.thumbnail);
}
if (v[0]) {
if ($.isArray(v[0]['value'])) {
if (k === 'ADR') {
Expand All @@ -984,7 +991,6 @@ Array.prototype.unique = function() {
console.log(k, v)
}
})
contact.thumbnail = vcard.data.thumbnail
return contact;
},
/**
Expand All @@ -1010,7 +1016,7 @@ Array.prototype.unique = function() {
favMarkers : [],
addFavContactMarker : function(contact) {
if (contact.thumbnail) {
var imagePath = 'data:image/png;base64,' + contact.thumbnail
var imagePath = contact.thumbnail
var iconImage = L.icon({
iconUrl : imagePath,
iconSize : [42, 49],
Expand Down

0 comments on commit 61354cc

Please sign in to comment.