Gives mail flag to ax addresses.
authorStéphane Jacob <sj@m4x.org>
Tue, 14 Dec 2010 23:43:05 +0000 (00:43 +0100)
committerStéphane Jacob <sj@m4x.org>
Fri, 17 Dec 2010 09:09:32 +0000 (10:09 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
upgrade/1.0.1/merge.php
upgrade/1.0.1/merge_issues.php

index 4255429..d0b6fe5 100755 (executable)
@@ -248,8 +248,8 @@ XDB::rawExecute("INSERT IGNORE INTO  profile_merge_issues (pid, issues)
                          INNER JOIN  profile_addresses AS pa ON (pa.pid = f.pid AND pa.type = 'home' AND pa.id = 0)
                               WHERE  f.text IS NOT NULL");
 
-XDB::rawExecute("INSERT INTO  profile_addresses (pid, type, id, pub, text)
-                      SELECT  f.pid, 'home', IF(pa.id IS NULL , 0, MAX(pa.id) + 1), 'ax', f.text
+XDB::rawExecute("INSERT INTO  profile_addresses (pid, type, id, pub, text, flags)
+                      SELECT  f.pid, 'home', IF(pa.id IS NULL , 0, MAX(pa.id) + 1), 'ax', f.text, 'mail'
                         FROM  fusionax_adresses AS f
                    LEFT JOIN  profile_addresses AS pa ON (pa.pid = f.pid AND pa.type = 'home')
                        WHERE  f.text IS NOT NULL
index 55f3214..1e8fdbb 100755 (executable)
@@ -135,6 +135,9 @@ foreach ($pids as $pid) {
                 if ($minPub->isVisible($addresses[$i]->pub)) {
                     $addresses[$i]->pub = $addresses[$j]->pub;
                 }
+                if ($addresses[$j]->hasFlag('mail') && !$addresses[$i]->hasFlag('mail')) {
+                    $addresses[$i]->addFlag('mail');
+                }
             }
         }
     }