Merge pull request #1277 from annando/1501-bugfix-remote-self

Items that were stored via "remote-self" hadn't contained a valid avatar
This commit is contained in:
Tobias Diekershoff 2015-01-02 13:07:14 +01:00
commit 379b161bbb

View file

@ -2668,14 +2668,14 @@ function item_is_remote_self($contact, &$datarray) {
$datarray2 = $datarray; $datarray2 = $datarray;
logger('remote-self start - Contact '.$contact['url'].' - '.$contact['remote_self'].' Item '.print_r($datarray, true), LOGGER_DEBUG); logger('remote-self start - Contact '.$contact['url'].' - '.$contact['remote_self'].' Item '.print_r($datarray, true), LOGGER_DEBUG);
if ($contact['remote_self'] == 2) { if ($contact['remote_self'] == 2) {
$r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`", $r = q("SELECT `id`,`url`,`name`,`thumb` FROM `contact` WHERE `uid` = %d AND `self`",
intval($contact['uid'])); intval($contact['uid']));
if (count($r)) { if (count($r)) {
$datarray['contact-id'] = $r[0]["id"]; $datarray['contact-id'] = $r[0]["id"];
$datarray['owner-name'] = $r[0]["name"]; $datarray['owner-name'] = $r[0]["name"];
$datarray['owner-link'] = $r[0]["url"]; $datarray['owner-link'] = $r[0]["url"];
$datarray['owner-avatar'] = $r[0]["avatar"]; $datarray['owner-avatar'] = $r[0]["thumb"];
$datarray['author-name'] = $datarray['owner-name']; $datarray['author-name'] = $datarray['owner-name'];
$datarray['author-link'] = $datarray['owner-link']; $datarray['author-link'] = $datarray['owner-link'];