1
1
Fork 0

The ID field will be stored with notifications as well.

This commit is contained in:
Michael Vogel 2015-04-21 10:14:20 +02:00
parent 261cd441c7
commit e2827c0af7
3 changed files with 9 additions and 0 deletions

View file

@ -1473,6 +1473,8 @@ function diaspora_comment($importer,$xml,$msg) {
DiasporaFetchGuid($datarray); DiasporaFetchGuid($datarray);
$message_id = item_store($datarray); $message_id = item_store($datarray);
$datarray['id'] = $message_id;
//if($message_id) { //if($message_id) {
//q("update item set plink = '%s' where id = %d", //q("update item set plink = '%s' where id = %d",
// //dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id), // //dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),

View file

@ -3660,6 +3660,9 @@ function local_delivery($importer,$data) {
$parent = 0; $parent = 0;
if($posted_id) { if($posted_id) {
$datarray["id"] = $posted_id;
$r = q("SELECT `parent`, `parent-uri` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", $r = q("SELECT `parent`, `parent-uri` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($posted_id), intval($posted_id),
intval($importer['importer_uid']) intval($importer['importer_uid'])

View file

@ -22,6 +22,10 @@ function ping_init(&$a) {
$firehose = intval(get_pconfig(local_user(),'system','notify_full')); $firehose = intval(get_pconfig(local_user(),'system','notify_full'));
/*
select notify.id, notify.type, iid, visible, deleted, CASE notify.iid WHEN 0 THEN 1 ELSE item.visible END as vis, CASE notify.iid WHEN 0 THEN 0 ELSE item.deleted END as del from notify left join item on item.id = notify.iid where notify.uid=1 group by notify.parent order by notify.id desc limit 10;
*/
$t = q("select count(*) as `total` from `notify` where `uid` = %d and `seen` = 0 AND `msg` != '' GROUP BY `parent`", $t = q("select count(*) as `total` from `notify` where `uid` = %d and `seen` = 0 AND `msg` != '' GROUP BY `parent`",
intval(local_user()) intval(local_user())
); );