added logbook

This commit is contained in:
PxlLoewe
2025-05-30 19:28:07 -07:00
parent 7822369126
commit eaedd78202
17 changed files with 372 additions and 128 deletions

View File

@@ -8,13 +8,21 @@ export interface PublicUser {
fullName: string;
}
export const getPublicUser = (user: User): PublicUser => {
export const getPublicUser = (
user: User,
options = {
ignorePrivacy: false,
},
): PublicUser => {
return {
firstname: user.firstname,
lastname: user.lastname
.split(" ")
.map((part) => `${part[0]}.`)
.join(" "), // Only take the first part of the name
lastname:
user.settingsHideLastname && !options.ignorePrivacy
? ""
: user.lastname
.split(" ")
.map((part) => `${part[0]}.`)
.join(" "), // Only take the first part of the name
fullName: `${user.firstname} ${user.lastname
.split(" ")
.map((part) => `${part[0]}.`)