Use Model\Photo as much as possible

Most important is to use `Photo::delete()` to have backend
to remove data.
This commit is contained in:
fabrixxm 2018-12-11 20:03:29 +01:00 committed by Hypolite Petovan
parent d549787bc1
commit 8c75c26361
8 changed files with 39 additions and 56 deletions

View file

@ -483,7 +483,7 @@ class Contact extends BaseObject
'gender' => $profile['gender'], 'avatar' => $profile['photo'],
'contact-type' => $user['account-type'], 'xmpp' => $profile['xmpp']];
$avatar = DBA::selectFirst('photo', ['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
$avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
if (DBA::isResult($avatar)) {
if ($update_avatar) {
$fields['avatar-date'] = DateTimeFormat::utcNow();