Support for new GroupV2 groups
This commit is contained in:
parent
1ce0959fa1
commit
7a02cc815d
53 changed files with 7326 additions and 839 deletions
|
@ -10,6 +10,7 @@ import { redactAll } from '../../js/modules/privacy';
|
|||
import { remove as removeUserConfig } from '../../app/user_config';
|
||||
import { combineNames } from '../util/combineNames';
|
||||
|
||||
import { GroupV2MemberType } from '../model-types.d';
|
||||
import { LocaleMessagesType } from '../types/I18N';
|
||||
|
||||
import pify from 'pify';
|
||||
|
@ -2070,6 +2071,7 @@ async function saveConversation(
|
|||
groupId,
|
||||
id,
|
||||
members,
|
||||
membersV2,
|
||||
name,
|
||||
profileFamilyName,
|
||||
profileName,
|
||||
|
@ -2077,6 +2079,13 @@ async function saveConversation(
|
|||
uuid,
|
||||
} = data;
|
||||
|
||||
// prettier-ignore
|
||||
const membersList = membersV2
|
||||
? membersV2.map((item: GroupV2MemberType) => item.conversationId).join(' ')
|
||||
: members
|
||||
? members.join(' ')
|
||||
: null;
|
||||
|
||||
await instance.run(
|
||||
`INSERT INTO conversations (
|
||||
id,
|
||||
|
@ -2119,7 +2128,7 @@ async function saveConversation(
|
|||
|
||||
$active_at: active_at,
|
||||
$type: type,
|
||||
$members: members ? members.join(' ') : null,
|
||||
$members: membersList,
|
||||
$name: name,
|
||||
$profileName: profileName,
|
||||
$profileFamilyName: profileFamilyName,
|
||||
|
@ -2156,6 +2165,7 @@ async function updateConversation(data: ConversationType) {
|
|||
active_at,
|
||||
type,
|
||||
members,
|
||||
membersV2,
|
||||
name,
|
||||
profileName,
|
||||
profileFamilyName,
|
||||
|
@ -2163,6 +2173,13 @@ async function updateConversation(data: ConversationType) {
|
|||
uuid,
|
||||
} = data;
|
||||
|
||||
// prettier-ignore
|
||||
const membersList = membersV2
|
||||
? membersV2.map((item: GroupV2MemberType) => item.conversationId).join(' ')
|
||||
: members
|
||||
? members.join(' ')
|
||||
: null;
|
||||
|
||||
await db.run(
|
||||
`UPDATE conversations SET
|
||||
json = $json,
|
||||
|
@ -2187,7 +2204,7 @@ async function updateConversation(data: ConversationType) {
|
|||
|
||||
$active_at: active_at,
|
||||
$type: type,
|
||||
$members: members ? members.join(' ') : null,
|
||||
$members: membersList,
|
||||
$name: name,
|
||||
$profileName: profileName,
|
||||
$profileFamilyName: profileFamilyName,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue