From 45ada943b4f04fff6cd94ba55a8f87633ae11f19 Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Sun, 6 Jan 2019 23:49:13 -0500
Subject: [PATCH] Update missing namespace uses in mod/

- Update missing constant moves in mod/
---
 mod/dfrn_notify.php |  1 +
 mod/hcard.php       |  1 +
 mod/profile.php     |  1 +
 mod/profiles.php    |  1 +
 mod/settings.php    | 36 ++++++++++++++++++------------------
 mod/videos.php      |  1 +
 mod/wall_attach.php |  2 +-
 mod/wall_upload.php |  1 +
 update.php          |  2 +-
 9 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index ac62d74534..e42f18e76b 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -12,6 +12,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
+use Friendica\Model\User;
 use Friendica\Protocol\DFRN;
 use Friendica\Protocol\Diaspora;
 use Friendica\Util\Strings;
diff --git a/mod/hcard.php b/mod/hcard.php
index 9a0c969ae4..cbaebc8ff4 100644
--- a/mod/hcard.php
+++ b/mod/hcard.php
@@ -8,6 +8,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\System;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
+use Friendica\Model\User;
 
 function hcard_init(App $a)
 {
diff --git a/mod/profile.php b/mod/profile.php
index e6b7f453c3..f93e45984b 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -19,6 +19,7 @@ use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Model\Item;
 use Friendica\Model\Profile;
+use Friendica\Model\User;
 use Friendica\Module\Login;
 use Friendica\Protocol\ActivityPub;
 use Friendica\Protocol\DFRN;
diff --git a/mod/profiles.php b/mod/profiles.php
index add9d50852..bc41718c54 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -19,6 +19,7 @@ use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
 use Friendica\Model\Profile;
+use Friendica\Model\User;
 use Friendica\Module\Login;
 use Friendica\Network\Probe;
 use Friendica\Util\DateTimeFormat;
diff --git a/mod/settings.php b/mod/settings.php
index 8aba6809f2..b1be28f8c9 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -474,13 +474,13 @@ function settings_post(App $a)
 	}
 
 	// Adjust the page flag if the account type doesn't fit to the page flag.
-	if (($account_type == Contact::ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_SOAPBOX, User::PAGE_FLAGS_FREELOVE])) {
+	if (($account_type == User::ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_SOAPBOX, User::PAGE_FLAGS_FREELOVE])) {
 		$page_flags = User::PAGE_FLAGS_NORMAL;
-	} elseif (($account_type == Contact::ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [User::PAGE_FLAGS_SOAPBOX])) {
+	} elseif (($account_type == User::ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [User::PAGE_FLAGS_SOAPBOX])) {
 		$page_flags = User::PAGE_FLAGS_SOAPBOX;
-	} elseif (($account_type == Contact::ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [User::PAGE_FLAGS_SOAPBOX])) {
+	} elseif (($account_type == User::ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [User::PAGE_FLAGS_SOAPBOX])) {
 		$page_flags = User::PAGE_FLAGS_SOAPBOX;
-	} elseif (($account_type == Contact::ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
+	} elseif (($account_type == User::ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
 		$page_flags = User::PAGE_FLAGS_COMMUNITY;
 	}
 
@@ -1015,8 +1015,8 @@ function settings_content(App $a)
 	// Set the account type to "Community" when the page is a community page but the account type doesn't fit
 	// This is only happening on the first visit after the update
 	if (in_array($a->user['page-flags'], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]) &&
-		($a->user['account-type'] != Contact::ACCOUNT_TYPE_COMMUNITY))
-		$a->user['account-type'] = Contact::ACCOUNT_TYPE_COMMUNITY;
+		($a->user['account-type'] != User::ACCOUNT_TYPE_COMMUNITY))
+		$a->user['account-type'] = User::ACCOUNT_TYPE_COMMUNITY;
 
 	$pageset_tpl = Renderer::getMarkupTemplate('settings/pagetypes.tpl');
 
@@ -1025,26 +1025,26 @@ function settings_content(App $a)
 		'$user' 		=> L10n::t("Personal Page Subtypes"),
 		'$community'		=> L10n::t("Community Forum Subtypes"),
 		'$account_type'		=> $a->user['account-type'],
-		'$type_person'		=> Contact::ACCOUNT_TYPE_PERSON,
-		'$type_organisation' 	=> Contact::ACCOUNT_TYPE_ORGANISATION,
-		'$type_news'		=> Contact::ACCOUNT_TYPE_NEWS,
-		'$type_community' 	=> Contact::ACCOUNT_TYPE_COMMUNITY,
+		'$type_person'		=> User::ACCOUNT_TYPE_PERSON,
+		'$type_organisation' 	=> User::ACCOUNT_TYPE_ORGANISATION,
+		'$type_news'		=> User::ACCOUNT_TYPE_NEWS,
+		'$type_community' 	=> User::ACCOUNT_TYPE_COMMUNITY,
 
-		'$account_person' 	=> ['account-type', L10n::t('Personal Page'), Contact::ACCOUNT_TYPE_PERSON,
+		'$account_person' 	=> ['account-type', L10n::t('Personal Page'), User::ACCOUNT_TYPE_PERSON,
 									L10n::t('Account for a personal profile.'),
-									($a->user['account-type'] == Contact::ACCOUNT_TYPE_PERSON)],
+									($a->user['account-type'] == User::ACCOUNT_TYPE_PERSON)],
 
-		'$account_organisation'	=> ['account-type', L10n::t('Organisation Page'), Contact::ACCOUNT_TYPE_ORGANISATION,
+		'$account_organisation'	=> ['account-type', L10n::t('Organisation Page'), User::ACCOUNT_TYPE_ORGANISATION,
 									L10n::t('Account for an organisation that automatically approves contact requests as "Followers".'),
-									($a->user['account-type'] == Contact::ACCOUNT_TYPE_ORGANISATION)],
+									($a->user['account-type'] == User::ACCOUNT_TYPE_ORGANISATION)],
 
-		'$account_news'		=> ['account-type', L10n::t('News Page'), Contact::ACCOUNT_TYPE_NEWS,
+		'$account_news'		=> ['account-type', L10n::t('News Page'), User::ACCOUNT_TYPE_NEWS,
 									L10n::t('Account for a news reflector that automatically approves contact requests as "Followers".'),
-									($a->user['account-type'] == Contact::ACCOUNT_TYPE_NEWS)],
+									($a->user['account-type'] == User::ACCOUNT_TYPE_NEWS)],
 
-		'$account_community' 	=> ['account-type', L10n::t('Community Forum'), Contact::ACCOUNT_TYPE_COMMUNITY,
+		'$account_community' 	=> ['account-type', L10n::t('Community Forum'), User::ACCOUNT_TYPE_COMMUNITY,
 									L10n::t('Account for community discussions.'),
-									($a->user['account-type'] == Contact::ACCOUNT_TYPE_COMMUNITY)],
+									($a->user['account-type'] == User::ACCOUNT_TYPE_COMMUNITY)],
 
 		'$page_normal'		=> ['page-flags', L10n::t('Normal Account Page'), User::PAGE_FLAGS_NORMAL,
 									L10n::t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
diff --git a/mod/videos.php b/mod/videos.php
index 1d37b76bd6..4120c136f1 100644
--- a/mod/videos.php
+++ b/mod/videos.php
@@ -16,6 +16,7 @@ use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Model\Item;
 use Friendica\Model\Profile;
+use Friendica\Model\User;
 use Friendica\Protocol\DFRN;
 use Friendica\Util\Security;
 
diff --git a/mod/wall_attach.php b/mod/wall_attach.php
index 4a4d1edc53..c4ee33bd18 100644
--- a/mod/wall_attach.php
+++ b/mod/wall_attach.php
@@ -8,7 +8,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Database\DBA;
 use Friendica\Model\Attach;
-use Friendica\Model\Contact;
+use Friendica\Model\User;
 use Friendica\Util\Strings;
 
 function wall_attach_post(App $a) {
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index 84da855984..a245ca739c 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -16,6 +16,7 @@ use Friendica\Core\Config;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Photo;
+use Friendica\Model\User;
 use Friendica\Object\Image;
 use Friendica\Util\Strings;
 
diff --git a/update.php b/update.php
index 4b0b2f2b6a..e619ec89dd 100644
--- a/update.php
+++ b/update.php
@@ -161,7 +161,7 @@ function update_1191()
 function update_1203()
 {
 	$r = q("UPDATE `user` SET `account-type` = %d WHERE `page-flags` IN (%d, %d)",
-		DBA::escape(Contact::ACCOUNT_TYPE_COMMUNITY),
+		DBA::escape(User::ACCOUNT_TYPE_COMMUNITY),
 		DBA::escape(User::PAGE_FLAGS_COMMUNITY),
 		DBA::escape(User::PAGE_FLAGS_PRVGROUP)
 	);