Add type for ConversationModel#getGroupV1Info
This commit is contained in:
parent
d5d808651a
commit
52328c2634
2 changed files with 12 additions and 6 deletions
|
@ -15,7 +15,10 @@ import {
|
|||
import { AttachmentType } from '../types/Attachment';
|
||||
import { CallMode, CallHistoryDetailsType } from '../types/Calling';
|
||||
import * as Stickers from '../types/Stickers';
|
||||
import { GroupV2InfoType } from '../textsecure/SendMessage';
|
||||
import type {
|
||||
GroupV1InfoType,
|
||||
GroupV2InfoType,
|
||||
} from '../textsecure/SendMessage';
|
||||
import createTaskWithTimeout from '../textsecure/TaskWithTimeout';
|
||||
import { CallbackResultType } from '../textsecure/Types.d';
|
||||
import { ConversationType } from '../state/ducks/conversations';
|
||||
|
@ -1134,17 +1137,20 @@ export class ConversationModel extends window.Backbone
|
|||
};
|
||||
}
|
||||
|
||||
getGroupV1Info(): WhatIsThis {
|
||||
getGroupV1Info(): GroupV1InfoType | undefined {
|
||||
const groupId = this.get('groupId');
|
||||
const groupVersion = this.get('groupVersion');
|
||||
|
||||
if (
|
||||
isDirectConversation(this.attributes) ||
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
this.get('groupVersion')! > 0
|
||||
!groupId ||
|
||||
(groupVersion && groupVersion > 0)
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
id: this.get('groupId'),
|
||||
id: groupId,
|
||||
members: this.getRecipients(),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ export type GroupV2InfoType = {
|
|||
revision: number;
|
||||
members: Array<string>;
|
||||
};
|
||||
type GroupV1InfoType = {
|
||||
export type GroupV1InfoType = {
|
||||
id: string;
|
||||
members: Array<string>;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue