]> git.mxchange.org Git - friendica-addons.git/commitdiff
The URI of mirrored posts are now looking more standard
authorMichael <heluecht@pirati.ca>
Tue, 15 Nov 2016 06:36:52 +0000 (06:36 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 15 Nov 2016 06:36:52 +0000 (06:36 +0000)
fromgplus/fromgplus.php
ifttt/ifttt.php
statusnet/statusnet.php
twitter/twitter.php

index 4c96892c662d94efd9ff9cdee6ee5742bc3c94d9..f4a61ec2dfd456d0e5c3d395b699e0d2290f072c 100644 (file)
@@ -11,6 +11,7 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
 
 require_once('mod/share.php');
 require_once('mod/parse_url.php');
+require_once('include/text.php');
 
 function fromgplus_install() {
        register_hook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
@@ -164,8 +165,9 @@ function fromgplus_post($a, $uid, $source, $body, $location, $coord, $id) {
        $_REQUEST['source'] = $source;
        $_REQUEST['extid'] = NETWORK_GPLUS;
 
-       if (isset($id))
-               $_REQUEST['message_id'] = NETWORK_GPLUS.":".$id;
+       if (isset($id)) {
+               $_REQUEST['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_GPLUS.':'.$id);
+       }
 
        // $_REQUEST['verb']
        // $_REQUEST['parent']
index 38236509570412638e098a6af85b5ad9ee2026b6..35f3ccc6c7edea9fd2797eeff7a25f32c444888d 100644 (file)
@@ -155,8 +155,11 @@ function ifttt_message($uid, $item) {
        //$_REQUEST["date"] = $item["date"];
        //$_REQUEST["uri"] = $item["url"];
 
-       if (strstr($item["url"], "facebook.com"))
+       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);
+       }
 
        if ($item["type"] == "link") {
                $data = query_page_info($item["link"]);
index febe4032f19d1c7f4566fdd43295f40e4b0e1833..bc9bc125f4a1ffb0a3f0e25470049eefd3f14a9a 100644 (file)
@@ -872,8 +872,9 @@ function statusnet_fetchtimeline($a, $uid) {
                        $_REQUEST["source"] = $post->source;
                        $_REQUEST["extid"] = NETWORK_STATUSNET;
 
-                       if (isset($post->id))
-                               $_REQUEST['message_id'] = NETWORK_STATUSNET.":".$post->id;
+                       if (isset($post->id)) {
+                               $_REQUEST['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_STATUSNET.":".$post->id);
+                       }
 
                        //$_REQUEST["date"] = $post->created_at;
 
index e7429696dec1339d717aa025ddf87e6a40bb9dde..1cc8fd6492dd3b6ab11b816c764b27578eb56789 100644 (file)
@@ -791,8 +791,9 @@ function twitter_fetchtimeline($a, $uid) {
                        $_REQUEST["source"] = $post->source;
                        $_REQUEST["extid"] = NETWORK_TWITTER;
 
-                       if (isset($post->id))
-                               $_REQUEST['message_id'] = NETWORK_TWITTER.":".$post->id;
+                       if (isset($post->id)) {
+                               $_REQUEST['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_TWITTER.":".$post->id);
+                       }
 
                        //$_REQUEST["date"] = $post->created_at;