]> git.mxchange.org Git - friendica-addons.git/commitdiff
Re-enabling a once stopped mirroring now doesn't flood the timeline with old posts...
authorMichael Vogel <icarus@dabo.de>
Thu, 29 May 2014 20:10:54 +0000 (22:10 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 29 May 2014 20:10:54 +0000 (22:10 +0200)
fbpost/fbpost.php
fromgplus/fromgplus.php
gpluspost/gpluspost.php
pumpio/pumpio.php
statusnet/statusnet.php
twitter/twitter.php

index 0d8df16b8aa3f79b041701006aafbea52b8c1257..b5e320fc5d136c1a764fa7193a334743482b43ca 100644 (file)
@@ -140,6 +140,9 @@ function fbpost_post(&$a) {
                $value = ((x($_POST,'mirror_posts')) ? intval($_POST['mirror_posts']) : 0);
                set_pconfig($uid,'facebook','mirror_posts', $value);
 
+               if (!$value)
+                       del_pconfig($uid,'facebook','last_created');
+
                $value = ((x($_POST,'suppress_view_on_friendica')) ? intval($_POST['suppress_view_on_friendica']) : 0);
                set_pconfig($uid,'facebook','suppress_view_on_friendica', $value);
 
index d2b496baf8312dd5b1bf1d038c2581c36bb0576c..5c7e1e2877f7d1db6b56c8fac7935994f0a05a31 100644 (file)
@@ -71,6 +71,10 @@ function fromgplus_addon_settings_post(&$a,&$b) {
                set_pconfig(local_user(),'fromgplus','account',trim($_POST['fromgplus-account']));
                $enable = ((x($_POST,'fromgplus-enable')) ? intval($_POST['fromgplus-enable']) : 0);
                set_pconfig(local_user(),'fromgplus','enable', $enable);
+
+               if (!$enable)
+                       del_pconfig(local_user(),'fromgplus','lastdate');
+
                info( t('Google+ Import Settings saved.') . EOL);
        }
 }
index ab0d07e8e4f2954fe0cd18b6b93b1daeb37bc52f..415e031b2629780a43f5cf75bfcae567922cd052 100644 (file)
@@ -182,6 +182,9 @@ function gpluspost_settings_post(&$a,&$b) {
                        set_pconfig(local_user(),'fromgplus','account',trim($_POST['fromgplus-account']));
                        $enable = ((x($_POST,'fromgplus-enable')) ? intval($_POST['fromgplus-enable']) : 0);
                        set_pconfig(local_user(),'fromgplus','enable', $enable);
+
+                       if (!$enable)
+                               del_pconfig(local_user(),'fromgplus','lastdate');
                }
        }
 }
index c45b474d8c29f3ebfcaafe2851f8c1abdc945192..78b738fab8dfb52618ddfe2fffe1e1afc6b3cff3 100755 (executable)
@@ -326,7 +326,7 @@ function pumpio_settings_post(&$a,&$b) {
                        set_pconfig(local_user(),'pumpio','post_by_default',intval($_POST['pumpio_bydefault']));
 
                        if (!$_POST['pumpio_mirror'])
-                               set_pconfig(local_user(),'pumpio','lastdate', $lastdate);
+                               del_pconfig(local_user(),'pumpio','lastdate');
 
                        //header("Location: ".$a->get_baseurl()."/pumpio/connect");
                }
index 1957cc96178b1d8286247fd8ff6b3128849d8ee7..abbda0e18e491a58bf89f3e350bcc15f86de62ed 100644 (file)
@@ -250,6 +250,10 @@ function statusnet_settings_post ($a,$post) {
                set_pconfig(local_user(), 'statusnet', 'mirror_posts', intval($_POST['statusnet-mirror']));
                set_pconfig(local_user(), 'statusnet', 'import', intval($_POST['statusnet-import']));
                set_pconfig(local_user(), 'statusnet', 'create_user', intval($_POST['statusnet-create_user']));
+
+               if (!intval($_POST['statusnet-mirror']))
+                       del_pconfig(local_user(),'statusnet','lastid');
+
                info( t('StatusNet settings updated.') . EOL);
        }}}}
 }
index 7204ec5b0eb50d1758254954cac88db33ed31d86..8a80f471baf30749b48443827004d13467946cb8 100755 (executable)
@@ -194,7 +194,11 @@ function twitter_settings_post ($a,$post) {
                set_pconfig(local_user(), 'twitter', 'mirror_posts', intval($_POST['twitter-mirror']));
                set_pconfig(local_user(), 'twitter', 'import', intval($_POST['twitter-import']));
                set_pconfig(local_user(), 'twitter', 'create_user', intval($_POST['twitter-create_user']));
-                info( t('Twitter settings updated.') . EOL);
+
+                if (!intval($_POST['twitter-mirror']))
+                        del_pconfig(local_user(),'twitter','lastid');
+
+                info(t('Twitter settings updated.') . EOL);
        }}
 }
 function twitter_settings(&$a,&$s) {