Skip to content

Node.js based forum software built for the modern web

feat: icon replacing user status for remote users, denoting that they are from outside the local instance, #12688

Julian Lama81ef609302b
diff --git a/install/package.json b/install/package.json
index 71f51b8bc2..e90227f0ef 100644
--- a/install/package.json
+++ b/install/package.json
@@ -105,7 +105,7 @@
"nodebb-plugin-ntfy": "1.7.4",
"nodebb-plugin-spam-be-gone": "2.2.2",
"nodebb-rewards-essentials": "1.0.0",
- "nodebb-theme-harmony": "2.0.0-pre.30",
+ "nodebb-theme-harmony": "2.0.0-pre.31",
"nodebb-theme-lavender": "7.1.8",
"nodebb-theme-peace": "2.2.6",
"nodebb-theme-persona": "13.3.24",
diff --git a/public/language/en-GB/global.json b/public/language/en-GB/global.json
index c947bb92ae..4ca7816332 100644
--- a/public/language/en-GB/global.json
+++ b/public/language/en-GB/global.json
@@ -132,6 +132,8 @@
"invisible": "Invisible",
"offline": "Offline",
+ "remote-user": "This user is from outside of this forum",
+
"email": "Email",
"language": "Language",
diff --git a/public/openapi/components/schemas/Chats.yaml b/public/openapi/components/schemas/Chats.yaml
index 8dc6349a6d..dc84aca4ef 100644
--- a/public/openapi/components/schemas/Chats.yaml
+++ b/public/openapi/components/schemas/Chats.yaml
@@ -61,6 +61,9 @@ MessageObject:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -122,6 +125,9 @@ RoomUserList:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
diff --git a/public/openapi/components/schemas/FlagObject.yaml b/public/openapi/components/schemas/FlagObject.yaml
index 7c488198d3..38e27e8f9e 100644
--- a/public/openapi/components/schemas/FlagObject.yaml
+++ b/public/openapi/components/schemas/FlagObject.yaml
@@ -58,6 +58,9 @@ FlagObject:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
@@ -122,6 +125,9 @@ FlagHistoryObject:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
@@ -175,6 +181,9 @@ FlagNotesObject:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
diff --git a/public/openapi/components/schemas/PostObject.yaml b/public/openapi/components/schemas/PostObject.yaml
index 914ca40837..fec938e820 100644
--- a/public/openapi/components/schemas/PostObject.yaml
+++ b/public/openapi/components/schemas/PostObject.yaml
@@ -40,6 +40,9 @@ PostObject:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
diff --git a/public/openapi/components/schemas/TopicObject.yaml b/public/openapi/components/schemas/TopicObject.yaml
index ee34558ffc..3789aa9518 100644
--- a/public/openapi/components/schemas/TopicObject.yaml
+++ b/public/openapi/components/schemas/TopicObject.yaml
@@ -35,6 +35,9 @@ TopicObject:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
diff --git a/public/openapi/components/schemas/UserObject.yaml b/public/openapi/components/schemas/UserObject.yaml
index 820e77c0a2..e78c106365 100644
--- a/public/openapi/components/schemas/UserObject.yaml
+++ b/public/openapi/components/schemas/UserObject.yaml
@@ -5,6 +5,9 @@ UserObject:
type: number
description: A user identifier
example: 1
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -209,6 +212,9 @@ UserObjectFull:
type: number
description: A user identifier
example: 1
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -540,6 +546,9 @@ UserObjectSlim:
type: number
description: A user identifier
example: 1
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -628,6 +637,9 @@ UserObjectACP:
type: number
description: A user identifier
example: 1
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
diff --git a/public/openapi/read/admin/manage/digest.yaml b/public/openapi/read/admin/manage/digest.yaml
index f094a3f7b6..34010e8152 100644
--- a/public/openapi/read/admin/manage/digest.yaml
+++ b/public/openapi/read/admin/manage/digest.yaml
@@ -45,6 +45,9 @@ get:
type: string
setting:
type: boolean
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
default:
type: string
required:
diff --git a/public/openapi/read/categories.yaml b/public/openapi/read/categories.yaml
index f1126e9dfb..37c0c09d31 100644
--- a/public/openapi/read/categories.yaml
+++ b/public/openapi/read/categories.yaml
@@ -151,6 +151,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -220,6 +223,9 @@ get:
uid:
type: number
example: 1
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
example: Dragon Fruit
diff --git a/public/openapi/read/index.yaml b/public/openapi/read/index.yaml
index a984fb35dc..f6c09d7c21 100644
--- a/public/openapi/read/index.yaml
+++ b/public/openapi/read/index.yaml
@@ -178,6 +178,9 @@ get:
`icon:text` for the user's
auto-generated icon
example: "#f44336"
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
index:
type: number
cid:
@@ -242,6 +245,9 @@ get:
'icon:bgColor':
type: string
example: '#9c27b0'
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
imageClass:
type: string
- $ref: ../components/schemas/Pagination.yaml#/Pagination
diff --git a/public/openapi/read/notifications.yaml b/public/openapi/read/notifications.yaml
index 14c0d054ce..015b6fae33 100644
--- a/public/openapi/read/notifications.yaml
+++ b/public/openapi/read/notifications.yaml
@@ -49,6 +49,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
diff --git a/public/openapi/read/topic/topic_id.yaml b/public/openapi/read/topic/topic_id.yaml
index 3c04bf5b08..a4fb127d59 100644
--- a/public/openapi/read/topic/topic_id.yaml
+++ b/public/openapi/read/topic/topic_id.yaml
@@ -90,6 +90,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -428,6 +431,9 @@ get:
type: string
displayname:
type: string
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
- type: object
description: Optional properties that may or may not be present (except for `tid`, which is always present, and is only here as a hack to pass validation)
properties:
diff --git a/public/openapi/read/unread.yaml b/public/openapi/read/unread.yaml
index 307a85b3b6..e916231d65 100644
--- a/public/openapi/read/unread.yaml
+++ b/public/openapi/read/unread.yaml
@@ -66,6 +66,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
diff --git a/public/openapi/read/user/userslug/chats/roomid.yaml b/public/openapi/read/user/userslug/chats/roomid.yaml
index bd0ae278fd..51788d3150 100644
--- a/public/openapi/read/user/userslug/chats/roomid.yaml
+++ b/public/openapi/read/user/userslug/chats/roomid.yaml
@@ -90,6 +90,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -141,6 +144,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -213,6 +219,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -268,6 +277,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -306,6 +318,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -366,6 +381,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -419,6 +437,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
@@ -457,6 +478,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
diff --git a/public/openapi/read/users.yaml b/public/openapi/read/users.yaml
index 160aa927d0..7fb7e7011c 100644
--- a/public/openapi/read/users.yaml
+++ b/public/openapi/read/users.yaml
@@ -35,6 +35,9 @@ get:
uid:
type: number
description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
diff --git a/public/openapi/write/categories/cid/moderator/uid.yaml b/public/openapi/write/categories/cid/moderator/uid.yaml
index 3cbcd4951b..78ca52ca96 100644
--- a/public/openapi/write/categories/cid/moderator/uid.yaml
+++ b/public/openapi/write/categories/cid/moderator/uid.yaml
@@ -64,6 +64,9 @@ put:
type: number
description: A user identifier
example: 1
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
username:
type: string
description: A friendly name for a given user account
diff --git a/src/user/data.js b/src/user/data.js
index 162a65317f..6ce3df70e3 100644
--- a/src/user/data.js
+++ b/src/user/data.js
@@ -285,6 +285,8 @@ module.exports = function (User) {
user.banned = false;
}
}
+
+ user.isLocal = utils.isNumber(user.uid);
});
if (unbanUids.length) {
await User.bans.unban(unbanUids, '[[user:info.ban-expired]]');