From e537f7d0171b06db54e45f26f101c3c8e8bcb38b Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Tue, 6 Nov 2018 21:16:27 -0500 Subject: [PATCH] Function calls update function calls to new class --- include/conversation.php | 2 +- include/enotify.php | 2 +- mod/item.php | 7 +++---- src/Content/Text/BBCode.php | 4 ++-- src/Object/Post.php | 2 +- src/Protocol/Email.php | 3 ++- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index cd635521e5..3e953db7da 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -638,7 +638,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ $lock = false; $likebuttons = false; - $body = prepare_body($item, true, $preview); + $body = Item::prepareBody($item, true, $preview); list($categories, $folders) = get_cats_and_terms($item); diff --git a/include/enotify.php b/include/enotify.php index 339e31a3c8..d6ca123271 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -157,7 +157,7 @@ function notification($params) $item = Item::selectFirstForUser($params['uid'], Item::ITEM_FIELDLIST, ['id' => $parent_id]); } - $item_post_type = item_post_type($item); + $item_post_type = Item::postType($item); $itemlink = $item['plink']; // "a post" diff --git a/mod/item.php b/mod/item.php index 739e09ab0f..c86ed5e278 100644 --- a/mod/item.php +++ b/mod/item.php @@ -697,11 +697,10 @@ function item_post(App $a) { killme(); } - if ($orig_post) { - + if ($orig_post) { // Fill the cache field // This could be done in Item::update as well - but we have to check for the existance of some fields. - put_item_in_cache($datarray); + Item::putInCache($datarray); $fields = [ 'title' => $datarray['title'], @@ -817,7 +816,7 @@ function item_post(App $a) { $subject = Email::encodeHeader('[Friendica]' . ' ' . L10n::t('%s posted an update.', $a->user['username']), 'UTF-8'); } $link = '' . $a->user['username'] . '

'; - $html = prepare_body($datarray); + $html = Item::prepareBody($datarray); $message = '' . $link . $html . $disclaimer . ''; $params = [ 'fromName' => $a->user['username'], diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 3592059d0c..f37400f836 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1363,7 +1363,7 @@ class BBCode extends BaseObject $text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '$2', $text); // leave open the posibility of [map=something] - // this is replaced in prepare_body() which has knowledge of the item location + // this is replaced in Item::prepareBody() which has knowledge of the item location if (strpos($text, '[/map]') !== false) { $text = preg_replace_callback( @@ -1474,7 +1474,7 @@ class BBCode extends BaseObject $text = str_replace('[hr]', '
', $text); - // This is actually executed in prepare_body() + // This is actually executed in Item::prepareBody() $text = str_replace('[nosmile]', '', $text); diff --git a/src/Object/Post.php b/src/Object/Post.php index 644d53e25d..e5a18e691d 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -315,7 +315,7 @@ class Post extends BaseObject localize_item($item); - $body = prepare_body($item, true); + $body = Item::prepareBody($item, true); list($categories, $folders) = get_cats_and_terms($item); diff --git a/src/Protocol/Email.php b/src/Protocol/Email.php index bb70972b03..ba8c311901 100644 --- a/src/Protocol/Email.php +++ b/src/Protocol/Email.php @@ -7,6 +7,7 @@ namespace Friendica\Protocol; use Friendica\Core\Logger; use Friendica\Content\Text\HTML; use Friendica\Core\Protocol; +use Friendica\Model\Item; /** * @brief Email class @@ -331,7 +332,7 @@ class Email $part = uniqid("", true); - $html = prepare_body($item); + $html = Item::prepareBody($item); $headers .= "Mime-Version: 1.0\n"; $headers .= 'Content-Type: multipart/alternative; boundary="=_'.$part.'"'."\n\n"; -- 2.39.5