}
+ // See if we've been passed a return path to redirect to
+ $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
+
+
$r = q("SELECT * FROM `item` WHERE `verb` = '%s' AND `deleted` = 0
AND `contact-id` = %d AND ( `parent` = '%s' OR `parent-uri` = '%s' OR `thr-parent` = '%s') LIMIT 1",
dbesc($activity),
// proc_run('php',"include/notifier.php","like","$post_id"); // $post_id isn't defined here!
$like_item_id = $like_item['id'];
proc_run('php',"include/notifier.php","like","$like_item_id");
- return;
+
+ like_content_return($a->get_baseurl(), $return_path);
+ return; // NOTREACHED
}
$uri = item_new_uri($a->get_hostname(),$owner_uid);
proc_run('php',"include/notifier.php","like","$post_id");
- killme();
+ like_content_return($a->get_baseurl(), $return_path);
+ killme(); // NOTREACHED
// return; // NOTREACHED
}
+// Decide how to return. If we were called with a 'return' argument,
+// then redirect back to the calling page. If not, just quietly end
+
+function like_content_return($baseurl, $return_path) {
+
+ if($return_path) {
+ $rand = '_=' . time();
+ if(strpos($return_path, '?')) $rand = "&$rand";
+ else $rand = "?$rand";
+
+ goaway($baseurl . "/" . $return_path . $rand);
+ }
+
+ killme();
+}
+
+
function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact) {
// Note that we can only create a signature for a user of the local server. We don't have
// a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it