mobilizon.chapril.org-mobil.../js/src/types/actor/person.model.ts
Thomas Citharel 7c11807c14
Allow to join an open group
Also:

* Refactor interacting with a remote event so that you can interact with
  a remote group as well
* Add a setting for group admins to pick between an open and invite-only
  group
* Fix new groups without posts/todos/resources/events/conversations URL
  set
* Repair local groups that haven't got their
  posts/todos/resources/events/conversations URL set
* Add a scheduled job to refresh remote groups every hour
* Add a user setting to pick when to receive notifications when there's
  new members to approve (will be used when this feature is available)
* Fix pagination for members

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-11-06 15:19:36 +01:00

43 lines
994 B
TypeScript

import { ICurrentUser } from "../current-user.model";
import { IEvent } from "../event.model";
import { Actor, IActor } from "./actor.model";
import { Paginate } from "../paginate";
import { IMember } from "./group.model";
import { IParticipant } from "../participant.model";
export interface IFeedToken {
token: string;
actor?: IPerson;
user: ICurrentUser;
}
export interface IPerson extends IActor {
feedTokens: IFeedToken[];
goingToEvents: IEvent[];
participations: Paginate<IParticipant>;
memberships: Paginate<IMember>;
user?: ICurrentUser;
}
export class Person extends Actor implements IPerson {
feedTokens: IFeedToken[] = [];
goingToEvents: IEvent[] = [];
participations!: Paginate<IParticipant>;
memberships!: Paginate<IMember>;
user!: ICurrentUser;
constructor(hash: IPerson | Record<string, unknown> = {}) {
super(hash);
this.patch(hash);
}
patch(hash: IPerson | Record<string, unknown>): void {
Object.assign(this, hash);
}
}