2020-05-08 17:04:37 +00:00
|
|
|
import { InteractionManager } from 'react-native';
|
2020-09-24 19:06:02 +00:00
|
|
|
import {
|
|
|
|
Rocketchat as RocketchatClient,
|
|
|
|
settings as RocketChatSettings
|
|
|
|
} from '@rocket.chat/sdk';
|
2019-09-16 20:26:32 +00:00
|
|
|
import { Q } from '@nozbe/watermelondb';
|
2020-05-08 17:04:37 +00:00
|
|
|
import AsyncStorage from '@react-native-community/async-storage';
|
2020-10-30 13:12:02 +00:00
|
|
|
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
2020-09-11 16:30:28 +00:00
|
|
|
import RNFetchBlob from 'rn-fetch-blob';
|
2018-05-18 17:55:08 +00:00
|
|
|
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
import { compareServerVersion, methods } from './utils';
|
2017-09-21 17:08:00 +00:00
|
|
|
import reduxStore from './createStore';
|
2018-06-18 13:30:36 +00:00
|
|
|
import defaultSettings from '../constants/settings';
|
2019-09-16 20:26:32 +00:00
|
|
|
import database from './database';
|
2018-05-18 17:55:08 +00:00
|
|
|
import log from '../utils/log';
|
2019-02-07 15:48:10 +00:00
|
|
|
import { isIOS, getBundleId } from '../utils/deviceInfo';
|
2020-05-04 20:20:45 +00:00
|
|
|
import fetch from '../utils/fetch';
|
2020-11-30 17:00:06 +00:00
|
|
|
import SSLPinning from '../utils/sslPinning';
|
2018-04-24 19:34:03 +00:00
|
|
|
|
2020-09-11 14:31:38 +00:00
|
|
|
import { encryptionInit } from '../actions/encryption';
|
2019-11-27 20:52:49 +00:00
|
|
|
import { setUser, setLoginServices, loginRequest } from '../actions/login';
|
2018-12-05 20:52:08 +00:00
|
|
|
import { disconnect, connectSuccess, connectRequest } from '../actions/connect';
|
2020-10-30 15:54:02 +00:00
|
|
|
import { shareSelectServer, shareSetUser, shareSetSettings } from '../actions/share';
|
2017-08-15 19:28:46 +00:00
|
|
|
|
2018-04-24 19:34:03 +00:00
|
|
|
import subscribeRooms from './methods/subscriptions/rooms';
|
2020-03-03 21:10:39 +00:00
|
|
|
import getUsersPresence, { getUserPresence, subscribeUsersPresence } from './methods/getUsersPresence';
|
2017-08-11 18:18:09 +00:00
|
|
|
|
2018-04-24 19:34:03 +00:00
|
|
|
import protectedFunction from './methods/helpers/protectedFunction';
|
|
|
|
import readMessages from './methods/readMessages';
|
2020-03-03 20:53:48 +00:00
|
|
|
import getSettings, { getLoginSettings, setSettings } from './methods/getSettings';
|
2018-02-19 21:15:31 +00:00
|
|
|
|
2018-04-24 19:34:03 +00:00
|
|
|
import getRooms from './methods/getRooms';
|
2021-03-15 20:16:34 +00:00
|
|
|
import { setPermissions, getPermissions } from './methods/getPermissions';
|
2019-09-16 20:26:32 +00:00
|
|
|
import { getCustomEmojis, setCustomEmojis } from './methods/getCustomEmojis';
|
2020-08-21 13:38:50 +00:00
|
|
|
import {
|
|
|
|
getEnterpriseModules, setEnterpriseModules, hasLicense, isOmnichannelModuleAvailable
|
|
|
|
} from './methods/enterpriseModules';
|
2019-06-10 18:36:56 +00:00
|
|
|
import getSlashCommands from './methods/getSlashCommands';
|
2019-04-26 21:15:25 +00:00
|
|
|
import getRoles from './methods/getRoles';
|
2018-05-07 20:43:26 +00:00
|
|
|
import canOpenRoom from './methods/canOpenRoom';
|
2020-02-11 14:01:35 +00:00
|
|
|
import triggerBlockAction, { triggerSubmitView, triggerCancel } from './methods/actions';
|
2018-04-24 19:34:03 +00:00
|
|
|
|
|
|
|
import loadMessagesForRoom from './methods/loadMessagesForRoom';
|
|
|
|
import loadMissedMessages from './methods/loadMissedMessages';
|
2019-04-17 17:01:03 +00:00
|
|
|
import loadThreadMessages from './methods/loadThreadMessages';
|
2018-02-19 21:15:31 +00:00
|
|
|
|
2020-09-11 14:31:38 +00:00
|
|
|
import sendMessage, { resendMessage } from './methods/sendMessage';
|
2018-07-17 19:10:27 +00:00
|
|
|
import { sendFileMessage, cancelUpload, isUploadActive } from './methods/sendFileMessage';
|
2018-04-24 19:34:03 +00:00
|
|
|
|
2019-09-18 17:32:12 +00:00
|
|
|
import callJitsi from './methods/callJitsi';
|
2020-05-04 20:20:45 +00:00
|
|
|
import logout, { removeServer } from './methods/logout';
|
2019-09-18 17:32:12 +00:00
|
|
|
|
2019-06-10 16:23:19 +00:00
|
|
|
import { getDeviceToken } from '../notifications/push';
|
2019-09-16 20:26:32 +00:00
|
|
|
import { setActiveUsers } from '../actions/activeUsers';
|
2019-11-13 19:52:00 +00:00
|
|
|
import I18n from '../i18n';
|
2020-04-01 20:32:24 +00:00
|
|
|
import { twoFactor } from '../utils/twoFactor';
|
2020-05-05 13:11:28 +00:00
|
|
|
import { selectServerFailure } from '../actions/server';
|
2020-05-04 20:20:45 +00:00
|
|
|
import { useSsl } from '../utils/url';
|
2020-08-19 17:14:22 +00:00
|
|
|
import UserPreferences from './userPreferences';
|
2020-09-11 14:31:38 +00:00
|
|
|
import { Encryption } from './encryption';
|
2020-08-28 19:41:08 +00:00
|
|
|
import EventEmitter from '../utils/events';
|
2020-09-15 13:01:43 +00:00
|
|
|
import { sanitizeLikeString } from './database/utils';
|
2018-07-10 13:40:32 +00:00
|
|
|
|
2018-04-24 19:34:03 +00:00
|
|
|
const TOKEN_KEY = 'reactnativemeteor_usertoken';
|
2020-08-19 17:14:22 +00:00
|
|
|
const CURRENT_SERVER = 'currentServer';
|
2018-09-04 14:29:20 +00:00
|
|
|
const SORT_PREFS_KEY = 'RC_SORT_PREFS_KEY';
|
2020-11-30 17:00:06 +00:00
|
|
|
const CERTIFICATE_KEY = 'RC_CERTIFICATE_KEY';
|
2019-12-04 16:39:53 +00:00
|
|
|
export const THEME_PREFERENCES_KEY = 'RC_THEME_PREFERENCES_KEY';
|
2019-08-23 13:18:47 +00:00
|
|
|
export const CRASH_REPORT_KEY = 'RC_CRASH_REPORT_KEY';
|
2020-09-11 17:34:11 +00:00
|
|
|
export const ANALYTICS_EVENTS_KEY = 'RC_ANALYTICS_EVENTS_KEY';
|
2019-04-26 21:15:25 +00:00
|
|
|
const MIN_ROCKETCHAT_VERSION = '0.70.0';
|
2018-02-19 21:15:31 +00:00
|
|
|
|
2019-05-28 16:52:26 +00:00
|
|
|
const STATUSES = ['offline', 'online', 'away', 'busy'];
|
|
|
|
|
2017-08-13 01:35:09 +00:00
|
|
|
const RocketChat = {
|
2017-11-13 13:53:45 +00:00
|
|
|
TOKEN_KEY,
|
2020-08-19 17:14:22 +00:00
|
|
|
CURRENT_SERVER,
|
2020-11-30 17:00:06 +00:00
|
|
|
CERTIFICATE_KEY,
|
2019-09-18 17:32:12 +00:00
|
|
|
callJitsi,
|
2019-08-27 17:41:07 +00:00
|
|
|
async subscribeRooms() {
|
2020-04-03 18:03:53 +00:00
|
|
|
if (!this.roomsSub) {
|
|
|
|
try {
|
|
|
|
this.roomsSub = await subscribeRooms.call(this);
|
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
|
|
|
}
|
2019-09-16 20:26:32 +00:00
|
|
|
}
|
2019-08-27 17:41:07 +00:00
|
|
|
},
|
2020-10-30 18:31:04 +00:00
|
|
|
unsubscribeRooms() {
|
|
|
|
if (this.roomsSub) {
|
|
|
|
this.roomsSub.stop();
|
|
|
|
this.roomsSub = null;
|
|
|
|
}
|
|
|
|
},
|
2018-05-07 20:43:26 +00:00
|
|
|
canOpenRoom,
|
2018-05-24 20:17:45 +00:00
|
|
|
createChannel({
|
2020-09-11 14:31:38 +00:00
|
|
|
name, users, type, readOnly, broadcast, encrypted
|
2018-05-24 20:17:45 +00:00
|
|
|
}) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.51.0
|
2020-09-11 14:31:38 +00:00
|
|
|
return this.methodCallWrapper(type ? 'createPrivateGroup' : 'createChannel', name, users, readOnly, {}, { broadcast, encrypted });
|
2017-08-10 16:25:50 +00:00
|
|
|
},
|
2019-11-13 19:52:00 +00:00
|
|
|
async getWebsocketInfo({ server }) {
|
2020-05-04 20:20:45 +00:00
|
|
|
const sdk = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: useSsl(server) });
|
2019-11-13 19:52:00 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
await sdk.connect();
|
|
|
|
} catch (err) {
|
|
|
|
if (err.message && err.message.includes('400')) {
|
|
|
|
return {
|
|
|
|
success: false,
|
2020-09-11 16:30:28 +00:00
|
|
|
message: I18n.t('Websocket_disabled', { contact: I18n.t('Contact_your_server_admin') })
|
2019-11-13 19:52:00 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sdk.disconnect();
|
|
|
|
|
|
|
|
return {
|
|
|
|
success: true
|
|
|
|
};
|
|
|
|
},
|
2019-04-17 17:01:03 +00:00
|
|
|
async getServerInfo(server) {
|
2018-08-01 19:35:06 +00:00
|
|
|
try {
|
2020-09-24 19:06:02 +00:00
|
|
|
const response = await RNFetchBlob.fetch('GET', `${ server }/api/info`, { ...RocketChatSettings.customHeaders });
|
2020-09-11 16:30:28 +00:00
|
|
|
try {
|
|
|
|
// Try to resolve as json
|
|
|
|
const jsonRes = response.json();
|
|
|
|
if (!(jsonRes?.success)) {
|
|
|
|
return {
|
|
|
|
success: false,
|
|
|
|
message: I18n.t('Not_RC_Server', { contact: I18n.t('Contact_your_server_admin') })
|
|
|
|
};
|
2019-11-13 19:52:00 +00:00
|
|
|
}
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
if (compareServerVersion(jsonRes.version, MIN_ROCKETCHAT_VERSION, methods.lowerThan)) {
|
2018-12-21 10:55:35 +00:00
|
|
|
return {
|
|
|
|
success: false,
|
2020-09-11 16:30:28 +00:00
|
|
|
message: I18n.t('Invalid_server_version', {
|
|
|
|
currentVersion: jsonRes.version,
|
2018-12-21 10:55:35 +00:00
|
|
|
minVersion: MIN_ROCKETCHAT_VERSION
|
2020-09-11 16:30:28 +00:00
|
|
|
})
|
2018-12-21 10:55:35 +00:00
|
|
|
};
|
|
|
|
}
|
2020-09-11 16:30:28 +00:00
|
|
|
return jsonRes;
|
|
|
|
} catch (error) {
|
|
|
|
// Request is successful, but response isn't a json
|
2017-09-01 19:42:50 +00:00
|
|
|
}
|
2018-08-01 19:35:06 +00:00
|
|
|
} catch (e) {
|
2020-09-11 16:30:28 +00:00
|
|
|
if (e?.message) {
|
|
|
|
if (e.message === 'Aborted') {
|
|
|
|
reduxStore.dispatch(selectServerFailure());
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
success: false,
|
|
|
|
message: e.message
|
|
|
|
};
|
2020-05-05 13:11:28 +00:00
|
|
|
}
|
2017-09-01 19:42:50 +00:00
|
|
|
}
|
2020-09-11 16:30:28 +00:00
|
|
|
|
2018-12-21 10:55:35 +00:00
|
|
|
return {
|
|
|
|
success: false,
|
2020-09-11 16:30:28 +00:00
|
|
|
message: I18n.t('Not_RC_Server', { contact: I18n.t('Contact_your_server_admin') })
|
2018-12-21 10:55:35 +00:00
|
|
|
};
|
2017-09-01 19:42:50 +00:00
|
|
|
},
|
2019-09-16 20:26:32 +00:00
|
|
|
stopListener(listener) {
|
|
|
|
return listener && listener.stop();
|
2017-12-08 19:13:21 +00:00
|
|
|
},
|
2020-05-05 13:11:28 +00:00
|
|
|
// Abort all requests and create a new AbortController
|
|
|
|
abort() {
|
|
|
|
if (this.controller) {
|
|
|
|
this.controller.abort();
|
|
|
|
if (this.sdk) {
|
|
|
|
this.sdk.abort();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.controller = new AbortController();
|
|
|
|
},
|
2021-03-15 20:16:34 +00:00
|
|
|
checkAndReopen() {
|
|
|
|
return this?.sdk?.checkAndReopen();
|
|
|
|
},
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
disconnect() {
|
|
|
|
this.sdk?.disconnect?.();
|
|
|
|
this.sdk = null;
|
|
|
|
},
|
2019-11-27 20:52:49 +00:00
|
|
|
connect({ server, user, logoutOnError = false }) {
|
2019-06-05 19:11:29 +00:00
|
|
|
return new Promise((resolve) => {
|
2021-03-15 20:16:34 +00:00
|
|
|
if (this?.sdk?.client?.host === server) {
|
|
|
|
return resolve();
|
|
|
|
} else {
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
this.disconnect();
|
2019-09-16 20:26:32 +00:00
|
|
|
database.setActiveDB(server);
|
|
|
|
}
|
2019-06-05 19:11:29 +00:00
|
|
|
reduxStore.dispatch(connectRequest());
|
2017-11-19 02:44:55 +00:00
|
|
|
|
2019-06-05 19:11:29 +00:00
|
|
|
if (this.connectTimeout) {
|
|
|
|
clearTimeout(this.connectTimeout);
|
|
|
|
}
|
2019-02-12 16:14:11 +00:00
|
|
|
|
2019-09-16 20:26:32 +00:00
|
|
|
if (this.connectedListener) {
|
|
|
|
this.connectedListener.then(this.stopListener);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.closeListener) {
|
|
|
|
this.closeListener.then(this.stopListener);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.usersListener) {
|
|
|
|
this.usersListener.then(this.stopListener);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.notifyLoggedListener) {
|
|
|
|
this.notifyLoggedListener.then(this.stopListener);
|
|
|
|
}
|
|
|
|
|
2020-10-30 18:31:04 +00:00
|
|
|
this.unsubscribeRooms();
|
2019-06-17 13:57:07 +00:00
|
|
|
|
2020-08-28 19:41:08 +00:00
|
|
|
EventEmitter.emit('INQUIRY_UNSUBSCRIBE');
|
2020-07-31 18:22:30 +00:00
|
|
|
|
2020-04-01 20:32:24 +00:00
|
|
|
if (this.code) {
|
|
|
|
this.code = null;
|
|
|
|
}
|
|
|
|
|
2020-05-04 20:20:45 +00:00
|
|
|
this.sdk = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: useSsl(server) });
|
2019-06-05 19:11:29 +00:00
|
|
|
this.getSettings();
|
|
|
|
|
2020-04-03 18:03:53 +00:00
|
|
|
const sdkConnect = () => this.sdk.connect()
|
2019-06-05 19:11:29 +00:00
|
|
|
.then(() => {
|
2020-05-05 13:11:28 +00:00
|
|
|
const { server: currentServer } = reduxStore.getState().server;
|
|
|
|
if (user && user.token && server === currentServer) {
|
2019-11-27 20:52:49 +00:00
|
|
|
reduxStore.dispatch(loginRequest({ resume: user.token }, logoutOnError));
|
2019-06-05 19:11:29 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.log('connect error', err);
|
|
|
|
|
2020-05-18 17:55:53 +00:00
|
|
|
// when `connect` raises an error, we try again in 10 seconds
|
|
|
|
this.connectTimeout = setTimeout(() => {
|
|
|
|
if (this.sdk?.client?.host === server) {
|
2020-05-05 13:11:28 +00:00
|
|
|
sdkConnect();
|
2020-05-18 17:55:53 +00:00
|
|
|
}
|
|
|
|
}, 10000);
|
2019-06-05 19:11:29 +00:00
|
|
|
});
|
2019-02-07 15:48:10 +00:00
|
|
|
|
2020-04-03 18:03:53 +00:00
|
|
|
sdkConnect();
|
|
|
|
|
2021-03-15 20:16:34 +00:00
|
|
|
this.connectedListener = this.sdk.onStreamData('connecting', () => {
|
|
|
|
reduxStore.dispatch(connectRequest());
|
|
|
|
});
|
|
|
|
|
2019-09-16 20:26:32 +00:00
|
|
|
this.connectedListener = this.sdk.onStreamData('connected', () => {
|
2019-06-05 19:11:29 +00:00
|
|
|
reduxStore.dispatch(connectSuccess());
|
2019-02-07 15:48:10 +00:00
|
|
|
});
|
2018-04-24 19:34:03 +00:00
|
|
|
|
2019-09-16 20:26:32 +00:00
|
|
|
this.closeListener = this.sdk.onStreamData('close', () => {
|
2019-06-05 19:11:29 +00:00
|
|
|
reduxStore.dispatch(disconnect());
|
|
|
|
});
|
2019-05-28 16:52:26 +00:00
|
|
|
|
2019-09-16 20:26:32 +00:00
|
|
|
this.usersListener = this.sdk.onStreamData('users', protectedFunction(ddpMessage => RocketChat._setUser(ddpMessage)));
|
2019-06-05 19:11:29 +00:00
|
|
|
|
2020-10-30 13:12:02 +00:00
|
|
|
this.notifyLoggedListener = this.sdk.onStreamData('stream-notify-logged', protectedFunction(async(ddpMessage) => {
|
2019-06-05 19:11:29 +00:00
|
|
|
const { eventName } = ddpMessage.fields;
|
2020-10-30 13:12:02 +00:00
|
|
|
if (/user-status/.test(eventName)) {
|
2019-09-16 20:26:32 +00:00
|
|
|
this.activeUsers = this.activeUsers || {};
|
|
|
|
if (!this._setUserTimer) {
|
|
|
|
this._setUserTimer = setTimeout(() => {
|
|
|
|
const activeUsersBatch = this.activeUsers;
|
|
|
|
InteractionManager.runAfterInteractions(() => {
|
|
|
|
reduxStore.dispatch(setActiveUsers(activeUsersBatch));
|
|
|
|
});
|
|
|
|
this._setUserTimer = null;
|
|
|
|
return this.activeUsers = {};
|
|
|
|
}, 10000);
|
|
|
|
}
|
2019-06-05 19:11:29 +00:00
|
|
|
const userStatus = ddpMessage.fields.args[0];
|
2020-03-30 20:19:01 +00:00
|
|
|
const [id,, status, statusText] = userStatus;
|
|
|
|
this.activeUsers[id] = { status: STATUSES[status], statusText };
|
2019-09-16 20:26:32 +00:00
|
|
|
|
|
|
|
const { user: loggedUser } = reduxStore.getState().login;
|
|
|
|
if (loggedUser && loggedUser.id === id) {
|
2020-03-30 20:19:01 +00:00
|
|
|
reduxStore.dispatch(setUser({ status: STATUSES[status], statusText }));
|
2019-06-05 19:11:29 +00:00
|
|
|
}
|
2020-10-30 13:12:02 +00:00
|
|
|
} else if (/updateAvatar/.test(eventName)) {
|
|
|
|
const { username, etag } = ddpMessage.fields.args[0];
|
|
|
|
const db = database.active;
|
2021-03-15 20:16:34 +00:00
|
|
|
const userCollection = db.get('users');
|
2020-10-30 13:12:02 +00:00
|
|
|
try {
|
|
|
|
const [userRecord] = await userCollection.query(Q.where('username', Q.eq(username))).fetch();
|
|
|
|
await db.action(async() => {
|
|
|
|
await userRecord.update((u) => {
|
|
|
|
u.avatarETag = etag;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
// We can't create a new record since we don't receive the user._id
|
|
|
|
}
|
|
|
|
} else if (/Users:NameChanged/.test(eventName)) {
|
|
|
|
const userNameChanged = ddpMessage.fields.args[0];
|
|
|
|
const db = database.active;
|
2021-03-15 20:16:34 +00:00
|
|
|
const userCollection = db.get('users');
|
2020-10-30 13:12:02 +00:00
|
|
|
try {
|
|
|
|
const userRecord = await userCollection.find(userNameChanged._id);
|
|
|
|
await db.action(async() => {
|
|
|
|
await userRecord.update((u) => {
|
|
|
|
Object.assign(u, userNameChanged);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
// User not found
|
|
|
|
await db.action(async() => {
|
|
|
|
await userCollection.create((u) => {
|
|
|
|
u._raw = sanitizedRaw({ id: userNameChanged._id }, userCollection.schema);
|
|
|
|
Object.assign(u, userNameChanged);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
2019-05-28 16:52:26 +00:00
|
|
|
}
|
2019-06-05 19:11:29 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
resolve();
|
|
|
|
});
|
2018-11-16 11:06:29 +00:00
|
|
|
},
|
2017-11-24 20:44:52 +00:00
|
|
|
|
2019-07-29 16:33:28 +00:00
|
|
|
async shareExtensionInit(server) {
|
2019-12-04 16:41:37 +00:00
|
|
|
database.setShareDB(server);
|
2019-07-29 16:33:28 +00:00
|
|
|
|
2020-11-30 17:00:06 +00:00
|
|
|
try {
|
|
|
|
const certificate = await UserPreferences.getStringAsync(`${ RocketChat.CERTIFICATE_KEY }-${ server }`);
|
|
|
|
await SSLPinning.setCertificate(certificate, server);
|
|
|
|
} catch {
|
|
|
|
// Do nothing
|
|
|
|
}
|
|
|
|
|
2019-12-04 16:41:37 +00:00
|
|
|
if (this.shareSDK) {
|
|
|
|
this.shareSDK.disconnect();
|
|
|
|
this.shareSDK = null;
|
2019-07-29 16:33:28 +00:00
|
|
|
}
|
|
|
|
|
2020-05-04 20:20:45 +00:00
|
|
|
this.shareSDK = new RocketchatClient({ host: server, protocol: 'ddp', useSsl: useSsl(server) });
|
2019-07-29 16:33:28 +00:00
|
|
|
|
|
|
|
// set Server
|
2020-11-04 16:53:44 +00:00
|
|
|
const currentServer = { server };
|
2019-09-16 20:26:32 +00:00
|
|
|
const serversDB = database.servers;
|
2021-03-15 20:16:34 +00:00
|
|
|
const serversCollection = serversDB.get('servers');
|
2020-11-04 16:53:44 +00:00
|
|
|
try {
|
|
|
|
const serverRecord = await serversCollection.find(server);
|
|
|
|
currentServer.version = serverRecord.version;
|
|
|
|
} catch {
|
|
|
|
// Record not found
|
|
|
|
}
|
|
|
|
reduxStore.dispatch(shareSelectServer(currentServer));
|
2019-07-29 16:33:28 +00:00
|
|
|
|
2020-07-08 16:19:41 +00:00
|
|
|
RocketChat.setCustomEmojis();
|
|
|
|
|
2019-09-16 20:26:32 +00:00
|
|
|
try {
|
2020-10-30 15:54:02 +00:00
|
|
|
// set Settings
|
|
|
|
const settings = ['Accounts_AvatarBlockUnauthenticatedAccess'];
|
|
|
|
const db = database.active;
|
2021-03-15 20:16:34 +00:00
|
|
|
const settingsCollection = db.get('settings');
|
2020-10-30 15:54:02 +00:00
|
|
|
const settingsRecords = await settingsCollection.query(Q.where('id', Q.oneOf(settings))).fetch();
|
|
|
|
const parsed = Object.values(settingsRecords).map(item => ({
|
|
|
|
_id: item.id,
|
|
|
|
valueAsString: item.valueAsString,
|
|
|
|
valueAsBoolean: item.valueAsBoolean,
|
|
|
|
valueAsNumber: item.valueAsNumber,
|
|
|
|
valueAsArray: item.valueAsArray,
|
|
|
|
_updatedAt: item._updatedAt
|
|
|
|
}));
|
|
|
|
reduxStore.dispatch(shareSetSettings(this.parseSettings(parsed)));
|
|
|
|
|
|
|
|
// set User info
|
2020-08-19 17:14:22 +00:00
|
|
|
const userId = await UserPreferences.getStringAsync(`${ RocketChat.TOKEN_KEY }-${ server }`);
|
2021-03-15 20:16:34 +00:00
|
|
|
const userCollections = serversDB.get('users');
|
2019-09-16 20:26:32 +00:00
|
|
|
let user = null;
|
|
|
|
if (userId) {
|
2019-10-02 12:55:25 +00:00
|
|
|
const userRecord = await userCollections.find(userId);
|
2019-09-16 20:26:32 +00:00
|
|
|
user = {
|
2019-10-02 12:55:25 +00:00
|
|
|
id: userRecord.id,
|
|
|
|
token: userRecord.token,
|
2020-04-13 12:51:16 +00:00
|
|
|
username: userRecord.username,
|
|
|
|
roles: userRecord.roles
|
2019-09-16 20:26:32 +00:00
|
|
|
};
|
|
|
|
}
|
2020-04-13 12:51:16 +00:00
|
|
|
reduxStore.dispatch(shareSetUser(user));
|
2019-09-16 20:26:32 +00:00
|
|
|
await RocketChat.login({ resume: user.token });
|
2020-09-11 14:31:38 +00:00
|
|
|
reduxStore.dispatch(encryptionInit());
|
2019-09-16 20:26:32 +00:00
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
|
|
|
}
|
2019-07-29 16:33:28 +00:00
|
|
|
},
|
2019-12-04 16:41:37 +00:00
|
|
|
closeShareExtension() {
|
|
|
|
if (this.shareSDK) {
|
|
|
|
this.shareSDK.disconnect();
|
|
|
|
this.shareSDK = null;
|
|
|
|
}
|
|
|
|
database.share = null;
|
2020-04-13 12:51:16 +00:00
|
|
|
|
2020-11-04 16:53:44 +00:00
|
|
|
reduxStore.dispatch(shareSelectServer({}));
|
2020-05-13 19:04:50 +00:00
|
|
|
reduxStore.dispatch(shareSetUser({}));
|
2020-10-30 15:54:02 +00:00
|
|
|
reduxStore.dispatch(shareSetSettings({}));
|
2019-12-04 16:41:37 +00:00
|
|
|
},
|
2019-07-29 16:33:28 +00:00
|
|
|
|
2020-09-11 14:31:38 +00:00
|
|
|
async e2eFetchMyKeys() {
|
|
|
|
// RC 0.70.0
|
|
|
|
const sdk = this.shareSDK || this.sdk;
|
|
|
|
const result = await sdk.get('e2e.fetchMyKeys');
|
|
|
|
// snake_case -> camelCase
|
|
|
|
if (result.success) {
|
|
|
|
return {
|
|
|
|
success: result.success,
|
|
|
|
publicKey: result.public_key,
|
|
|
|
privateKey: result.private_key
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
},
|
|
|
|
e2eSetUserPublicAndPrivateKeys(public_key, private_key) {
|
|
|
|
// RC 2.2.0
|
|
|
|
return this.post('e2e.setUserPublicAndPrivateKeys', { public_key, private_key });
|
|
|
|
},
|
|
|
|
e2eRequestSubscriptionKeys() {
|
|
|
|
// RC 0.72.0
|
|
|
|
return this.methodCallWrapper('e2e.requestSubscriptionKeys');
|
|
|
|
},
|
|
|
|
e2eGetUsersOfRoomWithoutKey(rid) {
|
|
|
|
// RC 0.70.0
|
|
|
|
return this.sdk.get('e2e.getUsersOfRoomWithoutKey', { rid });
|
|
|
|
},
|
|
|
|
e2eSetRoomKeyID(rid, keyID) {
|
|
|
|
// RC 0.70.0
|
|
|
|
return this.post('e2e.setRoomKeyID', { rid, keyID });
|
|
|
|
},
|
|
|
|
e2eUpdateGroupKey(uid, rid, key) {
|
|
|
|
// RC 0.70.0
|
|
|
|
return this.post('e2e.updateGroupKey', { uid, rid, key });
|
|
|
|
},
|
|
|
|
e2eRequestRoomKey(rid, e2eKeyId) {
|
|
|
|
// RC 0.70.0
|
|
|
|
return this.methodCallWrapper('stream-notify-room-users', `${ rid }/e2ekeyRequest`, rid, e2eKeyId);
|
|
|
|
},
|
2020-10-30 18:31:04 +00:00
|
|
|
e2eResetOwnKey() {
|
|
|
|
this.unsubscribeRooms();
|
|
|
|
|
|
|
|
// RC 0.72.0
|
|
|
|
return this.methodCallWrapper('e2e.resetOwnE2EKey');
|
|
|
|
},
|
2020-09-11 14:31:38 +00:00
|
|
|
|
2020-06-29 17:57:39 +00:00
|
|
|
updateJitsiTimeout(roomId) {
|
|
|
|
// RC 0.74.0
|
2020-07-10 12:52:03 +00:00
|
|
|
return this.post('video-conference/jitsi.update-timeout', { roomId });
|
2019-09-18 17:32:12 +00:00
|
|
|
},
|
|
|
|
|
2018-12-05 20:52:08 +00:00
|
|
|
register(credentials) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.50.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('users.register', credentials, false);
|
2017-11-07 16:28:02 +00:00
|
|
|
},
|
|
|
|
|
2017-11-10 13:42:02 +00:00
|
|
|
forgotPassword(email) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.64.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('users.forgotPassword', { email }, false);
|
|
|
|
},
|
|
|
|
|
2020-08-25 20:04:18 +00:00
|
|
|
loginTOTP(params, loginEmailPassword) {
|
2020-04-01 20:32:24 +00:00
|
|
|
return new Promise(async(resolve, reject) => {
|
|
|
|
try {
|
2020-08-25 20:04:18 +00:00
|
|
|
const result = await this.login(params, loginEmailPassword);
|
2020-04-01 20:32:24 +00:00
|
|
|
return resolve(result);
|
|
|
|
} catch (e) {
|
|
|
|
if (e.data?.error && (e.data.error === 'totp-required' || e.data.error === 'totp-invalid')) {
|
|
|
|
const { details } = e.data;
|
|
|
|
try {
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
const code = await twoFactor({ method: details?.method || 'totp', invalid: details?.error === 'totp-invalid' });
|
|
|
|
|
|
|
|
if (loginEmailPassword) {
|
|
|
|
reduxStore.dispatch(setUser({ username: params.user || params.username }));
|
|
|
|
|
|
|
|
// Force normalized params for 2FA starting RC 3.9.0.
|
|
|
|
const serverVersion = reduxStore.getState().server.version;
|
|
|
|
if (compareServerVersion(serverVersion, '3.9.0', methods.greaterThanOrEqualTo)) {
|
|
|
|
const user = params.user ?? params.username;
|
|
|
|
const password = params.password ?? params.ldapPass ?? params.crowdPassword;
|
|
|
|
params = { user, password };
|
|
|
|
}
|
|
|
|
|
|
|
|
return resolve(this.loginTOTP({ ...params, code: code?.twoFactorCode }, loginEmailPassword));
|
2020-12-01 12:54:10 +00:00
|
|
|
}
|
|
|
|
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
return resolve(this.loginTOTP({
|
|
|
|
totp: {
|
|
|
|
login: {
|
|
|
|
...params
|
|
|
|
},
|
|
|
|
code: code?.twoFactorCode
|
|
|
|
}
|
|
|
|
}));
|
2020-04-01 20:32:24 +00:00
|
|
|
} catch {
|
|
|
|
// twoFactor was canceled
|
|
|
|
return reject();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
reject(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2017-11-10 13:42:02 +00:00
|
|
|
},
|
|
|
|
|
2020-04-01 20:32:24 +00:00
|
|
|
loginWithPassword({ user, password }) {
|
2018-12-05 20:52:08 +00:00
|
|
|
let params = { user, password };
|
2017-08-13 23:02:46 +00:00
|
|
|
const state = reduxStore.getState();
|
|
|
|
|
|
|
|
if (state.settings.LDAP_Enable) {
|
|
|
|
params = {
|
2019-01-31 11:48:28 +00:00
|
|
|
username: user,
|
|
|
|
ldapPass: password,
|
2017-08-13 23:02:46 +00:00
|
|
|
ldap: true,
|
|
|
|
ldapOptions: {}
|
|
|
|
};
|
|
|
|
} else if (state.settings.CROWD_Enable) {
|
|
|
|
params = {
|
2019-11-13 16:02:36 +00:00
|
|
|
username: user,
|
|
|
|
crowdPassword: password,
|
2018-10-16 20:27:37 +00:00
|
|
|
crowd: true
|
2017-08-13 23:02:46 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-08-28 15:54:15 +00:00
|
|
|
return this.loginTOTP(params, true);
|
2017-08-09 20:18:00 +00:00
|
|
|
},
|
|
|
|
|
2019-08-09 17:28:46 +00:00
|
|
|
async loginOAuthOrSso(params) {
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
const result = await this.loginTOTP(params);
|
2020-05-08 16:37:49 +00:00
|
|
|
reduxStore.dispatch(loginRequest({ resume: result.token }));
|
2018-12-05 20:52:08 +00:00
|
|
|
},
|
|
|
|
|
2020-08-25 20:04:18 +00:00
|
|
|
async login(params, loginEmailPassword) {
|
2020-05-08 16:37:49 +00:00
|
|
|
const sdk = this.shareSDK || this.sdk;
|
|
|
|
// RC 0.64.0
|
|
|
|
await sdk.login(params);
|
|
|
|
const { result } = sdk.currentLogin;
|
|
|
|
const user = {
|
|
|
|
id: result.userId,
|
|
|
|
token: result.authToken,
|
|
|
|
username: result.me.username,
|
|
|
|
name: result.me.name,
|
|
|
|
language: result.me.language,
|
|
|
|
status: result.me.status,
|
|
|
|
statusText: result.me.statusText,
|
|
|
|
customFields: result.me.customFields,
|
2020-06-26 20:45:21 +00:00
|
|
|
statusLivechat: result.me.statusLivechat,
|
2020-05-08 16:37:49 +00:00
|
|
|
emails: result.me.emails,
|
2020-08-25 20:04:18 +00:00
|
|
|
roles: result.me.roles,
|
2020-10-30 13:12:02 +00:00
|
|
|
avatarETag: result.me.avatarETag,
|
2020-10-30 17:35:07 +00:00
|
|
|
loginEmailPassword,
|
|
|
|
showMessageInMainThread: result.me.settings?.preferences?.showMessageInMainThread ?? true
|
2020-05-08 16:37:49 +00:00
|
|
|
};
|
|
|
|
return user;
|
2018-04-24 19:34:03 +00:00
|
|
|
},
|
2020-05-04 20:20:45 +00:00
|
|
|
logout,
|
2020-08-25 16:51:49 +00:00
|
|
|
logoutOtherLocations() {
|
|
|
|
const { id: userId } = reduxStore.getState().login.user;
|
|
|
|
return this.sdk.post('users.removeOtherTokens', { userId });
|
|
|
|
},
|
2020-05-04 20:20:45 +00:00
|
|
|
removeServer,
|
2020-02-05 15:12:40 +00:00
|
|
|
async clearCache({ server }) {
|
|
|
|
try {
|
|
|
|
const serversDB = database.servers;
|
|
|
|
await serversDB.action(async() => {
|
2021-03-15 20:16:34 +00:00
|
|
|
const serverCollection = serversDB.get('servers');
|
2020-02-05 15:12:40 +00:00
|
|
|
const serverRecord = await serverCollection.find(server);
|
|
|
|
await serverRecord.update((s) => {
|
|
|
|
s.roomsUpdatedAt = null;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
// Do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
const db = database.active;
|
|
|
|
await db.action(() => db.unsafeResetDatabase());
|
|
|
|
} catch (e) {
|
|
|
|
// Do nothing
|
|
|
|
}
|
|
|
|
},
|
2018-12-05 20:52:08 +00:00
|
|
|
registerPushToken() {
|
2019-06-17 13:57:07 +00:00
|
|
|
return new Promise(async(resolve) => {
|
2018-12-05 20:52:08 +00:00
|
|
|
const token = getDeviceToken();
|
|
|
|
if (token) {
|
2019-01-29 19:52:56 +00:00
|
|
|
const type = isIOS ? 'apn' : 'gcm';
|
2018-12-05 20:52:08 +00:00
|
|
|
const data = {
|
|
|
|
value: token,
|
|
|
|
type,
|
2019-02-07 15:48:10 +00:00
|
|
|
appName: getBundleId
|
2018-12-05 20:52:08 +00:00
|
|
|
};
|
2019-06-17 13:57:07 +00:00
|
|
|
try {
|
|
|
|
// RC 0.60.0
|
2020-04-01 20:32:24 +00:00
|
|
|
await this.post('push.token', data);
|
2019-06-17 13:57:07 +00:00
|
|
|
} catch (error) {
|
|
|
|
console.log(error);
|
|
|
|
}
|
2018-12-05 20:52:08 +00:00
|
|
|
}
|
|
|
|
return resolve();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
removePushToken() {
|
|
|
|
const token = getDeviceToken();
|
|
|
|
if (token) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.60.0
|
2019-02-07 15:48:10 +00:00
|
|
|
return this.sdk.del('push.token', { token });
|
2018-07-10 13:40:32 +00:00
|
|
|
}
|
2018-12-05 20:52:08 +00:00
|
|
|
return Promise.resolve();
|
2017-11-18 20:17:24 +00:00
|
|
|
},
|
2018-04-24 19:34:03 +00:00
|
|
|
loadMissedMessages,
|
|
|
|
loadMessagesForRoom,
|
2019-04-17 17:01:03 +00:00
|
|
|
loadThreadMessages,
|
2018-04-24 19:34:03 +00:00
|
|
|
sendMessage,
|
|
|
|
getRooms,
|
|
|
|
readMessages,
|
2020-09-11 14:31:38 +00:00
|
|
|
resendMessage,
|
2017-08-10 16:16:32 +00:00
|
|
|
|
2021-01-25 17:14:45 +00:00
|
|
|
async localSearch({ text, filterUsers = true, filterRooms = true }) {
|
2018-08-31 18:13:30 +00:00
|
|
|
const searchText = text.trim();
|
2019-09-16 20:26:32 +00:00
|
|
|
const db = database.active;
|
2020-09-15 13:01:43 +00:00
|
|
|
const likeString = sanitizeLikeString(searchText);
|
2021-03-15 20:16:34 +00:00
|
|
|
let data = await db.get('subscriptions').query(
|
2020-09-15 13:01:43 +00:00
|
|
|
Q.or(
|
|
|
|
Q.where('name', Q.like(`%${ likeString }%`)),
|
|
|
|
Q.where('fname', Q.like(`%${ likeString }%`))
|
2021-01-25 17:14:45 +00:00
|
|
|
),
|
|
|
|
Q.experimentalSortBy('room_updated_at', Q.desc)
|
2019-09-16 20:26:32 +00:00
|
|
|
).fetch();
|
2018-08-31 18:13:30 +00:00
|
|
|
|
|
|
|
if (filterUsers && !filterRooms) {
|
2020-04-30 18:10:19 +00:00
|
|
|
data = data.filter(item => item.t === 'd' && !RocketChat.isGroupChat(item));
|
2018-08-31 18:13:30 +00:00
|
|
|
} else if (!filterUsers && filterRooms) {
|
2020-04-30 18:10:19 +00:00
|
|
|
data = data.filter(item => item.t !== 'd' || RocketChat.isGroupChat(item));
|
2018-08-31 18:13:30 +00:00
|
|
|
}
|
2020-08-21 13:38:50 +00:00
|
|
|
|
2018-08-31 18:13:30 +00:00
|
|
|
data = data.slice(0, 7);
|
|
|
|
|
2021-03-15 20:16:34 +00:00
|
|
|
data = data.map(sub => ({
|
|
|
|
rid: sub.rid,
|
|
|
|
name: sub.name,
|
|
|
|
fname: sub.fname,
|
|
|
|
avatarETag: sub.avatarETag,
|
|
|
|
t: sub.t,
|
|
|
|
encrypted: sub.encrypted,
|
|
|
|
lastMessage: sub.lastMessage
|
|
|
|
}));
|
2020-04-13 12:51:16 +00:00
|
|
|
|
2021-01-25 17:14:45 +00:00
|
|
|
return data;
|
|
|
|
},
|
|
|
|
|
|
|
|
async search({ text, filterUsers = true, filterRooms = true }) {
|
|
|
|
const searchText = text.trim();
|
|
|
|
|
|
|
|
if (this.oldPromise) {
|
|
|
|
this.oldPromise('cancel');
|
|
|
|
}
|
|
|
|
|
|
|
|
const data = await this.localSearch({ text, filterUsers, filterRooms });
|
|
|
|
|
2018-08-31 18:13:30 +00:00
|
|
|
const usernames = data.map(sub => sub.name);
|
|
|
|
try {
|
|
|
|
if (data.length < 7) {
|
|
|
|
const { users, rooms } = await Promise.race([
|
|
|
|
RocketChat.spotlight(searchText, usernames, { users: filterUsers, rooms: filterRooms }),
|
|
|
|
new Promise((resolve, reject) => this.oldPromise = reject)
|
|
|
|
]);
|
2020-02-13 19:24:39 +00:00
|
|
|
if (filterUsers) {
|
2021-01-25 17:14:45 +00:00
|
|
|
users
|
|
|
|
.filter((item1, index) => users.findIndex(item2 => item2._id === item1._id) === index) // Remove duplicated data from response
|
|
|
|
.filter(user => !data.some(sub => user.username === sub.name)) // Make sure to remove users already on local database
|
|
|
|
.forEach((user) => {
|
|
|
|
data.push({
|
|
|
|
...user,
|
|
|
|
rid: user.username,
|
|
|
|
name: user.username,
|
|
|
|
t: 'd',
|
|
|
|
search: true
|
|
|
|
});
|
|
|
|
});
|
2020-02-13 19:24:39 +00:00
|
|
|
}
|
|
|
|
if (filterRooms) {
|
|
|
|
rooms.forEach((room) => {
|
|
|
|
// Check if it exists on local database
|
|
|
|
const index = data.findIndex(item => item.rid === room._id);
|
|
|
|
if (index === -1) {
|
|
|
|
data.push({
|
|
|
|
rid: room._id,
|
|
|
|
...room,
|
|
|
|
search: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2018-08-31 18:13:30 +00:00
|
|
|
}
|
2018-09-28 20:17:49 +00:00
|
|
|
delete this.oldPromise;
|
2018-08-31 18:13:30 +00:00
|
|
|
return data;
|
|
|
|
} catch (e) {
|
|
|
|
console.warn(e);
|
2018-09-28 20:17:49 +00:00
|
|
|
return data;
|
|
|
|
// return [];
|
2018-08-31 18:13:30 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-12-20 20:14:07 +00:00
|
|
|
spotlight(search, usernames, type) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.51.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('spotlight', search, usernames, type);
|
2017-08-10 16:16:32 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
createDirectMessage(username) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.59.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('im.create', { username });
|
2017-08-10 16:16:32 +00:00
|
|
|
},
|
2020-03-30 19:50:27 +00:00
|
|
|
|
2020-04-01 12:28:54 +00:00
|
|
|
createGroupChat() {
|
2020-04-03 18:02:10 +00:00
|
|
|
const { users } = reduxStore.getState().selectedUsers;
|
|
|
|
const usernames = users.map(u => u.name).join(',');
|
2020-04-01 12:28:54 +00:00
|
|
|
|
|
|
|
// RC 3.1.0
|
2020-04-03 18:02:10 +00:00
|
|
|
return this.post('im.create', { usernames });
|
2020-04-01 12:28:54 +00:00
|
|
|
},
|
|
|
|
|
2020-03-30 19:50:27 +00:00
|
|
|
createDiscussion({
|
2021-01-25 17:14:45 +00:00
|
|
|
prid, pmid, t_name, reply, users, encrypted
|
2020-03-30 19:50:27 +00:00
|
|
|
}) {
|
|
|
|
// RC 1.0.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('rooms.createDiscussion', {
|
2021-01-25 17:14:45 +00:00
|
|
|
prid, pmid, t_name, reply, users, encrypted
|
2020-03-30 19:50:27 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2020-12-01 17:30:39 +00:00
|
|
|
joinRoom(roomId, joinCode, type) {
|
2018-12-05 20:52:08 +00:00
|
|
|
// TODO: join code
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.48.0
|
2019-06-20 19:02:50 +00:00
|
|
|
if (type === 'p') {
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('joinRoom', roomId);
|
2019-06-20 19:02:50 +00:00
|
|
|
}
|
2020-12-01 17:30:39 +00:00
|
|
|
return this.post('channels.join', { roomId, joinCode });
|
2017-08-10 20:09:54 +00:00
|
|
|
},
|
2020-02-11 14:01:35 +00:00
|
|
|
triggerBlockAction,
|
|
|
|
triggerSubmitView,
|
|
|
|
triggerCancel,
|
2018-07-17 19:10:27 +00:00
|
|
|
sendFileMessage,
|
|
|
|
cancelUpload,
|
|
|
|
isUploadActive,
|
2018-04-24 19:34:03 +00:00
|
|
|
getSettings,
|
2020-03-03 20:53:48 +00:00
|
|
|
getLoginSettings,
|
2019-10-28 13:37:13 +00:00
|
|
|
setSettings,
|
2018-04-24 19:34:03 +00:00
|
|
|
getPermissions,
|
2021-03-15 20:16:34 +00:00
|
|
|
setPermissions,
|
2019-06-17 13:57:07 +00:00
|
|
|
getCustomEmojis,
|
2019-09-16 20:26:32 +00:00
|
|
|
setCustomEmojis,
|
2020-08-21 13:38:50 +00:00
|
|
|
getEnterpriseModules,
|
|
|
|
setEnterpriseModules,
|
|
|
|
hasLicense,
|
|
|
|
isOmnichannelModuleAvailable,
|
2019-06-10 18:36:56 +00:00
|
|
|
getSlashCommands,
|
2019-04-26 21:15:25 +00:00
|
|
|
getRoles,
|
2017-11-19 02:44:55 +00:00
|
|
|
parseSettings: settings => settings.reduce((ret, item) => {
|
2020-02-28 17:32:04 +00:00
|
|
|
ret[item._id] = defaultSettings[item._id] && item[defaultSettings[item._id].type];
|
2020-02-20 20:43:56 +00:00
|
|
|
if (item._id === 'Hide_System_Messages') {
|
|
|
|
ret[item._id] = ret[item._id]
|
|
|
|
.reduce((array, value) => [...array, ...value === 'mute_unmute' ? ['user-muted', 'user-unmuted'] : [value]], []);
|
|
|
|
}
|
2017-11-19 02:44:55 +00:00
|
|
|
return ret;
|
|
|
|
}, {}),
|
2017-11-19 14:57:50 +00:00
|
|
|
_prepareSettings(settings) {
|
|
|
|
return settings.map((setting) => {
|
2018-06-18 13:30:36 +00:00
|
|
|
setting[defaultSettings[setting._id].type] = setting.value;
|
2017-11-19 14:57:50 +00:00
|
|
|
return setting;
|
|
|
|
});
|
|
|
|
},
|
2019-09-16 20:26:32 +00:00
|
|
|
deleteMessage(messageId, rid) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.48.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.delete', { msgId: messageId, roomId: rid });
|
2017-11-21 14:55:50 +00:00
|
|
|
},
|
2020-09-11 14:31:38 +00:00
|
|
|
async editMessage(message) {
|
|
|
|
const { rid, msg } = await Encryption.encryptMessage(message);
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.49.0
|
2020-09-11 14:31:38 +00:00
|
|
|
return this.post('chat.update', { roomId: rid, msgId: message.id, text: msg });
|
2017-11-21 14:55:50 +00:00
|
|
|
},
|
2020-02-28 19:31:19 +00:00
|
|
|
markAsUnread({ messageId }) {
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('subscriptions.unread', { firstUnreadMessage: { _id: messageId } });
|
2020-02-28 19:31:19 +00:00
|
|
|
},
|
2019-09-16 20:26:32 +00:00
|
|
|
toggleStarMessage(messageId, starred) {
|
|
|
|
if (starred) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.59.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.unStarMessage', { messageId });
|
2018-12-05 20:52:08 +00:00
|
|
|
}
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.59.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.starMessage', { messageId });
|
2017-11-21 14:55:50 +00:00
|
|
|
},
|
2019-09-16 20:26:32 +00:00
|
|
|
togglePinMessage(messageId, pinned) {
|
|
|
|
if (pinned) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.59.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.unPinMessage', { messageId });
|
2017-11-21 14:55:50 +00:00
|
|
|
}
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.59.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.pinMessage', { messageId });
|
2017-11-21 14:55:50 +00:00
|
|
|
},
|
2019-05-16 13:40:50 +00:00
|
|
|
reportMessage(messageId) {
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.reportMessage', { messageId, description: 'Message reported by user' });
|
2019-05-16 13:40:50 +00:00
|
|
|
},
|
2019-09-16 20:26:32 +00:00
|
|
|
async getRoom(rid) {
|
|
|
|
try {
|
|
|
|
const db = database.active;
|
2021-03-15 20:16:34 +00:00
|
|
|
const room = await db.get('subscriptions').find(rid);
|
2019-09-16 20:26:32 +00:00
|
|
|
return Promise.resolve(room);
|
|
|
|
} catch (error) {
|
2017-11-21 17:05:14 +00:00
|
|
|
return Promise.reject(new Error('Room not found'));
|
|
|
|
}
|
2017-11-21 14:55:50 +00:00
|
|
|
},
|
2019-05-29 21:19:12 +00:00
|
|
|
async getPermalinkMessage(message) {
|
2018-05-18 17:55:08 +00:00
|
|
|
let room;
|
|
|
|
try {
|
2019-09-16 20:26:32 +00:00
|
|
|
room = await RocketChat.getRoom(message.subscription.id);
|
2018-05-18 17:55:08 +00:00
|
|
|
} catch (e) {
|
2019-08-23 13:18:47 +00:00
|
|
|
log(e);
|
2018-05-18 17:55:08 +00:00
|
|
|
return null;
|
|
|
|
}
|
2018-04-24 19:34:03 +00:00
|
|
|
const { server } = reduxStore.getState().server;
|
2017-11-21 17:05:14 +00:00
|
|
|
const roomType = {
|
|
|
|
p: 'group',
|
|
|
|
c: 'channel',
|
|
|
|
d: 'direct'
|
|
|
|
}[room.t];
|
2020-08-05 16:48:46 +00:00
|
|
|
return `${ server }/${ roomType }/${ this.isGroupChat(room) ? room.rid : room.name }?msg=${ message.id }`;
|
2017-11-21 17:05:14 +00:00
|
|
|
},
|
2019-05-29 21:19:12 +00:00
|
|
|
getPermalinkChannel(channel) {
|
|
|
|
const { server } = reduxStore.getState().server;
|
|
|
|
const roomType = {
|
|
|
|
p: 'group',
|
|
|
|
c: 'channel',
|
|
|
|
d: 'direct'
|
|
|
|
}[channel.t];
|
|
|
|
return `${ server }/${ roomType }/${ channel.name }`;
|
|
|
|
},
|
2017-11-20 22:18:00 +00:00
|
|
|
subscribe(...args) {
|
2019-02-07 15:48:10 +00:00
|
|
|
return this.sdk.subscribe(...args);
|
2018-10-15 20:22:42 +00:00
|
|
|
},
|
2020-02-05 13:34:53 +00:00
|
|
|
subscribeRoom(...args) {
|
|
|
|
return this.sdk.subscribeRoom(...args);
|
|
|
|
},
|
2018-10-15 20:22:42 +00:00
|
|
|
unsubscribe(subscription) {
|
2019-02-07 15:48:10 +00:00
|
|
|
return this.sdk.unsubscribe(subscription);
|
2017-11-20 22:18:00 +00:00
|
|
|
},
|
2019-04-08 12:35:28 +00:00
|
|
|
onStreamData(...args) {
|
|
|
|
return this.sdk.onStreamData(...args);
|
|
|
|
},
|
2020-06-26 20:48:40 +00:00
|
|
|
emitTyping(room, typing = true) {
|
|
|
|
const { login, settings } = reduxStore.getState();
|
|
|
|
const { UI_Use_Real_Name } = settings;
|
|
|
|
const { user } = login;
|
|
|
|
const name = UI_Use_Real_Name ? user.name : user.username;
|
|
|
|
return this.methodCall('stream-notify-room', `${ room }/typing`, name, typing);
|
2017-12-04 18:24:21 +00:00
|
|
|
},
|
|
|
|
setUserPresenceAway() {
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.methodCall('UserPresence:away');
|
2017-12-04 18:24:21 +00:00
|
|
|
},
|
|
|
|
setUserPresenceOnline() {
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.methodCall('UserPresence:online');
|
2017-12-05 19:57:44 +00:00
|
|
|
},
|
2020-08-21 13:30:11 +00:00
|
|
|
setUserPreferences(userId, data) {
|
|
|
|
// RC 0.62.0
|
|
|
|
return this.sdk.post('users.setPreferences', { userId, data });
|
|
|
|
},
|
2020-04-06 19:32:58 +00:00
|
|
|
setUserStatus(status, message) {
|
2020-03-30 20:19:01 +00:00
|
|
|
// RC 1.2.0
|
2020-04-06 19:32:58 +00:00
|
|
|
return this.post('users.setStatus', { status, message });
|
2020-03-30 20:19:01 +00:00
|
|
|
},
|
2018-01-30 19:48:26 +00:00
|
|
|
setReaction(emoji, messageId) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.62.2
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.react', { emoji, messageId });
|
2018-02-19 21:19:39 +00:00
|
|
|
},
|
2018-12-05 20:52:08 +00:00
|
|
|
toggleFavorite(roomId, favorite) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.64.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('rooms.favorite', { roomId, favorite });
|
2018-03-02 15:11:34 +00:00
|
|
|
},
|
2019-07-01 14:20:38 +00:00
|
|
|
toggleRead(read, roomId) {
|
|
|
|
if (read) {
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('subscriptions.unread', { roomId });
|
2019-07-01 14:20:38 +00:00
|
|
|
}
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('subscriptions.read', { rid: roomId });
|
2019-07-01 14:20:38 +00:00
|
|
|
},
|
2019-04-17 17:01:03 +00:00
|
|
|
getRoomMembers(rid, allUsers, skip = 0, limit = 10) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.42.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('getUsersOfRoom', rid, allUsers, { skip, limit });
|
2018-03-23 16:49:51 +00:00
|
|
|
},
|
2020-06-29 17:57:39 +00:00
|
|
|
|
2020-08-19 17:13:02 +00:00
|
|
|
methodCallWrapper(method, ...params) {
|
2020-06-29 17:57:39 +00:00
|
|
|
const { API_Use_REST_For_DDP_Calls } = reduxStore.getState().settings;
|
|
|
|
if (API_Use_REST_For_DDP_Calls) {
|
2021-01-25 17:14:45 +00:00
|
|
|
return this.post(`method.call/${ method }`, { message: JSON.stringify({ method, params }) });
|
2020-06-29 17:57:39 +00:00
|
|
|
}
|
|
|
|
return this.methodCall(method, ...params);
|
|
|
|
},
|
|
|
|
|
2018-03-29 17:55:37 +00:00
|
|
|
getUserRoles() {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.27.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('getUserRoles');
|
2018-03-29 17:55:37 +00:00
|
|
|
},
|
2018-12-05 20:52:08 +00:00
|
|
|
getRoomCounters(roomId, t) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.65.0
|
2019-02-07 15:48:10 +00:00
|
|
|
return this.sdk.get(`${ this.roomTypeToApiType(t) }.counters`, { roomId });
|
2018-12-05 20:52:08 +00:00
|
|
|
},
|
2019-04-08 12:35:28 +00:00
|
|
|
getChannelInfo(roomId) {
|
|
|
|
// RC 0.48.0
|
|
|
|
return this.sdk.get('channels.info', { roomId });
|
|
|
|
},
|
2019-04-29 16:03:52 +00:00
|
|
|
getUserInfo(userId) {
|
|
|
|
// RC 0.48.0
|
|
|
|
return this.sdk.get('users.info', { userId });
|
|
|
|
},
|
2020-08-21 13:30:11 +00:00
|
|
|
getUserPreferences(userId) {
|
|
|
|
// RC 0.62.0
|
|
|
|
return this.sdk.get('users.getPreferences', { userId });
|
|
|
|
},
|
2019-08-22 18:08:07 +00:00
|
|
|
getRoomInfo(roomId) {
|
|
|
|
// RC 0.72.0
|
|
|
|
return this.sdk.get('rooms.info', { roomId });
|
|
|
|
},
|
2020-04-01 12:28:54 +00:00
|
|
|
|
2020-05-08 17:36:10 +00:00
|
|
|
getVisitorInfo(visitorId) {
|
|
|
|
// RC 2.3.0
|
|
|
|
return this.sdk.get('livechat/visitors.info', { visitorId });
|
|
|
|
},
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
getTeamListRoom({
|
|
|
|
teamId, count, offset, type, filter
|
|
|
|
}) {
|
|
|
|
const params = {
|
|
|
|
teamId, count, offset, type
|
|
|
|
};
|
|
|
|
|
|
|
|
if (filter) {
|
|
|
|
params.filter = filter;
|
|
|
|
}
|
|
|
|
// RC 3.13.0
|
|
|
|
return this.sdk.get('teams.listRooms', params);
|
|
|
|
},
|
2020-05-08 17:36:10 +00:00
|
|
|
closeLivechat(rid, comment) {
|
|
|
|
// RC 0.29.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('livechat:closeRoom', rid, comment, { clientAction: true });
|
2020-05-08 17:36:10 +00:00
|
|
|
},
|
|
|
|
editLivechat(userData, roomData) {
|
|
|
|
// RC 0.55.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('livechat:saveInfo', userData, roomData);
|
2020-05-08 17:36:10 +00:00
|
|
|
},
|
|
|
|
returnLivechat(rid) {
|
|
|
|
// RC 0.72.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('livechat:returnAsInquiry', rid);
|
2020-05-08 17:36:10 +00:00
|
|
|
},
|
|
|
|
forwardLivechat(transferData) {
|
|
|
|
// RC 0.36.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('livechat:transfer', transferData);
|
2020-05-08 17:36:10 +00:00
|
|
|
},
|
|
|
|
getPagesLivechat(rid, offset) {
|
|
|
|
// RC 2.3.0
|
|
|
|
return this.sdk.get(`livechat/visitors.pagesVisited/${ rid }?count=50&offset=${ offset }`);
|
|
|
|
},
|
|
|
|
getDepartmentInfo(departmentId) {
|
|
|
|
// RC 2.2.0
|
|
|
|
return this.sdk.get(`livechat/department/${ departmentId }?includeAgents=false`);
|
|
|
|
},
|
|
|
|
getDepartments() {
|
|
|
|
// RC 2.2.0
|
|
|
|
return this.sdk.get('livechat/department');
|
|
|
|
},
|
|
|
|
usersAutoComplete(selector) {
|
|
|
|
// RC 2.4.0
|
|
|
|
return this.sdk.get('users.autocomplete', { selector });
|
|
|
|
},
|
|
|
|
getRoutingConfig() {
|
|
|
|
// RC 2.0.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('livechat:getRoutingConfig');
|
2020-05-08 17:36:10 +00:00
|
|
|
},
|
|
|
|
getTagsList() {
|
|
|
|
// RC 2.0.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('livechat:getTagsList');
|
2020-05-08 17:36:10 +00:00
|
|
|
},
|
|
|
|
getAgentDepartments(uid) {
|
|
|
|
// RC 2.4.0
|
2020-07-31 18:22:30 +00:00
|
|
|
return this.sdk.get(`livechat/agents/${ uid }/departments?enabledDepartmentsOnly=true`);
|
2020-05-08 17:36:10 +00:00
|
|
|
},
|
|
|
|
getCustomFields() {
|
|
|
|
// RC 2.2.0
|
|
|
|
return this.sdk.get('livechat/custom-fields');
|
|
|
|
},
|
|
|
|
|
2020-04-09 05:20:57 +00:00
|
|
|
getUidDirectMessage(room) {
|
|
|
|
const { id: userId } = reduxStore.getState().login.user;
|
|
|
|
|
2020-10-30 17:35:07 +00:00
|
|
|
if (!room) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-04-01 12:28:54 +00:00
|
|
|
// legacy method
|
2020-10-30 17:35:07 +00:00
|
|
|
if (!room?.uids && room.rid && room.t === 'd') {
|
2020-04-01 12:28:54 +00:00
|
|
|
return room.rid.replace(userId, '').trim();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RocketChat.isGroupChat(room)) {
|
|
|
|
return false;
|
2018-03-29 17:55:37 +00:00
|
|
|
}
|
2020-04-01 12:28:54 +00:00
|
|
|
|
2020-10-30 17:35:07 +00:00
|
|
|
const me = room.uids?.find(uid => uid === userId);
|
|
|
|
const other = room.uids?.filter(uid => uid !== userId);
|
2020-04-01 12:28:54 +00:00
|
|
|
|
|
|
|
return other && other.length ? other[0] : me;
|
|
|
|
},
|
|
|
|
|
2020-07-20 16:44:54 +00:00
|
|
|
isRead(item) {
|
|
|
|
let isUnread = item.archived !== true && item.open === true; // item is not archived and not opened
|
|
|
|
isUnread = isUnread && (item.unread > 0 || item.alert === true); // either its unread count > 0 or its alert
|
|
|
|
return !isUnread;
|
|
|
|
},
|
|
|
|
|
2020-04-01 12:28:54 +00:00
|
|
|
isGroupChat(room) {
|
|
|
|
return (room.uids && room.uids.length > 2) || (room.usernames && room.usernames.length > 2);
|
2018-03-29 17:55:37 +00:00
|
|
|
},
|
2020-04-01 12:28:54 +00:00
|
|
|
|
2018-03-23 16:49:51 +00:00
|
|
|
toggleBlockUser(rid, blocked, block) {
|
|
|
|
if (block) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.49.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('blockUser', { rid, blocked });
|
2018-03-23 16:49:51 +00:00
|
|
|
}
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.49.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('unblockUser', { rid, blocked });
|
2018-03-23 16:49:51 +00:00
|
|
|
},
|
2018-12-05 20:52:08 +00:00
|
|
|
leaveRoom(roomId, t) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.48.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.leave`, { roomId });
|
2018-03-29 17:55:37 +00:00
|
|
|
},
|
2020-03-06 13:13:24 +00:00
|
|
|
deleteRoom(roomId, t) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.49.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.delete`, { roomId });
|
2018-03-29 17:55:37 +00:00
|
|
|
},
|
2018-04-24 19:34:03 +00:00
|
|
|
toggleMuteUserInRoom(rid, username, mute) {
|
|
|
|
if (mute) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.51.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('muteUserInRoom', { rid, username });
|
2018-04-24 19:34:03 +00:00
|
|
|
}
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.51.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('unmuteUserInRoom', { rid, username });
|
2018-04-24 19:34:03 +00:00
|
|
|
},
|
2020-11-30 20:00:31 +00:00
|
|
|
toggleRoomOwner({
|
|
|
|
roomId, t, userId, isOwner
|
|
|
|
}) {
|
|
|
|
if (isOwner) {
|
|
|
|
// RC 0.49.4
|
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.addOwner`, { roomId, userId });
|
|
|
|
}
|
|
|
|
// RC 0.49.4
|
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.removeOwner`, { roomId, userId });
|
|
|
|
},
|
|
|
|
toggleRoomLeader({
|
|
|
|
roomId, t, userId, isLeader
|
|
|
|
}) {
|
|
|
|
if (isLeader) {
|
|
|
|
// RC 0.58.0
|
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.addLeader`, { roomId, userId });
|
|
|
|
}
|
|
|
|
// RC 0.58.0
|
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.removeLeader`, { roomId, userId });
|
|
|
|
},
|
|
|
|
toggleRoomModerator({
|
|
|
|
roomId, t, userId, isModerator
|
|
|
|
}) {
|
|
|
|
if (isModerator) {
|
|
|
|
// RC 0.49.4
|
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.addModerator`, { roomId, userId });
|
|
|
|
}
|
|
|
|
// RC 0.49.4
|
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.removeModerator`, { roomId, userId });
|
|
|
|
},
|
|
|
|
removeUserFromRoom({
|
|
|
|
roomId, t, userId
|
|
|
|
}) {
|
|
|
|
// RC 0.48.0
|
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.kick`, { roomId, userId });
|
|
|
|
},
|
|
|
|
ignoreUser({ rid, userId, ignore }) {
|
|
|
|
return this.sdk.get('chat.ignoreUser', { rid, userId, ignore });
|
|
|
|
},
|
2018-12-12 15:15:10 +00:00
|
|
|
toggleArchiveRoom(roomId, t, archive) {
|
2018-03-29 17:55:37 +00:00
|
|
|
if (archive) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.48.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.archive`, { roomId });
|
2018-03-29 17:55:37 +00:00
|
|
|
}
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.48.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.unarchive`, { roomId });
|
2018-03-29 17:55:37 +00:00
|
|
|
},
|
2019-07-01 14:20:38 +00:00
|
|
|
hideRoom(roomId, t) {
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post(`${ this.roomTypeToApiType(t) }.close`, { roomId });
|
2019-07-01 14:20:38 +00:00
|
|
|
},
|
2018-03-29 17:55:37 +00:00
|
|
|
saveRoomSettings(rid, params) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.55.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('saveRoomSettings', rid, params);
|
2020-04-01 20:32:24 +00:00
|
|
|
},
|
|
|
|
post(...args) {
|
|
|
|
return new Promise(async(resolve, reject) => {
|
2021-01-25 17:14:45 +00:00
|
|
|
const isMethodCall = args[0]?.startsWith('method.call/');
|
2020-04-01 20:32:24 +00:00
|
|
|
try {
|
|
|
|
const result = await this.sdk.post(...args);
|
2021-01-25 17:14:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* if API_Use_REST_For_DDP_Calls is enabled and it's a method call,
|
|
|
|
* responses have a different object structure
|
|
|
|
*/
|
|
|
|
if (isMethodCall) {
|
|
|
|
const response = JSON.parse(result.message);
|
|
|
|
if (response?.error) {
|
|
|
|
throw response.error;
|
|
|
|
}
|
|
|
|
return resolve(response.result);
|
|
|
|
}
|
2020-04-01 20:32:24 +00:00
|
|
|
return resolve(result);
|
|
|
|
} catch (e) {
|
2021-01-25 17:14:45 +00:00
|
|
|
const errorType = isMethodCall ? e?.error : e?.data?.errorType;
|
|
|
|
const totpInvalid = 'totp-invalid';
|
|
|
|
const totpRequired = 'totp-required';
|
|
|
|
if ([totpInvalid, totpRequired].includes(errorType)) {
|
|
|
|
const { details } = isMethodCall ? e : e?.data;
|
2020-04-01 20:32:24 +00:00
|
|
|
try {
|
2021-01-25 17:14:45 +00:00
|
|
|
await twoFactor({ method: details?.method, invalid: errorType === totpInvalid });
|
2020-04-01 20:32:24 +00:00
|
|
|
return resolve(this.post(...args));
|
|
|
|
} catch {
|
|
|
|
// twoFactor was canceled
|
|
|
|
return resolve({});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
reject(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
methodCall(...args) {
|
|
|
|
return new Promise(async(resolve, reject) => {
|
|
|
|
try {
|
2020-04-30 18:09:17 +00:00
|
|
|
const result = await this.sdk.methodCall(...args, this.code || '');
|
2020-04-01 20:32:24 +00:00
|
|
|
return resolve(result);
|
|
|
|
} catch (e) {
|
|
|
|
if (e.error && (e.error === 'totp-required' || e.error === 'totp-invalid')) {
|
|
|
|
const { details } = e;
|
|
|
|
try {
|
|
|
|
this.code = await twoFactor({ method: details?.method, invalid: e.error === 'totp-invalid' });
|
|
|
|
return resolve(this.methodCall(...args));
|
|
|
|
} catch {
|
|
|
|
// twoFactor was canceled
|
|
|
|
return resolve({});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
reject(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
sendEmailCode() {
|
|
|
|
const { username } = reduxStore.getState().login.user;
|
|
|
|
// RC 3.1.0
|
|
|
|
return this.post('users.2fa.sendEmailCode', { emailOrUsername: username });
|
2018-03-29 17:55:37 +00:00
|
|
|
},
|
2019-06-05 16:29:07 +00:00
|
|
|
saveUserProfile(data, customFields) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.62.2
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('users.updateOwnBasicInfo', { data, customFields });
|
2018-06-13 01:33:00 +00:00
|
|
|
},
|
2020-06-29 17:57:39 +00:00
|
|
|
saveUserPreferences(data) {
|
|
|
|
// RC 0.62.0
|
|
|
|
return this.post('users.setPreferences', { data });
|
2018-06-13 01:33:00 +00:00
|
|
|
},
|
2018-12-05 20:52:08 +00:00
|
|
|
saveNotificationSettings(roomId, notifications) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.63.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('rooms.saveNotification', { roomId, notifications });
|
2018-04-24 19:34:03 +00:00
|
|
|
},
|
|
|
|
addUsersToRoom(rid) {
|
|
|
|
let { users } = reduxStore.getState().selectedUsers;
|
|
|
|
users = users.map(u => u.name);
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.51.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('addUsersToRoom', { rid, users });
|
2018-04-24 19:34:03 +00:00
|
|
|
},
|
2019-04-17 17:01:03 +00:00
|
|
|
getSingleMessage(msgId) {
|
2020-06-29 17:57:39 +00:00
|
|
|
// RC 0.47.0
|
|
|
|
return this.sdk.get('chat.getMessage', { msgId });
|
2019-04-17 17:01:03 +00:00
|
|
|
},
|
2020-07-31 18:22:30 +00:00
|
|
|
hasRole(role) {
|
|
|
|
const shareUser = reduxStore.getState().share.user;
|
|
|
|
const loginUser = reduxStore.getState().login.user;
|
|
|
|
// get user roles on the server from redux
|
|
|
|
const userRoles = (shareUser?.roles || loginUser?.roles) || [];
|
|
|
|
|
|
|
|
return userRoles.indexOf(r => r === role) > -1;
|
|
|
|
},
|
2020-11-30 20:00:31 +00:00
|
|
|
getRoomRoles(roomId, type) {
|
|
|
|
// RC 0.65.0
|
|
|
|
return this.sdk.get(`${ this.roomTypeToApiType(type) }.roles`, { roomId });
|
|
|
|
},
|
2021-03-15 20:16:34 +00:00
|
|
|
/**
|
|
|
|
* Permissions: array of permissions' roles from redux. Example: [['owner', 'admin'], ['leader']]
|
|
|
|
* Returns an array of boolean for each permission from permissions arg
|
|
|
|
*/
|
2019-09-16 20:26:32 +00:00
|
|
|
async hasPermission(permissions, rid) {
|
|
|
|
const db = database.active;
|
2021-03-15 20:16:34 +00:00
|
|
|
const subsCollection = db.get('subscriptions');
|
2019-04-26 20:54:58 +00:00
|
|
|
let roomRoles = [];
|
2018-12-21 10:55:35 +00:00
|
|
|
try {
|
2019-09-16 20:26:32 +00:00
|
|
|
// get the room from database
|
|
|
|
const room = await subsCollection.find(rid);
|
2018-12-21 10:55:35 +00:00
|
|
|
// get room roles
|
2020-04-13 12:51:16 +00:00
|
|
|
roomRoles = room.roles || [];
|
2018-12-21 10:55:35 +00:00
|
|
|
} catch (error) {
|
2019-09-16 20:26:32 +00:00
|
|
|
console.log('hasPermission -> Room not found');
|
2021-03-15 20:16:34 +00:00
|
|
|
return permissions.map(() => false);
|
2019-09-16 20:26:32 +00:00
|
|
|
}
|
2021-03-15 20:16:34 +00:00
|
|
|
|
2019-09-16 20:26:32 +00:00
|
|
|
try {
|
2020-04-13 12:51:16 +00:00
|
|
|
const shareUser = reduxStore.getState().share.user;
|
|
|
|
const loginUser = reduxStore.getState().login.user;
|
2019-09-16 20:26:32 +00:00
|
|
|
// get user roles on the server from redux
|
2020-05-13 19:04:50 +00:00
|
|
|
const userRoles = (shareUser?.roles || loginUser?.roles) || [];
|
2019-09-16 20:26:32 +00:00
|
|
|
const mergedRoles = [...new Set([...roomRoles, ...userRoles])];
|
2021-03-15 20:16:34 +00:00
|
|
|
return permissions.map(permission => permission?.some(r => mergedRoles.includes(r) ?? false));
|
2019-09-16 20:26:32 +00:00
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
|
|
|
}
|
2018-06-13 01:33:00 +00:00
|
|
|
},
|
|
|
|
getAvatarSuggestion() {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.51.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('getAvatarSuggestion');
|
2018-06-13 01:33:00 +00:00
|
|
|
},
|
2018-12-12 15:15:10 +00:00
|
|
|
resetAvatar(userId) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.55.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('users.resetAvatar', { userId });
|
2018-06-13 01:33:00 +00:00
|
|
|
},
|
|
|
|
setAvatarFromService({ data, contentType = '', service = null }) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.51.0
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('setAvatarFromService', data, contentType, service);
|
2018-09-04 14:29:20 +00:00
|
|
|
},
|
2019-08-23 13:18:47 +00:00
|
|
|
async getAllowCrashReport() {
|
|
|
|
const allowCrashReport = await AsyncStorage.getItem(CRASH_REPORT_KEY);
|
|
|
|
if (allowCrashReport === null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return JSON.parse(allowCrashReport);
|
|
|
|
},
|
2020-09-11 17:34:11 +00:00
|
|
|
async getAllowAnalyticsEvents() {
|
|
|
|
const allowAnalyticsEvents = await AsyncStorage.getItem(ANALYTICS_EVENTS_KEY);
|
|
|
|
if (allowAnalyticsEvents === null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return JSON.parse(allowAnalyticsEvents);
|
|
|
|
},
|
2018-09-04 14:29:20 +00:00
|
|
|
async getSortPreferences() {
|
2020-08-19 17:14:22 +00:00
|
|
|
const prefs = await UserPreferences.getMapAsync(SORT_PREFS_KEY);
|
2019-07-18 17:44:02 +00:00
|
|
|
return prefs;
|
2018-09-04 14:29:20 +00:00
|
|
|
},
|
|
|
|
async saveSortPreference(param) {
|
2020-08-19 17:14:22 +00:00
|
|
|
let prefs = await RocketChat.getSortPreferences();
|
|
|
|
prefs = { ...prefs, ...param };
|
|
|
|
return UserPreferences.setMapAsync(SORT_PREFS_KEY, prefs);
|
2018-11-14 21:42:03 +00:00
|
|
|
},
|
|
|
|
async getLoginServices(server) {
|
|
|
|
try {
|
2019-08-09 17:28:46 +00:00
|
|
|
let loginServices = [];
|
2018-11-14 21:42:03 +00:00
|
|
|
const loginServicesResult = await fetch(`${ server }/api/v1/settings.oauth`).then(response => response.json());
|
2019-08-07 14:36:54 +00:00
|
|
|
|
2020-02-20 20:08:20 +00:00
|
|
|
if (loginServicesResult.success && loginServicesResult.services) {
|
2018-11-14 21:42:03 +00:00
|
|
|
const { services } = loginServicesResult;
|
2019-08-09 17:28:46 +00:00
|
|
|
loginServices = services;
|
2019-08-07 14:36:54 +00:00
|
|
|
|
2019-08-09 17:28:46 +00:00
|
|
|
const loginServicesReducer = loginServices.reduce((ret, item) => {
|
|
|
|
const name = item.name || item.buttonLabelText || item.service;
|
2019-08-07 14:36:54 +00:00
|
|
|
const authType = this._determineAuthType(item);
|
|
|
|
|
|
|
|
if (authType !== 'not_supported') {
|
|
|
|
ret[name] = { ...item, name, authType };
|
|
|
|
}
|
|
|
|
|
2018-11-14 21:42:03 +00:00
|
|
|
return ret;
|
|
|
|
}, {});
|
|
|
|
reduxStore.dispatch(setLoginServices(loginServicesReducer));
|
2020-04-01 15:56:08 +00:00
|
|
|
} else {
|
|
|
|
reduxStore.dispatch(setLoginServices({}));
|
2018-11-14 21:42:03 +00:00
|
|
|
}
|
|
|
|
} catch (error) {
|
2020-04-01 15:56:08 +00:00
|
|
|
console.log(error);
|
|
|
|
reduxStore.dispatch(setLoginServices({}));
|
2018-11-14 21:42:03 +00:00
|
|
|
}
|
|
|
|
},
|
2019-08-09 17:28:46 +00:00
|
|
|
_determineAuthType(services) {
|
2019-08-22 19:24:27 +00:00
|
|
|
const {
|
|
|
|
name, custom, showButton = true, service
|
|
|
|
} = services;
|
2019-08-07 14:36:54 +00:00
|
|
|
|
2020-01-29 12:30:59 +00:00
|
|
|
const authName = name || service;
|
|
|
|
|
2019-08-22 19:24:27 +00:00
|
|
|
if (custom && showButton) {
|
2019-08-07 14:36:54 +00:00
|
|
|
return 'oauth_custom';
|
|
|
|
}
|
|
|
|
|
2019-08-09 17:28:46 +00:00
|
|
|
if (service === 'saml') {
|
|
|
|
return 'saml';
|
|
|
|
}
|
|
|
|
|
2019-08-12 18:37:42 +00:00
|
|
|
if (service === 'cas') {
|
|
|
|
return 'cas';
|
|
|
|
}
|
|
|
|
|
2020-07-14 16:07:45 +00:00
|
|
|
if (authName === 'apple' && isIOS) {
|
|
|
|
return 'apple';
|
|
|
|
}
|
|
|
|
|
2019-08-09 17:28:46 +00:00
|
|
|
// TODO: remove this after other oauth providers are implemented. e.g. Drupal, github_enterprise
|
2020-01-29 12:30:59 +00:00
|
|
|
const availableOAuth = ['facebook', 'github', 'gitlab', 'google', 'linkedin', 'meteor-developer', 'twitter', 'wordpress'];
|
|
|
|
return availableOAuth.includes(authName) ? 'oauth' : 'not_supported';
|
2019-08-07 14:36:54 +00:00
|
|
|
},
|
2018-11-14 21:42:03 +00:00
|
|
|
getUsernameSuggestion() {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.65.0
|
2019-02-07 15:48:10 +00:00
|
|
|
return this.sdk.get('users.getUsernameSuggestion');
|
2018-12-05 20:52:08 +00:00
|
|
|
},
|
|
|
|
roomTypeToApiType(t) {
|
|
|
|
const types = {
|
2020-02-07 13:24:16 +00:00
|
|
|
c: 'channels', d: 'im', p: 'groups', l: 'channels'
|
2018-12-05 20:52:08 +00:00
|
|
|
};
|
|
|
|
return types[t];
|
2018-12-12 15:15:10 +00:00
|
|
|
},
|
|
|
|
getFiles(roomId, type, offset) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.59.0
|
2019-02-07 15:48:10 +00:00
|
|
|
return this.sdk.get(`${ this.roomTypeToApiType(type) }.files`, {
|
2018-12-12 15:15:10 +00:00
|
|
|
roomId,
|
|
|
|
offset,
|
|
|
|
sort: { uploadedAt: -1 },
|
|
|
|
fields: {
|
|
|
|
name: 1, description: 1, size: 1, type: 1, uploadedAt: 1, url: 1, userId: 1
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
getMessages(roomId, type, query, offset) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.59.0
|
2019-02-07 15:48:10 +00:00
|
|
|
return this.sdk.get(`${ this.roomTypeToApiType(type) }.messages`, {
|
2018-12-12 15:15:10 +00:00
|
|
|
roomId,
|
|
|
|
query,
|
|
|
|
offset,
|
|
|
|
sort: { ts: -1 }
|
|
|
|
});
|
|
|
|
},
|
2019-06-10 18:36:31 +00:00
|
|
|
|
|
|
|
getReadReceipts(messageId) {
|
|
|
|
return this.sdk.get('chat.getMessageReadReceipts', {
|
|
|
|
messageId
|
|
|
|
});
|
|
|
|
},
|
2018-12-12 15:15:10 +00:00
|
|
|
searchMessages(roomId, searchText) {
|
2018-12-21 10:55:35 +00:00
|
|
|
// RC 0.60.0
|
2019-02-07 15:48:10 +00:00
|
|
|
return this.sdk.get('chat.search', {
|
2018-12-12 15:15:10 +00:00
|
|
|
roomId,
|
|
|
|
searchText
|
|
|
|
});
|
2019-04-17 17:01:03 +00:00
|
|
|
},
|
|
|
|
toggleFollowMessage(mid, follow) {
|
|
|
|
// RC 1.0
|
|
|
|
if (follow) {
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.followMessage', { mid });
|
2019-04-17 17:01:03 +00:00
|
|
|
}
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('chat.unfollowMessage', { mid });
|
2019-04-17 17:01:03 +00:00
|
|
|
},
|
2020-10-30 17:35:07 +00:00
|
|
|
getThreadsList({
|
|
|
|
rid, count, offset, text
|
|
|
|
}) {
|
|
|
|
const params = {
|
2019-04-24 18:36:29 +00:00
|
|
|
rid, count, offset, sort: { ts: -1 }
|
2020-10-30 17:35:07 +00:00
|
|
|
};
|
|
|
|
if (text) {
|
|
|
|
params.text = text;
|
|
|
|
}
|
|
|
|
|
|
|
|
// RC 1.0
|
|
|
|
return this.sdk.get('chat.getThreadsList', params);
|
2019-04-24 18:36:29 +00:00
|
|
|
},
|
|
|
|
getSyncThreadsList({ rid, updatedSince }) {
|
|
|
|
// RC 1.0
|
|
|
|
return this.sdk.get('chat.syncThreadsList', {
|
|
|
|
rid, updatedSince
|
|
|
|
});
|
2019-05-28 16:52:26 +00:00
|
|
|
},
|
2020-06-29 18:47:48 +00:00
|
|
|
readThreads(tmid) {
|
|
|
|
const serverVersion = reduxStore.getState().server.version;
|
Merge 4.16.0 into single-server (#3057)
* [FIX] RoomItem using deprecated animated event signature (#2771)
* [FIX] Server autocomplete text breaking line (#2774)
* [FIX] ServerDropdown flashing bigger server icon (#2775)
* [FIX] ServerDropdown flashing bigger server icon
* Remove unused logo and update image path where needed
* Minor tweak
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Share Extension hitting memory limit on iOS (#2788)
* [FIX] Disallow swipe to dismiss on share extension
* Limit query to 20 and clean up props
* Remove rn-extension-share branch pointer
* Test new branch
* Remove branch
* [IMPROVEMENT] Threads layout tweaks (#2686)
* improvement: Thread Details
* fix: re-render Thread Messages Item
* fix: update snapshots
* improve: thread details component
* fix: cast replies length
* improvement: format date of threads
* improvement: thread details styles
* fix: wrap text
* tests: update snapshot
* improvement: use same date format for all dates
* Icon size 24
* Remove date
* Remove prop drill
* Badge position
* Badge container tweak
* Fix inline style
* Move ThreadDetails to containers
* Update stories
* Fix lint
* Remove wrong prop
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove some migrations (#2792)
* Remove force rooms refresh
* Remove MMKV migration
* Bump version to 4.14.0 (#2797)
* [FIX] Messagebox tracking lost on pop gesture navigation (#2799)
* Use setTimeout instead of InteractionManager
* Update tracking lib
* [FIX] Back button closing activity when on root stack screen (#2804)
* Make hardware back button to behave as home button on root screens
* Remove unnecessary code
* Remove handleBackPress from OnboardingView
* Fix lint
* [i18n] Add missing German strings (#2715)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox missing style for text color (#2786)
* Changing auxilaryTintColor
* Changed Placeholder color to BodyText color
* added color prop
* eslint changes
* used array for styles
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Update arabic (#2696)
* Update ar.js
* Update ar.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Workspace input without i18n (#2689)
* [FIX] Translation of strings in Login page
* Strings are added for translation.
fixes: #2620
* Add pt-BR
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Spotlight returning duplicated entries (#2805)
* Update rocketchat.js
* Updated search function
* Minor improvements
* Remove atIndex
* Add remove logic to remove duplicate data from response
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor ServerItem (#2778)
* Updated ServerDropdown and ServerItem
* Added ServerItem stories
* Update ServerDropdown.js
* Updated ServerItem stories
* Updated ServerItem stories and ServerItem component
* Updated SelectServerView, ServerItem and ServerItem stories
* Updated ServerItem stories
* Updated ServerItem stories
* Update tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [DOCS] Updated Quick Start docs link in e2e/readme (#2802)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add Turkish (#2793)
* Turkish language support added
* Update tr.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Lint on #2793 (#2818)
* [I18N] Add missing german strings (#2689) (#2820)
* [I18N] Add missing italian strings (#2817)
* [FIX] Server version becoming null on server change (#2821)
* [FIX] Wrong styling on E2E encryption banner (#2767)
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner
* [FIX] Wrong styling on E2E encryption banner (#2767)
* Updated SortDropdown, ListHeader, ListItem and added stories for List.Item
* Updated SortDropdown
* Removed unused component
* Updated List.Item and stories
* Reverted unnecessary changes and updated ListItem stories
* Fix minor indentation
* Stop breaking Touch's default underlay color
* Fix indentation
* Remove falsy comparison from render
* Fix left icon
* Use List.Item on OmnichannelStatus
* Add missing separator
* Lint
* Fix sort dropdown
* Remove unnecessary styles
* Fix detox
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App Store using Experimental's app id (#2826)
* [FIX] Wrong username on push notifications (#2825)
* [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
* [FIX] Logout from other locations not prompting confirmation option (#2854)
* Fixed logout toast bug for the iOS
* Removing callToAction and replacing with confirmationText
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.14.1 (#2859)
* [IMPROVEMENT] Check for focused rooms on in-app notifications (#2857)
* Update InAppNotification and room reducer
* Update InAppNotification
This reverts commit 60330a1e04cfe8d2e5aa311f367083d831682c49.
* Stop subscribing to threads
* Remove ref
* Fix prop-types
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Real name being ignored in SearchMessagesView (#2838)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove unnecessary share reducer calls (#2861)
* Remove unnecesary share reducer calls
* Update Avatar
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Breadcrumbs exceeding characters limit (#2862)
* [FIX] breadcrumbs exceeding
* fix.breadcrumbs-exceeding-change-events
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App compressing videos on iOS (#2915)
* Update index.js
* Update index.js
* [FIX] Real name setting ignored on reply preview (#2908)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reply component sending unused prop to Description (#2900)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] BackdropOpacity based on themes (#2863)
* Added backdropOpacity based on theme
* Updated ActionSheet, ReactionsModal, ReactionPicker and Sidebar
* Updated MultiSelect
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Webview not falling back to default auth challenge when no cert is provided (#2918)
* [FIX] Android - fallback to default auth challenge handling when no cert is provided
* If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded.
To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel()
* No client certificate case defaults to super implementation
* Update react-native-webview
* Downgrade to previous dependency version
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
* [FIX] Support Jitsi_URL_Room_Hash (#2905)
* [FIX] Temp attachment files not being flushed after saved to gallery (#2871)
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
* Update AttachmentView.js
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Update iOS profiles for Experimental app (#2933)
* [IMPROVE] Deleted thread reply redirects to thread (#2840)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Thread showing typing indicator from main room (#2869)
* [FIX] Remove typing indicator from thread's header
* remove unnecessary props and change usersTyping condition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] DM rooms show typing status from last group room (#2878)
* [FIX] DM rooms show typing status from last group room
* Undo changes
* Check if current typing is from focused room before dispatching to redux
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues
* shorten the condition string
* fix selectedMessage state
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] RightButtonsContainer re-render check not returning default value (#2899)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Remove InteractionManager blocks (#2906)
* [FIX] Remove InteractionManager blocks
* Minor fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] App not sending second argument for EventEmitter.removeListener on some places (#2909)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Temp message ignoring real name (#2919)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] System message of e2e encryption is missing (#2888)
* [FIX] System message of e2e encryption missing
* add new encryption string
* add to stories
* Add pt-BR
* Move stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [CHORE] Add hold step for ios and android build experimental (#2943)
* [CHORE] Add hold step for ios-build-experimental and android-build-experimental
* Android hold step
* add ios hold step
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] Remove lodash.isEqual (#2893)
* Added dequal and react-fast-compare as substitutes to lodash.isEqual
* Update ReplyPreview.js
* Remove react-fast-compare
* Removed deep-equal and upgrade babel-eslint dev dependency
* Fix avatar
* Fix Messagebox
* Fix CreateDiscussionView
* ModalBlockView
* NewMessageView
* ProfileView
* RoomInfoEditView
* ServerDropdown
* Return local search as object instead of observable
* SelectedUsersView
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [I18N] Add missing Russian strings (#2946)
* [i18n] Add missing Russian strings
* Couple fixes
* Fix Direct_message
Translate Direct_message as already has been translated
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Use shortcut syntax for get collections (#2932)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Use List.Separator in all places (#2931)
* [FIX] Use List.Separator in all places
* add List.Separator
* change List.Separator
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Limit new message list query size to 50 (#2947)
* Limit query to 50
* Remove observable
* [FIX] Support chats order for older versions of the server (#2934)
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Update mergeSubscriptionsRooms.js
* Minor refactor
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Reactions modal's backdrop color too light (#2949)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Bump version to 4.15.0 (#2950)
* [FIX] Share extension not working correctly on Official app (#2963)
* [FIX] Cannot read property 'some' of undefined on hasPermission (#2966)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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
* [FIX] Messagebox's placeholder color is too bright (#2968)
* [IMPROVEMENT] Message attachment colors (#2860)
* Added convertStrToHex function and updated Reply component
* Removed convertStrtToHex function and added attachmentBackground
* Added color2k, removed transparent view and applied transparentize to backgroundColor
* Added stories
* Update Reply stories
* Update Reply stories
* Fix lint
* Update Reply stories
* Fix props
* Move tests to Message stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Add E2E tests to draft message (#2960)
* [E2E TEST] Draft message
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to group DM (#2961)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to directory (#2964)
* [E2E TEST] Directory
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Simplify server version comparison (#2922)
* Simplify server version where needed
* Added lte and gte functions and updated imports
* Updated functions names
* Update util functions
* Update util function and added methods
* Remove lt and coerce from getPermissions and mergeSubscriptionsRooms
* Fix comparison
* Update getPermissions.js
* Remove unused import
* Fix lint
* Fix lint
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to discussions (#2970)
* [E2E TEST] Discussions
* fix error Cannot find UI elemen
* Fix tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Attachment not rendering markdown (#2924)
* [FIX] Render markdown in Fields content
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add e2e tests for mark message as unread (#2953)
* [E2E TEST] Add e2e tests for mark message as unread
* fixed test for draft message
* change test name
* move test to other file
* Remove unnecessary tests
* Rename file
* Update jest tests
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [TESTS] Add E2E tests to delete server (#2954)
* [E2E TEST] Delete server
* fixed test for delete server
* fix tests
* minor changes
* Rename file
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Refactor RoomActionsView permissions (#2872)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [CHORE] Add status and teams icons (#2989)
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
* [FIX] SSO not working with 2FA (TOTP) (#2978)
* Update AuthenticationWebView.js
* Updated loginTOTP
* Added validation
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Update rocketchat.js
* Fix resolve
* Remove incognito
* Fix totp being requested on webview
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [IMPROVEMENT] User status icons (#2991)
* Add status and teams
* Update icons, icon size and getUsersPresence
* Minor changes
* Refactor RoomTypeIcon
* Minor tweaks
* Update unit tests
* Minor fixes
* Fix styles
* Small refactor
* Update jest
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [FIX] Create discussion request being sent with null value on encryption param (#3033)
* [CHORE] Use JSON files for i18n (#3011)
* [IMPROVEMENT] Load only i18n files needed (#3014)
* Use json
* Load only i18n files needed
* [REGRESSION] Clear local server cache not loading rooms (#3007)
* Fix clear cache
* Write e2e tests
* Fix lint
* Fix isRTL
* [FIX] Custom OAuth and iframe login attempts being called multiple times (#3020)
* [FIX] App crashing when attachment color is an invalid HEX (#3021)
* [IMPROVEMENT] Add "Message" option to Room Info (#3029)
* [CHORE] Go to room from hashtag
* Layout tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Can't change status (#3018)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Search input not using the whole header space (#3012)
* [FIX] Search input not using the whole space
* Fix on getHeaderTitlePosition
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [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>
* [TESTS] Move threads tests to its own file (#2965)
* [E2E TEST] Move threads test to another file
* changed descirbe title
* Rearrange files
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Regex typo on markdown (#2928)
* [FIX] Fix Regex Typo
* Add story for testing
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Make attachment validation compatible with web client (#2927)
* [FIX] Make attachment validation compatible with web client
* Added stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link
* Fix message stories for replies
* Final stories fix
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] i18n not being applied on login/register labels (#2930)
* Use I18n translate in login text input label
* Add to register and add missing strings
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Revert "[FIX] Make attachment validation compatible with web client (#2927)" (#3036)
This reverts commit d6200745c028dd47b4ce0f11eb396c8f2a4cf807.
* Bump version to 4.16.0 (#3037)
* [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>
* [CHORE] Refactor mention tracking logic (#2997)
* [Improvement] Improve mentions
This PR focuses on improving command, emoji, channel and user mentions.
* [Tests] Added e2e tests for mention improvement
* [Improvement] Modify slash command mention logic.
Added slash command with argument preview
Slash command should show only if the message bigins with /
* Return data on search for empty text
* Minor fixes
* Update e2e tests
* Minor fix
* [FIX] allow command mentioning in between text
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Status text not being updated on sidebar (#3041)
* Update StatusView.js
* Minor tweak
* Minor tweaks
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* [FIX] Unable to search non-latin alphabet names on members list (#3039)
* Add search by name in members list
* Update RoomMembersView search
Co-authored-by: Diego Mello <diegolmello@gmail.com>
* Search stops working after some time (#3044)
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: phriedrich <info@phriedrich.de>
Co-authored-by: yash-rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Fazil Boudjelal <fazildiablou@hotmail.fr>
Co-authored-by: Sumukha Hegde <SUMUKHA214@GMAIL.COM>
Co-authored-by: Hakan YILMAZ <mukerrem.yilmaz@hotmail.com>
Co-authored-by: Vincenzo Esposito <aenon.esposito@gmail.com>
Co-authored-by: Arkadyuti Bandyopadhyay <bandyopadhyayarkadyuti@gmail.com>
Co-authored-by: Anant Bhasin <38764067+aKn1ghtOut@users.noreply.github.com>
Co-authored-by: Gung Wah <41157464+kresnaputra@users.noreply.github.com>
Co-authored-by: Billy Newman <newmanw10@gmail.com>
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Co-authored-by: ankar84 <ankar84@gmail.com>
Co-authored-by: sadegh <sadeghmohamadnia@yahoo.com>
2021-04-13 13:39:06 +00:00
|
|
|
if (compareServerVersion(serverVersion, '3.4.0', methods.greaterThanOrEqualTo)) {
|
2020-06-29 18:47:48 +00:00
|
|
|
// RC 3.4.0
|
|
|
|
return this.methodCallWrapper('readThreads', tmid);
|
|
|
|
}
|
|
|
|
return Promise.resolve();
|
|
|
|
},
|
2020-02-11 15:56:06 +00:00
|
|
|
runSlashCommand(command, roomId, params, triggerId, tmid) {
|
2019-06-10 18:36:56 +00:00
|
|
|
// RC 0.60.2
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('commands.run', {
|
2020-02-11 15:56:06 +00:00
|
|
|
command, roomId, params, triggerId, tmid
|
2019-06-10 18:36:56 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
getCommandPreview(command, roomId, params) {
|
|
|
|
// RC 0.65.0
|
|
|
|
return this.sdk.get('commands.preview', {
|
|
|
|
command, roomId, params
|
|
|
|
});
|
|
|
|
},
|
2020-02-11 15:56:06 +00:00
|
|
|
executeCommandPreview(command, params, roomId, previewItem, triggerId, tmid) {
|
2019-06-10 18:36:56 +00:00
|
|
|
// RC 0.65.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('commands.preview', {
|
2020-02-11 15:56:06 +00:00
|
|
|
command, params, roomId, previewItem, triggerId, tmid
|
2019-06-10 18:36:56 +00:00
|
|
|
});
|
|
|
|
},
|
2019-09-16 20:26:32 +00:00
|
|
|
_setUser(ddpMessage) {
|
|
|
|
this.activeUsers = this.activeUsers || {};
|
|
|
|
const { user } = reduxStore.getState().login;
|
|
|
|
|
|
|
|
if (ddpMessage.fields && user && user.id === ddpMessage.id) {
|
|
|
|
reduxStore.dispatch(setUser(ddpMessage.fields));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ddpMessage.cleared && user && user.id === ddpMessage.id) {
|
2020-03-30 20:19:01 +00:00
|
|
|
reduxStore.dispatch(setUser({ status: { status: 'offline' } }));
|
2019-09-16 20:26:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!this._setUserTimer) {
|
|
|
|
this._setUserTimer = setTimeout(() => {
|
|
|
|
const activeUsersBatch = this.activeUsers;
|
|
|
|
InteractionManager.runAfterInteractions(() => {
|
|
|
|
reduxStore.dispatch(setActiveUsers(activeUsersBatch));
|
|
|
|
});
|
|
|
|
this._setUserTimer = null;
|
|
|
|
return this.activeUsers = {};
|
|
|
|
}, 10000);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ddpMessage.fields) {
|
2020-03-30 20:19:01 +00:00
|
|
|
this.activeUsers[ddpMessage.id] = { status: 'offline' };
|
2019-09-16 20:26:32 +00:00
|
|
|
} else if (ddpMessage.fields.status) {
|
2020-03-30 20:19:01 +00:00
|
|
|
this.activeUsers[ddpMessage.id] = { status: ddpMessage.fields.status };
|
2019-09-16 20:26:32 +00:00
|
|
|
}
|
|
|
|
},
|
2020-03-03 21:10:39 +00:00
|
|
|
getUsersPresence,
|
|
|
|
getUserPresence,
|
|
|
|
subscribeUsersPresence,
|
2019-06-10 16:22:35 +00:00
|
|
|
getDirectory({
|
|
|
|
query, count, offset, sort
|
|
|
|
}) {
|
|
|
|
// RC 1.0
|
|
|
|
return this.sdk.get('directory', {
|
|
|
|
query, count, offset, sort
|
|
|
|
});
|
2019-06-28 17:02:30 +00:00
|
|
|
},
|
2021-03-15 20:16:34 +00:00
|
|
|
canAutoTranslate() {
|
2019-06-28 17:02:30 +00:00
|
|
|
try {
|
2021-03-15 20:16:34 +00:00
|
|
|
const { AutoTranslate_Enabled } = reduxStore.getState().settings;
|
2019-06-28 17:02:30 +00:00
|
|
|
if (!AutoTranslate_Enabled) {
|
|
|
|
return false;
|
|
|
|
}
|
2021-03-15 20:16:34 +00:00
|
|
|
const autoTranslatePermission = reduxStore.getState().permissions['auto-translate'];
|
|
|
|
const userRoles = (reduxStore.getState().login?.user?.roles) ?? [];
|
|
|
|
return autoTranslatePermission?.some(role => userRoles.includes(role));
|
2019-08-23 13:18:47 +00:00
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
2019-06-28 17:02:30 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
saveAutoTranslate({
|
|
|
|
rid, field, value, options
|
|
|
|
}) {
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('autoTranslate.saveSettings', rid, field, value, options);
|
2019-06-28 17:02:30 +00:00
|
|
|
},
|
|
|
|
getSupportedLanguagesAutoTranslate() {
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('autoTranslate.getSupportedLanguages', 'en');
|
2019-06-28 17:02:30 +00:00
|
|
|
},
|
|
|
|
translateMessage(message, targetLanguage) {
|
2020-06-29 17:57:39 +00:00
|
|
|
return this.methodCallWrapper('autoTranslate.translateMessage', message, targetLanguage);
|
2020-01-28 13:22:35 +00:00
|
|
|
},
|
2020-09-11 14:31:38 +00:00
|
|
|
getSenderName(sender) {
|
|
|
|
const { UI_Use_Real_Name: useRealName } = reduxStore.getState().settings;
|
|
|
|
return useRealName ? sender.name : sender.username;
|
|
|
|
},
|
2020-01-28 13:22:35 +00:00
|
|
|
getRoomTitle(room) {
|
2020-04-30 16:24:49 +00:00
|
|
|
const { UI_Use_Real_Name: useRealName, UI_Allow_room_names_with_special_chars: allowSpecialChars } = reduxStore.getState().settings;
|
2020-04-01 12:28:54 +00:00
|
|
|
const { username } = reduxStore.getState().login.user;
|
|
|
|
if (RocketChat.isGroupChat(room) && !(room.name && room.name.length)) {
|
|
|
|
return room.usernames.filter(u => u !== username).sort((u1, u2) => u1.localeCompare(u2)).join(', ');
|
|
|
|
}
|
2020-04-30 16:24:49 +00:00
|
|
|
if (allowSpecialChars && room.t !== 'd') {
|
|
|
|
return room.fname || room.name;
|
|
|
|
}
|
2020-01-28 13:22:35 +00:00
|
|
|
return ((room.prid || useRealName) && room.fname) || room.name;
|
|
|
|
},
|
2020-02-12 17:21:11 +00:00
|
|
|
getRoomAvatar(room) {
|
2020-04-01 12:28:54 +00:00
|
|
|
if (RocketChat.isGroupChat(room)) {
|
2020-04-30 18:07:07 +00:00
|
|
|
return room.uids?.length + room.usernames?.join();
|
2020-04-01 12:28:54 +00:00
|
|
|
}
|
2020-02-12 17:21:11 +00:00
|
|
|
return room.prid ? room.fname : room.name;
|
|
|
|
},
|
2020-01-28 13:22:35 +00:00
|
|
|
|
|
|
|
findOrCreateInvite({ rid, days, maxUses }) {
|
|
|
|
// RC 2.4.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('findOrCreateInvite', { rid, days, maxUses });
|
2020-01-28 13:22:35 +00:00
|
|
|
},
|
|
|
|
validateInviteToken(token) {
|
|
|
|
// RC 2.4.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('validateInviteToken', { token });
|
2020-01-28 13:22:35 +00:00
|
|
|
},
|
|
|
|
useInviteToken(token) {
|
|
|
|
// RC 2.4.0
|
2020-04-01 20:32:24 +00:00
|
|
|
return this.post('useInviteToken', { token });
|
2017-11-20 22:18:00 +00:00
|
|
|
}
|
2017-08-09 20:18:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default RocketChat;
|