From: Stéphane Jacob Date: Sun, 12 Dec 2010 20:20:49 +0000 (+0100) Subject: Updates publicity if the item we delete is more public than the one we keep. X-Git-Tag: xorg/1.0.2~77 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ce7742561dd5125391229cf288864a34dd18849c;p=platal.git Updates publicity if the item we delete is more public than the one we keep. Signed-off-by: Stéphane Jacob --- diff --git a/upgrade/1.0.1/merge_issues.php b/upgrade/1.0.1/merge_issues.php index cf6f3d6..55f3214 100755 --- a/upgrade/1.0.1/merge_issues.php +++ b/upgrade/1.0.1/merge_issues.php @@ -131,6 +131,10 @@ foreach ($pids as $pid) { for ($j = $i + 1; $j < $count; ++$j) { if (check($rawAddresses[$i], $rawAddresses[$j])) { $duplicates[$j] = true; + $minPub = new ProfileVisibility($addresses[$j]->pub); + if ($minPub->isVisible($addresses[$i]->pub)) { + $addresses[$i]->pub = $addresses[$j]->pub; + } } } } @@ -211,7 +215,12 @@ foreach ($pids as $pid) { for ($i = 0; $i < $count; ++$i) { for ($j = $i + 1; $j < $count; ++$j) { if ($phones[$i]->search() == $phones[$j]->search()) { - $duplicates[$i] = true; + $duplicates[$j] = true; + $minPub = new ProfileVisibility($phones[$j]->pub); + if ($minPub->isVisible($phones[$i]->pub)) { + $phones[$i]->pub = $phones[$j]->pub; + } + } } }