New function for generating item URIs

This commit is contained in:
Michael 2018-06-16 06:46:25 +00:00
parent 49558d7d22
commit e1714de8ad
5 changed files with 7 additions and 5 deletions

View File

@ -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']

View File

@ -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') {

View File

@ -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;

View File

@ -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;

View File

@ -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"] = "";