From 4741beffe3e11e1c8d9098b9de70144fff886df0 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 16 May 2014 07:50:09 +0200 Subject: [PATCH] pump.io: preventing that a reenabling of the mirror option causes a flood of old posts --- pumpio/pumpio.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index f39bfef9..ba7a7d1b 100755 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -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"); } } -- 2.39.5