Skip to content

Commit

Permalink
chore: Merge 4.44.0 into master (#5408)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored Dec 18, 2023
1 parent 1d568c9 commit 087c8d2
Show file tree
Hide file tree
Showing 94 changed files with 5,176 additions and 397 deletions.
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.circleci/
.github/
.husky
build/
node_modules/
coverage/
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.43.0"
versionName "4.44.0"
vectorDrawables.useSupportLibrary = true
if (!isFoss) {
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
Expand Down
36 changes: 14 additions & 22 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />
Expand All @@ -15,7 +15,7 @@
<uses-permission android:name="android.permission.BLUETOOTH" />

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

<!-- android 13 media permission -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
Expand Down Expand Up @@ -43,31 +43,23 @@
<intent-filter>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
</intent-filter>
<intent-filter android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="go.rocket.chat"
android:scheme="https" />
<data
android:host="jitsi.rocket.chat"
android:scheme="https" />
<data
android:host="room"
android:scheme="rocketchat" />
<data
android:host="auth"
android:scheme="rocketchat" />
<data
android:host="jitsi.rocket.chat"
android:scheme="rocketchat" />
<data android:scheme="https" android:host="go.rocket.chat" android:path="/invite" />
<data android:scheme="https" android:host="go.rocket.chat" android:path="/auth" />
<data android:scheme="https" android:host="go.rocket.chat" android:path="/room" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="rocketchat" />
</intent-filter>
</activity>
<activity
Expand Down
Binary file added android/app/src/main/res/raw/ringtone.mp3
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ public void call(@Nullable Bundle bundle) {
bundle.putString("senderId", hasSender ? loadedEjson.sender._id : "1");
bundle.putString("avatarUri", loadedEjson.getAvatarUri());

notificationMessages.get(notId).add(bundle);
postNotification(Integer.parseInt(notId));
notifyReceivedToJS();
if (loadedEjson.notificationType instanceof String && loadedEjson.notificationType.equals("videoconf")) {
notifyReceivedToJS();
} else {
notificationMessages.get(notId).add(bundle);
postNotification(Integer.parseInt(notId));
notifyReceivedToJS();
}
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion app/actions/actionsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const METEOR = createRequestTypes('METEOR_CONNECT', [...defaultTypes, 'DI
export const LOGOUT = 'LOGOUT'; // logout is always success
export const DELETE_ACCOUNT = 'DELETE_ACCOUNT';
export const SNIPPETED_MESSAGES = createRequestTypes('SNIPPETED_MESSAGES', ['OPEN', 'READY', 'CLOSE', 'MESSAGES_RECEIVED']);
export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN']);
export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN', 'OPEN_VIDEO_CONF']);
export const SORT_PREFERENCES = createRequestTypes('SORT_PREFERENCES', ['SET_ALL', 'SET']);
export const SET_CUSTOM_EMOJIS = 'SET_CUSTOM_EMOJIS';
export const ACTIVE_USERS = createRequestTypes('ACTIVE_USERS', ['SET', 'CLEAR']);
Expand Down
8 changes: 7 additions & 1 deletion app/actions/deepLinking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ interface IParams {
rid: string;
messageId: string;
host: string;
isCall: boolean;
fullURL: string;
type: string;
token: string;
Expand All @@ -23,3 +22,10 @@ export function deepLinkingOpen(params: Partial<IParams>): IDeepLinkingOpen {
params
};
}

export function deepLinkingClickCallPush(params: any): IDeepLinkingOpen {
return {
type: DEEP_LINKING.OPEN_VIDEO_CONF,
params
};
}
37 changes: 22 additions & 15 deletions app/containers/ActionSheet/Item.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';
import { Text, View } from 'react-native';

import { themes } from '../../lib/constants';
import { CustomIcon } from '../CustomIcon';
import { useTheme } from '../../theme';
import EventEmitter from '../../lib/methods/helpers/events';
import I18n from '../../i18n';
import { TActionSheetOptionsItem } from './Provider';
import styles from './styles';
import { LISTENER } from '../Toast';
import Touch from '../Touch';

export interface IActionSheetItem {
Expand All @@ -14,25 +16,30 @@ export interface IActionSheetItem {
}

export const Item = React.memo(({ item, hide }: IActionSheetItem) => {
const { theme } = useTheme();
const enabled = item?.enabled ?? true;
const { colors } = useTheme();
const onPress = () => {
hide();
item?.onPress();
if (enabled) {
hide();
item?.onPress();
} else {
EventEmitter.emit(LISTENER, { message: I18n.t('You_dont_have_permission_to_perform_this_action') });
}
};

let textColor = colors.bodyText;
if (item.danger) {
textColor = colors.dangerColor;
}
if (!enabled) {
textColor = colors.fontDisabled;
}

return (
<Touch onPress={onPress} style={[styles.item, { backgroundColor: themes[theme].focusedBackground }]} testID={item.testID}>
{item.icon ? (
<CustomIcon name={item.icon} size={20} color={item.danger ? themes[theme].dangerColor : themes[theme].bodyText} />
) : null}
<Touch onPress={onPress} style={[styles.item, { backgroundColor: colors.focusedBackground }]} testID={item.testID}>
{item.icon ? <CustomIcon name={item.icon} size={20} color={textColor} /> : null}
<View style={styles.titleContainer}>
<Text
numberOfLines={1}
style={[
styles.title,
{ color: item.danger ? themes[theme].dangerColor : themes[theme].bodyText, marginLeft: item.icon ? 16 : 0 }
]}
>
<Text numberOfLines={1} style={[styles.title, { color: textColor, marginLeft: item.icon ? 16 : 0 }]}>
{item.title}
</Text>
</View>
Expand Down
1 change: 1 addition & 0 deletions app/containers/ActionSheet/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type TActionSheetOptionsItem = {
testID?: string;
onPress: () => void;
right?: () => React.ReactElement;
enabled?: boolean;
};

export type TActionSheetOptions = {
Expand Down
60 changes: 40 additions & 20 deletions app/containers/MessageActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { TActionSheetOptionsItem, useActionSheet, ACTION_SHEET_ANIMATION_DURATIO
import Header, { HEADER_HEIGHT, IHeader } from './Header';
import events from '../../lib/methods/helpers/log/events';
import { IApplicationState, IEmoji, ILoggedUser, TAnyMessageModel, TSubscriptionModel } from '../../definitions';
import { getPermalinkMessage } from '../../lib/methods';
import { getPermalinkMessage, getQuoteMessageLink } from '../../lib/methods';
import { compareServerVersion, getRoomTitle, getUidDirectMessage, hasPermission } from '../../lib/methods/helpers';
import { Services } from '../../lib/services';

Expand All @@ -28,6 +28,7 @@ export interface IMessageActionsProps {
reactionInit: (message: TAnyMessageModel) => void;
onReactionPress: (shortname: IEmoji, messageId: string) => void;
replyInit: (message: TAnyMessageModel, mention: boolean) => void;
jumpToMessage?: (messageUrl?: string, isFromReply?: boolean) => Promise<void>;
isMasterDetail: boolean;
isReadOnly: boolean;
serverVersion?: string | null;
Expand Down Expand Up @@ -62,6 +63,7 @@ const MessageActions = React.memo(
reactionInit,
onReactionPress,
replyInit,
jumpToMessage,
isReadOnly,
Message_AllowDeleting,
Message_AllowDeleting_BlockDeleteInMinutes,
Expand Down Expand Up @@ -374,6 +376,16 @@ const MessageActions = React.memo(
const options: TActionSheetOptionsItem[] = [];
const videoConfBlock = message.t === 'videoconf';

// Jump to message
const quoteMessageLink = getQuoteMessageLink(message.attachments);
if (quoteMessageLink && jumpToMessage) {
options.push({
title: I18n.t('Jump_to_message'),
icon: 'jump-to-message',
onPress: () => jumpToMessage(quoteMessageLink, true)
});
}

// Quote
if (!isReadOnly && !videoConfBlock) {
options.push({
Expand All @@ -393,22 +405,22 @@ const MessageActions = React.memo(
}

// Reply in DM
if (room.t !== 'd' && room.t !== 'l' && permissions.hasCreateDirectMessagePermission && !videoConfBlock) {
if (room.t !== 'd' && room.t !== 'l' && !videoConfBlock) {
options.push({
title: I18n.t('Reply_in_direct_message'),
icon: 'arrow-back',
onPress: () => handleReplyInDM(message)
onPress: () => handleReplyInDM(message),
enabled: permissions.hasCreateDirectMessagePermission
});
}

// Create Discussion
if (permissions.hasCreateDiscussionOtherUserPermission) {
options.push({
title: I18n.t('Start_a_Discussion'),
icon: 'discussions',
onPress: () => handleCreateDiscussion(message)
});
}
options.push({
title: I18n.t('Start_a_Discussion'),
icon: 'discussions',
onPress: () => handleCreateDiscussion(message),
enabled: permissions.hasCreateDiscussionOtherUserPermission
});

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

// Edit
if (allowEdit(message) && !videoConfBlock) {
const isEditAllowed = allowEdit(message);
if (!videoConfBlock && (isOwn(message) || isEditAllowed)) {
options.push({
title: I18n.t('Edit'),
icon: 'edit',
onPress: () => handleEdit(message)
onPress: () => handleEdit(message),
enabled: isEditAllowed
});
}

// Pin
if (Message_AllowPinning && permissions?.hasPinPermission && !videoConfBlock) {
if (Message_AllowPinning && !videoConfBlock) {
options.push({
title: I18n.t(message.pinned ? 'Unpin' : 'Pin'),
icon: 'pin',
onPress: () => handlePin(message)
onPress: () => handlePin(message),
enabled: permissions?.hasPinPermission
});
}

Expand Down Expand Up @@ -504,12 +519,14 @@ const MessageActions = React.memo(
});

// Delete
if (allowDelete(message)) {
const isDeleteAllowed = allowDelete(message);
if (isOwn(message) || isDeleteAllowed) {
options.push({
title: I18n.t('Delete'),
icon: 'delete',
danger: true,
onPress: () => handleDelete(message)
onPress: () => handleDelete(message),
enabled: isDeleteAllowed
});
}

Expand All @@ -522,10 +539,13 @@ const MessageActions = React.memo(
showActionSheet({
options: getOptions(message),
headerHeight: HEADER_HEIGHT,
customHeader:
!isReadOnly || room.reactWhenReadOnly ? (
<Header handleReaction={handleReaction} isMasterDetail={isMasterDetail} message={message} />
) : null
customHeader: (
<>
{!isReadOnly || room.reactWhenReadOnly ? (
<Header handleReaction={handleReaction} isMasterDetail={isMasterDetail} message={message} />
) : null}
</>
)
});
};

Expand Down
Loading

0 comments on commit 087c8d2

Please sign in to comment.