]> git.mxchange.org Git - friendica-addons.git/commitdiff
fbpost/statusnet/twitter: When messages are fetched the first time for mirroring...
authorMichael Vogel <icarus@dabo.de>
Mon, 7 Jan 2013 18:30:18 +0000 (19:30 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 7 Jan 2013 18:30:18 +0000 (19:30 +0100)
fbpost/fbpost.php
statusnet/statusnet.php
twitter/twitter.php

index e33ad6262ebfc5369056a4ea3639e0efa10c86e4..1486afdb2ba6efb802cf87075ccfd16c2c813d29 100644 (file)
@@ -1020,6 +1020,8 @@ function fbpost_fetchwall($a, $uid) {
 
        $url = "https://graph.facebook.com/".$post_to_page."/feed?access_token=".$access_token;
 
+       $first_time = ($lastcreated == "");
+
        if ($lastcreated != "")
                $url .= "&since=".urlencode($lastcreated);
 
@@ -1031,6 +1033,9 @@ function fbpost_fetchwall($a, $uid) {
                if ($item->created_time > $lastcreated)
                        $lastcreated = $item->created_time;
 
+               if ($first_time)
+                       continue;
+
                if ($item->application->id == get_config('facebook','appid'))
                        continue;
 
index 6a00d3df8f30ddf9b24e7fc31c209cf2075f7488..d5700710a93b979a5fd125a87f47be238d45f75d 100755 (executable)
@@ -800,6 +800,8 @@ function statusnet_fetchtimeline($a, $uid) {
 
        $parameters = array("exclude_replies" => true, "trim_user" => true, "contributor_details" => false, "include_rts" => false);
 
+       $first_time = ($lastid == "");
+
        if ($lastid <> "")
                $parameters["since_id"] = $lastid;
 
@@ -810,6 +812,9 @@ function statusnet_fetchtimeline($a, $uid) {
                if ($post->id > $lastid)
                        $lastid = $post->id;
 
+               if ($firsttime)
+                       continue;
+
                if (is_object($post->retweeted_status))
                        continue;
 
index aeacb5b297d54486267fe97a712f409e46d1643f..b9cb31467cd2d46c24a0496ca7bac1f27b080820 100755 (executable)
@@ -604,6 +604,8 @@ function twitter_fetchtimeline($a, $uid) {
 
        $parameters = array("exclude_replies" => true, "trim_user" => true, "contributor_details" => false, "include_rts" => false);
 
+       $first_time = ($lastid == "");
+
        if ($lastid <> "")
                $parameters["since_id"] = $lastid;
 
@@ -614,6 +616,9 @@ function twitter_fetchtimeline($a, $uid) {
                if ($post->id_str > $lastid)
                        $lastid = $post->id_str;
 
+               if ($firsttime)
+                       continue;
+
                if (!strpos($post->source, $application_name)) {
                        $_SESSION["authenticated"] = true;
                        $_SESSION["uid"] = $uid;