Skip to content

Commit

Permalink
Merge pull request #8 from nextcloud/downstream-sabre-fn
Browse files Browse the repository at this point in the history
Sabre dav 3.2 requires on each vcard to have fn set
  • Loading branch information
Henni authored Nov 15, 2016
2 parents a938314 + ed1659d commit e068649
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/models/contact_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,11 @@ angular.module('contactsApp')
self.setProperty(name, self.props[name][0]);
}
});
// force fn to be set
this.fullName(this.fullName());

// keep vCard in sync
this.data.addressData = $filter('JSON2vCard')(this.props);
self.data.addressData = $filter('JSON2vCard')(self.props);
},

matches: function(pattern) {
Expand Down
3 changes: 3 additions & 0 deletions js/services/contact_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ angular.module('contactsApp')
newContact.uid(newUid);
newContact.setUrl(addressBook, newUid);
newContact.addressBookId = addressBook.displayName;
if (_.isUndefined(newContact.fullName()) || newContact.fullName() === '') {
newContact.fullName(t('contacts', 'New contact'));
}

return DavClient.createCard(
addressBook,
Expand Down

0 comments on commit e068649

Please sign in to comment.