]> git.mxchange.org Git - friendica-addons.git/blobdiff - twitter/twitter.php
Use the original application name when mirroring posts.
[friendica-addons.git] / twitter / twitter.php
index 1919e28cf536293bcaad3c7d41cdf2e0933bea1c..380121c2e2a40bc0d820e2417021b077a3bfda33 100644 (file)
@@ -438,6 +438,9 @@ function twitter_post_hook(&$a,&$b) {
                return;
 
        // if post comes from twitter don't send it back
+       if($b['extid'] == NETWORK_TWITTER)
+               return;
+
        if($b['app'] == "Twitter")
                return;
 
@@ -743,7 +746,9 @@ function twitter_fetchtimeline($a, $uid) {
                        $_REQUEST["type"] = "wall";
                        $_REQUEST["api_source"] = true;
                        $_REQUEST["profile_uid"] = $uid;
-                       $_REQUEST["source"] = "Twitter";
+                       //$_REQUEST["source"] = "Twitter";
+                       $_REQUEST["source"] = $post->source;
+                       $_REQUEST["extid"] = NETWORK_TWITTER;
 
                        //$_REQUEST["date"] = $post->created_at;
 
@@ -892,6 +897,9 @@ function twitter_queue_hook(&$a,&$b) {
 function twitter_fetch_contact($uid, $contact, $create_user) {
        require_once("include/Photo.php");
 
+       if ($contact->id_str == "")
+               return(-1);
+
        $avatar = str_replace("_normal.", ".", $contact->profile_image_url_https);
 
        $info = get_photo_info($avatar);