Skip to content

Commit 087c8d2

Browse files
authored
chore: Merge 4.44.0 into master (#5408)
1 parent 1d568c9 commit 087c8d2

File tree

94 files changed

+5176
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+5176
-397
lines changed

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 4 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.circleci/
22
.github/
3-
.husky
43
build/
54
node_modules/
65
coverage/

__tests__/containers/message/__snapshots__/Message.stories.storyshot

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ android {
147147
minSdkVersion rootProject.ext.minSdkVersion
148148
targetSdkVersion rootProject.ext.targetSdkVersion
149149
versionCode VERSIONCODE as Integer
150-
versionName "4.43.0"
150+
versionName "4.44.0"
151151
vectorDrawables.useSupportLibrary = true
152152
if (!isFoss) {
153153
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]

android/app/src/main/AndroidManifest.xml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
77

88
<uses-permission android:name="android.permission.CAMERA" />
9-
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
9+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
1010
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
1111
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
1212
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />
@@ -15,7 +15,7 @@
1515
<uses-permission android:name="android.permission.BLUETOOTH" />
1616

1717
<!-- android 13 notifications -->
18-
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
18+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
1919

2020
<!-- android 13 media permission -->
2121
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
@@ -43,31 +43,23 @@
4343
<intent-filter>
4444
<action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
4545
</intent-filter>
46-
<intent-filter android:label="@string/app_name">
46+
<intent-filter>
47+
<action android:name="android.intent.action.MAIN" />
48+
<category android:name="android.intent.category.LAUNCHER" />
49+
</intent-filter>
50+
<intent-filter android:autoVerify="true">
4751
<action android:name="android.intent.action.VIEW" />
48-
4952
<category android:name="android.intent.category.DEFAULT" />
5053
<category android:name="android.intent.category.BROWSABLE" />
51-
52-
<data
53-
android:host="go.rocket.chat"
54-
android:scheme="https" />
55-
<data
56-
android:host="jitsi.rocket.chat"
57-
android:scheme="https" />
58-
<data
59-
android:host="room"
60-
android:scheme="rocketchat" />
61-
<data
62-
android:host="auth"
63-
android:scheme="rocketchat" />
64-
<data
65-
android:host="jitsi.rocket.chat"
66-
android:scheme="rocketchat" />
54+
<data android:scheme="https" android:host="go.rocket.chat" android:path="/invite" />
55+
<data android:scheme="https" android:host="go.rocket.chat" android:path="/auth" />
56+
<data android:scheme="https" android:host="go.rocket.chat" android:path="/room" />
6757
</intent-filter>
6858
<intent-filter>
69-
<action android:name="android.intent.action.MAIN" />
70-
<category android:name="android.intent.category.LAUNCHER" />
59+
<action android:name="android.intent.action.VIEW" />
60+
<category android:name="android.intent.category.DEFAULT" />
61+
<category android:name="android.intent.category.BROWSABLE" />
62+
<data android:scheme="rocketchat" />
7163
</intent-filter>
7264
</activity>
7365
<activity
59.2 KB
Binary file not shown.

android/app/src/play/java/chat/rocket/reactnative/CustomPushNotification.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,13 @@ public void call(@Nullable Bundle bundle) {
9797
bundle.putString("senderId", hasSender ? loadedEjson.sender._id : "1");
9898
bundle.putString("avatarUri", loadedEjson.getAvatarUri());
9999

100-
notificationMessages.get(notId).add(bundle);
101-
postNotification(Integer.parseInt(notId));
102-
notifyReceivedToJS();
100+
if (loadedEjson.notificationType instanceof String && loadedEjson.notificationType.equals("videoconf")) {
101+
notifyReceivedToJS();
102+
} else {
103+
notificationMessages.get(notId).add(bundle);
104+
postNotification(Integer.parseInt(notId));
105+
notifyReceivedToJS();
106+
}
103107
}
104108

105109
@Override

app/actions/actionsTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const METEOR = createRequestTypes('METEOR_CONNECT', [...defaultTypes, 'DI
6565
export const LOGOUT = 'LOGOUT'; // logout is always success
6666
export const DELETE_ACCOUNT = 'DELETE_ACCOUNT';
6767
export const SNIPPETED_MESSAGES = createRequestTypes('SNIPPETED_MESSAGES', ['OPEN', 'READY', 'CLOSE', 'MESSAGES_RECEIVED']);
68-
export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN']);
68+
export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN', 'OPEN_VIDEO_CONF']);
6969
export const SORT_PREFERENCES = createRequestTypes('SORT_PREFERENCES', ['SET_ALL', 'SET']);
7070
export const SET_CUSTOM_EMOJIS = 'SET_CUSTOM_EMOJIS';
7171
export const ACTIVE_USERS = createRequestTypes('ACTIVE_USERS', ['SET', 'CLEAR']);

app/actions/deepLinking.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ interface IParams {
77
rid: string;
88
messageId: string;
99
host: string;
10-
isCall: boolean;
1110
fullURL: string;
1211
type: string;
1312
token: string;
@@ -23,3 +22,10 @@ export function deepLinkingOpen(params: Partial<IParams>): IDeepLinkingOpen {
2322
params
2423
};
2524
}
25+
26+
export function deepLinkingClickCallPush(params: any): IDeepLinkingOpen {
27+
return {
28+
type: DEEP_LINKING.OPEN_VIDEO_CONF,
29+
params
30+
};
31+
}

app/containers/ActionSheet/Item.tsx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from 'react';
22
import { Text, View } from 'react-native';
33

4-
import { themes } from '../../lib/constants';
54
import { CustomIcon } from '../CustomIcon';
65
import { useTheme } from '../../theme';
6+
import EventEmitter from '../../lib/methods/helpers/events';
7+
import I18n from '../../i18n';
78
import { TActionSheetOptionsItem } from './Provider';
89
import styles from './styles';
10+
import { LISTENER } from '../Toast';
911
import Touch from '../Touch';
1012

1113
export interface IActionSheetItem {
@@ -14,25 +16,30 @@ export interface IActionSheetItem {
1416
}
1517

1618
export const Item = React.memo(({ item, hide }: IActionSheetItem) => {
17-
const { theme } = useTheme();
19+
const enabled = item?.enabled ?? true;
20+
const { colors } = useTheme();
1821
const onPress = () => {
19-
hide();
20-
item?.onPress();
22+
if (enabled) {
23+
hide();
24+
item?.onPress();
25+
} else {
26+
EventEmitter.emit(LISTENER, { message: I18n.t('You_dont_have_permission_to_perform_this_action') });
27+
}
2128
};
2229

30+
let textColor = colors.bodyText;
31+
if (item.danger) {
32+
textColor = colors.dangerColor;
33+
}
34+
if (!enabled) {
35+
textColor = colors.fontDisabled;
36+
}
37+
2338
return (
24-
<Touch onPress={onPress} style={[styles.item, { backgroundColor: themes[theme].focusedBackground }]} testID={item.testID}>
25-
{item.icon ? (
26-
<CustomIcon name={item.icon} size={20} color={item.danger ? themes[theme].dangerColor : themes[theme].bodyText} />
27-
) : null}
39+
<Touch onPress={onPress} style={[styles.item, { backgroundColor: colors.focusedBackground }]} testID={item.testID}>
40+
{item.icon ? <CustomIcon name={item.icon} size={20} color={textColor} /> : null}
2841
<View style={styles.titleContainer}>
29-
<Text
30-
numberOfLines={1}
31-
style={[
32-
styles.title,
33-
{ color: item.danger ? themes[theme].dangerColor : themes[theme].bodyText, marginLeft: item.icon ? 16 : 0 }
34-
]}
35-
>
42+
<Text numberOfLines={1} style={[styles.title, { color: textColor, marginLeft: item.icon ? 16 : 0 }]}>
3643
{item.title}
3744
</Text>
3845
</View>

app/containers/ActionSheet/Provider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type TActionSheetOptionsItem = {
1111
testID?: string;
1212
onPress: () => void;
1313
right?: () => React.ReactElement;
14+
enabled?: boolean;
1415
};
1516

1617
export type TActionSheetOptions = {

app/containers/MessageActions/index.tsx

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { TActionSheetOptionsItem, useActionSheet, ACTION_SHEET_ANIMATION_DURATIO
1616
import Header, { HEADER_HEIGHT, IHeader } from './Header';
1717
import events from '../../lib/methods/helpers/log/events';
1818
import { IApplicationState, IEmoji, ILoggedUser, TAnyMessageModel, TSubscriptionModel } from '../../definitions';
19-
import { getPermalinkMessage } from '../../lib/methods';
19+
import { getPermalinkMessage, getQuoteMessageLink } from '../../lib/methods';
2020
import { compareServerVersion, getRoomTitle, getUidDirectMessage, hasPermission } from '../../lib/methods/helpers';
2121
import { Services } from '../../lib/services';
2222

@@ -28,6 +28,7 @@ export interface IMessageActionsProps {
2828
reactionInit: (message: TAnyMessageModel) => void;
2929
onReactionPress: (shortname: IEmoji, messageId: string) => void;
3030
replyInit: (message: TAnyMessageModel, mention: boolean) => void;
31+
jumpToMessage?: (messageUrl?: string, isFromReply?: boolean) => Promise<void>;
3132
isMasterDetail: boolean;
3233
isReadOnly: boolean;
3334
serverVersion?: string | null;
@@ -62,6 +63,7 @@ const MessageActions = React.memo(
6263
reactionInit,
6364
onReactionPress,
6465
replyInit,
66+
jumpToMessage,
6567
isReadOnly,
6668
Message_AllowDeleting,
6769
Message_AllowDeleting_BlockDeleteInMinutes,
@@ -374,6 +376,16 @@ const MessageActions = React.memo(
374376
const options: TActionSheetOptionsItem[] = [];
375377
const videoConfBlock = message.t === 'videoconf';
376378

379+
// Jump to message
380+
const quoteMessageLink = getQuoteMessageLink(message.attachments);
381+
if (quoteMessageLink && jumpToMessage) {
382+
options.push({
383+
title: I18n.t('Jump_to_message'),
384+
icon: 'jump-to-message',
385+
onPress: () => jumpToMessage(quoteMessageLink, true)
386+
});
387+
}
388+
377389
// Quote
378390
if (!isReadOnly && !videoConfBlock) {
379391
options.push({
@@ -393,22 +405,22 @@ const MessageActions = React.memo(
393405
}
394406

395407
// Reply in DM
396-
if (room.t !== 'd' && room.t !== 'l' && permissions.hasCreateDirectMessagePermission && !videoConfBlock) {
408+
if (room.t !== 'd' && room.t !== 'l' && !videoConfBlock) {
397409
options.push({
398410
title: I18n.t('Reply_in_direct_message'),
399411
icon: 'arrow-back',
400-
onPress: () => handleReplyInDM(message)
412+
onPress: () => handleReplyInDM(message),
413+
enabled: permissions.hasCreateDirectMessagePermission
401414
});
402415
}
403416

404417
// Create Discussion
405-
if (permissions.hasCreateDiscussionOtherUserPermission) {
406-
options.push({
407-
title: I18n.t('Start_a_Discussion'),
408-
icon: 'discussions',
409-
onPress: () => handleCreateDiscussion(message)
410-
});
411-
}
418+
options.push({
419+
title: I18n.t('Start_a_Discussion'),
420+
icon: 'discussions',
421+
onPress: () => handleCreateDiscussion(message),
422+
enabled: permissions.hasCreateDiscussionOtherUserPermission
423+
});
412424

413425
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '6.2.0') && !videoConfBlock) {
414426
options.push({
@@ -442,20 +454,23 @@ const MessageActions = React.memo(
442454
});
443455

444456
// Edit
445-
if (allowEdit(message) && !videoConfBlock) {
457+
const isEditAllowed = allowEdit(message);
458+
if (!videoConfBlock && (isOwn(message) || isEditAllowed)) {
446459
options.push({
447460
title: I18n.t('Edit'),
448461
icon: 'edit',
449-
onPress: () => handleEdit(message)
462+
onPress: () => handleEdit(message),
463+
enabled: isEditAllowed
450464
});
451465
}
452466

453467
// Pin
454-
if (Message_AllowPinning && permissions?.hasPinPermission && !videoConfBlock) {
468+
if (Message_AllowPinning && !videoConfBlock) {
455469
options.push({
456470
title: I18n.t(message.pinned ? 'Unpin' : 'Pin'),
457471
icon: 'pin',
458-
onPress: () => handlePin(message)
472+
onPress: () => handlePin(message),
473+
enabled: permissions?.hasPinPermission
459474
});
460475
}
461476

@@ -504,12 +519,14 @@ const MessageActions = React.memo(
504519
});
505520

506521
// Delete
507-
if (allowDelete(message)) {
522+
const isDeleteAllowed = allowDelete(message);
523+
if (isOwn(message) || isDeleteAllowed) {
508524
options.push({
509525
title: I18n.t('Delete'),
510526
icon: 'delete',
511527
danger: true,
512-
onPress: () => handleDelete(message)
528+
onPress: () => handleDelete(message),
529+
enabled: isDeleteAllowed
513530
});
514531
}
515532

@@ -522,10 +539,13 @@ const MessageActions = React.memo(
522539
showActionSheet({
523540
options: getOptions(message),
524541
headerHeight: HEADER_HEIGHT,
525-
customHeader:
526-
!isReadOnly || room.reactWhenReadOnly ? (
527-
<Header handleReaction={handleReaction} isMasterDetail={isMasterDetail} message={message} />
528-
) : null
542+
customHeader: (
543+
<>
544+
{!isReadOnly || room.reactWhenReadOnly ? (
545+
<Header handleReaction={handleReaction} isMasterDetail={isMasterDetail} message={message} />
546+
) : null}
547+
</>
548+
)
529549
});
530550
};
531551

0 commit comments

Comments
 (0)