$inReplyTo = array("id" => $orig_post["uri"],
"objectType" => "note");
+ if (($orig_post["object-type"] != "") AND (strstr($orig_post["object-type"], NAMESPACE_ACTIVITY_SCHEMA)))
+ $inReplyTo["objectType"] = str_replace(NAMESPACE_ACTIVITY_SCHEMA, '', $orig_post["object-type"]);
+
$params["object"] = array(
'objectType' => "comment",
'content' => $title.$content,
}
}
-function pumpio_action(&$a, $uid, $uri, $action, $content) {
+function pumpio_action(&$a, $uid, $uri, $action, $content = "") {
// Don't do likes and other stuff if you don't import the timeline
if (!get_pconfig($uid,'pumpio','import'))
else
$uri = $orig_post["uri"];
- if (strstr($uri, "/api/comment/"))
+ if (($orig_post["object-type"] != "") AND (strstr($orig_post["object-type"], NAMESPACE_ACTIVITY_SCHEMA)))
+ $objectType = str_replace(NAMESPACE_ACTIVITY_SCHEMA, '', $orig_post["object-type"]);
+ elseif (strstr($uri, "/api/comment/"))
$objectType = "comment";
elseif (strstr($uri, "/api/note/"))
$objectType = "note";
$likedata['parent-uri'] = $orig_post["uri"];
$likedata['contact-id'] = $contactid;
$likedata['app'] = $post->generator->displayName;
- $likedata['verb'] = ACTIVITY_LIKE;
$likedata['author-name'] = $post->actor->displayName;
$likedata['author-link'] = $post->actor->url;
$likedata['author-avatar'] = $post->actor->image->url;
function pumpio_get_contact($uid, $contact) {
- if (($contact->url == "") OR ($contact->id == 0))
- return(false);
-
$r = q("SELECT id FROM unique_contacts WHERE url='%s' LIMIT 1",
dbesc(normalise_link($contact->url)));
$postarray['uid'] = $uid;
$postarray['wall'] = 0;
$postarray['uri'] = $post->object->id;
+ $postarray['object-type'] = NAMESPACE_ACTIVITY_SCHEMA.strtolower($post->object->objectType);
if ($post->object->objectType != "comment") {
$contact_id = pumpio_get_contact($uid, $post->actor);
'to_email' => $user[0]['email'],
'uid' => $user[0]['uid'],
'item' => $postarray,
- 'link' => $a->get_baseurl() . '/display/' . $user[0]['nickname'] . '/' . $top_item,
+ 'link' => $a->get_baseurl().'/display/'.urlencode(get_item_guid($top_item)),
'source_name' => $postarray['author-name'],
'source_link' => $postarray['author-link'],
'source_photo' => $postarray['author-avatar'],