]> git.mxchange.org Git - friendica-addons.git/commitdiff
New methods in item class
authorMichael <heluecht@pirati.ca>
Sun, 28 Jan 2018 11:19:38 +0000 (11:19 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 28 Jan 2018 11:19:38 +0000 (11:19 +0000)
pumpio/pumpio.php
statusnet/statusnet.php
twitter/twitter.php

index 6a7429ffb0d297d0fe13a58343622df59ce6be2a..d0fe09d568e070fe6f2e730762a232faa28ac22e 100644 (file)
@@ -974,7 +974,7 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = tru
        $likedata['object'] = '<object><type>' . ACTIVITY_OBJ_NOTE . '</type><local>1</local>' .
                '<id>' . $orig_post['uri'] . '</id><link>' . xmlify('<link rel="alternate" type="text/html" href="' . xmlify($orig_post['plink']) . '" />') . '</link><title>' . $orig_post['title'] . '</title><content>' . $orig_post['body'] . '</content></object>';
 
-       $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'],
index eae1c1e4ccd8086a6101bae8abf3033fb718bc2f..7308f223de5ad70267e65f5e5339758c87a61ad0 100644 (file)
@@ -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);
index 5168aa0ecfda12c57df03abcb4ea64f2ffa13173..d625dfa5bae8f5ef7baa76d807e62af8019e9143 100644 (file)
@@ -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'],