Skip to content

Commit

Permalink
chore: Merge 4.50.1 into master (#5783)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored Jul 11, 2024
2 parents 5eaeb47 + b5b386b commit deb8ea4
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Rocket.Chat Mobile

- **Supported server versions:** 0.70.0+
- **Supported iOS versions**: 12+
- **Supported iOS versions**: 13.4+
- **Supported Android versions**: 6.0+

## Download
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.50.0"
versionName "4.50.1"
vectorDrawables.useSupportLibrary = true
if (!isFoss) {
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
Expand Down
2 changes: 2 additions & 0 deletions app/containers/MessageComposer/MessageComposer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ describe('MessageComposer', () => {
const onSendMessage = jest.fn();
render(<Render context={{ onSendMessage }} />);
expect(screen.getByTestId('message-composer-send-audio')).toBeOnTheScreen();
expect(screen.queryByTestId('message-composer-send')).not.toBeOnTheScreen();

await user.type(screen.getByTestId('message-composer-input'), 'test');
expect(screen.getByTestId('message-composer-input')).not.toBe('');
expect(screen.queryByTestId('message-composer-send-audio')).not.toBeOnTheScreen();
expect(screen.getByTestId('message-composer-send')).toBeOnTheScreen();

Expand Down
18 changes: 14 additions & 4 deletions app/containers/MessageComposer/components/ComposerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ import { useSubscription, useAutoSaveDraft } from '../hooks';
import sharedStyles from '../../../views/Styles';
import { useTheme } from '../../../theme';
import { userTyping } from '../../../actions/room';
import { getRoomTitle, parseJson } from '../../../lib/methods/helpers';
import { MAX_HEIGHT, MIN_HEIGHT, NO_CANNED_RESPONSES, MARKDOWN_STYLES } from '../constants';
import { getRoomTitle, isTablet, parseJson } from '../../../lib/methods/helpers';
import {
MAX_HEIGHT,
MIN_HEIGHT,
NO_CANNED_RESPONSES,
MARKDOWN_STYLES,
COMPOSER_INPUT_PLACEHOLDER_MAX_LENGTH
} from '../constants';
import database from '../../../lib/database';
import Navigation from '../../../lib/navigation/appNavigation';
import { emitter } from '../../../lib/methods/helpers/emitter';
Expand Down Expand Up @@ -44,6 +50,9 @@ export const ComposerInput = memo(
let placeholder = tmid ? I18n.t('Add_thread_reply') : '';
if (subscription && !tmid) {
placeholder = I18n.t('Message_roomname', { roomName: (subscription.t === 'd' ? '@' : '#') + getRoomTitle(subscription) });
if (!isTablet && placeholder.length > COMPOSER_INPUT_PLACEHOLDER_MAX_LENGTH) {
placeholder = `${placeholder.slice(0, COMPOSER_INPUT_PLACEHOLDER_MAX_LENGTH)}...`;
}
}
const route = useRoute<RouteProp<ChatsStackParamList, 'RoomView'>>();
const usedCannedResponse = route.params?.usedCannedResponse;
Expand Down Expand Up @@ -143,7 +152,8 @@ export const ComposerInput = memo(
}));

const setInput: TSetInput = (text, selection) => {
textRef.current = text;
const message = text.trim();
textRef.current = message;
if (inputRef.current) {
inputRef.current.setNativeProps({ text });
}
Expand All @@ -154,7 +164,7 @@ export const ComposerInput = memo(
selectionRef.current = selection;
}, 50);
}
setMicOrSend(text.length === 0 ? 'mic' : 'send');
setMicOrSend(message.length === 0 ? 'mic' : 'send');
};

const focus = () => {
Expand Down
2 changes: 2 additions & 0 deletions app/containers/MessageComposer/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ export const MARKDOWN_STYLES: Record<TMarkdownStyle, string> = {
code: '`',
'code-block': '```'
};

export const COMPOSER_INPUT_PLACEHOLDER_MAX_LENGTH = 30;
2 changes: 0 additions & 2 deletions app/containers/message/Components/Attachments/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const ImageContainer = ({
}: IMessageImage): React.ReactElement | null => {
const { id, baseUrl, user } = useContext(MessageContext);
const [imageCached, setImageCached] = useFile(file, id);
console.log('🚀 ~ imageCached:', id, imageCached);
const [cached, setCached] = useState(false);
const [loading, setLoading] = useState(true);
const { theme } = useTheme();
Expand All @@ -107,7 +106,6 @@ const ImageContainer = ({
const handleCache = async () => {
if (img) {
const isImageCached = await handleGetMediaCache();
console.log('🚀 ~ handleCache ~ isImageCached:', isImageCached);
if (isImageCached) {
return;
}
Expand Down
14 changes: 9 additions & 5 deletions app/lib/methods/helpers/fileDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ export const fileDownload = async (url: string, attachment?: IAttachment, fileNa

export const fileDownloadAndPreview = async (url: string, attachment: IAttachment, messageId: string): Promise<void> => {
try {
const file = await fileDownload(url, attachment);
let file = url;
// If url starts with file://, we assume it's a local file and we don't download/decrypt it
if (!file.startsWith('file://')) {
file = await fileDownload(file, attachment);

if (attachment.encryption) {
if (!attachment.hashes?.sha256) {
throw new Error('Missing checksum');
if (attachment.encryption) {
if (!attachment.hashes?.sha256) {
throw new Error('Missing checksum');
}
await Encryption.addFileToDecryptFileQueue(messageId, file, attachment.encryption, attachment.hashes?.sha256);
}
await Encryption.addFileToDecryptFileQueue(messageId, file, attachment.encryption, attachment.hashes?.sha256);
}

await FileViewer.open(file, {
Expand Down
1 change: 0 additions & 1 deletion app/lib/methods/sendFileMessage/sendFileMessageV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export async function sendFileMessageV2(
let uploadPath: string | null = '';
let uploadRecord: TUploadModel | null;
try {
console.log('sendFileMessage', rid, fileInfo);
const { id, token } = user;
const headers = {
...RocketChatSettings.customHeaders,
Expand Down
2 changes: 0 additions & 2 deletions app/views/RoomView/List/hooks/useMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,5 @@ export const useMessages = ({
subscription.current?.unsubscribe();
};

// console.log(messages[0]);

return [messages, messagesIds, fetchMessages] as const;
};
4 changes: 2 additions & 2 deletions ios/RocketChatRN.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3135,7 +3135,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 4.50.0;
MARKETING_VERSION = 4.50.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -3179,7 +3179,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 4.50.0;
MARKETING_VERSION = 4.50.1;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative.NotificationService;
Expand Down
2 changes: 1 addition & 1 deletion ios/RocketChatRN/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.50.0</string>
<string>4.50.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/ShareRocketChatRN/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>4.50.0</string>
<string>4.50.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>KeychainGroup</key>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rocket-chat-reactnative",
"version": "4.50.0",
"version": "4.50.1",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down

0 comments on commit deb8ea4

Please sign in to comment.