Merge pull request #623 from annando/new-item-uri

New function for generating item URIs
This commit is contained in:
Hypolite Petovan 2018-06-16 11:26:12 -04:00 committed by GitHub
commit 6b77771343
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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

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