Skip to content

Commit b3fcb61

Browse files
committed
fix: change deliveredBy to deliveredToCount
1 parent 1ff8033 commit b3fcb61

File tree

10 files changed

+132
-138
lines changed

10 files changed

+132
-138
lines changed

examples/SampleApp/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import './src/utils/bootstrapBackgroundMessageHandler';
12
import 'react-native-gesture-handler';
23
import { AppRegistry } from 'react-native';
34
import { enableScreens } from 'react-native-screens';
4-
import './src/utils/bootstrapBackgroundMessageHandler';
55

66
import App from './App';
77
import { name as appName } from './app.json';

examples/SampleApp/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3458,7 +3458,7 @@ SPEC CHECKSUMS:
34583458
op-sqlite: a7e46cfdaebeef219fd0e939332967af9fe6d406
34593459
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
34603460
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
3461-
RCT-Folly: 59ec0ac1f2f39672a0c6e6cecdd39383b764646f
3461+
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
34623462
RCTDeprecation: 300c5eb91114d4339b0bb39505d0f4824d7299b7
34633463
RCTRequired: e0446b01093475b7082fbeee5d1ef4ad1fe20ac4
34643464
RCTTypeSafety: cb974efcdc6695deedf7bf1eb942f2a0603a063f
Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,53 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>CFBundleDevelopmentRegion</key>
6-
<string>en</string>
7-
<key>CFBundleExecutable</key>
8-
<string>$(EXECUTABLE_NAME)</string>
9-
<key>CFBundleIdentifier</key>
10-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11-
<key>CFBundleInfoDictionaryVersion</key>
12-
<string>6.0</string>
13-
<key>CFBundleName</key>
14-
<string>$(PRODUCT_NAME)</string>
15-
<key>CFBundlePackageType</key>
16-
<string>APPL</string>
17-
<key>CFBundleShortVersionString</key>
18-
<string>0.0.22</string>
19-
<key>CFBundleSignature</key>
20-
<string>????</string>
21-
<key>CFBundleVersion</key>
22-
<string>28</string>
23-
<key>LSRequiresIPhoneOS</key>
24-
<true/>
25-
<key>NSAppTransportSecurity</key>
264
<dict>
27-
<key>NSExceptionDomains</key>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>0.0.22</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>28</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true />
25+
<key>NSAppTransportSecurity</key>
2826
<dict>
29-
<key>localhost</key>
27+
<key>NSExceptionDomains</key>
3028
<dict>
31-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
32-
<true/>
29+
<key>localhost</key>
30+
<dict>
31+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
32+
<true />
33+
</dict>
3334
</dict>
3435
</dict>
36+
<key>NSLocationWhenInUseUsageDescription</key>
37+
<string></string>
38+
<key>UILaunchStoryboardName</key>
39+
<string>LaunchScreen</string>
40+
<key>UIRequiredDeviceCapabilities</key>
41+
<array>
42+
<string>armv7</string>
43+
</array>
44+
<key>UISupportedInterfaceOrientations</key>
45+
<array>
46+
<string>UIInterfaceOrientationPortrait</string>
47+
<string>UIInterfaceOrientationLandscapeLeft</string>
48+
<string>UIInterfaceOrientationLandscapeRight</string>
49+
</array>
50+
<key>UIViewControllerBasedStatusBarAppearance</key>
51+
<false />
3552
</dict>
36-
<key>NSLocationWhenInUseUsageDescription</key>
37-
<string></string>
38-
<key>RCTNewArchEnabled</key>
39-
<true/>
40-
<key>UILaunchStoryboardName</key>
41-
<string>LaunchScreen</string>
42-
<key>UIRequiredDeviceCapabilities</key>
43-
<array>
44-
<string>armv7</string>
45-
</array>
46-
<key>UISupportedInterfaceOrientations</key>
47-
<array>
48-
<string>UIInterfaceOrientationPortrait</string>
49-
<string>UIInterfaceOrientationLandscapeLeft</string>
50-
<string>UIInterfaceOrientationLandscapeRight</string>
51-
</array>
52-
<key>UIViewControllerBasedStatusBarAppearance</key>
53-
<false/>
54-
</dict>
55-
</plist>
53+
</plist>
Lines changed: 57 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,62 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>CFBundleDevelopmentRegion</key>
6-
<string>en</string>
7-
<key>CFBundleDisplayName</key>
8-
<string>ChatSample</string>
9-
<key>CFBundleExecutable</key>
10-
<string>$(EXECUTABLE_NAME)</string>
11-
<key>CFBundleIdentifier</key>
12-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13-
<key>CFBundleInfoDictionaryVersion</key>
14-
<string>6.0</string>
15-
<key>CFBundleName</key>
16-
<string>$(PRODUCT_NAME)</string>
17-
<key>CFBundlePackageType</key>
18-
<string>APPL</string>
19-
<key>CFBundleShortVersionString</key>
20-
<string>1.11.0</string>
21-
<key>CFBundleSignature</key>
22-
<string>????</string>
23-
<key>CFBundleVersion</key>
24-
<string>154</string>
25-
<key>FirebaseAppDelegateProxyEnabled</key>
26-
<true/>
27-
<key>ITSAppUsesNonExemptEncryption</key>
28-
<false/>
29-
<key>LSRequiresIPhoneOS</key>
30-
<true/>
31-
<key>NSAppTransportSecurity</key>
324
<dict>
33-
<key>NSAllowsArbitraryLoads</key>
34-
<false/>
35-
<key>NSAllowsLocalNetworking</key>
36-
<true/>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>ChatSample</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.11.0</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>CFBundleVersion</key>
24+
<string>154</string>
25+
<key>FirebaseAppDelegateProxyEnabled</key>
26+
<true />
27+
<key>ITSAppUsesNonExemptEncryption</key>
28+
<false />
29+
<key>LSRequiresIPhoneOS</key>
30+
<true />
31+
<key>NSAppTransportSecurity</key>
32+
<dict>
33+
<key>NSAllowsArbitraryLoads</key>
34+
<false />
35+
<key>NSAllowsLocalNetworking</key>
36+
<true />
37+
</dict>
38+
<key>NSCameraUsageDescription</key>
39+
<string>$(PRODUCT_NAME) would like to use your camera to share image in a message.</string>
40+
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
41+
<string>$(PRODUCT_NAME) would like share live location always in a message.</string>
42+
<key>NSLocationWhenInUseUsageDescription</key>
43+
<string>$(PRODUCT_NAME) would like share live location when in use in a message.</string>
44+
<key>NSMicrophoneUsageDescription</key>
45+
<string>$(PRODUCT_NAME) would like to use your microphone for voice recording.</string>
46+
<key>NSPhotoLibraryUsageDescription</key>
47+
<string>$(PRODUCT_NAME) would like access to your photo gallery to share image in a message.</string>
48+
<key>UILaunchStoryboardName</key>
49+
<string>LaunchScreen</string>
50+
<key>UIRequiredDeviceCapabilities</key>
51+
<array>
52+
<string>arm64</string>
53+
</array>
54+
<key>UISupportedInterfaceOrientations</key>
55+
<array>
56+
<string>UIInterfaceOrientationPortrait</string>
57+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
58+
</array>
59+
<key>UIViewControllerBasedStatusBarAppearance</key>
60+
<false />
3761
</dict>
38-
<key>NSCameraUsageDescription</key>
39-
<string>$(PRODUCT_NAME) would like to use your camera to share image in a message.</string>
40-
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
41-
<string>$(PRODUCT_NAME) would like share live location always in a message.</string>
42-
<key>NSLocationWhenInUseUsageDescription</key>
43-
<string>$(PRODUCT_NAME) would like share live location when in use in a message.</string>
44-
<key>NSMicrophoneUsageDescription</key>
45-
<string>$(PRODUCT_NAME) would like to use your microphone for voice recording.</string>
46-
<key>NSPhotoLibraryUsageDescription</key>
47-
<string>$(PRODUCT_NAME) would like access to your photo gallery to share image in a message.</string>
48-
<key>RCTNewArchEnabled</key>
49-
<true/>
50-
<key>UIBackgroundModes</key>
51-
<array>
52-
<string>fetch</string>
53-
<string>remote-notification</string>
54-
</array>
55-
<key>UILaunchStoryboardName</key>
56-
<string>LaunchScreen</string>
57-
<key>UIRequiredDeviceCapabilities</key>
58-
<array>
59-
<string>arm64</string>
60-
</array>
61-
<key>UISupportedInterfaceOrientations</key>
62-
<array>
63-
<string>UIInterfaceOrientationPortrait</string>
64-
<string>UIInterfaceOrientationPortraitUpsideDown</string>
65-
</array>
66-
<key>UIViewControllerBasedStatusBarAppearance</key>
67-
<false/>
68-
</dict>
69-
</plist>
62+
</plist>

package/src/components/Message/Message.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ export type MessagePropsWithContext = Pick<
147147
| 'handleReaction'
148148
| 'message'
149149
| 'isMessageAIGenerated'
150-
| 'deliveredBy'
150+
| 'deliveredToCount'
151151
| 'readBy'
152152
>
153153
> &
154154
Pick<
155155
MessageContextValue,
156-
'groupStyles' | 'message' | 'isMessageAIGenerated' | 'readBy' | 'deliveredBy'
156+
'groupStyles' | 'message' | 'isMessageAIGenerated' | 'readBy' | 'deliveredToCount'
157157
> &
158158
Pick<
159159
MessagesContextValue,
@@ -228,7 +228,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
228228
chatContext,
229229
deleteMessage: deleteMessageFromContext,
230230
deleteReaction,
231-
deliveredBy,
231+
deliveredToCount,
232232
dismissKeyboard,
233233
dismissKeyboardOnMessageTouch,
234234
enableLongPress = true,
@@ -627,7 +627,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
627627
actionsEnabled,
628628
alignment,
629629
channel,
630-
deliveredBy,
630+
deliveredToCount,
631631
dismissOverlay,
632632
files: attachments.files,
633633
goToMessage,
@@ -769,7 +769,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
769769
const areEqual = (prevProps: MessagePropsWithContext, nextProps: MessagePropsWithContext) => {
770770
const {
771771
chatContext: { mutedUsers: prevMutedUsers },
772-
deliveredBy: prevDeliveredBy,
772+
deliveredToCount: prevDeliveredBy,
773773
goToMessage: prevGoToMessage,
774774
groupStyles: prevGroupStyles,
775775
isAttachmentEqual,
@@ -784,7 +784,7 @@ const areEqual = (prevProps: MessagePropsWithContext, nextProps: MessagePropsWit
784784
} = prevProps;
785785
const {
786786
chatContext: { mutedUsers: nextMutedUsers },
787-
deliveredBy: nextDeliveredBy,
787+
deliveredToCount: nextDeliveredBy,
788788
goToMessage: nextGoToMessage,
789789
groupStyles: nextGroupStyles,
790790
isTargetedMessage: nextIsTargetedMessage,
@@ -973,7 +973,7 @@ export const Message = (props: MessageProps) => {
973973
const { openThread } = useThreadContext();
974974
const { t } = useTranslationContext();
975975
const readBy = useMessageReadData({ message });
976-
const deliveredBy = useMessageDeliveredData({ message });
976+
const deliveredToCount = useMessageDeliveredData({ message });
977977
const { setQuotedMessage, setEditingState } = useMessageComposerAPIContext();
978978

979979
return (
@@ -982,7 +982,7 @@ export const Message = (props: MessageProps) => {
982982
{...{
983983
channel,
984984
chatContext,
985-
deliveredBy,
985+
deliveredToCount,
986986
dismissKeyboard,
987987
enforceUniqueReaction,
988988
members,

package/src/components/Message/MessageSimple/MessageStatus.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import { Time } from '../../../icons/Time';
1616
import { MessageStatusTypes } from '../../../utils/utils';
1717

1818
export type MessageStatusPropsWithContext = Pick<ChannelContextValue, 'channel'> &
19-
Pick<MessageContextValue, 'deliveredBy' | 'message' | 'readBy' | 'threadList'>;
19+
Pick<MessageContextValue, 'deliveredToCount' | 'message' | 'readBy' | 'threadList'>;
2020

2121
const MessageStatusWithContext = (props: MessageStatusPropsWithContext) => {
22-
const { channel, deliveredBy, message, readBy, threadList } = props;
22+
const { channel, deliveredToCount, message, readBy, threadList } = props;
2323

2424
const {
2525
theme: {
@@ -38,7 +38,7 @@ const MessageStatusWithContext = (props: MessageStatusPropsWithContext) => {
3838

3939
// Variables to determine the status of the message
4040
const read = hasReadByGreaterThanOne || readBy === true;
41-
const delivered = deliveredBy > 1;
41+
const delivered = deliveredToCount > 1;
4242
const sending = message.status === MessageStatusTypes.SENDING;
4343
const sent =
4444
message.status === MessageStatusTypes.RECEIVED &&
@@ -80,13 +80,13 @@ const areEqual = (
8080
nextProps: MessageStatusPropsWithContext,
8181
) => {
8282
const {
83-
deliveredBy: prevDeliveredBy,
83+
deliveredToCount: prevDeliveredBy,
8484
message: prevMessage,
8585
readBy: prevReadBy,
8686
threadList: prevThreadList,
8787
} = prevProps;
8888
const {
89-
deliveredBy: nextDeliveredBy,
89+
deliveredToCount: nextDeliveredBy,
9090
message: nextMessage,
9191
readBy: nextReadBy,
9292
threadList: nextThreadList,
@@ -125,10 +125,13 @@ export type MessageStatusProps = Partial<MessageStatusPropsWithContext>;
125125

126126
export const MessageStatus = (props: MessageStatusProps) => {
127127
const { channel } = useChannelContext();
128-
const { deliveredBy, message, readBy, threadList } = useMessageContext();
128+
const { deliveredToCount, message, readBy, threadList } = useMessageContext();
129129

130130
return (
131-
<MemoizedMessageStatus {...{ channel, deliveredBy, message, readBy, threadList }} {...props} />
131+
<MemoizedMessageStatus
132+
{...{ channel, deliveredToCount, message, readBy, threadList }}
133+
{...props}
134+
/>
132135
);
133136
};
134137

package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('MessageStatus', () => {
6464
const readBy = 2;
6565

6666
const { getByLabelText, getByText, rerender, toJSON } = renderMessageStatus({
67-
deliveredBy: 2,
67+
deliveredToCount: 2,
6868
message,
6969
readBy,
7070
});
@@ -104,12 +104,12 @@ describe('MessageStatus', () => {
104104
[1, 1, 'received', 'Sent'],
105105
[2, 1, 'received', 'Delivered'],
106106
])(
107-
'should render message status with %s container when deliveredBy is %s and readBy is %s and status is %s',
108-
async (deliveredBy, readBy, status, accessibilityLabel) => {
107+
'should render message status with %s container when deliveredToCount is %s and readBy is %s and status is %s',
108+
async (deliveredToCount, readBy, status, accessibilityLabel) => {
109109
const user = generateUser();
110110
const message = generateMessage({ user });
111111
const { getByLabelText } = renderMessageStatus({
112-
deliveredBy,
112+
deliveredToCount,
113113
message: { ...message, status },
114114
readBy,
115115
});

0 commit comments

Comments
 (0)