Merge pull request #5006 from annando/fix-empty-avatar

Bugfix: Avoid empty avatar photos when a public contact is created
This commit is contained in:
Tobias Diekershoff 2018-05-09 09:24:16 +02:00 committed by GitHub
commit 418f19d35b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -489,7 +489,7 @@ class Item extends BaseObject
$item["contact-id"] = self::contactId($item);
$default = ['url' => $item['author-link'], 'name' => $item['author-name'],
'avatar' => $item['author-avatar'], 'network' => $item['network']];
'photo' => $item['author-avatar'], 'network' => $item['network']];
$item['author-id'] = defaults($item, 'author-id', Contact::getIdForURL($item["author-link"], 0, false, $default));
@ -499,7 +499,7 @@ class Item extends BaseObject
}
$default = ['url' => $item['owner-link'], 'name' => $item['owner-name'],
'avatar' => $item['owner-avatar'], 'network' => $item['network']];
'photo' => $item['owner-avatar'], 'network' => $item['network']];
$item['owner-id'] = defaults($item, 'owner-id', Contact::getIdForURL($item["owner-link"], 0, false, $default));

View file

@ -196,7 +196,7 @@ function update_1260() {
WHERE `owner-id` = 0 AND `owner-link` != ''");
while ($item = dba::fetch($items)) {
$contact = ['url' => $item['owner-link'], 'name' => $item['owner-name'],
'avatar' => $item['owner-avatar'], 'network' => $item['network']];
'photo' => $item['owner-avatar'], 'network' => $item['network']];
$cid = Contact::getIdForURL($item['owner-link'], 0, false, $contact);
if (empty($cid)) {
continue;
@ -212,7 +212,7 @@ function update_1260() {
WHERE `author-id` = 0 AND `author-link` != ''");
while ($item = dba::fetch($items)) {
$contact = ['url' => $item['author-link'], 'name' => $item['author-name'],
'avatar' => $item['author-avatar'], 'network' => $item['network']];
'photo' => $item['author-avatar'], 'network' => $item['network']];
$cid = Contact::getIdForURL($item['author-link'], 0, false, $contact);
if (empty($cid)) {
continue;