From e1714de8ad91c7e15a2d437313c3af3e1e305168 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 16 Jun 2018 06:46:25 +0000 Subject: [PATCH] New function for generating item URIs --- fromgplus/fromgplus.php | 3 ++- ifttt/ifttt.php | 3 ++- pumpio/pumpio.php | 2 +- statusnet/statusnet.php | 2 +- twitter/twitter.php | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index ade1ca31..5dfac50c 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -16,6 +16,7 @@ use Friendica\Core\PConfig; use Friendica\Object\Image; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; +use Friendica\Model\Item; require_once 'mod/share.php'; require_once 'mod/parse_url.php'; @@ -176,7 +177,7 @@ function fromgplus_post($a, $uid, $source, $body, $location, $coord, $id) { $_REQUEST['extid'] = NETWORK_GPLUS; if (isset($id)) { - $_REQUEST['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_GPLUS.':'.$id); + $_REQUEST['message_id'] = Item::newURI($uid, NETWORK_GPLUS.':'.$id); } // $_REQUEST['verb'] diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index bdb2b607..48278d5c 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -15,6 +15,7 @@ use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Database\DBM; +use Friendica\Model\Item; function ifttt_install() { @@ -182,7 +183,7 @@ function ifttt_message($uid, $item) if (strstr($item['url'], 'facebook.com')) { $hash = hash('ripemd128', item['url']); $_REQUEST['extid'] = NETWORK_FACEBOOK; - $_REQUEST['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_FACEBOOK . ':' . $hash); + $_REQUEST['message_id'] = Item::newURI($uid, NETWORK_FACEBOOK . ':' . $hash); } if ($item['type'] == 'link') { diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 2da35abc..cf659225 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -945,7 +945,7 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = tru $likedata['gravity'] = 3; $likedata['uid'] = $uid; $likedata['wall'] = 0; - $likedata['uri'] = item_new_uri($a->get_baseurl(), $uid); + $likedata['uri'] = Item::newURI($uid); $likedata['parent-uri'] = $orig_post["uri"]; $likedata['contact-id'] = $contactid; $likedata['app'] = $post->generator->displayName; diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 8cc5caa8..a297baeb 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -853,7 +853,7 @@ function statusnet_fetchtimeline(App $a, $uid) $_REQUEST["extid"] = NETWORK_STATUSNET; if (isset($post->id)) { - $_REQUEST['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_STATUSNET . ":" . $post->id); + $_REQUEST['message_id'] = Item::newURI($uid, NETWORK_STATUSNET . ":" . $post->id); } //$_REQUEST["date"] = $post->created_at; diff --git a/twitter/twitter.php b/twitter/twitter.php index a38fd72b..e69ebb8e 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -807,7 +807,7 @@ function twitter_do_mirrorpost(App $a, $uid, $post) $datarray["api_source"] = true; $datarray["profile_uid"] = $uid; $datarray["extid"] = NETWORK_TWITTER; - $datarray['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_TWITTER . ":" . $post->id); + $datarray['message_id'] = Item::newURI($uid, NETWORK_TWITTER . ":" . $post->id); $datarray['object'] = json_encode($post); $datarray["title"] = "";