From 9c3503a706d445bcbf7a14c2adcd8d344df3e46b Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 16 Sep 2011 06:49:24 -0700 Subject: update timestamp on activity change (comment/like) --- include/items.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index facd8b2d4..735adc717 100644 --- a/include/items.php +++ b/include/items.php @@ -865,6 +865,13 @@ function item_store($arr,$force_parent = false) { intval($current_post) ); + // update the timestamp on the parent + + q("UPDATE `item` set `changed` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(datetime_convert()), + intval($parent_id) + ); + if($dsprsig) { q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", intval($current_post), -- cgit v1.2.3 From 8bf6a29d4e05af5d461da3f01999785dc12ee7da Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 18 Sep 2011 19:04:11 -0700 Subject: optimise the commented date view --- include/items.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 735adc717..b433381a7 100644 --- a/include/items.php +++ b/include/items.php @@ -717,6 +717,7 @@ function item_store($arr,$force_parent = false) { $arr['owner-avatar'] = ((x($arr,'owner-avatar')) ? notags(trim($arr['owner-avatar'])) : ''); $arr['created'] = ((x($arr,'created') !== false) ? datetime_convert('UTC','UTC',$arr['created']) : datetime_convert()); $arr['edited'] = ((x($arr,'edited') !== false) ? datetime_convert('UTC','UTC',$arr['edited']) : datetime_convert()); + $arr['commented'] = datetime_convert(); $arr['received'] = datetime_convert(); $arr['changed'] = datetime_convert(); $arr['title'] = ((x($arr,'title')) ? notags(trim($arr['title'])) : ''); @@ -865,9 +866,10 @@ function item_store($arr,$force_parent = false) { intval($current_post) ); - // update the timestamp on the parent + // update the commented timestamp on the parent - q("UPDATE `item` set `changed` = '%s' WHERE `id` = %d LIMIT 1", + q("UPDATE `item` set `commented` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(datetime_convert()), dbesc(datetime_convert()), intval($parent_id) ); -- cgit v1.2.3 From d6b446d63ffe589429394b5937b67ec666bbe219 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 22 Sep 2011 04:11:39 -0700 Subject: starting the big delivery shakeup --- include/items.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index b433381a7..da5a18cad 100644 --- a/include/items.php +++ b/include/items.php @@ -1615,13 +1615,18 @@ function lose_follower($importer,$contact,$datarray,$item) { } -function subscribe_to_hub($url,$importer,$contact) { +function subscribe_to_hub($url,$importer,$contact,$submode = 'subscribe') { if(is_array($importer)) { $r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1", intval($importer['uid']) ); } + + // Diaspora has different message-ids in feeds than they do + // through the direct Diaspora protocol. If we try and use + // the feed, we'll get duplicates. So don't. + if((! count($r)) || $contact['network'] === NETWORK_DIASPORA) return; @@ -1631,7 +1636,7 @@ function subscribe_to_hub($url,$importer,$contact) { $verify_token = ((strlen($contact['hub-verify'])) ? $contact['hub-verify'] : random_string()); - $params= 'hub.mode=subscribe&hub.callback=' . urlencode($push_url) . '&hub.topic=' . urlencode($contact['poll']) . '&hub.verify=async&hub.verify_token=' . $verify_token; + $params= 'hub.mode=' . $hubmode . '&hub.callback=' . urlencode($push_url) . '&hub.topic=' . urlencode($contact['poll']) . '&hub.verify=async&hub.verify_token=' . $verify_token; logger('subscribe_to_hub: subscribing ' . $contact['name'] . ' to hub ' . $url . ' with verifier ' . $verify_token); -- cgit v1.2.3