]> git.mxchange.org Git - friendica-addons.git/blobdiff - pumpio/pumpio.php
Merge remote-tracking branch 'upstream/master'
[friendica-addons.git] / pumpio / pumpio.php
index 63f403c276d842e3622e57170bf03b52a90647da..1f76c10085458c6616a1b92aef097a6a2f97a60a 100755 (executable)
@@ -484,7 +484,7 @@ function pumpio_send(&$a,&$b) {
                        logger('pumpio_send '.$username.': success '.$post_id);
                        if($post_id AND $iscomment) {
                                logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$b['id']);
-                               q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1",
+                               q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d",
                                        dbesc($post_id),
                                        intval($b['id'])
                                );
@@ -925,7 +925,7 @@ function pumpio_get_contact($uid, $contact) {
                                        `name-date` = '%s',
                                        `uri-date` = '%s',
                                        `avatar-date` = '%s'
-                               WHERE `id` = %d LIMIT 1
+                               WHERE `id` = %d
                        ",
                dbesc($photos[0]),
                dbesc($photos[1]),
@@ -952,8 +952,10 @@ function pumpio_get_contact($uid, $contact) {
                                         `micro` = '%s',
                                         `name-date` = '%s',
                                         `uri-date` = '%s',
-                                        `avatar-date` = '%s'
-                                        WHERE `id` = %d LIMIT 1
+                                        `avatar-date` = '%s',
+                                       `name` = '%s',
+                                       `nick` = '%s'
+                                       WHERE `id` = %d
                                 ",
                        dbesc($photos[0]),
                        dbesc($photos[1]),
@@ -961,6 +963,8 @@ function pumpio_get_contact($uid, $contact) {
                        dbesc(datetime_convert()),
                        dbesc(datetime_convert()),
                        dbesc(datetime_convert()),
+                       dbesc($contact->displayName),
+                       dbesc($contact->preferredUsername),
                        intval($r[0]['id'])
                        );
                }
@@ -1129,10 +1133,17 @@ function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcomplet
        }
 
        if ($post->verb == "share") {
-               $postarray['body'] = "[share author='".$post->object->author->displayName.
-                                "' profile='".$post->object->author->url.
-                                "' avatar='".$post->object->author->image->url.
-                                "' link='".$post->links->self->href."']".$postarray['body']."[/share]";
+               if (!intval(get_config('system','wall-to-wall_share'))) {
+                       $postarray['body'] = "[share author='".$post->object->author->displayName.
+                                       "' profile='".$post->object->author->url.
+                                       "' avatar='".$post->object->author->image->url.
+                                       "' link='".$post->links->self->href."']".$postarray['body']."[/share]";
+               } else {
+                       // Let shares look like wall-to-wall posts
+                       $postarray['author-name'] = $post->object->author->displayName;
+                       $postarray['author-link'] = $post->object->author->url;
+                       $postarray['author-avatar'] = $post->object->author->image->url;
+               }
        }
 
        if (trim($postarray['body']) == "")
@@ -1350,7 +1361,7 @@ function pumpio_queue_hook(&$a,&$b) {
                                logger('pumpio_queue: send '.$username.': success '.$post_id);
                                if($post_id AND $iscomment) {
                                        logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$z['item']);
-                                       q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1",
+                                       q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d",
                                                dbesc($post_id),
                                                intval($z['item'])
                                        );