]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Fallback when there is no nick name
[friendica.git] / mod / item.php
index 80a10179e873a71970d7be651ba8cad3d450cf43..2ade524a0500c53dd97e48e42183c5cdf3c6edd4 100644 (file)
@@ -160,6 +160,9 @@ function item_post(&$a) {
                                logger('no contact found: '.print_r($thrparent, true), LOGGER_DEBUG);
                        } else
                                logger('parent contact: '.print_r($parent_contact, true), LOGGER_DEBUG);
+
+                       if ($parent_contact["nick"] == "")
+                               $parent_contact["nick"] = $parent_contact["name"];
                }
        }
 
@@ -844,9 +847,6 @@ function item_post(&$a) {
                // NOTREACHED
        }
 
-       // Store the guid and other relevant data
-       add_guid($datarray);
-
        $post_id = $r[0]['id'];
        logger('mod_item: saved item ' . $post_id);
 
@@ -900,7 +900,7 @@ function item_post(&$a) {
 
 
                // Store the comment signature information in case we need to relay to Diaspora
-               store_diaspora_comment_sig($datarray, $author, ($self ? $a->user['prvkey'] : false), $parent_item, $post_id);
+               store_diaspora_comment_sig($datarray, $author, ($self ? $user['prvkey'] : false), $parent_item, $post_id);
 
        } else {
                $parent = $post_id;
@@ -1271,7 +1271,7 @@ function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item,
        $signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $diaspora_handle;
 
        if( $uprvkey !== false )
-               $authorsig = base64_encode(rsa_sign($signed_text,$uprvkey,'sha256'));
+               $authorsig = rsa_sign($signed_text,$uprvkey,'sha256');
        else
                $authorsig = '';