Fix rendering of group joins and remove checkServiceIdEquivalence

This commit is contained in:
Scott Nonnenberg 2024-05-03 07:28:36 -07:00 committed by GitHub
parent 214fae0c6e
commit a1f0afdae8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 108 additions and 65 deletions

View file

@ -50,13 +50,6 @@ const renderContact: SmartContactRendererType<JSX.Element> = (
</React.Fragment>
);
function checkServiceIdEquivalence(
left: ServiceIdString | undefined,
right: ServiceIdString | undefined
): boolean {
return Boolean(left && right && contactMap[left] === contactMap[right]);
}
const renderChange = (
change: GroupV2ChangeType,
{
@ -79,7 +72,6 @@ const renderChange = (
blockGroupLinkRequests={action('blockGroupLinkRequests')}
conversationId="some-conversation-id"
change={change}
checkServiceIdEquivalence={checkServiceIdEquivalence}
groupBannedMemberships={groupBannedMemberships}
groupMemberships={groupMemberships}
groupName={groupName}
@ -615,7 +607,39 @@ export function MemberAddFromInvited(): JSX.Element {
},
],
})}
ACI accepts PNI invite:
ACI accepts PNI invite (X joined the group)
{renderChange({
from: OUR_PNI,
details: [
{
type: 'member-add-from-invite',
aci: OUR_ACI,
pni: OUR_PNI,
inviter: CONTACT_B,
},
],
})}
{renderChange({
from: OUR_PNI,
details: [
{
type: 'member-add-from-invite',
aci: OUR_ACI,
pni: OUR_PNI,
},
],
})}
{renderChange({
from: CONTACT_A_PNI,
details: [
{
type: 'member-add-from-invite',
aci: CONTACT_A,
pni: CONTACT_A_PNI,
},
],
})}
ACI accepts PNI invite, the old way (X added X to group)
{renderChange({
from: OUR_PNI,
details: [

View file

@ -49,10 +49,6 @@ export type PropsActionsType = {
};
export type PropsHousekeepingType = {
checkServiceIdEquivalence(
left: ServiceIdString | undefined,
right: ServiceIdString | undefined
): boolean;
i18n: LocalizerType;
renderContact: SmartContactRendererType<JSX.Element>;
};
@ -297,7 +293,6 @@ export function GroupV2Change(props: PropsType): ReactElement {
areWeAdmin,
blockGroupLinkRequests,
change,
checkServiceIdEquivalence,
conversationId,
groupBannedMemberships,
groupMemberships,
@ -311,7 +306,6 @@ export function GroupV2Change(props: PropsType): ReactElement {
return (
<>
{renderChange<JSX.Element>(change, {
checkServiceIdEquivalence,
i18n,
ourAci,
ourPni,

View file

@ -361,7 +361,6 @@ const renderItem = ({
isNextItemCallingNotification={false}
theme={ThemeType.light}
platform="darwin"
checkServiceIdEquivalence={() => false}
containerElementRef={containerElementRef}
containerWidthBreakpoint={containerWidthBreakpoint}
conversationId=""

View file

@ -69,7 +69,6 @@ const getDefaultProps = () => ({
toggleSelectMessage: action('toggleSelectMessage'),
reactToMessage: action('reactToMessage'),
checkForAccount: action('checkForAccount'),
checkServiceIdEquivalence: () => false,
clearTargetedMessage: action('clearTargetedMessage'),
setMessageToEdit: action('setMessageToEdit'),
setQuoteByMessageId: action('setQuoteByMessageId'),

View file

@ -61,7 +61,6 @@ import {
type MessageRequestResponseNotificationData,
} from './MessageRequestResponseNotification';
import type { MessageRequestState } from './MessageRequestActionsConfirmation';
import type { ServiceIdString } from '../../types/ServiceId';
type CallHistoryType = {
type: 'callHistory';
@ -173,10 +172,6 @@ export type TimelineItemType = (
) & { timestamp: number };
type PropsLocalType = {
checkServiceIdEquivalence(
left: ServiceIdString | undefined,
right: ServiceIdString | undefined
): boolean;
containerElementRef: RefObject<HTMLElement>;
conversationId: string;
item?: TimelineItemType;