Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5d2050b
[FIX] RoomItem using deprecated animated event signature (#2771)
gerzonc Jan 7, 2021
59fd703
[FIX] Server autocomplete text breaking line (#2774)
gerzonc Jan 12, 2021
3b4f457
[FIX] ServerDropdown flashing bigger server icon (#2775)
gerzonc Jan 13, 2021
7f0abe1
[FIX] Rooms list not being updated on some cases (#2765)
diegolmello Jan 13, 2021
32b1b36
[FIX] Share Extension hitting memory limit on iOS (#2788)
diegolmello Jan 13, 2021
4d13689
[IMPROVEMENT] Threads layout tweaks (#2686)
djorkaeffalexandre Jan 14, 2021
6457546
[CHORE] Remove some migrations (#2792)
diegolmello Jan 14, 2021
0330219
Bump version to 4.14.0 (#2797)
diegolmello Jan 14, 2021
b77603c
[FIX] Messagebox tracking lost on pop gesture navigation (#2799)
diegolmello Jan 15, 2021
a51a985
[FIX] Back button closing activity when on root stack screen (#2804)
diegolmello Jan 15, 2021
a1bd97f
[i18n] Add missing German strings (#2715)
phriedrich Jan 19, 2021
db5074a
[NEW] Encrypted Discussions (#2813)
diegolmello Jan 20, 2021
4b96d30
[FIX] Messagebox missing style for text color (#2786)
yash-rajpal Jan 20, 2021
54f3fb9
[I18N] Update arabic (#2696)
faziloub Jan 20, 2021
61bc2a4
[FIX] Workspace input without i18n (#2689)
sumukhah Jan 20, 2021
d83631d
[FIX] Spotlight returning duplicated entries (#2805)
gerzonc Jan 20, 2021
8d1dd27
[CHORE] Refactor ServerItem (#2778)
gerzonc Jan 20, 2021
af34e5a
[DOCS] Updated Quick Start docs link in e2e/readme (#2802)
yash-rajpal Jan 20, 2021
8abc3a8
[I18N] Add Turkish (#2793)
mukerremyilmaz Jan 20, 2021
94d94cf
[FIX] Lint on #2793 (#2818)
diegolmello Jan 20, 2021
e2d0a00
[I18N] Add missing german strings (#2689) (#2820)
phriedrich Jan 21, 2021
f0046f6
[I18N] Add missing italian strings (#2817)
aenonGit Jan 21, 2021
0fdb8f2
[FIX] Server version becoming null on server change (#2821)
diegolmello Jan 21, 2021
bd09cd3
[FIX] Wrong styling on E2E encryption banner (#2767)
gerzonc Jan 21, 2021
b10c5db
[FIX] App Store using Experimental's app id (#2826)
diegolmello Jan 22, 2021
cf59644
[FIX] Wrong username on push notifications (#2825)
diegolmello Jan 22, 2021
6623f43
Merge branch 'develop' into single-server-update
diegolmello Jan 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,489 changes: 4,464 additions & 3,025 deletions __tests__/__snapshots__/Storyshots.test.js.snap

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 @@ -144,7 +144,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.13.1"
versionName "4.14.0"
vectorDrawables.useSupportLibrary = true
if (!isFoss) {
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTask"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import com.zoontek.rnbootsplash.RNBootSplash;
import com.tencent.mmkv.MMKV;
import com.google.gson.Gson;

class ThemePreferences {
Expand All @@ -36,61 +35,11 @@ protected void onCreate(Bundle savedInstanceState) {
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
super.onCreate(null);
RNBootSplash.init(R.drawable.launch_screen, MainActivity.this);
}

MMKV.initialize(MainActivity.this);

// Start the MMKV container
MMKV defaultMMKV = MMKV.defaultMMKV();
boolean alreadyMigrated = defaultMMKV.decodeBool("alreadyMigrated");

if (!alreadyMigrated) {
// MMKV Instance that will be used by JS
MMKV mmkv = MMKV.mmkvWithID("default");

// SharedPreferences -> MMKV (Migration)
SharedPreferences sharedPreferences = getSharedPreferences("react-native", Context.MODE_PRIVATE);
mmkv.importFromSharedPreferences(sharedPreferences);

// SharedPreferences only save strings, so we saved this value as a String and now we'll need to cast into a MMKV object

// Theme preferences object
String THEME_PREFERENCES_KEY = "RC_THEME_PREFERENCES_KEY";
String themeJson = sharedPreferences.getString(THEME_PREFERENCES_KEY, "");
if (!themeJson.isEmpty()) {
ThemePreferences themePreferences = new Gson().fromJson(themeJson, ThemePreferences.class);
WritableMap themeMap = new Arguments().createMap();
themeMap.putString("currentTheme", themePreferences.currentTheme);
themeMap.putString("darkLevel", themePreferences.darkLevel);
Bundle bundle = Arguments.toBundle(themeMap);
mmkv.encode(THEME_PREFERENCES_KEY, bundle);
}

// Sort preferences object
String SORT_PREFS_KEY = "RC_SORT_PREFS_KEY";
String sortJson = sharedPreferences.getString(SORT_PREFS_KEY, "");
if (!sortJson.isEmpty()) {
SortPreferences sortPreferences = new Gson().fromJson(sortJson, SortPreferences.class);
WritableMap sortMap = new Arguments().createMap();
sortMap.putString("sortBy", sortPreferences.sortBy);
if (sortPreferences.groupByType != null) {
sortMap.putBoolean("groupByType", sortPreferences.groupByType);
}
if (sortPreferences.showFavorites != null) {
sortMap.putBoolean("showFavorites", sortPreferences.showFavorites);
}
if (sortPreferences.showUnread != null) {
sortMap.putBoolean("showUnread", sortPreferences.showUnread);
}
Bundle bundle = Arguments.toBundle(sortMap);
mmkv.encode(SORT_PREFS_KEY, bundle);
}

// Remove all our keys of SharedPreferences
sharedPreferences.edit().clear().commit();

// Mark migration complete
defaultMMKV.encode("alreadyMigrated", true);
}
@Override
public void invokeDefaultOnBackPressed() {
moveTaskToBack(true);
}

/**
Expand Down
Binary file removed android/app/src/main/res/drawable-hdpi/logo.png
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-mdpi/logo.png
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-xhdpi/logo.png
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-xxhdpi/logo.png
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-xxxhdpi/logo.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ private void notificationStyle(Notification.Builder notification, int notId, Bun
Notification.MessagingStyle messageStyle;

Gson gson = new Gson();
Ejson ejson = gson.fromJson(bundle.getString("ejson", "{}"), Ejson.class);

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
messageStyle = new Notification.MessagingStyle("");
Expand All @@ -278,25 +277,19 @@ private void notificationStyle(Notification.Builder notification, int notId, Bun

long timestamp = data.getLong("time");
String message = data.getString("message");
String username = data.getString("username");
String senderId = data.getString("senderId");
String avatarUri = data.getString("avatarUri");

Ejson ejson = gson.fromJson(data.getString("ejson", "{}"), Ejson.class);
String m = extractMessage(message, ejson);

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
messageStyle.addMessage(m, timestamp, username);
messageStyle.addMessage(m, timestamp, ejson.senderName);
} else {
Bitmap avatar = getAvatar(avatarUri);

String name = username;
if (ejson.senderName != null) {
name = ejson.senderName;
}

Person.Builder sender = new Person.Builder()
.setKey(senderId)
.setName(name);
.setName(ejson.senderName);

if (avatar != null) {
sender.setIcon(Icon.createWithBitmap(avatar));
Expand Down
4 changes: 2 additions & 2 deletions app/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { connect } from 'react-redux';
import Navigation from './lib/Navigation';
import { defaultHeader, getActiveRouteName, navigationTheme } from './utils/navigation';
import {
ROOT_LOADING, ROOT_OUTSIDE, ROOT_NEW_SERVER, ROOT_INSIDE, ROOT_SET_USERNAME, ROOT_BACKGROUND
ROOT_LOADING, ROOT_OUTSIDE, ROOT_NEW_SERVER, ROOT_INSIDE, ROOT_SET_USERNAME
} from './actions/app';

// Stacks
Expand Down Expand Up @@ -65,7 +65,7 @@ const App = React.memo(({ root, isMasterDetail }) => {
>
<Stack.Navigator screenOptions={{ headerShown: false, animationEnabled: false }}>
<>
{root === ROOT_LOADING || root === ROOT_BACKGROUND ? (
{root === ROOT_LOADING ? (
<Stack.Screen
name='AuthLoading'
component={AuthLoadingView}
Expand Down
2 changes: 1 addition & 1 deletion app/actions/actionsTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ export const INVITE_LINKS = createRequestTypes('INVITE_LINKS', [
export const SETTINGS = createRequestTypes('SETTINGS', ['CLEAR', 'ADD']);
export const APP_STATE = createRequestTypes('APP_STATE', ['FOREGROUND', 'BACKGROUND']);
export const ENTERPRISE_MODULES = createRequestTypes('ENTERPRISE_MODULES', ['CLEAR', 'SET']);
export const ENCRYPTION = createRequestTypes('ENCRYPTION', ['INIT', 'STOP', 'DECODE_KEY', 'SET_BANNER']);
export const ENCRYPTION = createRequestTypes('ENCRYPTION', ['INIT', 'STOP', 'DECODE_KEY', 'SET', 'SET_BANNER']);
1 change: 0 additions & 1 deletion app/actions/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const ROOT_INSIDE = 'inside';
export const ROOT_LOADING = 'loading';
export const ROOT_NEW_SERVER = 'newServer';
export const ROOT_SET_USERNAME = 'setUsername';
export const ROOT_BACKGROUND = 'background';

export function appStart({ root, ...args }) {
return {
Expand Down
8 changes: 8 additions & 0 deletions app/actions/encryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ export function encryptionStop() {
};
}

export function encryptionSet(enabled = false, banner = null) {
return {
type: types.ENCRYPTION.SET,
enabled,
banner
};
}

export function encryptionSetBanner(banner) {
return {
type: types.ENCRYPTION.SET_BANNER,
Expand Down
5 changes: 3 additions & 2 deletions app/actions/server.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { SERVER } from './actionsTypes';

export function selectServerRequest(server, version, fetchVersion = true) {
export function selectServerRequest(server, version, fetchVersion = true, changeServer = false) {
return {
type: SERVER.SELECT_REQUEST,
server,
version,
fetchVersion
fetchVersion,
changeServer
};
}

Expand Down
3 changes: 3 additions & 0 deletions app/constants/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const themes = {
auxiliaryText: '#9ca2a8',
infoText: '#6d6d72',
tintColor: '#1d74f5',
tintActive: '#549df9',
auxiliaryTintColor: '#6C727A',
actionTintColor: '#1d74f5',
separatorColor: '#cbcbcc',
Expand Down Expand Up @@ -80,6 +81,7 @@ export const themes = {
auxiliaryText: '#9297a2',
infoText: '#6D6D72',
tintColor: '#1d74f5',
tintActive: '#549df9',
auxiliaryTintColor: '#f9f9f9',
actionTintColor: '#1d74f5',
separatorColor: '#2b2b2d',
Expand Down Expand Up @@ -125,6 +127,7 @@ export const themes = {
auxiliaryText: '#b2b8c6',
infoText: '#6d6d72',
tintColor: '#1e9bfe',
tintActive: '#76b7fc',
auxiliaryTintColor: '#f9f9f9',
actionTintColor: '#1e9bfe',
separatorColor: '#272728',
Expand Down
19 changes: 10 additions & 9 deletions app/containers/List/ListItem.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react';
import {
View,
Text,
StyleSheet,
I18nManager
View, Text, StyleSheet, I18nManager
} from 'react-native';
import PropTypes from 'prop-types';

Expand Down Expand Up @@ -82,11 +79,12 @@ const Content = React.memo(({
));

const Button = React.memo(({
onPress, ...props
onPress, backgroundColor, underlayColor, ...props
}) => (
<Touch
onPress={() => onPress(props.title)}
style={{ backgroundColor: themes[props.theme].backgroundColor }}
style={{ backgroundColor: backgroundColor || themes[props.theme].backgroundColor }}
underlayColor={underlayColor}
enabled={!props.disabled}
theme={props.theme}
>
Expand All @@ -99,15 +97,16 @@ const ListItem = React.memo(({ ...props }) => {
return <Button {...props} />;
}
return (
<View style={{ backgroundColor: themes[props.theme].backgroundColor }}>
<View style={{ backgroundColor: props.backgroundColor || themes[props.theme].backgroundColor }}>
<Content {...props} />
</View>
);
});

ListItem.propTypes = {
onPress: PropTypes.func,
theme: PropTypes.string
theme: PropTypes.string,
backgroundColor: PropTypes.string
};

ListItem.displayName = 'List.Item';
Expand Down Expand Up @@ -137,7 +136,9 @@ Button.propTypes = {
title: PropTypes.string,
onPress: PropTypes.func,
disabled: PropTypes.bool,
theme: PropTypes.string
theme: PropTypes.string,
backgroundColor: PropTypes.string,
underlayColor: PropTypes.string
};

Button.defaultProps = {
Expand Down
12 changes: 8 additions & 4 deletions app/containers/MessageBox/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
View, Alert, Keyboard, NativeModules, Text, InteractionManager
View, Alert, Keyboard, NativeModules, Text
} from 'react-native';
import { connect } from 'react-redux';
import { KeyboardAccessoryView } from 'react-native-ui-lib/keyboard';
Expand Down Expand Up @@ -224,12 +224,12 @@ class MessageBox extends Component {
this.unsubscribeFocus = navigation.addListener('focus', () => {
// didFocus
// We should wait pushed views be dismissed
InteractionManager.runAfterInteractions(() => {
this.trackingTimeout = setTimeout(() => {
if (this.tracking && this.tracking.resetTracking) {
// Reset messageBox keyboard tracking
this.tracking.resetTracking();
}
});
}, 500);
});
this.unsubscribeBlur = navigation.addListener('blur', () => {
this.component?.blur();
Expand Down Expand Up @@ -258,6 +258,10 @@ class MessageBox extends Component {
} else if (!nextProps.message) {
this.clearInput();
}
if (this.trackingTimeout) {
clearTimeout(this.trackingTimeout);
this.trackingTimeout = false;
}
}

shouldComponentUpdate(nextProps, nextState) {
Expand Down Expand Up @@ -932,7 +936,7 @@ class MessageBox extends Component {
/>
<TextInput
ref={component => this.component = component}
style={styles.textBoxInput}
style={[styles.textBoxInput, { color: themes[theme].bodyText }]}
returnKeyType='default'
keyboardType='twitter'
blurOnSubmit={false}
Expand Down
Loading