From db09724aec91a55ba76d8e0cd451a91895bc1e9c Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 12 Sep 2012 17:19:26 -0700 Subject: [PATCH] use local photo for tag notifications if available --- include/items.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 7b43bf500a..2f5b5f1f79 100755 --- a/include/items.php +++ b/include/items.php @@ -1184,6 +1184,15 @@ function tag_deliver($uid,$item_id) { // send a notification + // use a local photo if we have one + + $r = q("select thumb from contact where uid = %d and nurl = '%s' limit 1", + intval($u[0]['uid']), + dbesc(normalise_link($item['author-link'])) + ); + $photo = (($r && count($r)) ? $r[0]['thumb'] : $item['author-avatar']); + + require_once('include/enotify.php'); notification(array( 'type' => NOTIFY_TAGSELF, @@ -1196,7 +1205,7 @@ function tag_deliver($uid,$item_id) { 'link' => $a->get_baseurl() . '/display/' . $u[0]['nickname'] . '/' . $item['id'], 'source_name' => $item['author-name'], 'source_link' => $item['author-link'], - 'source_photo' => $item['author-avatar'], + 'source_photo' => $photo, 'verb' => ACTIVITY_TAG, 'otype' => 'item' ));