Skip to content

Commit

Permalink
Merge branch 'develop' into test.sdk-disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored Mar 20, 2020
2 parents 1adc2d5 + 975a038 commit 59a8645
Show file tree
Hide file tree
Showing 40 changed files with 117 additions and 48 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.5.1"
versionName "4.6.0"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion android/app/src/debug/res/values/colors.xml

This file was deleted.

5 changes: 2 additions & 3 deletions android/app/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<resources>
<string name="app_name">[DEVELOP] RocketChatRN</string>

<string name="no_browser_found">No Browser Found</string>
<string name="app_name">[DEBUG] Rocket.Chat Experimental</string>
<string name="share_extension_name">[DEBUG] Rocket.Chat Experimental</string>
</resources>
9 changes: 0 additions & 9 deletions android/app/src/debug/res/values/styles.xml

This file was deleted.

Binary file added android/app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions android/app/src/main/res/drawable-v24/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M0,0h512v512h-512z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="0"
android:startX="256"
android:endY="512"
android:endX="256"
android:type="linear">
<item android:offset="0" android:color="#FF1C82FF"/>
<item android:offset="1" android:color="#FF0066E3"/>
</gradient>
</aapt:attr>
</path>
</vector>
5 changes: 5 additions & 0 deletions android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<resources>
<string name="app_name">Rocket.Chat Experimental</string>
<string name="share_extension_name">Rocket.Chat Experimental</string>
<string name="no_browser_found">No Browser Found</string>
</resources>
2 changes: 1 addition & 1 deletion app/actions/actionsTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const ROOMS = createRequestTypes('ROOMS', [
'OPEN_SEARCH_HEADER',
'CLOSE_SEARCH_HEADER'
]);
export const ROOM = createRequestTypes('ROOM', ['LEAVE', 'DELETE_INIT', 'DELETE_FINISH', 'USER_TYPING']);
export const ROOM = createRequestTypes('ROOM', ['LEAVE', 'DELETE', 'REMOVED', 'USER_TYPING']);
export const APP = createRequestTypes('APP', ['START', 'READY', 'INIT', 'INIT_LOCAL_SETTINGS']);
export const MESSAGES = createRequestTypes('MESSAGES', ['REPLY_BROADCAST']);
export const CREATE_CHANNEL = createRequestTypes('CREATE_CHANNEL', [...defaultTypes]);
Expand Down
8 changes: 4 additions & 4 deletions app/actions/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ export function leaveRoom(rid, t) {
};
}

export function deleteRoomInit(rid, t) {
export function deleteRoom(rid, t) {
return {
type: types.ROOM.DELETE_INIT,
type: types.ROOM.DELETE,
rid,
t
};
}

export function deleteRoomFinish() {
export function removedRoom() {
return {
type: types.ROOM.DELETE_FINISH
type: types.ROOM.REMOVED
};
}

Expand Down
14 changes: 13 additions & 1 deletion app/containers/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import MarkdownTableCell from './TableCell';
import mergeTextNodes from './mergeTextNodes';

import styles from './styles';
import { isValidURL } from '../../utils/url';

// Support <http://link|Text>
const formatText = text => text.replace(
Expand Down Expand Up @@ -278,7 +279,18 @@ class Markdown extends PureComponent {
);
}

renderImage = ({ src }) => <Image style={styles.inlineImage} source={{ uri: src }} />;
renderImage = ({ src }) => {
if (!isValidURL(src)) {
return null;
}

return (
<Image
style={styles.inlineImage}
source={{ uri: encodeURI(src) }}
/>
);
}

renderEditedIndicator = () => {
const { theme } = this.props;
Expand Down
21 changes: 21 additions & 0 deletions app/i18n/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,21 @@ export default {
Has_joined_the_channel: 'Ist dem Kanal beigetreten',
Has_joined_the_conversation: 'Hat sich dem Gespräch angeschlossen',
Has_left_the_channel: 'Hat den Kanal verlassen',
Hide_System_Messages: 'Systemnachrichten verstecken',
Hide_type_messages: 'Verstecke "{{type}}"-Nachrichten',
Message_HideType_uj: 'Nutzer beigetreten',
Message_HideType_ul: 'Nutzer verlassen',
Message_HideType_ru: 'Nutzer entfernt',
Message_HideType_au: 'Nutzer hinzugefügt',
Message_HideType_mute_unmute: 'Nutzer stummgeschaltet / freigegeben',
Message_HideType_r: 'Raumname geändert',
Message_HideType_ut: 'Nutzer ist der Unterhaltung beigetreten',
Message_HideType_wm: 'Willkommen',
Message_HideType_rm: 'Nachricht entfernt',
Message_HideType_subscription_role_added: 'Rolle wurde gesetzt',
Message_HideType_subscription_role_removed: 'Rolle nicht länger definiert',
Message_HideType_room_archived: 'Raum archiviert',
Message_HideType_room_unarchived: 'Raum nicht mehr archiviert',
In_app: 'In-App-Browser',
IN_APP_AND_DESKTOP: 'IN-APP UND DESKTOP',
In_App_and_Desktop_Alert_info: 'Zeigt ein Banner oben am Bildschirm, wenn die App geöffnet ist und eine Benachrichtigung auf dem Desktop.',
Expand Down Expand Up @@ -249,6 +264,8 @@ export default {
Message_actions: 'Nachrichtenaktionen',
Message_pinned: 'Eine Nachricht wurde angeheftet',
Message_removed: 'Nachricht entfernt',
Message_starred: 'Nachricht favorisiert',
Message_unstarred: 'Nachricht nicht mehr favorisiert',
message: 'Nachricht',
messages: 'Nachrichten',
Message: 'Nachricht',
Expand All @@ -275,6 +292,7 @@ export default {
No_results_found: 'Keine Ergebnisse gefunden',
No_starred_messages: 'Keine markierten Nachrichten',
No_thread_messages: 'Keine Threadnachrichten',
No_label_provided: 'Kein(e) {{label}} gesetzt.',
No_Message: 'Keine Nachricht',
No_messages_yet: 'Noch keine Nachrichten',
No_Reactions: 'Keine Reaktionen',
Expand All @@ -294,6 +312,7 @@ export default {
Only_authorized_users_can_write_new_messages: 'Nur autorisierte Benutzer können neue Nachrichten schreiben',
Open_emoji_selector: 'Öffne die Emoji-Auswahl',
Open_Source_Communication: 'Open-Source-Kommunikation',
Overwrites_the_server_configuration_and_use_room_config: 'Übergeht die Servereinstellungen und nutzt Einstellung für den Raum',
Password: 'Passwort',
Permalink_copied_to_clipboard: 'Permalink in die Zwischenablage kopiert!',
Pin: 'Anheften',
Expand Down Expand Up @@ -453,6 +472,7 @@ export default {
Username_is_empty: 'Der Benutzername ist leer',
Username: 'Benutzername',
Username_or_email: 'Benutzername oder E-Mail-Adresse',
Uses_server_configuration: 'Nutzt Servereinstellungen',
Validating: 'Validierung',
Verify_email_title: 'Registrierung erfolgreich!',
Verify_email_desc: 'Wir haben dir eine Email geschickt um deine Anmeldung zu bestätigen. Wenn du keine Email erhältst, komme bitte wieder und versuche es noch einmal.',
Expand All @@ -473,6 +493,7 @@ export default {
You_can_search_using_RegExp_eg: 'Sie können mit RegExp suchen. z.B. `/ ^ text $ / i`',
You_colon: 'Sie: ',
you_were_mentioned: 'Sie wurden erwähnt',
You_were_removed_from_channel: 'Sie wurden aus dem Kanal {{channel}} entfernt',
you: 'Sie',
You: 'Sie',
Logged_out_by_server: 'Du bist vom Server abgemeldet worden. Bitte melde dich wieder an.',
Expand Down
4 changes: 2 additions & 2 deletions app/lib/methods/subscriptions/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { handlePayloadUserInteraction } from '../actions';
import buildMessage from '../helpers/buildMessage';
import RocketChat from '../../rocketchat';
import EventEmmiter from '../../../utils/events';
import { deleteRoomFinish } from '../../../actions/room';
import { removedRoom } from '../../../actions/room';

const removeListener = listener => listener.stop();

Expand Down Expand Up @@ -245,7 +245,7 @@ export default function subscribeRooms() {
// Delete and remove events come from this stream
// Here we identify which one was triggered
if (data.rid === roomState.rid && roomState.isDeleting) {
store.dispatch(deleteRoomFinish());
store.dispatch(removedRoom());
} else {
EventEmmiter.emit('ROOM_REMOVED', { rid: data.rid });
}
Expand Down
10 changes: 8 additions & 2 deletions app/reducers/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ const initialState = {

export default function(state = initialState, action) {
switch (action.type) {
case ROOM.DELETE_INIT:
case ROOM.LEAVE:
return {
...state,
rid: action.rid,
isDeleting: true
};
case ROOM.DELETE_FINISH:
case ROOM.DELETE:
return {
...state,
rid: action.rid,
isDeleting: true
};
case ROOM.REMOVED:
return {
...state,
isDeleting: false
Expand Down
34 changes: 18 additions & 16 deletions app/sagas/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {

import Navigation from '../lib/Navigation';
import * as types from '../actions/actionsTypes';
import { deleteRoomFinish } from '../actions/room';
import { removedRoom } from '../actions/room';
import RocketChat from '../lib/rocketchat';
import log from '../utils/log';
import I18n from '../i18n';
Expand All @@ -28,12 +28,24 @@ const watchUserTyping = function* watchUserTyping({ rid, status }) {
}
};

const handleRemovedRoom = function* handleLeaveRoom({ result }) {
if (result.success) {
yield Navigation.navigate('RoomsListView');
}
// types.ROOM.REMOVE is triggered by `subscriptions-changed` with `removed` arg
const { timeout } = yield race({
deleteFinished: take(types.ROOM.REMOVED),
timeout: delay(3000)
});
if (timeout) {
put(removedRoom());
}
};

const handleLeaveRoom = function* handleLeaveRoom({ rid, t }) {
try {
const result = yield RocketChat.leaveRoom(rid, t);
if (result.success) {
yield Navigation.navigate('RoomsListView');
}
yield handleRemovedRoom({ result });
} catch (e) {
if (e.data && e.data.errorType === 'error-you-are-last-owner') {
Alert.alert(I18n.t('Oops'), I18n.t(e.data.errorType));
Expand All @@ -46,17 +58,7 @@ const handleLeaveRoom = function* handleLeaveRoom({ rid, t }) {
const handleDeleteRoom = function* handleDeleteRoom({ rid, t }) {
try {
const result = yield RocketChat.deleteRoom(rid, t);
if (result.success) {
yield Navigation.navigate('RoomsListView');
}
// types.ROOM.DELETE_FINISH is triggered by `subscriptions-changed` with `removed` arg
const { timeout } = yield race({
deleteFinished: take(types.ROOM.DELETE_FINISH),
timeout: delay(3000)
});
if (timeout) {
put(deleteRoomFinish());
}
yield handleRemovedRoom({ result });
} catch (e) {
Alert.alert(I18n.t('Oops'), I18n.t('There_was_an_error_while_action', { action: I18n.t('deleting_room') }));
}
Expand All @@ -65,6 +67,6 @@ const handleDeleteRoom = function* handleDeleteRoom({ rid, t }) {
const root = function* root() {
yield takeLatest(types.ROOM.USER_TYPING, watchUserTyping);
yield takeLatest(types.ROOM.LEAVE, handleLeaveRoom);
yield takeLatest(types.ROOM.DELETE_INIT, handleDeleteRoom);
yield takeLatest(types.ROOM.DELETE, handleDeleteRoom);
};
export default root;
9 changes: 9 additions & 0 deletions app/utils/url.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const isValidURL = (url) => {
const pattern = new RegExp('^(https?:\\/\\/)?' // protocol
+ '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' // domain name
+ '((\\d{1,3}\\.){3}\\d{1,3}))' // OR ip (v4) address
+ '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' // port and path
+ '(\\?[;&a-z\\d%_.~+=-]*)?' // query string
+ '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
return !!pattern.test(url);
};
10 changes: 5 additions & 5 deletions app/views/RoomInfoEditView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import isEqual from 'lodash/isEqual';
import semver from 'semver';

import database from '../../lib/database';
import { deleteRoomInit as deleteRoomInitAction } from '../../actions/room';
import { deleteRoom as deleteRoomAction } from '../../actions/room';
import KeyboardView from '../../presentation/KeyboardView';
import sharedStyles from '../Styles';
import styles from './styles';
Expand Down Expand Up @@ -56,7 +56,7 @@ class RoomInfoEditView extends React.Component {

static propTypes = {
navigation: PropTypes.object,
deleteRoomInit: PropTypes.func,
deleteRoom: PropTypes.func,
serverVersion: PropTypes.string,
theme: PropTypes.string
};
Expand Down Expand Up @@ -253,7 +253,7 @@ class RoomInfoEditView extends React.Component {

delete = () => {
const { room } = this.state;
const { deleteRoomInit } = this.props;
const { deleteRoom } = this.props;

Alert.alert(
I18n.t('Are_you_sure_question_mark'),
Expand All @@ -266,7 +266,7 @@ class RoomInfoEditView extends React.Component {
{
text: I18n.t('Yes_action_it', { action: I18n.t('delete') }),
style: 'destructive',
onPress: () => deleteRoomInit(room.rid, room.t)
onPress: () => deleteRoom(room.rid, room.t)
}
],
{ cancelable: false }
Expand Down Expand Up @@ -554,7 +554,7 @@ const mapStateToProps = state => ({
});

const mapDispatchToProps = dispatch => ({
deleteRoomInit: (rid, t) => dispatch(deleteRoomInitAction(rid, t))
deleteRoom: (rid, t) => dispatch(deleteRoomAction(rid, t))
});

export default connect(mapStateToProps, mapDispatchToProps)(withTheme(RoomInfoEditView));
2 changes: 1 addition & 1 deletion ios/RocketChatRN/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.5.1</string>
<string>4.6.0</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 @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>4.5.1</string>
<string>4.6.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSAppTransportSecurity</key>
Expand Down

0 comments on commit 59a8645

Please sign in to comment.