From 10731ea361005bc6a56516ad03984b6c366b3a27 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 24 Dec 2010 18:32:23 -0800 Subject: more plugin hooks --- include/items.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 75445ee49..a606749ce 100644 --- a/include/items.php +++ b/include/items.php @@ -158,7 +158,12 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) { )); + call_hooks('atom_feed', $atom); + if(! count($items)) { + + call_hooks('atom_feed_end', $atom); + $atom .= '' . "\r\n"; return $atom; } @@ -177,6 +182,8 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) { $atom .= atom_entry($item,$type,null,$owner,true); } + call_hooks('atom_feed_end', $atom); + $atom .= '' . "\r\n"; return $atom; } @@ -491,6 +498,8 @@ function get_atom_elements($feed,$item) { $res['target'] .= '' . "\n"; } + call_hooks('parse_atom', array('feed' => $feed, 'item' => $item, 'result' => $res)); + return $res; } @@ -1231,6 +1240,9 @@ function atom_author($tag,$name,$uri,$h,$w,$photo) { $o .= "$uri\r\n"; $o .= '' . "\r\n"; $o .= '' . "\r\n"; + + call_hooks('atom_author', $o); + $o .= "\r\n"; return $o; } @@ -1287,6 +1299,8 @@ function atom_entry($item,$type,$author,$owner,$comment = false) { if($mentioned) $o .= $mentioned; + call_hooks('atom_entry', $o); + $o .= '' . "\r\n"; return $o; -- cgit v1.2.3 From 3ba322889fdfecc07099377cf6e28c4b2fb30e59 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 24 Dec 2010 19:04:40 -0800 Subject: undo one of the hooks from last checkin - passing objects led to error --- include/items.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index a606749ce..c00ec93ae 100644 --- a/include/items.php +++ b/include/items.php @@ -185,6 +185,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) { call_hooks('atom_feed_end', $atom); $atom .= '' . "\r\n"; + return $atom; } @@ -498,7 +499,7 @@ function get_atom_elements($feed,$item) { $res['target'] .= '' . "\n"; } - call_hooks('parse_atom', array('feed' => $feed, 'item' => $item, 'result' => $res)); +// call_hooks('parse_atom', array('feed' => $feed, 'item' => $item, 'result' => $res)); return $res; } -- cgit v1.2.3