Skip to content

Commit

Permalink
[native][web] Stop limiting media encryption to staff community
Browse files Browse the repository at this point in the history
Summary:
We had a check that enabled encrypted media only for staff community. Hardcoded it to enable encryption for all communities.

Depends on D13889

Test Plan: Used my local community for testing. Verified that after this change, multimedia messages are now of type `encrypted-{photo,video}`.

Reviewers: ashoat

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13890
  • Loading branch information
barthap committed Nov 7, 2024
1 parent 30f6d90 commit dc9c299
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions native/input/input-state-container.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
uploadMultimedia,
useBlobServiceUpload,
} from 'lib/actions/upload-actions.js';
import commStaffCommunity from 'lib/facts/comm-staff-community.js';
import {
type SendMultimediaMessagePayload,
useInputStateContainerSendMultimediaMessage,
Expand Down Expand Up @@ -53,7 +52,6 @@ import type { CreationSideEffectsFunc } from 'lib/shared/messages/message-spec.j
import { createRealThreadFromPendingThread } from 'lib/shared/thread-actions-utils.js';
import {
patchThreadInfoToIncludeMentionedMembersOfParent,
threadInfoInsideCommunity,
threadIsPending,
threadIsPendingSidebar,
} from 'lib/shared/thread-utils.js';
Expand Down Expand Up @@ -632,11 +630,9 @@ class InputStateContainer extends React.PureComponent<Props, State> {
}
}

// eslint-disable-next-line no-unused-vars
shouldEncryptMedia(threadInfo: ThreadInfo): boolean {
return (
threadTypeIsThick(threadInfo.type) ||
threadInfoInsideCommunity(threadInfo, commStaffCommunity.id)
);
return true;
}

sendMultimediaMessage = async (
Expand Down
8 changes: 2 additions & 6 deletions web/input/input-state-container.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
useModalContext,
} from 'lib/components/modal-provider.react.js';
import blobService from 'lib/facts/blob-service.js';
import commStaffCommunity from 'lib/facts/comm-staff-community.js';
import {
type SendMultimediaMessagePayload,
useInputStateContainerSendMultimediaMessage,
Expand All @@ -55,7 +54,6 @@ import { createRealThreadFromPendingThread } from 'lib/shared/thread-actions-uti
import {
draftKeyFromThreadID,
patchThreadInfoToIncludeMentionedMembersOfParent,
threadInfoInsideCommunity,
threadIsPending,
threadIsPendingSidebar,
} from 'lib/shared/thread-utils.js';
Expand Down Expand Up @@ -448,11 +446,9 @@ class InputStateContainer extends React.PureComponent<Props, State> {
return rawMessageInfo;
}

// eslint-disable-next-line no-unused-vars
shouldEncryptMedia(threadInfo: ThreadInfo): boolean {
return (
threadTypeIsThick(threadInfo.type) ||
threadInfoInsideCommunity(threadInfo, commStaffCommunity.id)
);
return true;
}

async sendMultimediaMessage(
Expand Down

0 comments on commit dc9c299

Please sign in to comment.