1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +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), name: name == "false" ? "" : removeHTMLNodes(name),
following: h.postBool("follow"), following: h.postBool("follow"),
members: members, members: members,
canEveryoneAddMembers: h.postBool("canEveryoneAddMembers", true),
} }
const convID = await ConversationsHelper.Create(conv); const convID = await ConversationsHelper.Create(conv);
@ -156,7 +157,8 @@ export class ConversationsController {
ownerID: h.getUserId(), ownerID: h.getUserId(),
name: "", name: "",
following: true, following: true,
members: new Set([h.getUserId(), otherUser]) members: new Set([h.getUserId(), otherUser]),
canEveryoneAddMembers: true
}); });
list.push(convID); list.push(convID);

View File

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

View File

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