1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-12-26 13:38:52 +00:00

Add "canEveryoneAddMembers" add conversation creation time

This commit is contained in:
Pierre HUBERT 2020-04-26 14:25:20 +02:00
parent 40e9733955
commit 9f54670cf1
3 changed files with 7 additions and 3 deletions

View File

@ -41,6 +41,7 @@ export class ConversationsController {
name: name == "false" ? "" : removeHTMLNodes(name),
following: h.postBool("follow"),
members: members,
canEveryoneAddMembers: h.postBool("canEveryoneAddMembers", true),
}
const convID = await ConversationsHelper.Create(conv);
@ -156,7 +157,8 @@ export class ConversationsController {
ownerID: h.getUserId(),
name: "",
following: true,
members: new Set([h.getUserId(), otherUser])
members: new Set([h.getUserId(), otherUser]),
canEveryoneAddMembers: true
});
list.push(convID);

View File

@ -8,7 +8,8 @@ export interface BaseConversation {
ownerID: number,
name: string,
following: boolean,
members: Set<number>
members: Set<number>,
canEveryoneAddMembers: boolean,
}
export interface Conversation extends BaseConversation {

View File

@ -30,7 +30,8 @@ export class ConversationsHelper {
"user_id": conv.ownerID,
"name": conv.name,
"last_active": time(),
"creation_time": time()
"creation_time": time(),
"can_everyone_add_members": conv.canEveryoneAddMembers ? 1 : 0
});
// Add the members to the conversation