delivery report tweaks
This commit is contained in:
parent
6f27e8db38
commit
a7e4553ea7
@ -258,6 +258,15 @@ class Item extends BaseObject {
|
|||||||
if ($shareable)
|
if ($shareable)
|
||||||
$share = array( t('Share This'), t('share'));
|
$share = array( t('Share This'), t('share'));
|
||||||
|
|
||||||
|
$dreport = '';
|
||||||
|
|
||||||
|
$keep_reports = intval(get_config('system','expire_delivery_reports'));
|
||||||
|
if($keep_reports === 0)
|
||||||
|
$keep_reports = 30;
|
||||||
|
|
||||||
|
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0)
|
||||||
|
$dreport = t('Delivery Report');
|
||||||
|
|
||||||
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
|
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
|
||||||
$indent .= ' shiny';
|
$indent .= ' shiny';
|
||||||
|
|
||||||
@ -277,6 +286,10 @@ class Item extends BaseObject {
|
|||||||
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
|
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
|
||||||
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
|
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$children = $this->get_children();
|
$children = $this->get_children();
|
||||||
|
|
||||||
$has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
|
$has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
|
||||||
@ -309,7 +322,7 @@ class Item extends BaseObject {
|
|||||||
'vwall' => t('via Wall-To-Wall:'),
|
'vwall' => t('via Wall-To-Wall:'),
|
||||||
'profile_url' => $profile_link,
|
'profile_url' => $profile_link,
|
||||||
'item_photo_menu' => item_photo_menu($item),
|
'item_photo_menu' => item_photo_menu($item),
|
||||||
'dreport' => t('Delivery Report'),
|
'dreport' => $dreport,
|
||||||
'name' => $profile_name,
|
'name' => $profile_name,
|
||||||
'thumb' => $profile_avatar,
|
'thumb' => $profile_avatar,
|
||||||
'osparkle' => $osparkle,
|
'osparkle' => $osparkle,
|
||||||
|
@ -3950,6 +3950,10 @@ function delivery_report_is_storable($dr) {
|
|||||||
if(! $c)
|
if(! $c)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// is the recipient one of our connections, or do we want to store every report?
|
// is the recipient one of our connections, or do we want to store every report?
|
||||||
|
|
||||||
$r = explode(' ', $dr['recipient']);
|
$r = explode(' ', $dr['recipient']);
|
||||||
@ -3958,6 +3962,14 @@ function delivery_report_is_storable($dr) {
|
|||||||
if($pcf)
|
if($pcf)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// We always add ourself as a recipient to private and relayed posts
|
||||||
|
// So if a remote site says they can't find us, that's no big surprise
|
||||||
|
// and just creates a lot of extra report noise
|
||||||
|
|
||||||
|
if(($dr['location'] !== z_root()) && ($dr['sender'] === $rxchan) && ($dr['status'] === 'recipient_not_found'))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
$r = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
|
$r = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
|
||||||
dbesc($rxchan),
|
dbesc($rxchan),
|
||||||
intval($c[0]['channel_id'])
|
intval($c[0]['channel_id'])
|
||||||
|
@ -143,7 +143,7 @@
|
|||||||
<li role="presentation" class="divider"></li>
|
<li role="presentation" class="divider"></li>
|
||||||
{{$item.item_photo_menu}}
|
{{$item.item_photo_menu}}
|
||||||
|
|
||||||
{{if $item.edpost}}
|
{{if $item.edpost && $item.dreport}}
|
||||||
<li role="presentation"><a role="menuitem" href="dreport/{{$item.mid}}">{{$item.dreport}}</a></li>
|
<li role="presentation"><a role="menuitem" href="dreport/{{$item.mid}}">{{$item.dreport}}</a></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user