Skip to content

Commit 2f5efd7

Browse files
Merge branch 'develop' of https://github.com/GetStream/stream-chat-react-native into khushal87-crns-290
2 parents 0baaa4d + 50f4e87 commit 2f5efd7

File tree

9 files changed

+435
-20
lines changed

9 files changed

+435
-20
lines changed

examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@
495495
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
496496
CLANG_ENABLE_MODULES = YES;
497497
CODE_SIGN_IDENTITY = "iPhone Distribution";
498-
CURRENT_PROJECT_VERSION = 78;
498+
CURRENT_PROJECT_VERSION = 82;
499499
DEVELOPMENT_TEAM = EHV7XZLAHA;
500500
ENABLE_BITCODE = NO;
501501
INFOPLIST_FILE = SampleApp/Info.plist;
@@ -525,7 +525,7 @@
525525
CLANG_ENABLE_MODULES = YES;
526526
CODE_SIGN_IDENTITY = "iPhone Distribution";
527527
CODE_SIGN_STYLE = Manual;
528-
CURRENT_PROJECT_VERSION = 78;
528+
CURRENT_PROJECT_VERSION = 82;
529529
DEVELOPMENT_TEAM = EHV7XZLAHA;
530530
INFOPLIST_FILE = SampleApp/Info.plist;
531531
LD_RUNPATH_SEARCH_PATHS = (

examples/SampleApp/ios/SampleApp/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>78</string>
24+
<string>82</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true />
2727
<key>NSAppTransportSecurity</key>

examples/SampleApp/ios/SampleAppTests/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>78</string>
22+
<string>82</string>
2323
</dict>
2424
</plist>

package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export const useCreateOwnCapabilitiesContext = <
2121
const overrideCapabilitiesStr = overrideCapabilities
2222
? JSON.stringify(Object.values(overrideCapabilities))
2323
: null;
24+
const ownCapabilitiesStr = channel?.data?.own_capabilities
25+
? JSON.stringify(Object.values(channel?.data?.own_capabilities as Array<string>))
26+
: null;
27+
2428
const ownCapabilitiesContext: OwnCapabilitiesContextValue = useMemo(() => {
2529
const capabilities = (channel?.data?.own_capabilities || []) as Array<string>;
2630
const ownCapabilitiesContext = Object.keys(allOwnCapabilities).reduce(
@@ -34,6 +38,7 @@ export const useCreateOwnCapabilitiesContext = <
3438
);
3539

3640
return ownCapabilitiesContext;
37-
}, [channel.id, overrideCapabilitiesStr]);
41+
}, [channel.id, overrideCapabilitiesStr, ownCapabilitiesStr]);
42+
3843
return ownCapabilitiesContext;
3944
};

package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const useCreatePaginatedMessageListContext = <
2323
({ deleted_at, latest_reactions, reply_count, status, updated_at }) =>
2424
`${deleted_at}${
2525
latest_reactions ? latest_reactions.map(({ type }) => type).join() : ''
26-
}${reply_count}${status}${updated_at.toISOString()}`,
26+
}${reply_count}${status}${updated_at?.toISOString?.() || updated_at}`,
2727
)
2828
.join();
2929

package/src/components/ImageGallery/ImageGallery.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ export const ImageGallery = <
312312
const attachmentImages =
313313
cur.attachments?.filter(
314314
(attachment) =>
315-
(attachment.type === 'giphy' && attachment.giphy?.[giphyVersion]?.url) ||
315+
(attachment.type === 'giphy' &&
316+
(attachment.giphy?.[giphyVersion]?.url ||
317+
attachment.thumb_url ||
318+
attachment.image_url)) ||
316319
(attachment.type === 'image' &&
317320
!attachment.title_link &&
318321
!attachment.og_scrape_url &&

package/src/components/Message/MessageSimple/utils/parseLinks.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,11 @@ getstream.io
9797
scheme: 'https://',
9898
});
9999
});
100+
101+
it('does not parse a decimal number as a URL', () => {
102+
const input = '123.456';
103+
const result = parseLinksFromText(input);
104+
105+
expect(result).toHaveLength(0);
106+
});
100107
});

package/src/components/Message/MessageSimple/utils/parseLinks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
* */
99
const emailUserName = '[\\w+\\.~$_-]+';
1010
const schema = `(\\w{2,15}:\\/\\/)`;
11-
const domain = `((?:\\w+\\.\\w+)+(?:[^:\\/\\s]+))`;
11+
// something.tld OR 123.123.123.123
12+
const domain = `((?:\\w+\\.[a-zA-Z]+)+(?:[^:\\/\\s]+)|(?:\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}))`;
1213
const port = `(:[0-9]{1,5})`;
1314
const path = `((?:\\/)?[^?#\\s]+)`;
1415
const queryString = `(\\?[^#\\s]+)`;

0 commit comments

Comments
 (0)