+function update_1438()
+{
+ DBA::update('photo', ['photo-type' => Photo::USER_AVATAR], ['profile' => true]);
+ DBA::update('photo', ['photo-type' => Photo::CONTACT_AVATAR], ["NOT `profile` AND NOT `contact-id` IS NULL AND `contact-id` != ?", 0]);
+ DBA::update('photo', ['photo-type' => Photo::DEFAULT], ["NOT `profile` AND (`contact-id` IS NULL OR `contact-id` = ?) AND `photo-type` IS NULL AND `album` != ?", 0, Photo::CONTACT_PHOTOS]);
+}
+
+function update_1439()
+{
+ if (!DBStructure::existsTable('fcontact')) {
+ return Update::SUCCESS;
+ }
+
+ $intros = DBA::select('intro', ['id', 'fid'], ["NOT `fid` IS NULL AND `fid` != ?", 0]);
+ while ($intro = DBA::fetch($intros)) {
+ $fcontact = DBA::selectFirst('fcontact', ['url'], ['id' => $intro['fid']]);
+ if (!empty($fcontact['url'])) {
+ $id = Contact::getIdForURL($fcontact['url']);
+ if (!empty($id)) {
+ DBA::update('intro',['suggest-cid' => $id], ['id' => $intro['id']]);
+ }
+ }
+ }
+ DBA::close($intros);
+
+ return Update::SUCCESS;
+}
+
+function update_1440()
+{
+ // Fix wrong public permissionset
+ DBA::p("UPDATE `profile_field` SET `psid` = ? WHERE psid IN (SELECT `id` FROM `permissionset` WHERE `id` != ? AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '')", PermissionSet::PUBLIC, PermissionSet::PUBLIC);
+ DBA::delete('permissionset', ["`id` != ? AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = ''", PermissionSet::PUBLIC]);
+
+ return Update::SUCCESS;
+}
+
+function update_1441()
+{
+ $languages = DI::l10n()->getAvailableLanguages();
+
+ $albums = [Photo::PROFILE_PHOTOS];
+ foreach ($languages as $language) {
+ $albums[] = DI::l10n()->withLang($language)->t(Photo::PROFILE_PHOTOS);
+ }
+ $albums = array_unique($albums);
+
+ Photo::update(['photo-type' => Photo::USER_AVATAR], ['album' => $albums]);
+
+ return Update::SUCCESS;
+}
+
+function update_1442()
+{
+ // transform blocked intros into ignored intros
+ DBA::update('intro', ['ignore' => 1, 'blocked' => 0], ['blocked' => 1]);
+
+ return Update::SUCCESS;
+}
+
+/**
+ * A bug in Contact\User::updateByContactUpdate prevented any update to the user-contact table since the rows have been
+ * created in version 1435. This version fixes this bug but the user-contact rows are outdated, we need to regenerate
+ * them.
+ */
+function update_1444()