]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Merge pull request #5238 from annando/more-abstraction
[friendica.git] / mod / item.php
index 8aa7c665af8733df7cbb873f35818698192f76fe..f164fb0ae2c6f4347225dd08ab112cdcd66ee1b4 100644 (file)
@@ -576,7 +576,7 @@ function item_post(App $a) {
 
        $notify_type = ($parent ? 'comment-new' : 'wall-new');
 
-       $uri = ($message_id ? $message_id : item_new_uri($a->get_hostname(), $profile_uid, $guid));
+       $uri = ($message_id ? $message_id : Item::newURI($profile_uid, $guid));
 
        // Fallback so that we alway have a parent uri
        if (!$thr_parent_uri || !$parent) {
@@ -661,6 +661,11 @@ function item_post(App $a) {
                $datarray['edit'] = true;
        }
 
+       // Check for hashtags in the body and repair or add hashtag links
+       if ($preview || $orig_post) {
+               Item::setHashtags($datarray);
+       }
+
        // preview mode - prepare the body for display and send it via json
        if ($preview) {
                require_once 'include/conversation.php';
@@ -808,7 +813,6 @@ function item_post(App $a) {
                                $link = '<a href="' . System::baseUrl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
                                $html    = prepare_body($datarray);
                                $message = '<html><body>' . $link . $html . $disclaimer . '</body></html>';
-                               include_once 'include/html2plain.php';
                                $params =  [
                                        'fromName' => $a->user['username'],
                                        'fromEmail' => $a->user['email'],
@@ -816,7 +820,7 @@ function item_post(App $a) {
                                        'replyTo' => $a->user['email'],
                                        'messageSubject' => $subject,
                                        'htmlVersion' => $message,
-                                       'textVersion' => html2plain($html.$disclaimer)
+                                       'textVersion' => Friendica\Content\Text\HTML::toPlaintext($html.$disclaimer)
                                ];
                                Emailer::send($params);
                        }
@@ -873,7 +877,7 @@ function item_content(App $a) {
        $o = '';
        if (($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
                if (is_ajax()) {
-                       $o = Item::deleteById($a->argv[2]);
+                       $o = Item::deleteForUser(['id' => $a->argv[2]], local_user());
                } else {
                        $o = drop_item($a->argv[2]);
                }