]> git.mxchange.org Git - friendica-addons.git/blobdiff - pumpio/pumpio.php
Merge remote-tracking branch 'upstream/master' into 1612-twitter-video
[friendica-addons.git] / pumpio / pumpio.php
index cfa60e0eaed695e131e6285af26aabc1f57af8ab..1b3c587f93a9f560b2db7deb04946435dd5d4bb7 100644 (file)
@@ -775,6 +775,10 @@ function pumpio_fetchtimeline(&$a, $uid) {
                                $_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
@@ -1055,7 +1059,8 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
                */
        }
 
-       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);
 }
@@ -1351,9 +1356,10 @@ function pumpio_fetchinbox(&$a, $uid) {
        $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)
                        );