]> git.mxchange.org Git - friendica-addons.git/blobdiff - twitter/twitter.php
Merge pull request #381 from tobiasd/20161013-es
[friendica-addons.git] / twitter / twitter.php
index e5b058cc8166025d07839dedc99610dae039cab7..8f023dfeb4608f66b5bf38bb9e468cde6d1136f1 100644 (file)
@@ -61,6 +61,7 @@
  */
 
 require_once('include/enotify.php');
+require_once("include/socgraph.php");
 
 define('TWITTER_DEFAULT_POLL_INTERVAL', 5); // given in minutes
 
@@ -770,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;
@@ -1697,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;