diff --git a/android/app/build.gradle b/android/app/build.gradle index 5e03b7e19c..886b1f87ec 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -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] } diff --git a/android/app/src/debug/res/mipmap-hdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-hdpi/ic_launcher.png deleted file mode 100755 index ea0f58ac03..0000000000 Binary files a/android/app/src/debug/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/debug/res/mipmap-mdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-mdpi/ic_launcher.png deleted file mode 100755 index f98ca51c4d..0000000000 Binary files a/android/app/src/debug/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100755 index 9706b70d2a..0000000000 Binary files a/android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100755 index 1ee4de388c..0000000000 Binary files a/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100755 index 555c58844c..0000000000 Binary files a/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/debug/res/values/colors.xml b/android/app/src/debug/res/values/colors.xml deleted file mode 100644 index 56779d1e17..0000000000 --- a/android/app/src/debug/res/values/colors.xml +++ /dev/null @@ -1 +0,0 @@ - #660B0B0B \ No newline at end of file diff --git a/android/app/src/debug/res/values/strings.xml b/android/app/src/debug/res/values/strings.xml index 631d28ea8a..207352c2a8 100644 --- a/android/app/src/debug/res/values/strings.xml +++ b/android/app/src/debug/res/values/strings.xml @@ -1,5 +1,4 @@ - [DEVELOP] RocketChatRN - - No Browser Found + [DEBUG] Rocket.Chat Experimental + [DEBUG] Rocket.Chat Experimental diff --git a/android/app/src/debug/res/values/styles.xml b/android/app/src/debug/res/values/styles.xml deleted file mode 100644 index 654ec9502b..0000000000 --- a/android/app/src/debug/res/values/styles.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/android/app/src/main/ic_launcher-web.png b/android/app/src/main/ic_launcher-web.png new file mode 100644 index 0000000000..469e3e31ed Binary files /dev/null and b/android/app/src/main/ic_launcher-web.png differ diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_background.xml b/android/app/src/main/res/drawable-v24/ic_launcher_background.xml new file mode 100644 index 0000000000..6e2c4fed1d --- /dev/null +++ b/android/app/src/main/res/drawable-v24/ic_launcher_background.xml @@ -0,0 +1,21 @@ + + + + + + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000000..c4a603d4cc --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000000..c4a603d4cc --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index 427ab384bf..283cd03d73 100755 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000000..22ba3f90ce Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000000..b5e4065313 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 874d548a63..7058008e3a 100755 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000000..63495400d8 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000000..3296da8bcc Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 459fa34d00..27fe2a7e99 100755 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000000..707e833111 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..6a05faa33c Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 91be92cc10..84884b9e31 100755 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000000..bc656a040e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..d1a0abb0e9 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index e0cfa5e340..4b60c7eb8d 100755 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000000..4eeb425392 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..02cec6d94c Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index afec33cb3e..e8e7ca8c14 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,5 +1,4 @@ Rocket.Chat Experimental Rocket.Chat Experimental - No Browser Found diff --git a/app/actions/actionsTypes.js b/app/actions/actionsTypes.js index bf07a329d9..786c411fae 100644 --- a/app/actions/actionsTypes.js +++ b/app/actions/actionsTypes.js @@ -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]); diff --git a/app/actions/room.js b/app/actions/room.js index 8d4e17e962..76a37b656e 100644 --- a/app/actions/room.js +++ b/app/actions/room.js @@ -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 }; } diff --git a/app/containers/markdown/index.js b/app/containers/markdown/index.js index 990b2fc66f..5f6b29a227 100644 --- a/app/containers/markdown/index.js +++ b/app/containers/markdown/index.js @@ -22,6 +22,7 @@ import MarkdownTableCell from './TableCell'; import mergeTextNodes from './mergeTextNodes'; import styles from './styles'; +import { isValidURL } from '../../utils/url'; // Support const formatText = text => text.replace( @@ -278,7 +279,18 @@ class Markdown extends PureComponent { ); } - renderImage = ({ src }) => ; + renderImage = ({ src }) => { + if (!isValidURL(src)) { + return null; + } + + return ( + + ); + } renderEditedIndicator = () => { const { theme } = this.props; diff --git a/app/i18n/locales/de.js b/app/i18n/locales/de.js index ed625c63bf..77983dbbeb 100644 --- a/app/i18n/locales/de.js +++ b/app/i18n/locales/de.js @@ -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.', @@ -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', @@ -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', @@ -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', @@ -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.', @@ -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.', diff --git a/app/lib/methods/subscriptions/rooms.js b/app/lib/methods/subscriptions/rooms.js index 8ecb83706a..7ba99097a7 100644 --- a/app/lib/methods/subscriptions/rooms.js +++ b/app/lib/methods/subscriptions/rooms.js @@ -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(); @@ -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 }); } diff --git a/app/reducers/room.js b/app/reducers/room.js index a689a44804..6a34aa8d53 100644 --- a/app/reducers/room.js +++ b/app/reducers/room.js @@ -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 diff --git a/app/sagas/room.js b/app/sagas/room.js index 13eb8c7520..a5cd48b460 100644 --- a/app/sagas/room.js +++ b/app/sagas/room.js @@ -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'; @@ -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)); @@ -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') })); } @@ -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; diff --git a/app/utils/url.js b/app/utils/url.js new file mode 100644 index 0000000000..856eac7715 --- /dev/null +++ b/app/utils/url.js @@ -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); +}; diff --git a/app/views/RoomInfoEditView/index.js b/app/views/RoomInfoEditView/index.js index fe217ec1a9..63de0c02cf 100644 --- a/app/views/RoomInfoEditView/index.js +++ b/app/views/RoomInfoEditView/index.js @@ -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'; @@ -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 }; @@ -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'), @@ -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 } @@ -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)); diff --git a/ios/RocketChatRN/Info.plist b/ios/RocketChatRN/Info.plist index a4541cbfb8..0d086fe1d1 100644 --- a/ios/RocketChatRN/Info.plist +++ b/ios/RocketChatRN/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.5.1 + 4.6.0 CFBundleSignature ???? CFBundleURLTypes diff --git a/ios/ShareRocketChatRN/Info.plist b/ios/ShareRocketChatRN/Info.plist index 3e98094be8..b6538c7645 100644 --- a/ios/ShareRocketChatRN/Info.plist +++ b/ios/ShareRocketChatRN/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 4.5.1 + 4.6.0 CFBundleVersion 1 NSAppTransportSecurity