Lets users send stories to groups

This commit is contained in:
Josh Perez 2022-08-10 14:37:19 -04:00 committed by GitHub
parent d4b74db05c
commit ccc89545c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1177 additions and 400 deletions

View file

@ -195,6 +195,7 @@ export type ConversationType = {
groupVersion?: 1 | 2;
groupId?: string;
groupLink?: string;
isGroupStorySendReady?: boolean;
messageRequestsEnabled?: boolean;
acceptedMessageRequest: boolean;
secretParams?: string;
@ -852,6 +853,7 @@ export const actions = {
showConversation,
startComposing,
startSettingGroupMetadata,
tagGroupsAsNewGroupStory,
toggleAdmin,
toggleConversationInChooseMembers,
toggleComposeEditingAvatar,
@ -1953,6 +1955,29 @@ function removeMemberFromGroup(
};
}
function tagGroupsAsNewGroupStory(
conversationIds: Array<string>
): ThunkAction<void, RootStateType, unknown, NoopActionType> {
return async dispatch => {
await Promise.all(
conversationIds.map(async conversationId => {
const conversation = window.ConversationController.get(conversationId);
if (!conversation) {
return;
}
conversation.set({ isGroupStorySendReady: true });
await window.Signal.Data.updateConversation(conversation.attributes);
})
);
dispatch({
type: 'NOOP',
payload: null,
});
};
}
function toggleAdmin(
conversationId: string,
contactId: string