activity widget - turns out the owner is not relevant.

This commit is contained in:
zotlabs 2017-03-02 18:10:23 -08:00
parent 70ca4a7fea
commit cee9a20e85

View File

@ -1508,7 +1508,7 @@ function widget_activity($arr) {
$perms_sql = item_permissions_sql(local_channel()) . item_normal(); $perms_sql = item_permissions_sql(local_channel()) . item_normal();
$r = q("select owner_xchan, author_xchan from item where item_unseen = 1 and uid = %d $perms_sql", $r = q("select author_xchan from item where item_unseen = 1 and uid = %d $perms_sql",
intval(local_channel()) intval(local_channel())
); );
@ -1517,16 +1517,12 @@ function widget_activity($arr) {
if($r) { if($r) {
foreach($r as $rv) { foreach($r as $rv) {
if(array_key_exists($rv['owner_xchan'],$contributors)) if(array_key_exists($rv['author_xchan'],$contributors)) {
$contributors[$rv['owner_xchan']] ++;
else
$contributors[$rv['owner_xchan']] = 1;
if($rv['owner_xchan'] === $rv['author_xchan'])
continue;
if(array_key_exists($rv['author_xchan'],$contributors))
$contributors[$rv['author_xchan']] ++; $contributors[$rv['author_xchan']] ++;
else }
else {
$contributors[$rv['author_xchan']] = 1; $contributors[$rv['author_xchan']] = 1;
}
} }
foreach($contributors as $k => $v) { foreach($contributors as $k => $v) {
$arr[] = [ 'author_xchan' => $k, 'total' => $v ]; $arr[] = [ 'author_xchan' => $k, 'total' => $v ];