"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ts/components/conversation/TimelineItem.tsx" between
Signal-Desktop-1.35.2.tar.gz and Signal-Desktop-1.36.1.tar.gz

About: Signal-Desktop is a cross-platform encrypted messaging service (also available for mobile devices).

TimelineItem.tsx  (Signal-Desktop-1.35.2):TimelineItem.tsx  (Signal-Desktop-1.36.1)
skipping to change at line 38 skipping to change at line 38
SafetyNumberNotification, SafetyNumberNotification,
} from './SafetyNumberNotification'; } from './SafetyNumberNotification';
import { import {
PropsData as VerificationNotificationProps, PropsData as VerificationNotificationProps,
VerificationNotification, VerificationNotification,
} from './VerificationNotification'; } from './VerificationNotification';
import { import {
GroupNotification, GroupNotification,
PropsData as GroupNotificationProps, PropsData as GroupNotificationProps,
} from './GroupNotification'; } from './GroupNotification';
import {
GroupV2Change,
PropsDataType as GroupV2ChangeProps,
} from './GroupV2Change';
import { SmartContactRendererType } from '../../groupChange';
import { ResetSessionNotification } from './ResetSessionNotification'; import { ResetSessionNotification } from './ResetSessionNotification';
import { import {
ProfileChangeNotification, ProfileChangeNotification,
PropsType as ProfileChangeNotificationPropsType, PropsType as ProfileChangeNotificationPropsType,
} from './ProfileChangeNotification'; } from './ProfileChangeNotification';
type CallHistoryType = { type CallHistoryType = {
type: 'callHistory'; type: 'callHistory';
data: CallingNotificationProps; data: CallingNotificationProps;
}; };
skipping to change at line 76 skipping to change at line 81
data: SafetyNumberNotificationProps; data: SafetyNumberNotificationProps;
}; };
type VerificationNotificationType = { type VerificationNotificationType = {
type: 'verificationNotification'; type: 'verificationNotification';
data: VerificationNotificationProps; data: VerificationNotificationProps;
}; };
type GroupNotificationType = { type GroupNotificationType = {
type: 'groupNotification'; type: 'groupNotification';
data: GroupNotificationProps; data: GroupNotificationProps;
}; };
type GroupV2ChangeType = {
type: 'groupV2Change';
data: GroupV2ChangeProps;
};
type ResetSessionNotificationType = { type ResetSessionNotificationType = {
type: 'resetSessionNotification'; type: 'resetSessionNotification';
data: null; data: null;
}; };
type ProfileChangeNotificationType = { type ProfileChangeNotificationType = {
type: 'profileChange'; type: 'profileChange';
data: ProfileChangeNotificationPropsType; data: ProfileChangeNotificationPropsType;
}; };
export type TimelineItemType = export type TimelineItemType =
| CallHistoryType | CallHistoryType
| GroupNotificationType | GroupNotificationType
| GroupV2ChangeType
| LinkNotificationType | LinkNotificationType
| MessageType | MessageType
| ProfileChangeNotificationType | ProfileChangeNotificationType
| ResetSessionNotificationType | ResetSessionNotificationType
| SafetyNumberNotificationType | SafetyNumberNotificationType
| TimerNotificationType | TimerNotificationType
| UnsupportedMessageType | UnsupportedMessageType
| VerificationNotificationType; | VerificationNotificationType;
type PropsLocalType = { type PropsLocalType = {
conversationId: string; conversationId: string;
conversationAccepted: boolean; conversationAccepted: boolean;
item?: TimelineItemType; item?: TimelineItemType;
id: string; id: string;
isSelected: boolean; isSelected: boolean;
selectMessage: (messageId: string, conversationId: string) => unknown; selectMessage: (messageId: string, conversationId: string) => unknown;
renderContact: SmartContactRendererType;
i18n: LocalizerType; i18n: LocalizerType;
}; };
type PropsActionsType = MessageActionsType & type PropsActionsType = MessageActionsType &
UnsupportedMessageActionsType & UnsupportedMessageActionsType &
SafetyNumberActionsType; SafetyNumberActionsType;
export type PropsType = PropsLocalType & export type PropsType = PropsLocalType &
PropsActionsType & PropsActionsType &
Pick<AllMessageProps, 'renderEmojiPicker'>; Pick<AllMessageProps, 'renderEmojiPicker'>;
export class TimelineItem extends React.PureComponent<PropsType> { export class TimelineItem extends React.PureComponent<PropsType> {
public render() { public render() {
const { const {
conversationId, conversationId,
id, id,
isSelected, isSelected,
item, item,
i18n, i18n,
renderContact,
selectMessage, selectMessage,
} = this.props; } = this.props;
if (!item) { if (!item) {
// tslint:disable-next-line:no-console // tslint:disable-next-line:no-console
console.warn(`TimelineItem: item ${id} provided was falsey`); console.warn(`TimelineItem: item ${id} provided was falsey`);
return null; return null;
} }
skipping to change at line 168 skipping to change at line 180
<SafetyNumberNotification {...this.props} {...item.data} i18n={i18n} /> <SafetyNumberNotification {...this.props} {...item.data} i18n={i18n} />
); );
} else if (item.type === 'verificationNotification') { } else if (item.type === 'verificationNotification') {
notification = ( notification = (
<VerificationNotification {...this.props} {...item.data} i18n={i18n} /> <VerificationNotification {...this.props} {...item.data} i18n={i18n} />
); );
} else if (item.type === 'groupNotification') { } else if (item.type === 'groupNotification') {
notification = ( notification = (
<GroupNotification {...this.props} {...item.data} i18n={i18n} /> <GroupNotification {...this.props} {...item.data} i18n={i18n} />
); );
} else if (item.type === 'groupV2Change') {
notification = (
<GroupV2Change
renderContact={renderContact}
{...item.data}
i18n={i18n}
/>
);
} else if (item.type === 'resetSessionNotification') { } else if (item.type === 'resetSessionNotification') {
notification = ( notification = (
<ResetSessionNotification {...this.props} {...item.data} i18n={i18n} /> <ResetSessionNotification {...this.props} {...item.data} i18n={i18n} />
); );
} else if (item.type === 'profileChange') { } else if (item.type === 'profileChange') {
notification = ( notification = (
<ProfileChangeNotification {...this.props} {...item.data} i18n={i18n} /> <ProfileChangeNotification {...this.props} {...item.data} i18n={i18n} />
); );
} else { } else {
throw new Error('TimelineItem: Unknown type!'); // Weird, yes, but the idea is to get a compile error when we aren't compr
ehensive
// with our if/else checks above, but also log out the type we don't und
erstand if
// we encounter it at runtime.
const unknownItem: never = item;
const asItem = unknownItem as TimelineItemType;
throw new Error(`TimelineItem: Unknown type: ${asItem.type}`);
} }
return ( return (
<InlineNotificationWrapper <InlineNotificationWrapper
id={id} id={id}
conversationId={conversationId} conversationId={conversationId}
isSelected={isSelected} isSelected={isSelected}
selectMessage={selectMessage} selectMessage={selectMessage}
> >
{notification} {notification}
 End of changes. 7 change blocks. 
1 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)