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

This commit is contained in:
Julian Lam
2024-07-10 13:36:30 -04:00
parent fdc0d670d7
commit a81ef60930
17 changed files with 95 additions and 1 deletions

View File

@@ -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",

View File

@@ -132,6 +132,8 @@
"invisible": "Invisible",
"offline": "Offline",
"remote-user": "This user is from outside of this forum",
"email": "Email",
"language": "Language",

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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]]');