]> git.mxchange.org Git - friendica-addons.git/commitdiff
pumpio: contacts are synced once a day
authorMichael Vogel <icarus@dabo.de>
Sun, 15 Sep 2013 08:47:08 +0000 (10:47 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 15 Sep 2013 08:47:08 +0000 (10:47 +0200)
pumpio/pumpio.php

index 4329bc5d1c649f097b2b614f1542e0144eb0d9c9..d9b814bdc7fa12192e722b1b63775b4c096a84b3 100755 (executable)
@@ -581,12 +581,21 @@ function pumpio_cron($a,$b) {
                foreach($r as $rr) {
                        logger('pumpio: importing timeline from user '.$rr['uid']);
                        pumpio_fetchinbox($a, $rr['uid']);
+
+                       // check for new contacts once a day
+                       $last_contact_check = get_pconfig($rr['uid'],'pumpio','contact_check');
+                       if($last_contact_check)
+                               $next_contact_check = $last_contact_check + 86400;
+                       else
+                               $next_contact_check = 0;
+
+                       if($next_contact_check <= time()) {
+                               pumpio_getallusers($a, $rr["uid"]);
+                               set_pconfig($rr['uid'],'pumpio','contact_check',time());
+                       }
                }
        }
 
-       // To-Do:
-       //pumpio_getallusers($a, $uid);
-
        logger('pumpio: cron_end');
 
        set_config('pumpio','last_poll', time());
@@ -1509,6 +1518,7 @@ function pumpio_fetchallcomments($a, $uid, $id) {
 Bugs:
 
 To-Do:
+ - contact sync every day
 
 Could be hard to do:
  - edit own notes