]> git.mxchange.org Git - friendica-addons.git/commitdiff
Twitter: Prevent posting loops
authorMichael Vogel <icarus@dabo.de>
Mon, 11 Jul 2016 04:44:36 +0000 (06:44 +0200)
committerMichael Vogel <icarus@dabo.de>
Mon, 11 Jul 2016 04:44:36 +0000 (06:44 +0200)
twitter/twitter.php

index 07fa58ad1b3332ab279fbec946460ab502b249b2..8f023dfeb4608f66b5bf38bb9e468cde6d1136f1 100644 (file)
@@ -771,8 +771,10 @@ function twitter_fetchtimeline($a, $uid) {
 
        if (count($posts)) {
            foreach ($posts as $post) {
-               if ($post->id_str > $lastid)
+               if ($post->id_str > $lastid) {
                        $lastid = $post->id_str;
+                       set_pconfig($uid, 'twitter', 'lastid', $lastid);
+               }
 
                if ($first_time)
                        continue;
@@ -1698,8 +1700,10 @@ function twitter_fetchhometimeline($a, $uid) {
 
        if (count($posts)) {
                foreach ($posts as $post) {
-                       if ($post->id_str > $lastid)
+                       if ($post->id_str > $lastid) {
                                $lastid = $post->id_str;
+                               set_pconfig($uid, 'twitter', 'lasthometimelineid', $lastid);
+                       }
 
                        if ($first_time)
                                continue;