From: Michael Date: Sun, 28 Jan 2018 11:19:38 +0000 (+0000) Subject: New methods in item class X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=229b21d7b22c82efc9baaefa8b13644b3ddda51d;p=friendica-addons.git New methods in item class --- diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 6a7429ff..d0fe09d5 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -974,7 +974,7 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = tru $likedata['object'] = '' . ACTIVITY_OBJ_NOTE . '1' . '' . $orig_post['uri'] . '' . xmlify('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; - $ret = item_store($likedata); + $ret = Item::insert($likedata); logger("pumpio_dolike: ".$ret." User ".$own_id." ".$uid." Contact: ".$contactid." Url ".$orig_post['uri']); } @@ -1250,7 +1250,7 @@ function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcomplet if (trim($postarray['body']) == "") return false; - $top_item = item_store($postarray); + $top_item = Item::insert($postarray); $postarray["id"] = $top_item; if (($top_item == 0) && ($post->verb == "update")) { @@ -1306,7 +1306,7 @@ function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcomplet 'to_email' => $user[0]['email'], 'uid' => $user[0]['uid'], 'item' => $postarray, - 'link' => $a->get_baseurl().'/display/'.urlencode(get_item_guid($top_item)), + 'link' => $a->get_baseurl().'/display/'.urlencode(Item::getGuidById($top_item)), 'source_name' => $postarray['author-name'], 'source_link' => $postarray['author-link'], 'source_photo' => $postarray['author-avatar'], diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index eae1c1e4..7308f223 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -55,6 +55,7 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Model\GContact; use Friendica\Model\Group; +use Friendica\Model\Item; use Friendica\Model\Photo; use Friendica\Model\User; use Friendica\Util\Network; @@ -1371,7 +1372,7 @@ function statusnet_checknotification(App $a, $uid, $own_url, $top_item, $postarr 'to_email' => $user[0]['email'], 'uid' => $user[0]['uid'], 'item' => $postarray, - 'link' => $a->get_baseurl() . '/display/' . urlencode(get_item_guid($top_item)), + 'link' => $a->get_baseurl() . '/display/' . urlencode(Item::getGuidById($top_item)), 'source_name' => $postarray['author-name'], 'source_link' => $postarray['author-link'], 'source_photo' => $postarray['author-avatar'], @@ -1495,7 +1496,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) continue; } - $item = item_store($postarray); + $item = Item::insert($postarray); $postarray["id"] = $item; logger('statusnet_fetchhometimeline: User ' . $self["nick"] . ' posted home timeline item ' . $item); @@ -1550,7 +1551,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) continue; } - $item = item_store($postarray); + $item = Item::insert($postarray); $postarray["id"] = $item; logger('statusnet_fetchhometimeline: User ' . $self["nick"] . ' posted mention timeline item ' . $item); @@ -1579,7 +1580,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) 'to_email' => $u[0]['email'], 'uid' => $u[0]['uid'], 'item' => $postarray, - 'link' => $a->get_baseurl() . '/display/' . urlencode(get_item_guid($item)), + 'link' => $a->get_baseurl() . '/display/' . urlencode(Item::getGuidById($item)), 'source_name' => $postarray['author-name'], 'source_link' => $postarray['author-link'], 'source_photo' => $postarray['author-avatar'], @@ -1620,7 +1621,7 @@ function statusnet_complete_conversation(App $a, $uid, $self, $create_user, $nic continue; } - $item = item_store($postarray); + $item = Item::insert($postarray); $postarray["id"] = $item; logger('statusnet_complete_conversation: User ' . $self["nick"] . ' posted home timeline item ' . $item); diff --git a/twitter/twitter.php b/twitter/twitter.php index 5168aa0e..d625dfa5 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -70,6 +70,7 @@ use Friendica\Core\PConfig; use Friendica\Core\Worker; use Friendica\Model\GContact; use Friendica\Model\Group; +use Friendica\Model\Item; use Friendica\Model\Photo; use Friendica\Model\Queue; use Friendica\Model\User; @@ -755,7 +756,7 @@ function twitter_expire(App $a, $b) if (count($r)) { foreach ($r as $rr) { logger('twitter_expire: user ' . $rr['uid']); - item_expire($rr['uid'], $days, NETWORK_TWITTER, true); + Item::expire($rr['uid'], $days, NETWORK_TWITTER, true); } } @@ -1603,7 +1604,7 @@ function twitter_checknotification(App $a, $uid, $own_id, $top_item, $postarray) 'to_email' => $user[0]['email'], 'uid' => $user[0]['uid'], 'item' => $postarray, - 'link' => $a->get_baseurl() . '/display/' . urlencode(get_item_guid($top_item)), + 'link' => $a->get_baseurl() . '/display/' . urlencode(Item::getGuidById($top_item)), 'source_name' => $postarray['author-name'], 'source_link' => $postarray['author-link'], 'source_photo' => $postarray['author-avatar'], @@ -1657,7 +1658,7 @@ function twitter_fetchparentposts(App $a, $uid, $post, $connection, $self, $own_ if (trim($postarray['body']) == "") continue; - $item = item_store($postarray); + $item = Item::insert($postarray); $postarray["id"] = $item; logger('twitter_fetchparentpost: User ' . $self["nick"] . ' posted parent timeline item ' . $item); @@ -1774,7 +1775,7 @@ function twitter_fetchhometimeline(App $a, $uid) continue; } - $item = item_store($postarray); + $item = Item::insert($postarray); $postarray["id"] = $item; logger('twitter_fetchhometimeline: User ' . $self["nick"] . ' posted home timeline item ' . $item); @@ -1826,7 +1827,7 @@ function twitter_fetchhometimeline(App $a, $uid) continue; } - $item = item_store($postarray); + $item = Item::insert($postarray); $postarray["id"] = $item; if ($item && function_exists("check_item_notification")) { @@ -1861,7 +1862,7 @@ function twitter_fetchhometimeline(App $a, $uid) 'to_email' => $u[0]['email'], 'uid' => $u[0]['uid'], 'item' => $postarray, - 'link' => $a->get_baseurl() . '/display/' . urlencode(get_item_guid($item)), + 'link' => $a->get_baseurl() . '/display/' . urlencode(Item::getGuidById($item)), 'source_name' => $postarray['author-name'], 'source_link' => $postarray['author-link'], 'source_photo' => $postarray['author-avatar'],