// e.g. "your post", "David's photo", etc.
$possess_desc = t('%s <!item_type!>');
+ if (isset($params['parent']))
+ $parent_id = $params['parent'];
+ else
+ $parent_id = 0;
+
if($params['type'] == NOTIFY_MAIL) {
$subject = sprintf( t('[Friendica:Notify] New mail received at %s'),$sitename);
if($params['type'] == NOTIFY_COMMENT) {
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
- $parent_id = $params['parent'];
+ //$parent_id = $params['parent'];
$p = q("SELECT `ignored` FROM `thread` WHERE `iid` = %d AND `uid` = %d LIMIT 1",
intval($parent_id),
'source_link' => $item[0]['author-link'],
'source_photo' => $item[0]['author-avatar'],
'verb' => ACTIVITY_TAG,
- 'otype' => 'item'
+ 'otype' => 'item',
+ 'parent' => $arr['parent']
));
logger('item_store: Notification sent for contact '.$arr['contact-id'].' and post '.$current_post, LOGGER_DEBUG);
}
'verb' => $datarray['verb'],
'otype' => 'person',
'activity' => $verb,
-
+ 'parent' => $datarray['parent']
));
}
}
$firehose = intval(get_pconfig(local_user(),'system','notify_full'));
- $t = q("select count(*) as total from notify where uid = %d and seen = 0",
+ $t = q("select count(*) as `total` from `notify` where `uid` = %d and `seen` = 0 AND `msg` != ''",
intval(local_user())
);
if($t && intval($t[0]['total']) > 49) {
- $z = q("select * from notify where uid = %d
+ $z = q("select * from notify where uid = %d AND `msg` != ''
and seen = 0 order by date desc limit 0, 50",
intval(local_user())
);
$sysnotify = $t[0]['total'];
}
else {
- $z1 = q("select * from notify where uid = %d
+ $z1 = q("select * from notify where uid = %d AND `msg` != ''
and seen = 0 order by date desc limit 0, 50",
intval(local_user())
);
- $z2 = q("select * from notify where uid = %d
+ $z2 = q("select * from notify where uid = %d AND `msg` != ''
and seen = 1 order by date desc limit 0, %d",
intval(local_user()),
intval(50 - intval($t[0]['total']))