From c1221cc052c78550c214e7974407cc66992eadbe Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 29 Sep 2011 15:52:31 -0700 Subject: add display_item hook to 'search|new' message display --- include/conversation.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index ebe582f4c..6069afb03 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -220,7 +220,7 @@ function conversation(&$a, $items, $mode, $update) { $body = prepare_body($item,true); - $treads[$treadsid] .= replace_macros($tpl,array( + $tmp_item = replace_macros($tpl,array( '$id' => $item['item_id'], '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), '$profile_url' => $profile_link, @@ -251,6 +251,11 @@ function conversation(&$a, $items, $mode, $update) { '$wait' => t('Please wait'), )); + $arr = array('item' => $item, 'output' => $tmp_item); + call_hooks('display_item', $arr); + + $treads[$treadsid] .= $arr['output']; + } } -- cgit v1.2.3 From 097c1f8da774c82f441f370f391f93acc2025ccd Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 29 Sep 2011 21:20:19 -0700 Subject: do not poll for abandoned accounts --- include/poller.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/poller.php b/include/poller.php index 07076508f..89a3408ec 100644 --- a/include/poller.php +++ b/include/poller.php @@ -44,6 +44,12 @@ function poller_run($argv, $argc){ AND `account_expires_on` != '0000-00-00 00:00:00' AND `account_expires_on` < UTC_TIMESTAMP() "); + $abandon_days = intval(get_config('system','account_abandon_days')); + if($abandon_days < 1) + $abandon_days = 0; + + + // once daily run expire in background $d1 = get_config('system','last_expire_day'); @@ -92,12 +98,17 @@ function poller_run($argv, $argc){ // and which have a polling address and ignore Diaspora since // we are unable to match those posts with a Diaspora GUID and prevent duplicates. + $abandon_sql = (($abandon_days) + ? sprintf(" AND `user`.`login_date` > UTC_TIMESTAMP() - INTERVAL %d DAY ", intval($abandon_days)) + : '' + ); + $contacts = q("SELECT `contact`.`id` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != '' AND `network` != '%s' $sql_extra AND `self` = 0 AND `contact`.`blocked` = 0 AND `contact`.`readonly` = 0 - AND `user`.`account_expired` = 0 ORDER BY RAND()", + AND `user`.`account_expired` = 0 $abandon_sql ORDER BY RAND()", intval(CONTACT_IS_SHARING), intval(CONTACT_IS_FRIEND), dbesc(NETWORK_DIASPORA) -- cgit v1.2.3 From 52557b011d2c05e83b1df91d2d766317dd2c5223 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 29 Sep 2011 21:56:44 -0700 Subject: possible sql errors --- include/delivery.php | 2 +- include/notifier.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/delivery.php b/include/delivery.php index 06cc1f679..3ab820b62 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -72,7 +72,7 @@ function delivery_run($argv, $argc){ $normal_mode = false; $expire = true; $items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1 - AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP - INTERVAL 30 MINUTE", + AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP() - INTERVAL 30 MINUTE", intval($item_id) ); $uid = $item_id; diff --git a/include/notifier.php b/include/notifier.php index 748d15743..864fa517b 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -86,7 +86,7 @@ function notifier_run($argv, $argc){ $normal_mode = false; $expire = true; $items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1 - AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP - INTERVAL 10 MINUTE", + AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP() - INTERVAL 10 MINUTE", intval($item_id) ); $uid = $item_id; -- cgit v1.2.3 From dfb3ee6e29b6943f86ec75af12db5a1422a7e1dd Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Fri, 30 Sep 2011 14:31:01 +0200 Subject: fix star icon viewing profile page as unlogged user --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index ebe582f4c..7859d301c 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -450,7 +450,7 @@ function conversation(&$a, $items, $mode, $update) { ); $star = false; - $starred = "unstarred"; + $isstarred = "unstarred"; if ($profile_owner == local_user() && $toplevelpost) { $isstarred = (($item['starred']) ? "starred" : "unstarred"); -- cgit v1.2.3 From 7c1968907d26a66581d362475a6b557e53e159cb Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 2 Oct 2011 05:32:05 -0700 Subject: attack of the zombie orphans --- include/delivery.php | 2 ++ include/notifier.php | 3 +++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/delivery.php b/include/delivery.php index 3ab820b62..46112d78e 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -96,6 +96,8 @@ function delivery_run($argv, $argc){ $uid = $r[0]['uid']; $updated = $r[0]['edited']; + if(! $parent_id) + return; $items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer` diff --git a/include/notifier.php b/include/notifier.php index 864fa517b..d1cd1cc73 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -123,6 +123,9 @@ function notifier_run($argv, $argc){ $uid = $r[0]['uid']; $updated = $r[0]['edited']; + if(! $parent_id) + return; + $items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer` FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d ORDER BY `id` ASC", intval($parent_id) -- cgit v1.2.3 From 8f9656da926b402e16432de3363e6dc1cef1ef8a Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 2 Oct 2011 16:18:01 -0700 Subject: basic support for AS friend requests --- include/items.php | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index a1baf7471..32f0728c3 100644 --- a/include/items.php +++ b/include/items.php @@ -1491,6 +1491,20 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee lose_follower($importer,$contact,$datarray,$item); return; } + + if(activity_match($datarray['verb'],ACTIVITY_REQ_FRIEND)) { + logger('consume-feed: New friend request'); + new_follower($importer,$contact,$datarray,$item,true); + return; + } + if(activity_match($datarray['verb'],ACTIVITY_UNFRIEND)) { + lose_sharer($importer,$contact,$datarray,$item); + return; + } + + + + if(! is_array($contact)) return; @@ -1522,7 +1536,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee } } -function new_follower($importer,$contact,$datarray,$item) { +function new_follower($importer,$contact,$datarray,$item,$sharing = false) { $url = notags(trim($datarray['author-link'])); $name = notags(trim($datarray['author-name'])); $photo = notags(trim($datarray['author-avatar'])); @@ -1532,14 +1546,14 @@ function new_follower($importer,$contact,$datarray,$item) { $nick = $rawtag[0]['child'][NAMESPACE_POCO]['preferredUsername'][0]['data']; if(is_array($contact)) { - if($contact['network'] == 'stat' && $contact['rel'] == CONTACT_IS_SHARING) { + if(($contact['network'] == NETWORK_OSTATUS && $contact['rel'] == CONTACT_IS_SHARING) + || ($sharing && $contact['rel'] == CONTACT_IS_FOLLOWER)) { $r = q("UPDATE `contact` SET `rel` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1", intval(CONTACT_IS_FRIEND), intval($contact['id']), intval($importer['uid']) ); } - // send email notification to owner? } else { @@ -1555,13 +1569,12 @@ function new_follower($importer,$contact,$datarray,$item) { dbesc($name), dbesc($nick), dbesc($photo), - dbesc('stat'), - intval(CONTACT_IS_FOLLOWER) + dbesc(($sharing) ? NETWORK_ZOT : NETWORK_OSTATUS), + intval(($sharing) ? CONTACT_IS_SHARING : CONTACT_IS_FOLLOWER) ); - $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `pending` = 1 AND `rel` = %d LIMIT 1", + $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `pending` = 1 LIMIT 1", intval($importer['uid']), - dbesc($url), - intval(CONTACT_IS_FOLLOWER) + dbesc($url) ); if(count($r)) $contact_record = $r[0]; @@ -1593,7 +1606,7 @@ function new_follower($importer,$contact,$datarray,$item) { '$sitename' => $a->config['sitename'] )); $res = mail($r[0]['email'], - t("You have a new follower at ") . $a->config['sitename'], + (($sharing) ? t('A new person is sharing with you at ') : t("You have a new follower at ")) . $a->config['sitename'], $email, 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" @@ -1617,6 +1630,19 @@ function lose_follower($importer,$contact,$datarray,$item) { } } +function lose_sharer($importer,$contact,$datarray,$item) { + + if(($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_FOLLOWER)) { + q("UPDATE `contact` SET `rel` = %d WHERE `id` = %d LIMIT 1", + intval(CONTACT_IS_FOLLOWER), + intval($contact['id']) + ); + } + else { + contact_remove($contact['id']); + } +} + function subscribe_to_hub($url,$importer,$contact,$submode = 'subscribe') { -- cgit v1.2.3 From 4d5580ab7781eea81dc4cb3d67b7376f49357bef Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 3 Oct 2011 09:38:58 +0200 Subject: fix typo --- include/conversation.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index 64ad5d0b1..10b34ebe6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -142,8 +142,8 @@ function conversation(&$a, $items, $mode, $update) { // array with html for each thread (parent+comments) - $treads = array(); - $treadsid = -1; + $threads = array(); + $threadsid = -1; if(count($items)) { @@ -155,7 +155,7 @@ function conversation(&$a, $items, $mode, $update) { $tpl = get_markup_template('search_item.tpl'); foreach($items as $item) { - $treadsid++; + $threadsid++; $comment = ''; $owner_url = ''; @@ -254,7 +254,7 @@ function conversation(&$a, $items, $mode, $update) { $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); - $treads[$treadsid] .= $arr['output']; + $threads[$threadsid] .= $arr['output']; } @@ -336,8 +336,8 @@ function conversation(&$a, $items, $mode, $update) { $comments_seen = 0; $comments_collapsed = false; - $treadsid++; - $treads[$treadsid] = ""; + $threadsid++; + $threads[$threadsid] = ""; } else { // prevent private email from leaking into public conversation @@ -351,7 +351,7 @@ function conversation(&$a, $items, $mode, $update) { if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) { if(! $comments_collapsed) { - $treads[$treadsid] .= '' . ''; + $threads[$threadsid] .= ''; } $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; @@ -564,7 +564,7 @@ function conversation(&$a, $items, $mode, $update) { $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); - $treads[$treadsid] .= $arr['output']; + $threads[$threadsid] .= $arr['output']; } } } @@ -573,11 +573,11 @@ function conversation(&$a, $items, $mode, $update) { // if author collapsing is in force but didn't get closed, close it off now. /*if($blowhard_count >= 3) - $treads[$treadsid] .= '';*/ + $threads[$threadsid] .= '';*/ $page_template = get_markup_template("conversation.tpl"); $o .= replace_macros($page_template, array( - '$treads' => $treads, + '$threads' => $threads, '$dropping' => ($dropping?t('Delete Selected Items'):False), )); -- cgit v1.2.3 From c6ac4387350eefce8ba68485c49ba8da60ff437b Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 3 Oct 2011 06:04:17 -0700 Subject: item_store: prevent storing a duplicate item with same uri+uid --- include/items.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/items.php b/include/items.php index 32f0728c3..d907aeddb 100644 --- a/include/items.php +++ b/include/items.php @@ -807,6 +807,14 @@ function item_store($arr,$force_parent = false) { } } + $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + dbesc($arr['uri']), + dbesc($arr['uid']) + ); + if($r && count($r)) { + logger('item-store: duplicate item ignored. ' . print_r($arr,true)); + return 0; + } call_hooks('post_remote',$arr); -- cgit v1.2.3 From 07b09300a9aa6f10941b07dd289539b675d1e6ec Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 03:06:34 -0700 Subject: improve feed import performance --- include/items.php | 18 +++++++++--------- include/poller.php | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index d907aeddb..c8dd4ca42 100644 --- a/include/items.php +++ b/include/items.php @@ -1081,7 +1081,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { * */ -function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_feed = false) { +function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) { require_once('library/simplepie/simplepie.inc'); @@ -1249,7 +1249,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee // process any deleted entries $del_entries = $feed->get_feed_tags(NAMESPACE_TOMB, 'deleted-entry'); - if(is_array($del_entries) && count($del_entries)) { + if(is_array($del_entries) && count($del_entries) && $pass != 2) { foreach($del_entries as $dentry) { $deleted = false; if(isset($dentry['attribs']['']['ref'])) { @@ -1341,7 +1341,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee $parent_uri = $rawthread[0]['attribs']['']['ref']; } - if(($is_reply) && is_array($contact)) { + if(($is_reply) && is_array($contact) && $pass != 1) { // Have we seen it? If not, import it. @@ -1393,7 +1393,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee } $force_parent = false; - if($contact['network'] === 'stat') { + if($contact['network'] === NETWORK_OSTATUS) { $force_parent = true; if(strlen($datarray['title'])) unset($datarray['title']); @@ -1405,7 +1405,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee $datarray['last-child'] = 1; } - if(($contact['network'] === 'feed') || (! strlen($contact['notify']))) { + if(($contact['network'] === NETWORK_FEED) || (! strlen($contact['notify']))) { // one way feed - no remote comment ability $datarray['last-child'] = 0; } @@ -1438,6 +1438,8 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee $datarray['author-avatar'] = $contact['thumb']; } + // special handling for events + if((x($datarray,'object-type')) && ($datarray['object-type'] === ACTIVITY_OBJ_EVENT)) { $ev = bbtoevent($datarray['body']); if(x($ev,'desc') && x($ev,'start')) { @@ -1511,18 +1513,16 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee } - - if(! is_array($contact)) return; - if($contact['network'] === 'stat' || stristr($permalink,'twitter.com')) { + if($contact['network'] === NETWORK_OSTATUS || stristr($permalink,'twitter.com')) { if(strlen($datarray['title'])) unset($datarray['title']); $datarray['last-child'] = 1; } - if(($contact['network'] === 'feed') || (! strlen($contact['notify']))) { + if(($contact['network'] === NETWORK_FEED) || (! strlen($contact['notify']))) { // one way feed - no remote comment ability $datarray['last-child'] = 0; } diff --git a/include/poller.php b/include/poller.php index 89a3408ec..427f8887c 100644 --- a/include/poller.php +++ b/include/poller.php @@ -486,11 +486,11 @@ function poller_run($argv, $argc){ } - consume_feed($xml,$importer,$contact,$hub,1, true); + consume_feed($xml,$importer,$contact,$hub,1,1); // do it twice. Ensures that children of parents which may be later in the stream aren't tossed - consume_feed($xml,$importer,$contact,$hub,1); + consume_feed($xml,$importer,$contact,$hub,1,2); $hubmode = 'subscribe'; if($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly']) -- cgit v1.2.3 From aeb83fa063297db774826f750fcef68904c901a0 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 04:38:58 -0700 Subject: document multi-pass mode on consume_feed --- include/items.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/items.php b/include/items.php index c8dd4ca42..dc08fb3db 100644 --- a/include/items.php +++ b/include/items.php @@ -1078,7 +1078,18 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { * have a contact record. * $hub = should we find a hub declation in the feed, pass it back to our calling process, who might (or * might not) try and subscribe to it. + * $datedir sorts in reverse order + * $pass - by default ($pass = 0) we cannot guarantee that a parent item has been + * imported prior to its children being seen in the stream unless we are certain + * of how the feed is arranged/ordered. + * With $pass = 1, we only pull parent items out of the stream. + * With $pass = 2, we only pull children (comments/likes). * + * So running this twice, first with pass 1 and then with pass 2 will do the right + * thing regardless of feed ordering. This won't be adequate in a fully-threaded + * model where comments can have sub-threads. That would require some massive sorting + * to get all the feed items into a mostly linear ordering, and might still require + * recursion. */ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) { -- cgit v1.2.3 From 7b648e6da85ece5b402dfce6d546f5711bc63bea Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 18:53:56 -0700 Subject: performance enhancements --- include/delivery.php | 8 ++++++-- include/items.php | 4 ++-- include/notifier.php | 7 ++++++- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/delivery.php b/include/delivery.php index 46112d78e..e06db6d97 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -123,7 +123,6 @@ function delivery_run($argv, $argc){ if( ! ($icontacts && count($icontacts))) return; - // avoid race condition with deleting entries if($items[0]['deleted']) { @@ -269,7 +268,12 @@ function delivery_run($argv, $argc){ if(! $item_contact) continue; - $atom .= atom_entry($item,'text',$item_contact,$owner,true); + if($normal_mode) { + if($item_id == $item['id']) + $atom .= atom_entry($item,'text',$item_contact,$owner,true); + } + else + $atom .= atom_entry($item,'text',$item_contact,$owner,true); } diff --git a/include/items.php b/include/items.php index dc08fb3db..93a730d22 100644 --- a/include/items.php +++ b/include/items.php @@ -1663,7 +1663,7 @@ function lose_sharer($importer,$contact,$datarray,$item) { } -function subscribe_to_hub($url,$importer,$contact,$submode = 'subscribe') { +function subscribe_to_hub($url,$importer,$contact,$hubmode = 'subscribe') { if(is_array($importer)) { $r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1", @@ -1686,7 +1686,7 @@ function subscribe_to_hub($url,$importer,$contact,$submode = 'subscribe') { $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); + logger('subscribe_to_hub: ' . $hubmode . ' ' . $contact['name'] . ' to hub ' . $url . ' endpoint: ' . $push_url . ' with verifier ' . $verify_token); if(! strlen($contact['hub-verify'])) { $r = q("UPDATE `contact` SET `hub-verify` = '%s' WHERE `id` = %d LIMIT 1", diff --git a/include/notifier.php b/include/notifier.php index d1cd1cc73..ceeea2368 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -360,7 +360,12 @@ function notifier_run($argv, $argc){ if(! $contact) continue; - $atom .= atom_entry($item,'text',$contact,$owner,true); + if($normal_mode) { + if($item_id == $item['id']) + $atom .= atom_entry($item,'text',$contact,$owner,true); + } + else + $atom .= atom_entry($item,'text',$contact,$owner,true); if(($top_level) && ($public_message) && ($item['author-link'] === $item['owner-link']) && (! $expire)) $slaps[] = atom_entry($item,'html',$contact,$owner,true); -- cgit v1.2.3 From ab5052197137b1fbf069f3791c75d6163c569bc0 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 22:00:45 -0700 Subject: yikes --- include/delivery.php | 2 +- include/notifier.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/delivery.php b/include/delivery.php index e06db6d97..1ba1d9c3a 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -269,7 +269,7 @@ function delivery_run($argv, $argc){ continue; if($normal_mode) { - if($item_id == $item['id']) + if($item_id == $item['id'] || $item['id'] == $item['parent']) $atom .= atom_entry($item,'text',$item_contact,$owner,true); } else diff --git a/include/notifier.php b/include/notifier.php index ceeea2368..ccac5106f 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -361,7 +361,7 @@ function notifier_run($argv, $argc){ continue; if($normal_mode) { - if($item_id == $item['id']) + if($item_id == $item['id'] || $item['id'] == $item['parent']) $atom .= atom_entry($item,'text',$contact,$owner,true); } else -- cgit v1.2.3 From 6c521017f5e58432d0eaadb90d0745fe7c4f1472 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 22:03:57 -0700 Subject: document backward compat issue --- include/notifier.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/notifier.php b/include/notifier.php index ccac5106f..c3f7f33ea 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -361,6 +361,10 @@ function notifier_run($argv, $argc){ continue; if($normal_mode) { + + // we only need the current item, but include the parent because without it + // older sites without a corresponding dfrn_notify change may do the wrong thing. + if($item_id == $item['id'] || $item['id'] == $item['parent']) $atom .= atom_entry($item,'text',$contact,$owner,true); } -- cgit v1.2.3 From 924d4193789217dadbddf8e0dddb960a2988136c Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 5 Oct 2011 02:35:25 -0700 Subject: added prepare_body hooks --- include/text.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/text.php b/include/text.php index 656cd8809..701c1e41b 100644 --- a/include/text.php +++ b/include/text.php @@ -744,7 +744,12 @@ function link_compare($a,$b) { if(! function_exists('prepare_body')) { function prepare_body($item,$attach = false) { + call_hooks('prepare_body_init', $item); + $s = prepare_text($item['body']); + + call_hooks('prepare_body', $s); + if(! $attach) return $s; @@ -776,6 +781,7 @@ function prepare_body($item,$attach = false) { } $s .= '
'; } + call_hooks('prepare_body_final', $s); return $s; }} -- cgit v1.2.3