$_REQUEST["profile_uid"] = $uid;
$_REQUEST["source"] = "pump.io";
+ if (isset($post->object->id)) {
+ $_REQUEST['message_id'] = NETWORK_PUMPIO.":".$post->object->id;
+ }
+
if ($post->object->displayName != "")
$_REQUEST["title"] = html2bbcode($post->object->displayName);
else
function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = true) {
require_once('include/items.php');
+ if ($post->object->id == "") {
+ logger('Got empty like: '.print_r($post, true), LOGGER_DEBUG);
+ return;
+ }
+
// Searching for the liked post
// Two queries for speed issues
$r = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `uid` = %d AND `network` = '%s' LIMIT 1",
$post->actor->url = $self[0]['url'];
$post->actor->image->url = $self[0]['photo'];
} else {
- $r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d AND `blocked` = 0 AND `readonly` = 0 LIMIT 1",
- dbesc($post->actor->url),
+ $r = q("SELECT * FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `blocked` = 0 AND `readonly` = 0 LIMIT 1",
+ dbesc(normalise_link($post->actor->url)),
intval($uid)
);
*/
}
- update_contact_avatar($contact->image->url, $uid, $contact_id);
+ if (function_exists("update_contact_avatar"))
+ update_contact_avatar($contact->image->url, $uid, $contact_id);
return($contact_id);
}
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
intval($uid));
- $lastitems = q("SELECT uri FROM `item` WHERE `network` = '%s' AND `uid` = %d AND
- `extid` != '' AND `id` = `parent`
- ORDER BY `commented` DESC LIMIT 10",
+ $lastitems = q("SELECT `uri` FROM `thread`
+ INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
+ WHERE `thread`.`network` = '%s' AND `thread`.`uid` = %d AND `item`.`extid` != ''
+ ORDER BY `thread`.`commented` DESC LIMIT 10",
dbesc(NETWORK_PUMPIO),
intval($uid)
);