]> git.mxchange.org Git - friendica-addons.git/blobdiff - pumpio/pumpio.php
pump.io: Removed some debug output
[friendica-addons.git] / pumpio / pumpio.php
index 367879e61f8cedca0737cd053591e6417d37a997..c45b474d8c29f3ebfcaafe2851f8c1abdc945192 100755 (executable)
@@ -293,12 +293,16 @@ function pumpio_settings_post(&$a,&$b) {
                if(x($_POST,'pumpio_delete')) {
                        set_pconfig(local_user(),'pumpio','consumer_key','');
                        set_pconfig(local_user(),'pumpio','consumer_secret','');
-                       set_pconfig(local_user(),'pumpio','host','');
                        set_pconfig(local_user(),'pumpio','oauth_token','');
                        set_pconfig(local_user(),'pumpio','oauth_token_secret','');
                        set_pconfig(local_user(),'pumpio','post',false);
-                       set_pconfig(local_user(),'pumpio','post_by_default',false);
+                       set_pconfig(local_user(),'pumpio','import',false);
+                       set_pconfig(local_user(),'pumpio','host','');
                        set_pconfig(local_user(),'pumpio','user','');
+                       set_pconfig(local_user(),'pumpio','public',false);
+                       set_pconfig(local_user(),'pumpio','mirror',false);
+                       set_pconfig(local_user(),'pumpio','post_by_default',false);
+                       set_pconfig(local_user(),'pumpio','lastdate', 0);
                } else {
                        // filtering the username if it is filled wrong
                        $user = $_POST['pumpio_user'];
@@ -321,6 +325,9 @@ function pumpio_settings_post(&$a,&$b) {
                        set_pconfig(local_user(),'pumpio','mirror',$_POST['pumpio_mirror']);
                        set_pconfig(local_user(),'pumpio','post_by_default',intval($_POST['pumpio_bydefault']));
 
+                       if (!$_POST['pumpio_mirror'])
+                               set_pconfig(local_user(),'pumpio','lastdate', $lastdate);
+
                        //header("Location: ".$a->get_baseurl()."/pumpio/connect");
                }
        }
@@ -678,11 +685,11 @@ function pumpio_fetchtimeline(&$a, $uid) {
 
        if (count($posts)) {
                foreach ($posts as $post) {
-                       if ($post->generator->published <= $initiallastdate)
+                       if ($post->published <= $initiallastdate)
                                continue;
 
-                       if ($lastdate < $post->generator->published)
-                               $lastdate = $post->generator->published;
+                       if ($lastdate < $post->published)
+                               $lastdate = $post->published;
 
                        if ($first_time)
                                continue;
@@ -1326,7 +1333,7 @@ function pumpio_getallusers(&$a, $uid) {
        }
 
        foreach ($users->items AS $user)
-               echo pumpio_get_contact($uid, $user)."\n";
+               pumpio_get_contact($uid, $user);
 }
 
 function pumpio_queue_hook(&$a,&$b) {