From 7aa258627f29477895cdf10c563815d820db024e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 25 Apr 2020 18:02:08 +0200 Subject: [PATCH] Add new conversation parameter --- src/controllers/ConversationsController.ts | 1 + src/entities/Conversation.ts | 1 + src/helpers/ConversationsHelper.ts | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/ConversationsController.ts b/src/controllers/ConversationsController.ts index 66377ba..07b41bd 100644 --- a/src/controllers/ConversationsController.ts +++ b/src/controllers/ConversationsController.ts @@ -372,6 +372,7 @@ export class ConversationsController { following: c.following ? 1 : 0, saw_last_message: c.sawLastMessage ? 1 : 0, members: [...c.members], + canEveryoneAddMembers: c.canEveryoneAddMembers, can_have_call: CallsHelper.CanHaveCall(c), can_have_video_call: CallsHelper.CanHaveVideoCAll(c), has_call_now: CallsController.IsHavingCall(c.id) diff --git a/src/entities/Conversation.ts b/src/entities/Conversation.ts index 9ecec92..287c4c1 100644 --- a/src/entities/Conversation.ts +++ b/src/entities/Conversation.ts @@ -16,4 +16,5 @@ export interface Conversation extends BaseConversation { lastActive: number, timeCreate: number, sawLastMessage: boolean, + canEveryoneAddMembers: boolean, } \ No newline at end of file diff --git a/src/helpers/ConversationsHelper.ts b/src/helpers/ConversationsHelper.ts index e2f19fa..623fc09 100644 --- a/src/helpers/ConversationsHelper.ts +++ b/src/helpers/ConversationsHelper.ts @@ -747,7 +747,8 @@ export class ConversationsHelper { timeCreate: row.time_add, following: row.following, sawLastMessage: row.saw_last_message == 1, - members: await this.GetConversationMembers(row.id) + members: await this.GetConversationMembers(row.id), + canEveryoneAddMembers: row.can_everyone_add_members == 1, } }