]> git.mxchange.org Git - friendica.git/blobdiff - include/diaspora.php
BBCode: Add a linefeed between a picture and the following text. This is important...
[friendica.git] / include / diaspora.php
index 6df7f4baf82510f9ef636e2ece4ed0bc6c2e297a..8b85e7b9552c2158b71a81b2d56c8cca5955e427 100755 (executable)
@@ -872,7 +872,8 @@ function diaspora_post($importer,$xml,$msg) {
        $datarray['uid'] = $importer['uid'];
        $datarray['contact-id'] = $contact['id'];
        $datarray['wall'] = 0;
-       $datarray['network']  = NETWORK_DIASPORA;
+       $datarray['network'] = NETWORK_DIASPORA;
+       $datarray['verb'] = ACTIVITY_POST;
        $datarray['guid'] = $guid;
        $datarray['uri'] = $datarray['parent-uri'] = $message_id;
        $datarray['changed'] = $datarray['created'] = $datarray['edited'] = datetime_convert('UTC','UTC',$created);
@@ -1346,6 +1347,7 @@ function diaspora_comment($importer,$xml,$msg) {
        $datarray['type'] = 'remote-comment';
        $datarray['wall'] = $parent_item['wall'];
        $datarray['network']  = NETWORK_DIASPORA;
+       $datarray['verb'] = ACTIVITY_POST;
        $datarray['gravity'] = GRAVITY_COMMENT;
        $datarray['guid'] = $guid;
        $datarray['uri'] = $message_id;
@@ -1371,12 +1373,13 @@ function diaspora_comment($importer,$xml,$msg) {
 
        $message_id = item_store($datarray);
 
-       if($message_id) {
-               q("update item set plink = '%s' where id = %d",
-                       dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
-                       intval($message_id)
-               );
-       }
+       //if($message_id) {
+               //q("update item set plink = '%s' where id = %d",
+               //      //dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
+               //      dbesc($a->get_baseurl().'/display/'.$datarray['guid']),
+               //      intval($message_id)
+               //);
+       //}
 
        if(($parent_item['origin']) && (! $parent_author_signature)) {
                q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
@@ -1420,7 +1423,7 @@ function diaspora_comment($importer,$xml,$msg) {
                                'to_email'     => $importer['email'],
                                'uid'          => $importer['uid'],
                                'item'         => $datarray,
-                               'link'             => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id,
+                               'link'             => $a->get_baseurl().'/display/'.urlencode($datarray['guid']),
                                'source_name'  => $datarray['author-name'],
                                'source_link'  => $datarray['author-link'],
                                'source_photo' => $datarray['author-avatar'],
@@ -1955,7 +1958,8 @@ EOT;
 
        $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
        $alink = '[url=' . $parent_item['author-link'] . ']' . $parent_item['author-name'] . '[/url]';
-       $plink = '[url=' . $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $parent_item['id'] . ']' . $post_type . '[/url]';
+       //$plink = '[url=' . $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $parent_item['id'] . ']' . $post_type . '[/url]';
+       $plink = '[url='.$a->get_baseurl().'/display/'.urlencode($guid).']'.$post_type.'[/url]';
        $arr['body'] =  sprintf( $bodyverb, $ulink, $alink, $plink );
 
        $arr['app']  = 'Diaspora';
@@ -1971,12 +1975,13 @@ EOT;
        $message_id = item_store($arr);
 
 
-       if($message_id) {
-               q("update item set plink = '%s' where id = %d",
-                       dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
-                       intval($message_id)
-               );
-       }
+       //if($message_id) {
+       //      q("update item set plink = '%s' where id = %d",
+       //              //dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
+       //              dbesc($a->get_baseurl().'/display/'.$guid),
+       //              intval($message_id)
+       //      );
+       //}
 
        if(! $parent_author_signature) {
                q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",