-function item_store($arr,$force_parent = false) {
+function item_store($arr,$force_parent = false, $notify = false) {
// If a Diaspora signature structure was passed in, pull it out of the
// item array and set it aside for later storage.
$allow_gid = $arr['allow_gid'];
$deny_cid = $arr['deny_cid'];
$deny_gid = $arr['deny_gid'];
+ $notify_type = 'wall-new';
}
else {
$deny_cid = $r[0]['deny_cid'];
$deny_gid = $r[0]['deny_gid'];
$arr['wall'] = $r[0]['wall'];
+ $notify_type = 'comment-new';
// if the parent is private, force privacy for the entire conversation
// This differs from the above settings as it subtly allows comments from
create_tags_from_item($current_post);
create_files_from_item($current_post);
+ if ($notify)
+ proc_run('php', "include/notifier.php", $notify_type, $current_post);
+
return $current_post;
}
if($contact['network'] === NETWORK_FEED)
$datarray['private'] = 2;
- // This is my contact on another system, but it's really me.
- // Turn this into a wall post.
-
- if($contact['remote_self']) {
- $datarray['wall'] = 1;
- if($contact['network'] === NETWORK_FEED) {
- $datarray['private'] = 0;
- }
- }
-
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
$datarray['owner-avatar'] = $contact['thumb'];
}
+ // This is my contact on another system, but it's really me.
+ // Turn this into a wall post.
+
+ if($contact['remote_self']) {
+ $datarray['wall'] = 1;
+
+ // Test
+ $datarray['author-name'] = $datarray['owner-name'];
+ $datarray['author-link'] = $datarray['owner-link'];
+ $datarray['author-avatar'] = $datarray['owner-avatar'];
+
+ $notify = true;
+ if($contact['network'] === NETWORK_FEED) {
+ $datarray['private'] = 0;
+ }
+ } else
+ $notify = false;
+
// We've allowed "followers" to reach this point so we can decide if they are
// posting an @-tag delivery, which followers are allowed to do for certain
// page types. Now that we've parsed the post, let's check if it is legit. Otherwise ignore it.
continue;
- $r = item_store($datarray);
+ $r = item_store($datarray, false, $notify);
continue;
}
// This is my contact on another system, but it's really me.
// Turn this into a wall post.
- if($importer['remote_self'])
+ if($importer['remote_self']) {
$datarray['wall'] = 1;
+ $notify = true;
+ } else
+ $notify = false;
+
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['importer_uid'];
if(($importer['rel'] == CONTACT_IS_FOLLOWER) && (! tgroup_check($importer['importer_uid'],$datarray)))
continue;
- $posted_id = item_store($datarray);
+ $posted_id = item_store($datarray, false, $notify);
if(stristr($datarray['verb'],ACTIVITY_POKE)) {
$verb = urldecode(substr($datarray['verb'],strpos($datarray['verb'],'#')+1));