blob: dab9dd08942c682eb876f5718525aa8bfa137d37 [file] [log] [blame]
simon26e79f72022-10-05 22:16:08 -04001/*
2 * Copyright (C) 2022 Savoir-faire Linux Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public
15 * License along with this program. If not, see
16 * <https://www.gnu.org/licenses/>.
17 */
Misha Krieger-Raynauldcfa44302022-11-30 18:36:36 -050018import { IContact } from './contact';
19
Misha Krieger-Raynauldcfa44302022-11-30 18:36:36 -050020export interface IConversationMember {
21 role?: ConversationMemberRole;
22 contact: IContact;
23}
24
25export type ConversationMemberRole = 'admin' | 'member' | 'invited' | 'banned' | 'left';
26
Misha Krieger-Raynauld6bbdacf2022-11-29 21:45:40 -050027export interface Message {
28 id: string;
29 author: string;
30 timestamp: string;
31 type:
32 | 'application/call-history+json'
33 | 'application/data-transfer+json'
34 | 'application/update-profile'
35 | 'initial'
36 | 'member'
37 | 'merge'
38 | 'text/plain'
39 | 'vote';
40 linearizedParent: string;
41 parents: string;
42 body?: string;
43 duration?: string;
44 to?: string;
45 invited?: string;
simon06527b02022-10-01 15:01:47 -040046}
Misha Krieger-Raynauldcfa44302022-11-30 18:36:36 -050047
48export interface ConversationInfos {
idillon07d31cc2022-12-06 22:40:14 -050049 avatar?: string;
50 description?: string;
Misha Krieger-Raynauldcfa44302022-11-30 18:36:36 -050051 mode?: string;
52 title?: string;
53}
54
55export interface NewConversationRequestBody {
56 members: string[];
57}
58
59export interface NewMessageRequestBody {
60 message: string;
61}
idillon07d31cc2022-12-06 22:40:14 -050062
63export interface IConversationSummary {
64 id: string;
65 avatar: ConversationInfos['avatar'];
66 title: ConversationInfos['title'];
67 membersNames: string[];
68 lastMessage: Message;
69}