Commit Graph

240 Commits

Author SHA1 Message Date
Reinaldo Neto 2ab1bacdb3
[NEW] Direct link to a threaded conversation (#3406)
* [FIX] deeplinking to thread

* fix how to find threadId

* tmid as route params jumpToThreaId

* minor tweak

* minor tweak on logic

* E2E Test

* minor tweak

* wait for the return of the thread

* Minor refactor

* Fix e2e tests for docker

* popToRoot when focused and there is a jumpToThread

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-10-26 13:11:50 -03:00
Reinaldo Neto 72d50887a4
[FIX] Cannot read property 'error' of undefined when creating a channel (#3437) 2021-10-26 10:40:46 -03:00
Reinaldo Neto 2d392425ff
[FIX] Unnecessary navigation on server forced logout (#3428) 2021-10-14 16:38:32 -03:00
Reinaldo Neto d2544a79c8
[IMPROVE] Onboarding changes (#3387)
- Change the first screen of the app
- Minor changes on NewServerView and make it the first screen of the app
- Add "Create workspace" to ServerDropdown

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-09-23 11:17:53 -03:00
Alex Junior 69a67ea998
Chore: Start Typescript migration (#3279) 2021-09-13 17:41:05 -03:00
Reinaldo Neto f838825644
[FIX] Evaluate values in handle failure (#3235)
* [FIX] HEvaluating proper the error for channel, team and undefined

* Added some team errors in i18n

* Added unauthorized to i18n

* Test if there is channel name too, to prevent to show {missing roomName}

* Refactor the treatment error to check if exists before translate with i18n

* Remove some check conditional points

* Minor tweak

* Added array with error inside the createChannel

* Moved error array to inside the handleFailure

* added creating_discussion

Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-08-27 13:34:38 -03:00
Reinaldo Neto 7cd19b6a29
[FIX] Bugsnag and Analytics opt-out (#3335)
* Deleted redux actions for bugsnag and analytics, in addition fixed to eon/off reports for both

* Removed console.log

* minor tweak

* Enable and disable crashlytics and remove breadcrumb from bugsnag

* minor tweaks with the names of the variables

* minor tweak

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-08-23 11:15:01 -03:00
Diego Mello 3d5e69b8a1
Chore: Update dependencies (#3206)
* Update non-dev patches

* Update dev patches

* Update minors

* Update dev minors

* Update few non semver

* Cookies

* datepicker, netinfo, base64 and bootsplash

* Patch cookies

* Update navigation

* Device info

* mocha

* localize

* react-native-picker-select

* vector icons, xregexp, popover

* try save husky

* document picker

* Remove emotion dev

* Downgrade some libs and make sure jest is passing

* Update storybook to stable

* mocha, axios, bootsplash

* Update lint job to node 15
2021-07-20 10:23:29 -03:00
Reinaldo Neto 190853225f
[FIX] Create team crashing the app (#3248)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-07-09 11:11:26 -03:00
Diego Mello 6385daebb5
[FIX] Subscribe to settings making app to hang on login (#3254) 2021-07-06 13:22:38 -03:00
Gerzon Z f42c9149fb
[FIX] Google OAuth triggering cookies logic (#3244)
* Remove checkCookiesAndLogout

* Add loginEmailPassword to loginOAuthOrSso

* Add isFromWebView field

* Fix migrations

* Minor tweak

* Fix OAuth for other services

* Fix migrations

* Stop persisting loginEmailPassword

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-07-05 15:21:15 -03:00
Reinaldo Neto 46689930c3
[FIX] App not showing proper alert on team delete (#3219)
* [FIX] Rule to delete team's channel

* Fixed Saga and flow to delete team and team's channel

* Adjusted the warning alert as the Figma

Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-07-02 16:13:41 -03:00
Gung Wah 88191b965a
[IMPROVE] Subscribe to roles (#2992)
* [CHORE] Subscribe to Roles

* subscribe to roles-change

* add subscribe for stream-roles

* fixed subscribe roles

* Add componentDidUpdate to RoomMembersView and propType

* Update componentDidUpdate in RoomMembersView, roles reducer,  getRoles method and actionType

* Minor tweaks

* Remove componentDidUpdate

* Fix add role

* Fix initialState and remove role

* Minor try/catch fix

* Fix lint

* Fix offline first

Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
2021-07-01 13:51:19 -03:00
Diego Mello 267dfc547e
[FIX] Teams tests (#3196)
* Make team_main not optional and fix tests

* Undo isOptional and fix query

* Comment
2021-06-07 17:20:07 -03:00
Diego Mello 7e31ac75f1
[NEW] Support Google OAuth from external browser (#3134)
* Deep linking to the app

* Handle deep linking
2021-06-07 14:27:15 -03:00
Reinaldo Neto 0b7461e800
[FIX] App not showing proper alert on team leave (#3161)
* [IMPROVEMENT] refactoring how to leave team

* Fix the data passed to leaveTeam

* Fixed the lint error in i18n, the path of i18n, merged two ifs in one

* Fixed the Saga's flow when try to leave a room

* Fixed params passed to leaveRoom

* Fix the function name of leaveTeam

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-07 13:18:14 -03:00
Reinaldo Neto 981b3688f1
[FIX] Team creation not raising error if something unexpected happens (#3152)
* [IMPROVEMENT] Add error to AddExistingChannel

* Fix the alert error when create a channel

* Fix the error alert box when create channel and teams

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-27 14:27:24 -03:00
Diego Mello 3ef4ef5317
[NEW] Jump to message (#3099)
* Scrolling

* Add loadMore button at the end of loadMessagesForRoom

* Delete dummy item on tap

* Only insert loadMore dummy if there's more data

* load surrounding messages

* fixes and load next

* First dummy and dummy-next

* Save load next messages

* Check if message exists before fetching surroundings

* Refactoring List

* Jumping to message :)

* Showing blocking loader while scrolling/fetching message

* Check if message exists on local db before inserting dummy

* Delete dummies automatically when the message sent to updateMessages again

* Minor cleanup

* Fix scroll

* Highlight message

* Jump to bottom

* Load more on scroll

* Adding stories to LoadMore

* Refactoring

* Add loading indicator to LoadMore

* Small refactor

* Add LoadMore to threads

* getMoreMessages

* chat.getThreadMessages -> getThreadMessages

* Start jumping to threads

* Add jumpToMessageId on RoomView

* Nav to correct channel

* Fix PK issue on thread_messages

* Disable jump to thread from another room

* Fix nav to thread params

* Add navToRoom

* Refactor styles

* Test notch

* Fix Android border

* Fix thread message on title

* Fix NavBottomFAB on threads

* Minor cleanup

* Workaround for readThreads being called too often

* Lint

* Update tests

* Jump from search

* Go to threads from search

* Remove getItemLayout and rely on viewable items

* Fix load older

* stash working

* Fix infinite loading

* Lower itemVisiblePercentThreshhold to 10, so very long messages behave as viewable

* Add generateLoadMoreId util

* Minor cleanup

* Jump to message from notification/deep linking

* Add getMessageInfo

* Nav to threads from other rooms

* getThreadName

* Unnecessary logic

* getRoomInfo

* Colocate getMessageInfo closer to RoomView

* Minor cleanup

* Remove search from RoomActionsView

* Minor fix for search on not joined public channels

* Jump to any link

* Fix tablets

* Jump to message from MessagesView and other bug fixes

* Fix issue on Urls

* Adds race condition to cancel jump to message if it's stuck or after 5 seconds

* Jump from message search quote

* lint

* Stop onPress

* Small refactor on load methods

* Minor fixes for loadThreadMessages

* Minor typo

* LoadMore i18n

* Minor cleanup
2021-05-26 14:24:54 -03:00
Gerzon Z 9670fa623a
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team

* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView

* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView

* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view

* Minor tweaks

* Show TeamChannelsView only if joined the team

* Minor tweak

* Added AddChannelTeamView

* Added permissions, translations strings for teams,  deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView

* Refactor touch component and update removeRoom and deleteRoom methods

* Minor tweaks

* Minor tweaks for removing channels and addExistingChannelView

* Added missing events and fixed channels list

* Minor tweaks for refactored touch component

* Minor tweaks

* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable

* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable

* Minor tweak

* Update loadMessagesForRoom.js

* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item

* Fix unnecessary changes

* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView

* Updated styles, added tag story

* Minor tweak

* Minor tweaks

* Auto-join tweak

* Minor tweaks

* Minor tweak on search

* One way to refactor :P

* Next level refactor :)

* Fix create group dm

* Refactor renderItem

* Minor bug fixes

* Fix stories

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 18:14:42 -03:00
Gerzon Z 1f0ff830a3
[NEW] Create Team (#3082)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-12 16:01:29 -03:00
Diego Mello d04d0f27b6
[NEW] Basic support to Teams (#3016)
* Database migration

* RoomItem icon

* Team icons

* Teams group

* Small tweak on RoomTypeIcon

* RoomView Header

* Add team's channels to RoomView header

* Starting TeamChannelsView

* Icon size

* o data found

* Update TeamChannelsView, add teams subscriptions and send params to TeamChannelsView

* Use teams.ListRooms endpoint, render rooms list, remove unused functions

* Show team main on TeamChannelsView

* Disable swipe

* Pagination working

* Fix blinking no data found

* Search working

* Refactor to use BackgroundContainer while loading

* Go to room

* Cleanup

* Go to actions

* Events

* Lint

* Add debounce to go room

* Fix for tablet

* i18n

* Small fix

* Minor refactor

* Use local data when it exists

* Show last message

* Force teams migration

* Add stories to BackgroundContainer

* Remove unused component

* Move RoomViewHeader into containers folder

* Refactoring

* Testing RoomHeader

* i18n

* Fix server endpoint version

* Fix events

Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
2021-04-07 15:31:25 -03:00
Gung Wah 704e071275
[FIX] E2EE password hiding automatically (#2972)
* [FIX] E2EE password hiding automatically

* add e2e test

* fixed hiding banner

* move e2e tests to 01-e2eencryption

* remove console.log

* Fix tests

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-04-01 16:27:46 -03:00
Diego Mello ed181aa863
[IMPROVEMENT] Load only i18n files needed (#3014)
* Use json

* Load only i18n files needed
2021-04-01 09:38:16 -03:00
Gerzon Z c5bf13c22d
[REGRESSION] Auth via deep linking not working (#3015)
* Update rocketchat and add e2e test for deep linking

* Update rocketchat and add e2e test for deep linking

* Update deeplinking e2e

* fix deep linking auth

* Test deep linking auth

* Fix deeplink to rid and add tests

* Small refactor

* Add non existing server test

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-03-31 18:01:20 -03:00
Gerzon Z 1ff6530a19
[FIX] App forgetting workspace when server is not finished added (#2798)
* [FIX] App forgetting workspace

* Added e2e tests

* Update login.js

* Update logout.js

* Reverted changes on login and share, updated init

* Update 08-persistantworkspace.spec.js

* Revert unnecessary changes

* Revert line change

* Update share.js

* Tweak tests

* Use wm shorthand

* Remove irrelevant calls to RocketChat.TOKEN_KEY

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-03-18 10:18:33 -03:00
Diego Mello cc8dc6a75a
[FIX] Deep linking and other connectivity issues (#2894)
* Navigate from push notification only if necessary

* Use JS SDK branch

* Stop reconnecting if it's already connected

* Fix RoomsListView forever loading after tapping push notification of another server

* Execute fewer operations on app/index

* Remove roomsRequest call from onForeground

* Apply check and reopen

* Stop opening in-app notification when the app is on backgorund

* Connecting tweaks

* Fix deep linking not working if the app is on background

* Force reset yarn cache

* Upgrade JS SDK

* Remove listener on unmount

* Fix resume on Android after back button is pressed

* Fix local authentication resume

* Fix back button android

* Change JS SDK branch
2021-03-05 13:10:21 -03:00
Gung Wah 98890df773
[CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-02-26 13:25:51 -03:00
Gung Wah e98116587d
[CHORE] Add permissions to Redux (#2914)
* [FIX] Add permissions to Redux store

* add only permissions being used in the app

* add clear permissions reducer

* call RocketChat.hasPermission from reducer

* add server version comparison on getPermissions

* refactor hasPermission function

* refactor hasPermission function

* remove uncomment code

* use Q.experimentalSortBy()

* add coerce function

* Change Rocketchat.hasPermission

* Apply on isReadOnly

* Apply to RoomInfoEditView

* Apply to RoomInfoView and RoomInfoEditView

* canAutoTranslate

* Unnecessary clear permissions

* Revert getUpdatedSince

* Naming fix

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-02-25 13:41:44 -03:00
Diego Mello f579641660
[FIX] Support Jitsi_URL_Room_Hash (#2905) 2021-02-22 18:37:13 -03:00
Gung Wah 3264746400
[FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding

* fix.breadcrumbs-exceeding-change-events

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-02-11 18:44:50 -03:00
Diego Mello acd5f04314
[FIX] Share extension memory issues on iOS (#2845)
* Remove unnecessary class prop

* Stop rendering servers when there's only one

* Map and alloc only necessary columns from query

* Fetch servers count instead of all servers records

* Fetch only needed servers

* Separators

* Remove renderContent

* Minor fix

* Refactor query

* Smaller avatars in memory

* Fix getItemLayout

* Add topic

* Load less pods

* tests

* Import only used functions from lodash

* Fix pods

* Import only used functions from semver

* Fix media sharing

* Update pods

* Disables preview and thumb on iOS

* Update expo-video-thumbnail

* Unnecessary change
2021-02-01 14:18:55 -03:00
Diego Mello db5074ab70
[NEW] Encrypted Discussions (#2813)
* I18n key fix

* Add encrypted switch

* Remove unused i18n keys

* Add enabled to encryption reducer

* Show encrypted option on CreateDiscussionView only when e2e encryption is properly set

* Add localSearch and use it on search

* Use encrypted from parent channel

* Fix method calls as rest api with 2fa enabled

* Fix logout after reset keys

* Use encryption reducer instead of lib directly to check render

* Check for room type logic to display encryption option on create discussion

* Check toggle-room-e2e-encryption permission on RoomActionsView

* Check for encryption status instead of setting on server

* Fix

* Disable switch instead of hide it

* Fix spotlight for DMs

* Fix server test
2021-01-20 14:34:01 -03:00
Diego Mello 645754674d
[CHORE] Remove some migrations (#2792)
* Remove force rooms refresh

* Remove MMKV migration
2021-01-14 14:06:38 -03:00
Diego Mello 7f0abe1713
[FIX] Rooms list not being updated on some cases (#2765)
* Request subscriptions on RoomsListView.constructor

* Removes opened rooms from last message persisting

* Change server reducer

* Prevent undefined ids causing query error
2021-01-13 11:16:00 -03:00
Sumukha Hegde 53c51feca2
[FIX] Generate Jitsi access token when making a call (#2694)
fixes: #2693

 # Please enter the commit message for your changes. Lines starting

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-01-04 10:34:29 -03:00
Djorkaeff Alexandre 10ba9d5138
[NEW] Support RTL (#2656)
* wip: RTL (iOS)

* wip: RTL (Android)

* wip: reload bundle when change between RTL languages

* fix: Stack Animation on Android

* fix: update snapshot

* fix: Swipe Room Actions in RTL mode

* fix: snapshots

* Move isRTL to i18n

* Fix styling

* Update tests

* Update pods

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-11-30 18:47:05 -03:00
Djorkaeff Alexandre 155fc04aca
[NEW] Support client certificates for SSL (two-way authentication) (Android) (#2624)
* wip: Android SSL Pinning

* Use own SSLPinningModule

* wip: Use Rocket.Chat own react-native

* wip: Fresco Images using custom OkHttpClient

* wip: react-native-webview onReceivedClientCertRequest

* feat: Save Images of a SSL Pinning protected server

* chore: SSLPinning package as a interface to iOS & Android implementations

* chore: update glide

* feat: load images under a client ssl certificate protected server

* chore: remove patch

* feat: Audio & Video under a SSL Client protected server

* fix: Unpin certificate when change server

* feat: Fast Image as a patch

* chore: update fast-image

* Fix merge

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-11-30 14:00:06 -03:00
Djorkaeff Alexandre 080b8cc3fc
[FIX] Storybook not able to import Avatar (#2607)
* [FIX] Storybook not able to import Avatar

* Fix lint

* Mock Date.now

* Fix RU translation

* isLegacy -> serverVersion

* Remove change avatar from room info edit for servers below 3.6

* Mock for storyshots only

* lint

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-11-04 13:53:44 -03:00
Diego Mello fade17d0de
[IMPROVEMENT] Add `Change Encryption Password` and `Reset E2E Key` (#2542)
* init

* Basic tests passing

* Add SecurityPrivacyView

* List.Item

* section

* Start removing theme as prop

* Remove StatusBar theme prop

* SafeAreaView theme prop

* Minor fixes

* List.Container

* Add translateTitle and translateSubtitle props

* Storybook

* Show action indicator

* Header

* Info

* Theme stories

* FlatList

* DisplayName

* Fix settings

* FlatList tweaks

* ThemeView

* Screen Lock Config

* DefaultBrowserView

* PickerView and User Prefs

* Notification Prefs

* StatusView

* Auto Translate

* InviteUsersEdit

* Visitor

* Minor fixes

* Remove Separator

* Remove iteminfo

* Font scale

* Legal

* Jitsi and e2e

* Block

* search, star, etc

* auto translate and notifications

* RoomInfo

* Refactor RoomActions

* lint

* Remove DisclosureIndicator

* padding horizontal 12

* Detox

* Tests

* SecurityPrivacy

* E2E encryption sec view

* stash

* Reset own key

* Reset key

* Change password

* Hide content

* Small refactor

* Fix tests

* Tests passing

* Change test order

* add pt-br

* Address review comments

* tests

* Missing i18n ptbr

Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
2020-10-30 15:31:04 -03:00
Diego Mello 6271b885ee
[NEW] Threads (#2567)
* [IMPROVEMENT] Mentions layout without background

* Fix RoomItem

* Fix tests

* Smaller messagebox

* Messagebox colors tweak

* Beginning header buttons refactor

* Add HeaderButtons

* item with title

* Refactor

* Remove lib

* Refactor

* Update snapshot

* Send to channel on messagebox

* Add tshow

* Add showMessageInMainThread to login.user reducer

* Filter threads on main channel based on user setting

* Send tshow

* Add tunread

* Move unread colors logic away from UnreadBadge component so it can be used on other components

* Export UnreadBadge on index

* Add empty test

* Refactor

* Update tests

* Lint

* Thread unread user and group on RoomItem

* Thread badge working

* Started ThreadMessagesView.Item

* Fix separator

* Reactivity working

* Lint

* custom emojis aren't necessary

* Basic filter layout

* Filtering layout

* Refactor

* apply filter

* DropdownItemHeader

* default all

* few fixes

* No data found

* Fixes list performance issues

* Use locale on date formats

* Fixed minor styles

* Thread badge

* Refactor getBadgeColor

* Fix send to channel background color

* starting search threads

* Fix lint and tests

* Bump to 4.12.0 just for testing :)

* Search input layout

* query

* starting threads header

* fix unnecessary tlm on tmid messages

* Fix thread header

* lint

* Fix thread header on ShareView

* Add e2e tests

* Fix subscriptions sort

* Update stories and minor fixes

* Fix button sizes on Messagebox

* Remove comment

* Unnecessary conditional

* Add showMessageInMainThread to user collection

* Fix thread header

* Fix thread messages not working on tablet

* Reset Messagebox.tshow after sending a message

* Allow to send to channel when replying to a thread from main channel

* Unnecessary theme prop

* Address comments

* Remove re-render

* Fix scroll indicator bug

* Fix style

* Minor i18n fix

* Fix dropdown height

* I18n ptbr

* I18n
2020-10-30 14:35:07 -03:00
Djorkaeff Alexandre 734039191f
[FIX] Avatar cache invalidation (#2311)
* [WIP] Avatar cache invalidation

* [WIP] Avatar container

* [IMPROVEMENT] Avatar container

* [CHORE] Improve code

* Allow static image on Avatar

* Fix avatar changing while change username (#1583)

Co-authored-by: Prateek93a <prateek93a@gmail.com>

* Add default props to properly update on Sidebar and ProfileView

* Fix subscribing on the wrong moment

* Storyshots update

* RoomItem using Avatar Component

* use iife to unsubscribe from user

* Use component on avatar container

* RoomItem as a React.Component

* Move servers models to servers folder

* Avatar -> AvatarContainer

* Users indexed fields

* Initialize author and check if u is present

* Not was found -> User not found (turn comments more relevant)

* RoomItemInner -> Wrapper

* Revert Avatar Touchable logic

* Revert responsability of LeftButton on Tablet Mode

* Prevent setState on constructor

* Run avatarURL only when its not static

* Add streams RC Version

* Move entire add user logic to result.success

* Reorder init on RoomItem

* onPress as a class function

* Fix roomItem using same username

* Add avatar Stories

* Fix pick an image from gallery on ProfileView

* get avatar etag on select users of create discussion

* invalidate ci cache

* Fix migration

* Fix sidebar avatar not updating

Co-authored-by: Prateek93a <prateek93a@gmail.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-10-30 10:12:02 -03:00
Djorkaeff Alexandre 60dc128c63
[NEW] E2E Encryption push (iOS) (#2463)
* link pods to notification service

* push encryption poc

* decrypt room key poc

* read user key from mmkv and cast into a pkcs

* push decrypt poc (iOS)

* expose needed watermelon methods

* watermelon -> database

* indent & simple-crypto update

* string extensions

* storage

* toBase64 -> toData

* remove a forced unwrap

* remove unused import

* database driver

* improvement

* folder structure & watermelon bridge

* more improvement stuff

* watermelon -> database

* reuse database instance

* improvement

* database fix: bypass watermelon cache

* some code improvements

* encryption instances

* start api stuff

* network layer

* improve notification service

* improve folder structure

* watermelon patch

* retry fetch logic

* rocketchat class

* fix try to decrypt without a roomKey

* fallback to original content that is translated

* some fixes to rocketchat logic

* merge develop

* remove unnecessary extension

* [CHORE] Improve reply notification code (iOS)

* undo sign changes

* remove mocked value

* import direct from library

* send message request

* reply notification with encrypted message working properly

* revert apple sign

* fix api onerror

* trick to display sender name on group notifications

* revert data.host change

* fix some multithread issues

* use sendername sent by server

* small improvement

* Bump crypto lib

* Update ios/NotificationService/NotificationService.swift

* add experimental string

* remove trailing slash

* remove trailing slash on reply

* fix decrypt messages

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-09-24 15:34:13 -03:00
Djorkaeff Alexandre b9a79a1724
[FIX] Language set by web client (#2488)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-09-24 11:13:23 -03:00
Djorkaeff Alexandre 8ae489074e
[CHORE] Change database location to Experimental Apps (#2483)
* change database location of experimental apps

* fix migration from older versions
2020-09-23 14:16:04 -03:00
Youssef Muhamad 639d667838
[NEW] Toggle analytics events (#2422)
* Create flow to toggle analytics events on memory

* Persist toggle analytics events

* Update crash report to contemplate analytics events

* Minor tweaks

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-09-11 14:34:11 -03:00
Ezequiel de Oliveira d37678b354
[NEW] Show server history (#2421)
* Add dropdown

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Adding new table to serverSchema

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Saving if not exists

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* list of visited servers finished

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Fix lint

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Rename ServerLinks to ServersHistory

* Refactor

* Save username

* Sort servers desc

* ServerInput

* Item

* Refactor

* Layout tweaks

* Layout

* query by text

* Small refactor

* Redirecting to login

* Save username for oauth

* Fix keyboard persist

* Add tests

* Unnecessary yield

* Stop rendering FlatList logic when there's no servers on history

* Dismiss keyboard and autocomplete when tapped outside server TextInput

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-09-11 14:10:16 -03:00
Diego Mello 334140df0d
[IMPROVEMENT] Show errors on server enter (#2449)
* Catching errors

* [IMPROVEMENT] Show errors on server enter

* "Not rc server" instead of "invalid or insecure url" msg
2020-09-11 13:30:28 -03:00
Djorkaeff Alexandre 3c9017a62d
[NEW] E2E Encryption (#2394)
* Add E2EKey to Subscription Model

* Install react-native-simple-crypto

* Install bytebuffer

* Add translations

* CreateChannel Encrypted toggle

* Request E2E_Enabled setting

* Add some E2E API methods

* POC E2E Encryption

* Garbage remove

* Remove keys cleaner

* Android cast JWK -> PKCS1

* Initialize E2E when Login Success

* Add some translations

* Add e2e property to Message model

* Send Encrypted messages

* (iOS) PKCS1 -> JWK & e2e.setUserPublicAndPrivateKeys

* (Android) PKCS1 -> JWK & e2e.setUserPublicAndPrivateKeys

* Create an encrypted channel

* Fix app crashing on RoomsList

* Create room key

* Set Room E2E Key (Android)

* Edit room encrypted

* Show encrypted icon on messages

* logEvents

* Decrypt pending subscriptions & messages

* Handle user cancel e2e password entry

* E2ESavePasswordView

* Update Snapshot

* Add encrypted props to message on Send

* Thread messages encryption

* E2E -> Encryption

* Share Extension: Share encrypted text

* (POC) Search messages on Encrypted room

* Provide room key to new users

* Request roomKey on stream-notify-room-users

* Add e2eKeyId to Room Model

* (WIP) E2E Encryption Screens

* Remove encryption subscription file

* Move E2E_Enable to Server Model

* Encryption List Banner

* Move Encryption init to Sagas

* Show banner only when enabled

* Use RocketChat/react-native-simple-crypto

* Search on WM only when is an Encrypted channel

* (WIP) Encryption Banner

* Encryption banner

* Patch -> Fork

* Improve send encrypted message

* Update simple-crypto

* Not decrypt already decrypted messages

* Add comments

* Change eslint disable to inline

* Improve code

* Remove comment

* Some fixes

* (WIP) Encryption Screens

* Improve sub find

* Resend an encrypted message

* Fix comment

* Code improvements

* Hide e2e buttons on features if it is not enabled

* InApp notifications of a encrypted room

* Encryption stop logic

* Edit encrypted message

* DB batch on decryptPending

* Encryption ready client

* Comments

* Handle getRoomInstance errors

* Multiple messages decrypt

* Remove unnecessary try/catch

* Fix decrypt all messages history

* Just add a questionmark

* Fix some subscriptions missing decrypt

* Disable request key logic

* Fix unicode emojis

* Fix e2ekey request

* roomId -> subscription

* Decrypt subscription after merge

* E2ERoom -> EncryptionRoom

* Fix infinite loading

* Handle import key errors

* Handle request key errors

* Move e2eRequestRoomKey to Rocket.Chat

* WIP handshake when key should be requested

* Add search messages explanation

* Remove some TODO and update comments

* Improvements

* Dont show message hash to user

* Handle key request & prevent multiple calls

* Request E2EKey on decryptSubscription that doesn't exists on database yet

* Insert decrypted subscription

* Fix crash after login

* Decrypt sub when receive the key

* Decrypt pending messages of a room

* Encrypted as a switch

* Buffer to Base64 URI Safe

* Add a relevant comment

* Prevent import key without a privateKey

* Prevent create a new instance when client is not ready

* Update simple-crypto & remove replace trick

* More comments

* Remove useless comment

* Remove useless try/catch

* I18n all E2E screens

* E2ESavePassword -> E2ESaveYourPassword

* Prevent multiple views on message when is not encrypted

* Fix encryption toggle not working sometimes

* follow some suggestions

* dont rotate icons

* remove unnecessary condition

* remove unreachable event

* create channel comment

* disable no-bitwise rule for entire file

* loadKeys -> persistKeys

* getMasterKey -> generateMasterKey

* explicit difference between E2EKey & e2eKeyId

* roomId -> rid

* group columns

* Remove server selector

* missing log events

* remove comment

* use stored public key

* update simple-crypto & remove base64-js patch

* add some logs

* remove unreachable condition

* log errors

* handle errors on provide key directly on subscription

* Downgrade RocketChat/react-native-simple-crypto

* improve get room instance

* migration of older apps

* check encrypted status before send a message

* wait client ready

* use our own base64-js

* add more jest tests

* explain return

* remove unncessary stop

* thrown error to caller

* remove superfluous checks

* use Encryption property

* change ready state logic

* ready -> establishing

* encryption.room -> encryptionRoom

* EncryptionRoom -> Room

* add documentation

* wait establishing before provide a room key

* remove superfluous condition

* improve error handling logic

* fallback e2ekey set

* remove no longer necessary check

* remove e.g.

* improve getRoomInstance

* import from index

* use batch

* fix a comment

* decrypt tmsg

* dont show hash when message is encrypted

* Fix detox

* Apply suggestions from code review

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-09-11 11:31:38 -03:00
Diego Mello 7172c028cc
[IMPROVEMENT] Move toggle and inquiry to Enterprise Edition license (#2426)
* [IMPROVEMENT] Move toggle and inquiry to Enterprise

* Move inquiry stream to ee

* Emit inquiry subscribe

* imports to ee last

* Add readme to ee

Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
2020-08-28 16:41:08 -03:00
Ezequiel de Oliveira 15c12f8901
[FIX] Logout from custom oauth (#2377)
* New field in table of users

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Saving when the user logged in with email and password

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Saving login method info

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Ask for the user to clear cookies

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Fix lint

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Removing loginMethod from redux and add I18n

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Using async/await instead of then/catch

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Fix lint

Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com>

* Pods

* Added dismissText on showConfirmationAlert

* Fix iOS

* Rename function

* I18n tweaks

Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-08-25 17:04:18 -03:00