Introduce basic user and profile management
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -66,3 +66,10 @@ export function usernameWithDomain(actor: IActor): string {
|
||||
}
|
||||
return actor.preferredUsername;
|
||||
}
|
||||
|
||||
export function displayNameAndUsername(actor: IActor): string {
|
||||
if (actor.name) {
|
||||
return `${actor.name} (@${usernameWithDomain(actor)})`;
|
||||
}
|
||||
return usernameWithDomain(actor);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ export interface IPerson extends IActor {
|
||||
goingToEvents: IEvent[];
|
||||
participations: IParticipant[];
|
||||
memberships: Paginate<IMember>;
|
||||
user?: ICurrentUser;
|
||||
}
|
||||
|
||||
export class Person extends Actor implements IPerson {
|
||||
@@ -26,6 +27,8 @@ export class Person extends Actor implements IPerson {
|
||||
|
||||
memberships!: Paginate<IMember>;
|
||||
|
||||
user!: ICurrentUser;
|
||||
|
||||
constructor(hash: IPerson | {} = {}) {
|
||||
super(hash);
|
||||
|
||||
|
||||
@@ -19,6 +19,14 @@ export interface ICurrentUser {
|
||||
settings: IUserSettings;
|
||||
}
|
||||
|
||||
export interface IUser extends ICurrentUser {
|
||||
confirmedAt: Date;
|
||||
confirmationSendAt: Date;
|
||||
locale: String;
|
||||
actors: IPerson[];
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
export enum INotificationPendingParticipationEnum {
|
||||
NONE = "NONE",
|
||||
DIRECT = "DIRECT",
|
||||
|
||||
@@ -39,11 +39,13 @@ export enum ActionLogAction {
|
||||
REPORT_UPDATE_RESOLVED = "REPORT_UPDATE_RESOLVED",
|
||||
EVENT_DELETION = "EVENT_DELETION",
|
||||
COMMENT_DELETION = "COMMENT_DELETION",
|
||||
ACTOR_SUSPENSION = "ACTOR_SUSPENSION",
|
||||
ACTOR_UNSUSPENSION = "ACTOR_UNSUSPENSION",
|
||||
}
|
||||
|
||||
export interface IActionLog {
|
||||
id: string;
|
||||
object: IReport | IReportNote | IEvent;
|
||||
object: IReport | IReportNote | IEvent | IComment | IActor;
|
||||
actor: IActor;
|
||||
action: ActionLogAction;
|
||||
insertedAt: Date;
|
||||
|
||||
Reference in New Issue
Block a user