Revert "DEV: `Discourse.User` has been deprecated since 2.6"

Revert “DEV: Discourse.User has been deprecated since 2.6”

This reverts commit 3edf24437a4ef117ee8d8b49497da350b0dce8c6.

Too many plugins rely on this right now and need to be updated.

diff --git a/app/assets/javascripts/discourse/app/models/user.js b/app/assets/javascripts/discourse/app/models/user.js
index ed0101a..fc28a3b 100644
--- a/app/assets/javascripts/discourse/app/models/user.js
+++ b/app/assets/javascripts/discourse/app/models/user.js
@@ -22,6 +22,7 @@ import UserDraftsStream from "discourse/models/user-drafts-stream";
 import UserPostsStream from "discourse/models/user-posts-stream";
 import UserStream from "discourse/models/user-stream";
 import { ajax } from "discourse/lib/ajax";
+import deprecated from "discourse-common/lib/deprecated";
 import discourseComputed from "discourse-common/utils/decorators";
 import { emojiUnescape } from "discourse/lib/text";
 import { getOwner } from "discourse-common/lib/get-owner";
@@ -1119,4 +1120,20 @@ User.reopenClass(Singleton, {
   },
 });
 
+if (typeof Discourse !== "undefined") {
+  let warned = false;
+  Object.defineProperty(Discourse, "User", {
+    get() {
+      if (!warned) {
+        deprecated("Import the User class instead of using User", {
+          since: "2.4.0",
+          dropFrom: "2.6.0",
+        });
+        warned = true;
+      }
+      return User;
+    },
+  });
+}
+
 export default User;

GitHub sha: 5c07e544afb46a43f43c754f9216c29a493176ed

This commit appears in #13979 which was approved by Falco. It was merged by eviltrout.