From 9f22f28d2f4bae5fa2a4947fc01af6200a5a5223 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 22 Aug 2014 15:51:03 -0700 Subject: doc update --- doc/html/items_8php.html | 165 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 138 insertions(+), 27 deletions(-) (limited to 'doc/html/items_8php.html') diff --git a/doc/html/items_8php.html b/doc/html/items_8php.html index 7be105fc9..5e7c4ff11 100644 --- a/doc/html/items_8php.html +++ b/doc/html/items_8php.html @@ -176,8 +176,8 @@ Functions    get_profile_elements ($x)   - get_atom_elements ($feed, $item) -  + get_atom_elements ($feed, $item, &$author) +   encode_rel_links ($links)    item_store ($arr, $allow_exec=false) @@ -192,12 +192,18 @@ Functions    tgroup_check ($uid, $item)   + start_delivery_chain ($channel, $item, $item_id, $parent) +   check_item_source ($uid, $item)    mail_store ($arr)   - consume_feed ($xml, $importer, &$contact, &$hub, $datedir=0, $pass=0) -  + consume_feed ($xml, $importer, &$contact, $pass=0) +  + update_feed_item ($uid, $datarray) +  + handle_feed ($uid, $abook_id, $url) +   atom_author ($tag, $name, $uri, $h, $w, $type, $photo)    atom_entry ($item, $type, $author, $owner, $comment=false, $cid=0) @@ -603,7 +609,7 @@ Functions - +
@@ -625,18 +631,6 @@ Functions - - - - - - - - - - - - @@ -655,6 +649,8 @@ Functions

$importer = the contact_record (joined to user_record) of the local user who owns this relationship. It is this person's stuff that is going to be updated. $contact = the person who is sending us stuff. If not set, we MAY be processing a "follow" activity from an external network and MAY create an appropriate contact record. Otherwise, we MUST 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.

+

Referenced by handle_feed().

+ @@ -733,7 +729,7 @@ Functions
$contact,
$hub,
 $datedir = 0,
@@ -859,7 +855,7 @@ Functions
-

Referenced by get_atom_elements().

+

Referenced by get_atom_elements().

@@ -977,7 +973,7 @@ Functions - +
@@ -991,7 +987,13 @@ Functions - + + + + + + + @@ -1002,7 +1004,7 @@ Functions

If there's a copy of the body content which is guaranteed to have survived mangling in transit, use it.

-

Referenced by consume_feed().

+

Referenced by consume_feed().

@@ -1147,6 +1149,38 @@ Functions

Referenced by feed_init().

+ + + +
+
+
 $item $item,
$author 
+ + + + + + + + + + + + + + + + + + + + + + + +
handle_feed ( $uid,
 $abook_id,
 $url 
)
+
+
@@ -1352,7 +1386,7 @@ Functions
-

Referenced by diaspora_asphoto(), diaspora_comment(), diaspora_like(), diaspora_post(), diaspora_request(), diaspora_reshare(), event_store_item(), item_post(), like_content(), mood_init(), photo_upload(), photos_create_item(), post_activity_item(), process_delivery(), profile_activity(), and subthread_content().

+

Referenced by diaspora_asphoto(), diaspora_comment(), diaspora_like(), diaspora_post(), diaspora_reshare(), event_store_item(), item_post(), like_content(), mood_init(), photo_upload(), photos_create_item(), post_activity_item(), process_delivery(), profile_activity(), and subthread_content().

@@ -1444,7 +1478,7 @@ Functions
-

Referenced by get_atom_elements().

+

Referenced by get_atom_elements().

@@ -1519,7 +1553,7 @@ Functions
-

Referenced by encode_item(), item_post(), post_activity_item(), and profiles_content().

+

Referenced by encode_item(), item_post(), post_activity_item(), profiles_content(), and start_delivery_chain().

@@ -1701,6 +1735,47 @@ Functions

Referenced by item_store(), and item_store_update().

+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
start_delivery_chain ( $channel,
 $item,
 $item_id,
 $parent 
)
+
+

Sourced and tag-delivered posts are re-targetted for delivery to the connections of the channel receiving the post. This starts the second delivery chain, by resetting permissions and ensuring that ITEM_UPLINK is set on the parent post, and storing the current owner_xchan as the source_xchan. We'll become the new owner. If called without $parent, this is the parent post.

+ +

Referenced by tag_deliver().

+
@@ -1726,6 +1801,12 @@ Functions
+

Fetch stuff we need - a channel and an item

+

Seems like a good place to plug in a poke notification.

+

Do community tagging

+

A "union" is a message which our channel has sourced from another channel. This sets up a second delivery chain just like forum tags do. Find out if this is a source-able post.

+

Now we've got those out of the way. Let's see if this is a post that's tagged for re-delivery

+

Kill two birds with one stone. As long as we're here, send a mention notification.

Referenced by delete_imported_item(), item_content(), item_store(), and item_store_update().

@@ -1772,8 +1853,10 @@ Functions
+

tgroup_check($uid,$item)

+

This function is called pre-deliver to see if a post matches the criteria to be tag delivered. We don't actually do anything except check that it matches the criteria. This is so that the channel with tag_delivery enabled can receive the post even if they turn off permissions for the sender to send their stream. tag_deliver() can't be called until the post is actually stored. By then it would be too late to reject it.

-

Referenced by consume_feed(), and process_delivery().

+

Referenced by process_delivery().

@@ -1801,7 +1884,7 @@ Functions
-

Referenced by get_atom_elements().

+

Referenced by get_atom_elements().

@@ -1821,6 +1904,34 @@ Functions

Referenced by lockview_content(), and profiles_content().

+ + + +
+
+ + + + + + + + + + + + + + + + + + +
update_feed_item ( $uid,
 $datarray 
)
+
+ +

Referenced by consume_feed().

+
-- cgit v1.2.3 From 345d170236572866c0aa29698d5089f4d2bf7c11 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 29 Aug 2014 17:31:29 -0700 Subject: doc update --- doc/html/items_8php.html | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'doc/html/items_8php.html') diff --git a/doc/html/items_8php.html b/doc/html/items_8php.html index 5e7c4ff11..358d5a31c 100644 --- a/doc/html/items_8php.html +++ b/doc/html/items_8php.html @@ -114,6 +114,8 @@ $(document).ready(function(){initNavTree('items_8php.html','');}); Functions  collect_recipients ($item, &$private_envelope)   + comments_are_now_closed ($item) +   can_comment_on_post ($observer_xchan, $item)    add_source_route ($iid, $hash) @@ -457,7 +459,7 @@ Functions

can_comment_on_post($observer_xchan,$item);

-

This function examines the comment_policy attached to an item and decides if the current observer has sufficient privileges to comment. This will normally be called on a remote site where perm_is_allowed() will not be suitable because the post owner does not have a local channel_id. Generally we should look at the item - in particular the author['book_flags'] and see if ABOOK_FLAG_SELF is set. If it is, you should be able to use perm_is_allowed( ... 'post_comments'), and if it isn't you need to call can_comment_on_post()

+

This function examines the comment_policy attached to an item and decides if the current observer has sufficient privileges to comment. This will normally be called on a remote site where perm_is_allowed() will not be suitable because the post owner does not have a local channel_id. Generally we should look at the item - in particular the author['book_flags'] and see if ABOOK_FLAG_SELF is set. If it is, you should be able to use perm_is_allowed( ... 'post_comments'), and if it isn't you need to call can_comment_on_post() We also check the comments_closed date/time on the item if this is set.

Referenced by Conversation\add_thread(), and item_post().

@@ -525,6 +527,24 @@ Functions

Referenced by notifier_run().

+
+ + +
+
+ + + + + + + + +
comments_are_now_closed ( $item)
+
@@ -1386,7 +1406,7 @@ Functions @@ -1733,7 +1753,7 @@ Functions -- cgit v1.2.3