verdnatura-chat/app/utils/room.ts

66 lines
1.8 KiB
TypeScript
Raw Normal View History

2022-01-24 20:12:36 +00:00
import moment from 'moment';
import { themes } from '../constants/colors';
import I18n from '../i18n';
import { IAttachment } from '../definitions/IAttachment';
Merge 4.26.0 into master (#3978) * test * Remove console.log * test * [FIX] StoryShots not working for async rendered components (#3677) * remove console.log * Add missing DiscussionsView snapshot * fix build and useless done and async generator * update snapshot * Chore: fix build and useless done and async generator (#3678) * fix build and useless done and async generator * update snapshot * Chore: Migrate Database to Typescript (#3580) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module permissions to typescript (#3630) * Chore: Migrate redux module share to typescript (#3612) * chore: migrate redux module share to typescript * chore: fix types * chore: update types * chore: migrate redux module share to typescript * remove double import * chore: fix import * Chore: Migrate redux module createChannel to typescript (#3602) * chore: migrate createChannel to ts and add tests * chore: fix naming * chore: add more types and remove mapDispatchToProps from components * remove todo * update tests * chore: migrate interface to reducer and fix errors on return * chore: insert IApplicationState to mapStateToProps state type * Remove spread * fix type * fix import and state type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module app to typescript (#3598) * chore: migrate activeUsers reducer and action to TS * chore: init types folder and set redux and BaseScreen interface * chore: remove mapDispatchToProps to use dispatch prop and clear some types * chore: type selectedUsers action and reducer and improvement in the code of other files * chore: move IUser to base types * chore: move state props to ISelectedUsersViewProps * chore: create mocketStore * chore: remove applyAppStateMiddleware * test: create activeUser and selectedUser tests * test: add more selectedUsers tests * chore: fix action type * chore: move types to definition folder and fix imports * chore: remove unused const * chore: migrate redux tests to reducer folder and add eslint jest plugin * chore: exprot initial state and then import on tests * chore: move interfaces to reducer and import on screen * chore: set eslint-plugin-jest version to 24.7.0 * chore: fix IUser import * chore: update interfaces and types names * chore: update definitions * chore: update IBaseScreen definitions * chore: init reducer/app migration to ts * chore: add tests and migrate RootEnum * wip: migrate fixed consts to RootEnum * chore: remove redux action inferences * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module createDiscussion to typescript (#3604) * chore: migrate createDiscussion to ts and add tests * chore: add TActionCreateDiscussion to TApplicationActions * fix types * update types * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] ios-testflight-experimental unable to find cache (#3684) * Chore: Remove Non-null assertion operator in ThreadMessagesView (#3632) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate CannedResponsesListView to Typescript (#3553) * Chore: Migrate CannedResponsesListView to TS * Moved IcannedResponse to definitions and fixed the index * Chore: Migrate CannedResponseDetail to TS * minor tweaks * refactor: update new types and interfaces for use ISubscription * fix lint error and canned responses's dropdown Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate LivechatEditView to Typescript (#3499) * Chore: Migrate LivechatEditView to Typescript * refactor: minor tweak * refactor: fix the interfaces for input * refactor: fix lint erros * minor tweak with new navigation types * function * iroom tweak * livechateditview tweak * TextInput tweak * refactor: update new types and interfaces for use ISubscription * refactor to default useState type * change the component name in SearchBox * changed state type Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Message press navigating to empty RoomView (#3680) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Prevent duplicated .jpg on file upload (#3658) * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * refactored comment * Chore: Migrate lib/utils to TypeScript (#3637) * Migrate utils to TypeScript * Add @types/semver * Refactor compareServerVersion(currentVersion, oldVersion, func) to compareServerVersion(current, func, oldVersion) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate readMessages to TS (#3669) * Migrate readMessages to TS * Update IRocketChat interface * [FIX] Unnecessary login dispatch on adding new server (#3693) * [FIX] Disable tap gesture on call messages (#3694) * [IMPROVE] Keep biometry option from last session (#3668) Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> * Fix reactotron multiple connections (#3622) * Chore: Fix rocketchat interface (#3705) * Chore: Migrate logout to Typescript (#3688) * [NEW] Stream to get individual presence updates (#3606) Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> * [FIX] Inject Redux store to prevent/remove require cycles (#3691) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate lib/rocketchat.js to TS - structure PoC (#3661) Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * [FIX] #3606 merged using wrong JS SDK branch (#3709) * [FIX] Remove deprecated database methods and other database operations (#3686) * Fix PK error on subscriptions/room * Instead of checking for pending update, wrap the call on a try catch and return null in case of error * Generate delete operations before create/update to prevent errors * Apply same logic on encryption * Fix database operations on getRoles * Fix a few database issues found on Bugsnag on ThreadMessagesView * Run prettier :( * Chore: Add REST API definitions from server (#3721) * create first definitions * chore: implements get and post types * fix lint * add ts-ignore * add teams.removeRoom method * Remove unused endpoints Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Move some methods to SDK (#3736) * [IMPROVE] Add support for ephemeral messages inside threads (#3687) * Chore: dehydrate small server requests away from rocketchat.js (#3740) * Bump version to 4.25.0 (#3745) * [Snyk] Security upgrade url-parse from 1.5.1 to 1.5.6 (#3746) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-URLPARSE-2401205 * Language update from LingoHub 🤖 on 2022-02-14Z (#3730) * Language update from LingoHub 🤖 Project Name: Rocket.Chat.ReactNative Project Link: https://translate.lingohub.com/rocketchat/dashboard/rocket-dot-chat-dot-reactnative User: Robot LingoHub Easy language translations with LingoHub 🚀 * remove draft gl Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getSingleMessage to TS (#3700) * migrate getSingleMessage to TS * minor tweak * Chore: Migrate methods/getRooms to TS (#3702) * migrate getRooms to TS * add sdk and set any types * Moved the new variable around and added ts-ignore to follow the pattern from /services/restApi.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate updateMessages to Typescript (#3715) * Chore: Migrate selector/login to TS (#3731) * migrate selector/login to TS * Fix lint errors * set aliases for returns * Chore: Migrate helpers/parseUrls to Typescript (#3735) * Chore: Migrate methods/helpers/parseQuery to Typescript (#3742) * Chore: Migrate methods/helpers/parseQuery to Typescript * tweak in example * Chore: Migrate app/commands to typescript (#3697) * Chore: Migrate lib/encryption folder to TypeScript (#3639) * Initial commit * add types/bytebuffer, add type definitions to params and update interfaces * add more types and type assertions * update types * change bang operator by type assertion and update class variables definitions * add types for deferred class * minor tweaks on types definitions * add ts-ignore * Update encryption.ts * update deferred and encryption * update encryption.ts * Update room.ts * update toDecrypt type * initialize sessionKeyExportedString * remove return types * Chore: Migrate redux actions/enterpriseModules to TS (#3698) * migrate enterpriseModules to TS * update test file * Chore: Migrate database/services and database/utils to TS (#3708) * migrate database services and utils to ts * Migrate tests Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate buildMessage to TS (#3732) * migrate buildMessage to TS * Fix lint * minor tweak * minor tweaks * Chore: Migrate getPermissions to Typescript (#3720) * Migrating... * Fix IPermission * Playing with types * Remove `as const` * Fix lint * Fix test * Apply sdk * Fix lint and autocomplete * [FIX] Add search and fix pagination for omnichannels departments (#3621) * [FIX] Search and pagination for omnichannels departments * pagination complete * minor tweak * renamed a param and workaround for a ux bug * fix style of flatlist and search as header scrollable * stick the header * Merge branch 'fix.forward-department-list' of https://github.com/RocketChat/Rocket.Chat.ReactNative into fix.forward-department-list * refactor pagination * fix value type * refactor render search * refactor layout * make ts happy * Chore: Migrate Markdown to Typescript (#3558) * Chore: Migrate Markdown to TS * Chore: Migrate Markdown to TS * minor tweak * added preview where markdown was preview and fixed params within markdown * removed ts-ignore * fix lint * removed numbersofline={0} and default value to numberOfLines=1 * change how to import markdown preview and remove numberOfLines * using useTheme inside markdownPreview and remove theme from components * minor tweak on interfaces * isNewMarkdown return as boolean * minor tweaks * minor tweaks * removed unused component * fixed markdown stories * updated snapshot because removed numberOfLines={0} from message/content * create IEmoji.ts in definitions and refactor all places where getCustomEmoji was called * onLinkPress typed * todo: refactor navtoroominfo * formatText.test.ts * markdown stories to typescript too * minor tweak * IMessage definition * refactor: update new types and interfaces for use ISubscription * refactor: update threadItem for use new MarkdownPreview * refactor: rollback wrong file commited * formatHyperlink * fix lint * updated item story shot * refactor and refactor some types * Remove non-null assertion * Minor change on useRealName * tweak Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/callJitsi to typescript (#3660) * chore: migrate callJitsi to typescript * change fixed string to type * wip * wip * back to old times :) * back to typescript * Chore: Migrate redux module room to typescript (#3636) * chore: migrate redux module room to typescript and remove dispatch on dependencies * chore: add tests to redux module room * chore: create ERoomType and use on implemention * chore: update enum name * fix test id * Chore: Migrate redux module login to typescript (#3647) * chore: migrate redux module login to typescript chore: update redux module login tests * update workers * wip * fix type * remove partial * add more status * migrate the rest of the stuff to typescript * fix tests and types * fix types and tests * Chore: Migrate method getSettings to typescript (#3703) * chore: migrate getSettings to typescript and and some types * chore: remove this and add current to code * chore: add current * Chore: Migrate getCustomEmojis to TS (#3724) * update customEmoji interface and getCustomEmoji * add sdk * updated emojiCustom rest definition * minor refactor * update params object * [FIX] getRooms request using param with wrong name (#3761) * Chore: Migrate methods/getRoomInfo to TS (#3695) * migrate getRoomInfo to TS * update room type * update types * Fix lint error * Chore: Migrate getSlashCommands to TS (#3711) * migrate getSlashCommands to TS * use sdk and update getSlashCommands * minor tweak * Remove implicit anys Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate getUsersPresence to TS (#3717) * migrate getUsersPresence to ts * use sdk and remove this context from getUsersPresence * Chore: Migrate loadMissedMessages to typescript (#3704) * chore: migrate loadMissedMessages to typescript * remove loaderItem * remove this from functions * Chore: Migrate methods/getRoles to Typescript (#3741) * chore: migrate getRoles to ts * chore: removing unused const * chore: minor tweak * Type batch Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadMessagesForRoom to Typescript (#3701) * chore: change loadMessagesForRoom to typescript * minor tweak * chore: minor tweaks after merge with developer * chore: minor tweaks after merge with developer * chore: minor tweak * chore: minor tweaks * Fix return Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate methods/sendFileMessage to typescript (#3683) * chore: start the migration * chore: update sendFileMessage to ts * chore: removing an `any` from uploadQueue * chore: minor tweak * chore: minor tweak * chore: minor tweaks after merge with developer * chore: minor tweak after merge develop into current * [FIX] Differ to Last Session Authenticated (#3667) * [FIX] Differ to Last Session Authenticated * Added timesync * [FIX] Differ to Last Session Authenticated * Added timesync * timesync tweaks * refactor diffLastLocalSession and saveLastLocalAuthentication * did a race * Update comment in app/utils/localAuthentication.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * refactor getServerTimeSync and when use this route * tweak Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadNextMessages to typescript (#3719) * feat: update loadNextMessages to ts * minor tweak * chore: minor tweaks after merge with developer * chore: migrate getFileUrlFromMessage to ts (#3734) * Chore: Migrate to Typescript mergeSubscriptionRooms and findSubscriptionsRooms (#3747) * fix fromJSONValue type * migrate findSubscription and mergeSubscription to typescript * chore: fix subscription param returning null * Chore: Migrate sendMessage to TS (#3712) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/enterpriseModules to TS (#3706) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getThreadName to typescript (#3707) * chore: change getThreadName to typescript * chore: change types after merge develop into current * chore: minor tweak * Chore: Migrate method canOpenRoom to Typescript (#3650) * chore: migrate canOpenRoom to ts * chore: update rocketchat types * change types to Isubscription types * fix: fix mergeSubscriptionsRooms (#3770) * [IMPROVE] Team system messages feedback (#3771) * almost there * Update stories * chore: removing unused function getTeamInfo (#3773) * Chore: create definitions for e2e.setUserPublicAndPrivateKeys api call (#3775) * Chore: Migrate RoomMembersView to Typescript (#3769) * chore: migrate RoomMembersView to ts * fix goRoom item interface * Chore: Migrate views/RoomListView to typescript (#3758) * chore: migrating RoomListView to ts * chore: migrating RoomListView to ts * chore: implementing types for RoomListView * chore: change ChatsStackParamList for fix RoomListView errors * chore: minor tweak * chore: minor tweak * chore: fix setTimeout type * chore: applying changes requested * chore: minor tweak * Chore: Migrate to TS RommInfoEditView (#3766) * initial commit * fix last types * fix import * fix lint * Chore: Server API types POC - loadMessagesForRoom (#3765) * create interface and implements base types * fix some types * Update app/lib/methods/updateMessages.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * fix date type * apply types changes * fix type * fix date value * fix types * typescript things... Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate RoomView to Typescript (#3754) * Chore: Migrate RoomActionsView to Typescript (#3750) * Chore: Migrate loadThreadMessages to TS (#3718) * Migrate loadThreadMessages to TypeScript * Update interfaces * Bump version to 4.26.0 (#3806) * Chore: Migrate REST API - markAsUnread to TS (#3801) * Migrate `subscriptions.unread` to typescript * Chore: Migrate REST API - convertChannelToTeam to TS (#3792) * migrate channels.convertToTeam and groups.convertToTeam to ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getDepartmentInfo to Typescript (#3795) * Chore: Migrate REST API - sendConfirmationEmail to Typescript (#3807) * Chore: Migrate REST API - getRoutingConfig to Typescript (#3794) * Chore: Migrate REST API - getRoutingConfig to Typescript * minor tweak * Chore: Migrate REST API - createChannel to Typescript (#3786) * Chore: Migrate REST API - createChannel to Typescript * removed success * iserverroomitem * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript (#3793) * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript * Update app/definitions/rest/v1/e2e.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - register to TS (#3796) * Migrate `user.register` to TypeScript * Chore: Migrate REST API - createTeam to TS (#3788) * Migrate `teams.create` REST API to TypeScript * Chore: Migrate REST API - addRoomsToTeam to TS (#3797) * Migrate REST API `teams.addRooms` to TypeScript * Chore: Migrate REST API - removeTeamMember to TS (#3799) * Migrate REST API `teams.removeMember` to TypeScript * Chore: Migrate REST API - toggleArchiveRoom to Typescript (#3791) * Chore: Migrate REST API - toggleArchiveRoom to Typescript * minor tweak * removed success param * minor tweak * Chore: Migrate REST API - convertTeamToChannel to TS (#3800) * Migrate REST API `teams.convertToChannel` to TypeScript * Chore: Migrate REST API - deleteMessage to TS (#3802) * Migrate REST API `chats.delete` to TypeScript * Chore: Server API types - user.setPreferences (#3781) * chore: implementing type for test api - user.setPreferences * chore: minor tweak * Chore: Server API types - teams.updateRoom (#3774) * chore: type the API call `teams.updateRoom` * chore: creating the interface `IServerTeamUpdateRoom` * chore: minor tweak after merge * Chore: Migrate REST API - teamListRoomsOfUser to TS (#3805) * migrate REST API `teams.listRoomsOfUser` to TypeScript * update: `rooms` type on `teams.listRoomsOfUser` * update: if-conditionals on `RoomActionsView` * Chore: Migrate REST API - toggleBlockUser to Typescript (#3808) * Chore: Migrate REST API - saveRoomSettings to Typescript (#3787) * Chore: Migrate methods/loadSurroundingMessages to Typescript (#3733) * Chore: Migrate methods/loadSurroundingMessages to Typescript * tweaks * tweak * tweak * tweaks to make ts happy * instead as IMessage is optional u * enum to MessageTypeLoad * minor tweaks * Chore: Migrate RoomInfoView to Typescript (#3778) * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * react.reactelement | null * minor tweak * minor tweak livechatvisitor * remove console.log * Tweaks * Fix: fix the command to run detox on android (#3812) * fix the command to run detox on android (#3812) * Chore: Migrate subscriptions/rooms to TS (#3748) * chore: migrate subscriptions rooms to ts * chore: adding a TODO to remember this problem * chore: removing unnecessary todos * chore: minor tweak after develop updates * chore: migrate message service to ts * chore: minor tweaks * chore: minor tweak * chore: minor tweak after merge develop into this branch * chore: minor tweak after merge with dev * minor tweak * Chore: Migrate subscriptions/room to TS (#3752) * chore: initial commit * chore: fix readMessages * chore: removing some `any` * chore: removing some `any` * chore: removing some `any` * chore: fix erros after merge develop inside this branch * chore: minor tweak * chore: applying changes requested * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - e2eRequestSubscriptionKeys to Typescript (#3813) * Chore: Migrate REST API - merge v1/user in v1/users (#3827) * Chore: Migrate REST API - toggleRead to Typescript (#3820) * Chore: Migrate REST API - e2eSetRoomKeyID to Typescript (#3816) * Chore: Migrate REST API - removeTeamRoom to Typescript (#3819) * Chore: Migrate REST API - updateGroupKey to Typescript (#3817) * Chore: Migrate REST API - forgotPassword to Typescript (#3818) * Chore: Migrate REST API - updateJitsiTimeout to Typescript (#3822) * chore: add rest api return * chore: add rest api return * chore: add rest api return (#3824) * chore: add rest api return (#3825) * chore: add rest api return (#3829) * chore: add rest api return (#3826) * Chore: Delete unused function getUserRoles (#3836) * Chore: Migrate REST API - leaveRoom to Typescript (#3833) * chore: add rest api type * remove any * Chore: Migrate REST API - deleteRoom to Typescript (#3834) * Chore: Migrate REST API - removeUserFromRoom to Typescript (#3837) * Chore: Migrate REST API - hideRoom to Typescript (#3832) * chore: add rest api return (#3850) * chore: add rest api return (#3849) * Chore: Migrate REST API - setUserStatus to Typescript (#3828) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - spotlight to Typescript (#3821) * Chore: Migrate REST API - spotlight to Typescript * minor tweak * chore: add rest api return (#3844) * Chore: Migrate REST API - usersAutoComplete to Typescript (#3845) * chore: add rest api return (#3847) * chore: add rest api return (#3848) * Chore: Migrate REST API - joinRoom to Typescript (#3835) * Chore: Migrate REST API - joinRoom to Typescript * join to discussion * Chore: Migrate REST API - returnLivechat to Typescript (#3843) * Chore: Migrate REST API - getRoomCounters to Typescript (#3842) * Chore: Migrate REST API - getRoomCounters to Typescript * minor tweak * [FIX] Condensed layout cutting text on smaller text sizes (#3831) * Chore: Migrate ee/omnichannel folder to Typescript (#3749) * Chore: Migrate ee/omnichannel folder to Typescript * omnichannelstatus and queue list * boolean searching and react.ref * test initi * test and refactor interfaces * minor tweak * minor tweaks * [FIX] Hardcoded E2E password for Detox workflow (#3809) * [FIX] Removed account from E2E Data and create a file responsible for this account * Updated e2e/README.md * minor tweak * Update e2e/README.md Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> * Chore: Migrate REST API - getTagsList to Typescript (#3854) * Chore: Migrate normalizeMessage to TS (#3743) * migrate normalizeMessage to ts * fix: missing null validations and type aliases * Chore: Migrate REST API - e2eRequestRoomKey to Typescript (#3814) * Chore: Remove Teams migration (#3857) * Chore: Migrate REST API - getChannelInfo to TS (#3839) * add: type for REST API `channels.info` * add: `ts-ignore` to `RoomActionsView` * Chore: Migrate search and localSearch methods to Typescript (#3751) * chore: migrate search to typescript * fix types * fix type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getListCannedResponse to Typescript (#3858) * Chore: Migrate REST API - getCustomFields to Typescript (#3856) * Chore: Migrate REST API - getCustomFields to Typescript * minor tweak * Chore: Migrate REST API - getAgentDepartments to Typescript (#3855) * Chore: Create IServerRoom and IServerSubscription (#3782) * Chore: Server API types - chat.getDiscussions (#3776) * chore: implementing type for test api - getDiscussions * Fix DiscussionDetails count usage * chore: update getDiscussions to use IMessageFromServer Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getTeamListRoom to TS (#3840) * add: `teams.listRooms` types * add: `PaginatedResult<T>` to `teams.ts` * Chore: Dehydrate login methods from rocketchat.js (#3759) * dehydrate login methods from rocketchat.js * [FIX] Merge subscription and room logic using unparsed data (#3859) * chore: add rest api return (#3864) * chore: add rest api return (#3865) * Chore: Migrate REST API - saveUserProfile to Typescript (#3863) * Chore: Migrate REST API - saveUserProfile to Typescript * minor tweak * Chore: Update react-native-mmkv-storage to 0.6.12 (#3634) * chore: updating mmkv library * feat: updating android ejson to use the getSecureKey new version * feat: updating IOS files to use the getSecureKey new version * feat: changing all mmkv methods to use sync calls * feat: changing mmkv methods from Screen lock * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from logout * feat: changing all mmkv methods from e2e * fix: small fix at encryption and server drop down * feat: changing all mmkv methods from set theme * feat: changing all mmkv methods from openLink * fix: setting up mmkv to works property on Android * fix: fix an error to set the theme when open the app * refactor: change the react-native branch (temporary) * refactor: removing all `Async` from mmkv functions name * refactor: removing await from unnecessary functions, removing console.log and update cocoapods * refactor: removing unnecessary undefined from methods * feat: creating a custom hook for mmkv * refactor: changing the fetchPasscode to use the useUserPreferences hook * refactor: changing setTheme from app/index * refactor: small fix on setTheme * chore: update mmkv to 0.6.11 * chore: update mmkv to 0.6.11 * chore: minor tweak * chore: update mmkv to 0.6.12 * chore: mock NativeModules * chore: fix test mmkv * chore: removing custom MMKV JSI module, since is no more necessary after 0.6.11 version * feat: removing some async calls from mmkv after update from develop * feat: creating a function to get the initialTheme * feat: removing unnecessary try/catch * fix: fixing the blink white when open the app * feat: changing useMMKVStorage to create from mmkv lib * test: creating a mock for mmkv create function * chore: fix errors on tablet * minor tweak * Chore: Migrate REST API - getUserPreferences to Typescript (#3830) * Chore: Migrate REST API - getAvatarSuggestion to Typescript (#3869) * Chore: Migrate REST API - resetAvatar to Typescript (#3870) * Chore: Migrate REST API - setAvatarFromService to Typescript (#3871) * Chore: Migrate REST API - getUsernameSuggestion to Typescript (#3872) * Chore: Migrate REST API - getMessages to Typescript (#3875) * Chore: Migrate REST API - searchMessages to Typescript (#3874) * Chore: Migrate REST API - getFiles to Typescript (#3873) * [FIX] Issues after reconnecting (#3815) * [FIX] Fix synchronization of removed subscriptions (#3768) When a subscription is removed from the server via another client, when the mobile app is relaunched the subscriptions were not being removed properly. Changed the logic to use the subscriptionResult.remove array from the server and the _id property to fix. Co-authored-by: Christian King <cking@vonix.io> * Chore: Migrate REST API - editLivechat to Typescript (#3878) * Chore: Migrate REST API - getReadReceipts to Typescript (#3877) * [FIX] ReactNativeUiLib are not installed after run pod install (#3882) * fix ReactNativeUiLib not installed when run pod install * committing Podfile.lock * Chore: Migrate REST API - editMessage to Typescript (#3887) * Chore: Migrate REST API - editMessage to Typescript * minor tweak * Chore: Migrate REST API - e2eResetOwnKey to Typescript (#3888) * Chore: Migrate REST API - e2eResetOwnKey to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - emitTyping to Typescript (#3886) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers (#3868) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers * change GetRoomRoles local * Chore: Migrate REST API - addUsersToRoom to Typescript (#3884) * Chore: Migrate REST API - addUsersToRoom to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - createGroupChat to Typescript (#3885) * Chore: Migrate REST API - createGroupChat to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getCommandPreview to Typescript (#3894) * Chore: Migrate REST API - getCommandPreview and executeCommandPreview to Typescript (#3897) * Chore: Migrate REST API - getDirectory to Typescript (#3898) * Chore: Migrate REST API - getServerInfo to Typescript (#3900) * [FIX] Mention from suggestions concatenates to query string on autocomplete (#3696) * [FIX] Mention suggestion concatenate to query string * Add function to get regexp and its tests in separate files * Update getRegexp.ts * Update file names * Try new regex * One regex for all mention types Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - readThreads to Typescript (#3866) * chore: migrate readThreads to typescript * fix imports * Chore: Migrate REST API - getRoomInfo to Typescript (#3823) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - sendEmailCode to Typescript (#3891) * Chore: Migrate REST API - sendEmailCode to Typescript (#3905) * Chore: Migrate REST API - saveAutoTranslate to Typescript (#3892) * Chore: Migrate REST API - runSlashCommand to Typescript (#3893) * Chore: Migrate REST API - getSyncThreadsList to Typescript (#3896) * Chore: Migrate REST API - getRoomMembers to Typescript (#3899) * Chore: Migrate methods/actions to Typescript and refactor UiKit folder (#3716) * Chore: Migrate methods/actions to Typescript * tweak in actions * Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * refactor sdk.current * interface and uikit done * refactor interface, index and utils from UiKit * minor tweak * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - removePushToken to Typescript (#3903) * Chore: Migrate REST API - registerPushToken to Typescript (#3902) * Chore: Dehydrate share extension from rocketchat.js (#3753) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getThreadsList to Typescript (#3895) * chore: add rest api return * chore: removing sort param * Chore: evaluate Header components - TypeScript (#3918) * update: Header components * Chore: Evaluate BackgroundContainer - TypeScript (#3917) * update: `BackgroundContainer` * remove: `theme` from `IBackgroundContainer` * update: return type for `BackgroundContainer` * Chore: Evaluate ActivityIndicator - TypeScript (#3914) * update: `BackgroundContainer` and `ActivityIndicator` * update: return type for `RCActivityIndicator` * update: return type for `BackgroundContainer` * [NEW] Collapsible Message (#3879) * create new collapsible component * create collapsible tests and update snapshot * fix quote :) * update snapshot * add support to color * add collapsed prop * fix some styles * fix tests * wip * clean * add CollapsibleQuote story * better style * update snapshots * add better tests * remove testID * update storyshot * Chore: Migrate containers: Toast to Typescript (#3913) * Chore: Migrate containers: Loading to Typescript (#3915) * Chore: Migrate REST API - e2eFetchMyKeys to Typescript (#3942) * [FIX] Messages not loading for unjoined channels (#3904) * Fix message loading for unjoined channels * Update updateMessages.ts * log -> console.log Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: StatusBar theme and style props (#3906) * chore: clean status bar and remove useless theme * mend * wip * remove unused props * chore: Evaluate SearchBox (#3909) * [FIX] Wrong param sent to system message (#3943) * [FIX] Display added user to team * tweak when remove members from team too * update storyshot Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> * [NEW] Redesign quoted messages (#3883) * Language update from LingoHub 🤖 on 2022-03-21Z (#3940) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Clean TwoFactor - Typescript (#3912) * chore: clean TwoFactor * minor tweak * minor refactor * chore: removing console log * Chore: Clean Check component - TypeScript (#3919) * chore: clear Check component * chore: update tests * Chore: Clean InAppNotification - TypeScript (#3920) * Chore: Clean ThreadDetails - TypeScript (#3924) * Chore: Clean MessageErrorActions - TypeScript (#3928) * Chore: Evaluate TextInput - TypeScript (#3908) * update `TextInput` component update: ActivityIndicator * remove: `any` * update: `TextInput` on `UIKit` * Fix returnKeyType Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Evaluate ActionSheet - TypeScript (#3927) * Chore: Clean LoginServices - TypeScript (#3935) * Chore: Evaluate Passcode - TypeScript (#3931) * Chore: Migrate containers: Passcode to Typescript * minor tweak * minor tweak * [FIX] "Sent an attachment" text on media preview for threads (#3947) * update: `Content` component * update: `Message` snapshots * [FIX] Audio thumb's size (#3945) * update: Audio component * Chore: Update codecov version (#3954) * Chore: Evaluate HeaderButton - TypeScript (#3925) * update: `HeaderButton` components * update: types * fix types * fix lint and update snapshot Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> * [FIX] Navigate to team from directory (#3953) * [FIX] Param privacy when editing room info (#3962) * [FIX] Drawer failing to open/close on ProfileView (#3963) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Danish Ahmed Mirza <77742477+try-catch-stack@users.noreply.github.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> Co-authored-by: Snyk bot <snyk-bot@snyk.io> Co-authored-by: lingohub[bot] <69908207+lingohub[bot]@users.noreply.github.com> Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Christian King <cking@vonix.io>
2022-03-28 18:14:26 +00:00
import { SubscriptionType, TSubscriptionModel } from '../definitions/ISubscription';
2022-01-24 20:12:36 +00:00
Merge 4.26.0 into master (#3978) * test * Remove console.log * test * [FIX] StoryShots not working for async rendered components (#3677) * remove console.log * Add missing DiscussionsView snapshot * fix build and useless done and async generator * update snapshot * Chore: fix build and useless done and async generator (#3678) * fix build and useless done and async generator * update snapshot * Chore: Migrate Database to Typescript (#3580) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module permissions to typescript (#3630) * Chore: Migrate redux module share to typescript (#3612) * chore: migrate redux module share to typescript * chore: fix types * chore: update types * chore: migrate redux module share to typescript * remove double import * chore: fix import * Chore: Migrate redux module createChannel to typescript (#3602) * chore: migrate createChannel to ts and add tests * chore: fix naming * chore: add more types and remove mapDispatchToProps from components * remove todo * update tests * chore: migrate interface to reducer and fix errors on return * chore: insert IApplicationState to mapStateToProps state type * Remove spread * fix type * fix import and state type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module app to typescript (#3598) * chore: migrate activeUsers reducer and action to TS * chore: init types folder and set redux and BaseScreen interface * chore: remove mapDispatchToProps to use dispatch prop and clear some types * chore: type selectedUsers action and reducer and improvement in the code of other files * chore: move IUser to base types * chore: move state props to ISelectedUsersViewProps * chore: create mocketStore * chore: remove applyAppStateMiddleware * test: create activeUser and selectedUser tests * test: add more selectedUsers tests * chore: fix action type * chore: move types to definition folder and fix imports * chore: remove unused const * chore: migrate redux tests to reducer folder and add eslint jest plugin * chore: exprot initial state and then import on tests * chore: move interfaces to reducer and import on screen * chore: set eslint-plugin-jest version to 24.7.0 * chore: fix IUser import * chore: update interfaces and types names * chore: update definitions * chore: update IBaseScreen definitions * chore: init reducer/app migration to ts * chore: add tests and migrate RootEnum * wip: migrate fixed consts to RootEnum * chore: remove redux action inferences * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module createDiscussion to typescript (#3604) * chore: migrate createDiscussion to ts and add tests * chore: add TActionCreateDiscussion to TApplicationActions * fix types * update types * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] ios-testflight-experimental unable to find cache (#3684) * Chore: Remove Non-null assertion operator in ThreadMessagesView (#3632) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate CannedResponsesListView to Typescript (#3553) * Chore: Migrate CannedResponsesListView to TS * Moved IcannedResponse to definitions and fixed the index * Chore: Migrate CannedResponseDetail to TS * minor tweaks * refactor: update new types and interfaces for use ISubscription * fix lint error and canned responses's dropdown Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate LivechatEditView to Typescript (#3499) * Chore: Migrate LivechatEditView to Typescript * refactor: minor tweak * refactor: fix the interfaces for input * refactor: fix lint erros * minor tweak with new navigation types * function * iroom tweak * livechateditview tweak * TextInput tweak * refactor: update new types and interfaces for use ISubscription * refactor to default useState type * change the component name in SearchBox * changed state type Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Message press navigating to empty RoomView (#3680) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Prevent duplicated .jpg on file upload (#3658) * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * refactored comment * Chore: Migrate lib/utils to TypeScript (#3637) * Migrate utils to TypeScript * Add @types/semver * Refactor compareServerVersion(currentVersion, oldVersion, func) to compareServerVersion(current, func, oldVersion) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate readMessages to TS (#3669) * Migrate readMessages to TS * Update IRocketChat interface * [FIX] Unnecessary login dispatch on adding new server (#3693) * [FIX] Disable tap gesture on call messages (#3694) * [IMPROVE] Keep biometry option from last session (#3668) Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> * Fix reactotron multiple connections (#3622) * Chore: Fix rocketchat interface (#3705) * Chore: Migrate logout to Typescript (#3688) * [NEW] Stream to get individual presence updates (#3606) Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> * [FIX] Inject Redux store to prevent/remove require cycles (#3691) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate lib/rocketchat.js to TS - structure PoC (#3661) Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * [FIX] #3606 merged using wrong JS SDK branch (#3709) * [FIX] Remove deprecated database methods and other database operations (#3686) * Fix PK error on subscriptions/room * Instead of checking for pending update, wrap the call on a try catch and return null in case of error * Generate delete operations before create/update to prevent errors * Apply same logic on encryption * Fix database operations on getRoles * Fix a few database issues found on Bugsnag on ThreadMessagesView * Run prettier :( * Chore: Add REST API definitions from server (#3721) * create first definitions * chore: implements get and post types * fix lint * add ts-ignore * add teams.removeRoom method * Remove unused endpoints Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Move some methods to SDK (#3736) * [IMPROVE] Add support for ephemeral messages inside threads (#3687) * Chore: dehydrate small server requests away from rocketchat.js (#3740) * Bump version to 4.25.0 (#3745) * [Snyk] Security upgrade url-parse from 1.5.1 to 1.5.6 (#3746) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-URLPARSE-2401205 * Language update from LingoHub 🤖 on 2022-02-14Z (#3730) * Language update from LingoHub 🤖 Project Name: Rocket.Chat.ReactNative Project Link: https://translate.lingohub.com/rocketchat/dashboard/rocket-dot-chat-dot-reactnative User: Robot LingoHub Easy language translations with LingoHub 🚀 * remove draft gl Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getSingleMessage to TS (#3700) * migrate getSingleMessage to TS * minor tweak * Chore: Migrate methods/getRooms to TS (#3702) * migrate getRooms to TS * add sdk and set any types * Moved the new variable around and added ts-ignore to follow the pattern from /services/restApi.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate updateMessages to Typescript (#3715) * Chore: Migrate selector/login to TS (#3731) * migrate selector/login to TS * Fix lint errors * set aliases for returns * Chore: Migrate helpers/parseUrls to Typescript (#3735) * Chore: Migrate methods/helpers/parseQuery to Typescript (#3742) * Chore: Migrate methods/helpers/parseQuery to Typescript * tweak in example * Chore: Migrate app/commands to typescript (#3697) * Chore: Migrate lib/encryption folder to TypeScript (#3639) * Initial commit * add types/bytebuffer, add type definitions to params and update interfaces * add more types and type assertions * update types * change bang operator by type assertion and update class variables definitions * add types for deferred class * minor tweaks on types definitions * add ts-ignore * Update encryption.ts * update deferred and encryption * update encryption.ts * Update room.ts * update toDecrypt type * initialize sessionKeyExportedString * remove return types * Chore: Migrate redux actions/enterpriseModules to TS (#3698) * migrate enterpriseModules to TS * update test file * Chore: Migrate database/services and database/utils to TS (#3708) * migrate database services and utils to ts * Migrate tests Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate buildMessage to TS (#3732) * migrate buildMessage to TS * Fix lint * minor tweak * minor tweaks * Chore: Migrate getPermissions to Typescript (#3720) * Migrating... * Fix IPermission * Playing with types * Remove `as const` * Fix lint * Fix test * Apply sdk * Fix lint and autocomplete * [FIX] Add search and fix pagination for omnichannels departments (#3621) * [FIX] Search and pagination for omnichannels departments * pagination complete * minor tweak * renamed a param and workaround for a ux bug * fix style of flatlist and search as header scrollable * stick the header * Merge branch 'fix.forward-department-list' of https://github.com/RocketChat/Rocket.Chat.ReactNative into fix.forward-department-list * refactor pagination * fix value type * refactor render search * refactor layout * make ts happy * Chore: Migrate Markdown to Typescript (#3558) * Chore: Migrate Markdown to TS * Chore: Migrate Markdown to TS * minor tweak * added preview where markdown was preview and fixed params within markdown * removed ts-ignore * fix lint * removed numbersofline={0} and default value to numberOfLines=1 * change how to import markdown preview and remove numberOfLines * using useTheme inside markdownPreview and remove theme from components * minor tweak on interfaces * isNewMarkdown return as boolean * minor tweaks * minor tweaks * removed unused component * fixed markdown stories * updated snapshot because removed numberOfLines={0} from message/content * create IEmoji.ts in definitions and refactor all places where getCustomEmoji was called * onLinkPress typed * todo: refactor navtoroominfo * formatText.test.ts * markdown stories to typescript too * minor tweak * IMessage definition * refactor: update new types and interfaces for use ISubscription * refactor: update threadItem for use new MarkdownPreview * refactor: rollback wrong file commited * formatHyperlink * fix lint * updated item story shot * refactor and refactor some types * Remove non-null assertion * Minor change on useRealName * tweak Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/callJitsi to typescript (#3660) * chore: migrate callJitsi to typescript * change fixed string to type * wip * wip * back to old times :) * back to typescript * Chore: Migrate redux module room to typescript (#3636) * chore: migrate redux module room to typescript and remove dispatch on dependencies * chore: add tests to redux module room * chore: create ERoomType and use on implemention * chore: update enum name * fix test id * Chore: Migrate redux module login to typescript (#3647) * chore: migrate redux module login to typescript chore: update redux module login tests * update workers * wip * fix type * remove partial * add more status * migrate the rest of the stuff to typescript * fix tests and types * fix types and tests * Chore: Migrate method getSettings to typescript (#3703) * chore: migrate getSettings to typescript and and some types * chore: remove this and add current to code * chore: add current * Chore: Migrate getCustomEmojis to TS (#3724) * update customEmoji interface and getCustomEmoji * add sdk * updated emojiCustom rest definition * minor refactor * update params object * [FIX] getRooms request using param with wrong name (#3761) * Chore: Migrate methods/getRoomInfo to TS (#3695) * migrate getRoomInfo to TS * update room type * update types * Fix lint error * Chore: Migrate getSlashCommands to TS (#3711) * migrate getSlashCommands to TS * use sdk and update getSlashCommands * minor tweak * Remove implicit anys Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate getUsersPresence to TS (#3717) * migrate getUsersPresence to ts * use sdk and remove this context from getUsersPresence * Chore: Migrate loadMissedMessages to typescript (#3704) * chore: migrate loadMissedMessages to typescript * remove loaderItem * remove this from functions * Chore: Migrate methods/getRoles to Typescript (#3741) * chore: migrate getRoles to ts * chore: removing unused const * chore: minor tweak * Type batch Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadMessagesForRoom to Typescript (#3701) * chore: change loadMessagesForRoom to typescript * minor tweak * chore: minor tweaks after merge with developer * chore: minor tweaks after merge with developer * chore: minor tweak * chore: minor tweaks * Fix return Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate methods/sendFileMessage to typescript (#3683) * chore: start the migration * chore: update sendFileMessage to ts * chore: removing an `any` from uploadQueue * chore: minor tweak * chore: minor tweak * chore: minor tweaks after merge with developer * chore: minor tweak after merge develop into current * [FIX] Differ to Last Session Authenticated (#3667) * [FIX] Differ to Last Session Authenticated * Added timesync * [FIX] Differ to Last Session Authenticated * Added timesync * timesync tweaks * refactor diffLastLocalSession and saveLastLocalAuthentication * did a race * Update comment in app/utils/localAuthentication.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * refactor getServerTimeSync and when use this route * tweak Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadNextMessages to typescript (#3719) * feat: update loadNextMessages to ts * minor tweak * chore: minor tweaks after merge with developer * chore: migrate getFileUrlFromMessage to ts (#3734) * Chore: Migrate to Typescript mergeSubscriptionRooms and findSubscriptionsRooms (#3747) * fix fromJSONValue type * migrate findSubscription and mergeSubscription to typescript * chore: fix subscription param returning null * Chore: Migrate sendMessage to TS (#3712) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/enterpriseModules to TS (#3706) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getThreadName to typescript (#3707) * chore: change getThreadName to typescript * chore: change types after merge develop into current * chore: minor tweak * Chore: Migrate method canOpenRoom to Typescript (#3650) * chore: migrate canOpenRoom to ts * chore: update rocketchat types * change types to Isubscription types * fix: fix mergeSubscriptionsRooms (#3770) * [IMPROVE] Team system messages feedback (#3771) * almost there * Update stories * chore: removing unused function getTeamInfo (#3773) * Chore: create definitions for e2e.setUserPublicAndPrivateKeys api call (#3775) * Chore: Migrate RoomMembersView to Typescript (#3769) * chore: migrate RoomMembersView to ts * fix goRoom item interface * Chore: Migrate views/RoomListView to typescript (#3758) * chore: migrating RoomListView to ts * chore: migrating RoomListView to ts * chore: implementing types for RoomListView * chore: change ChatsStackParamList for fix RoomListView errors * chore: minor tweak * chore: minor tweak * chore: fix setTimeout type * chore: applying changes requested * chore: minor tweak * Chore: Migrate to TS RommInfoEditView (#3766) * initial commit * fix last types * fix import * fix lint * Chore: Server API types POC - loadMessagesForRoom (#3765) * create interface and implements base types * fix some types * Update app/lib/methods/updateMessages.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * fix date type * apply types changes * fix type * fix date value * fix types * typescript things... Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate RoomView to Typescript (#3754) * Chore: Migrate RoomActionsView to Typescript (#3750) * Chore: Migrate loadThreadMessages to TS (#3718) * Migrate loadThreadMessages to TypeScript * Update interfaces * Bump version to 4.26.0 (#3806) * Chore: Migrate REST API - markAsUnread to TS (#3801) * Migrate `subscriptions.unread` to typescript * Chore: Migrate REST API - convertChannelToTeam to TS (#3792) * migrate channels.convertToTeam and groups.convertToTeam to ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getDepartmentInfo to Typescript (#3795) * Chore: Migrate REST API - sendConfirmationEmail to Typescript (#3807) * Chore: Migrate REST API - getRoutingConfig to Typescript (#3794) * Chore: Migrate REST API - getRoutingConfig to Typescript * minor tweak * Chore: Migrate REST API - createChannel to Typescript (#3786) * Chore: Migrate REST API - createChannel to Typescript * removed success * iserverroomitem * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript (#3793) * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript * Update app/definitions/rest/v1/e2e.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - register to TS (#3796) * Migrate `user.register` to TypeScript * Chore: Migrate REST API - createTeam to TS (#3788) * Migrate `teams.create` REST API to TypeScript * Chore: Migrate REST API - addRoomsToTeam to TS (#3797) * Migrate REST API `teams.addRooms` to TypeScript * Chore: Migrate REST API - removeTeamMember to TS (#3799) * Migrate REST API `teams.removeMember` to TypeScript * Chore: Migrate REST API - toggleArchiveRoom to Typescript (#3791) * Chore: Migrate REST API - toggleArchiveRoom to Typescript * minor tweak * removed success param * minor tweak * Chore: Migrate REST API - convertTeamToChannel to TS (#3800) * Migrate REST API `teams.convertToChannel` to TypeScript * Chore: Migrate REST API - deleteMessage to TS (#3802) * Migrate REST API `chats.delete` to TypeScript * Chore: Server API types - user.setPreferences (#3781) * chore: implementing type for test api - user.setPreferences * chore: minor tweak * Chore: Server API types - teams.updateRoom (#3774) * chore: type the API call `teams.updateRoom` * chore: creating the interface `IServerTeamUpdateRoom` * chore: minor tweak after merge * Chore: Migrate REST API - teamListRoomsOfUser to TS (#3805) * migrate REST API `teams.listRoomsOfUser` to TypeScript * update: `rooms` type on `teams.listRoomsOfUser` * update: if-conditionals on `RoomActionsView` * Chore: Migrate REST API - toggleBlockUser to Typescript (#3808) * Chore: Migrate REST API - saveRoomSettings to Typescript (#3787) * Chore: Migrate methods/loadSurroundingMessages to Typescript (#3733) * Chore: Migrate methods/loadSurroundingMessages to Typescript * tweaks * tweak * tweak * tweaks to make ts happy * instead as IMessage is optional u * enum to MessageTypeLoad * minor tweaks * Chore: Migrate RoomInfoView to Typescript (#3778) * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * react.reactelement | null * minor tweak * minor tweak livechatvisitor * remove console.log * Tweaks * Fix: fix the command to run detox on android (#3812) * fix the command to run detox on android (#3812) * Chore: Migrate subscriptions/rooms to TS (#3748) * chore: migrate subscriptions rooms to ts * chore: adding a TODO to remember this problem * chore: removing unnecessary todos * chore: minor tweak after develop updates * chore: migrate message service to ts * chore: minor tweaks * chore: minor tweak * chore: minor tweak after merge develop into this branch * chore: minor tweak after merge with dev * minor tweak * Chore: Migrate subscriptions/room to TS (#3752) * chore: initial commit * chore: fix readMessages * chore: removing some `any` * chore: removing some `any` * chore: removing some `any` * chore: fix erros after merge develop inside this branch * chore: minor tweak * chore: applying changes requested * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - e2eRequestSubscriptionKeys to Typescript (#3813) * Chore: Migrate REST API - merge v1/user in v1/users (#3827) * Chore: Migrate REST API - toggleRead to Typescript (#3820) * Chore: Migrate REST API - e2eSetRoomKeyID to Typescript (#3816) * Chore: Migrate REST API - removeTeamRoom to Typescript (#3819) * Chore: Migrate REST API - updateGroupKey to Typescript (#3817) * Chore: Migrate REST API - forgotPassword to Typescript (#3818) * Chore: Migrate REST API - updateJitsiTimeout to Typescript (#3822) * chore: add rest api return * chore: add rest api return * chore: add rest api return (#3824) * chore: add rest api return (#3825) * chore: add rest api return (#3829) * chore: add rest api return (#3826) * Chore: Delete unused function getUserRoles (#3836) * Chore: Migrate REST API - leaveRoom to Typescript (#3833) * chore: add rest api type * remove any * Chore: Migrate REST API - deleteRoom to Typescript (#3834) * Chore: Migrate REST API - removeUserFromRoom to Typescript (#3837) * Chore: Migrate REST API - hideRoom to Typescript (#3832) * chore: add rest api return (#3850) * chore: add rest api return (#3849) * Chore: Migrate REST API - setUserStatus to Typescript (#3828) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - spotlight to Typescript (#3821) * Chore: Migrate REST API - spotlight to Typescript * minor tweak * chore: add rest api return (#3844) * Chore: Migrate REST API - usersAutoComplete to Typescript (#3845) * chore: add rest api return (#3847) * chore: add rest api return (#3848) * Chore: Migrate REST API - joinRoom to Typescript (#3835) * Chore: Migrate REST API - joinRoom to Typescript * join to discussion * Chore: Migrate REST API - returnLivechat to Typescript (#3843) * Chore: Migrate REST API - getRoomCounters to Typescript (#3842) * Chore: Migrate REST API - getRoomCounters to Typescript * minor tweak * [FIX] Condensed layout cutting text on smaller text sizes (#3831) * Chore: Migrate ee/omnichannel folder to Typescript (#3749) * Chore: Migrate ee/omnichannel folder to Typescript * omnichannelstatus and queue list * boolean searching and react.ref * test initi * test and refactor interfaces * minor tweak * minor tweaks * [FIX] Hardcoded E2E password for Detox workflow (#3809) * [FIX] Removed account from E2E Data and create a file responsible for this account * Updated e2e/README.md * minor tweak * Update e2e/README.md Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> * Chore: Migrate REST API - getTagsList to Typescript (#3854) * Chore: Migrate normalizeMessage to TS (#3743) * migrate normalizeMessage to ts * fix: missing null validations and type aliases * Chore: Migrate REST API - e2eRequestRoomKey to Typescript (#3814) * Chore: Remove Teams migration (#3857) * Chore: Migrate REST API - getChannelInfo to TS (#3839) * add: type for REST API `channels.info` * add: `ts-ignore` to `RoomActionsView` * Chore: Migrate search and localSearch methods to Typescript (#3751) * chore: migrate search to typescript * fix types * fix type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getListCannedResponse to Typescript (#3858) * Chore: Migrate REST API - getCustomFields to Typescript (#3856) * Chore: Migrate REST API - getCustomFields to Typescript * minor tweak * Chore: Migrate REST API - getAgentDepartments to Typescript (#3855) * Chore: Create IServerRoom and IServerSubscription (#3782) * Chore: Server API types - chat.getDiscussions (#3776) * chore: implementing type for test api - getDiscussions * Fix DiscussionDetails count usage * chore: update getDiscussions to use IMessageFromServer Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getTeamListRoom to TS (#3840) * add: `teams.listRooms` types * add: `PaginatedResult<T>` to `teams.ts` * Chore: Dehydrate login methods from rocketchat.js (#3759) * dehydrate login methods from rocketchat.js * [FIX] Merge subscription and room logic using unparsed data (#3859) * chore: add rest api return (#3864) * chore: add rest api return (#3865) * Chore: Migrate REST API - saveUserProfile to Typescript (#3863) * Chore: Migrate REST API - saveUserProfile to Typescript * minor tweak * Chore: Update react-native-mmkv-storage to 0.6.12 (#3634) * chore: updating mmkv library * feat: updating android ejson to use the getSecureKey new version * feat: updating IOS files to use the getSecureKey new version * feat: changing all mmkv methods to use sync calls * feat: changing mmkv methods from Screen lock * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from logout * feat: changing all mmkv methods from e2e * fix: small fix at encryption and server drop down * feat: changing all mmkv methods from set theme * feat: changing all mmkv methods from openLink * fix: setting up mmkv to works property on Android * fix: fix an error to set the theme when open the app * refactor: change the react-native branch (temporary) * refactor: removing all `Async` from mmkv functions name * refactor: removing await from unnecessary functions, removing console.log and update cocoapods * refactor: removing unnecessary undefined from methods * feat: creating a custom hook for mmkv * refactor: changing the fetchPasscode to use the useUserPreferences hook * refactor: changing setTheme from app/index * refactor: small fix on setTheme * chore: update mmkv to 0.6.11 * chore: update mmkv to 0.6.11 * chore: minor tweak * chore: update mmkv to 0.6.12 * chore: mock NativeModules * chore: fix test mmkv * chore: removing custom MMKV JSI module, since is no more necessary after 0.6.11 version * feat: removing some async calls from mmkv after update from develop * feat: creating a function to get the initialTheme * feat: removing unnecessary try/catch * fix: fixing the blink white when open the app * feat: changing useMMKVStorage to create from mmkv lib * test: creating a mock for mmkv create function * chore: fix errors on tablet * minor tweak * Chore: Migrate REST API - getUserPreferences to Typescript (#3830) * Chore: Migrate REST API - getAvatarSuggestion to Typescript (#3869) * Chore: Migrate REST API - resetAvatar to Typescript (#3870) * Chore: Migrate REST API - setAvatarFromService to Typescript (#3871) * Chore: Migrate REST API - getUsernameSuggestion to Typescript (#3872) * Chore: Migrate REST API - getMessages to Typescript (#3875) * Chore: Migrate REST API - searchMessages to Typescript (#3874) * Chore: Migrate REST API - getFiles to Typescript (#3873) * [FIX] Issues after reconnecting (#3815) * [FIX] Fix synchronization of removed subscriptions (#3768) When a subscription is removed from the server via another client, when the mobile app is relaunched the subscriptions were not being removed properly. Changed the logic to use the subscriptionResult.remove array from the server and the _id property to fix. Co-authored-by: Christian King <cking@vonix.io> * Chore: Migrate REST API - editLivechat to Typescript (#3878) * Chore: Migrate REST API - getReadReceipts to Typescript (#3877) * [FIX] ReactNativeUiLib are not installed after run pod install (#3882) * fix ReactNativeUiLib not installed when run pod install * committing Podfile.lock * Chore: Migrate REST API - editMessage to Typescript (#3887) * Chore: Migrate REST API - editMessage to Typescript * minor tweak * Chore: Migrate REST API - e2eResetOwnKey to Typescript (#3888) * Chore: Migrate REST API - e2eResetOwnKey to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - emitTyping to Typescript (#3886) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers (#3868) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers * change GetRoomRoles local * Chore: Migrate REST API - addUsersToRoom to Typescript (#3884) * Chore: Migrate REST API - addUsersToRoom to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - createGroupChat to Typescript (#3885) * Chore: Migrate REST API - createGroupChat to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getCommandPreview to Typescript (#3894) * Chore: Migrate REST API - getCommandPreview and executeCommandPreview to Typescript (#3897) * Chore: Migrate REST API - getDirectory to Typescript (#3898) * Chore: Migrate REST API - getServerInfo to Typescript (#3900) * [FIX] Mention from suggestions concatenates to query string on autocomplete (#3696) * [FIX] Mention suggestion concatenate to query string * Add function to get regexp and its tests in separate files * Update getRegexp.ts * Update file names * Try new regex * One regex for all mention types Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - readThreads to Typescript (#3866) * chore: migrate readThreads to typescript * fix imports * Chore: Migrate REST API - getRoomInfo to Typescript (#3823) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - sendEmailCode to Typescript (#3891) * Chore: Migrate REST API - sendEmailCode to Typescript (#3905) * Chore: Migrate REST API - saveAutoTranslate to Typescript (#3892) * Chore: Migrate REST API - runSlashCommand to Typescript (#3893) * Chore: Migrate REST API - getSyncThreadsList to Typescript (#3896) * Chore: Migrate REST API - getRoomMembers to Typescript (#3899) * Chore: Migrate methods/actions to Typescript and refactor UiKit folder (#3716) * Chore: Migrate methods/actions to Typescript * tweak in actions * Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * refactor sdk.current * interface and uikit done * refactor interface, index and utils from UiKit * minor tweak * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - removePushToken to Typescript (#3903) * Chore: Migrate REST API - registerPushToken to Typescript (#3902) * Chore: Dehydrate share extension from rocketchat.js (#3753) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getThreadsList to Typescript (#3895) * chore: add rest api return * chore: removing sort param * Chore: evaluate Header components - TypeScript (#3918) * update: Header components * Chore: Evaluate BackgroundContainer - TypeScript (#3917) * update: `BackgroundContainer` * remove: `theme` from `IBackgroundContainer` * update: return type for `BackgroundContainer` * Chore: Evaluate ActivityIndicator - TypeScript (#3914) * update: `BackgroundContainer` and `ActivityIndicator` * update: return type for `RCActivityIndicator` * update: return type for `BackgroundContainer` * [NEW] Collapsible Message (#3879) * create new collapsible component * create collapsible tests and update snapshot * fix quote :) * update snapshot * add support to color * add collapsed prop * fix some styles * fix tests * wip * clean * add CollapsibleQuote story * better style * update snapshots * add better tests * remove testID * update storyshot * Chore: Migrate containers: Toast to Typescript (#3913) * Chore: Migrate containers: Loading to Typescript (#3915) * Chore: Migrate REST API - e2eFetchMyKeys to Typescript (#3942) * [FIX] Messages not loading for unjoined channels (#3904) * Fix message loading for unjoined channels * Update updateMessages.ts * log -> console.log Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: StatusBar theme and style props (#3906) * chore: clean status bar and remove useless theme * mend * wip * remove unused props * chore: Evaluate SearchBox (#3909) * [FIX] Wrong param sent to system message (#3943) * [FIX] Display added user to team * tweak when remove members from team too * update storyshot Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> * [NEW] Redesign quoted messages (#3883) * Language update from LingoHub 🤖 on 2022-03-21Z (#3940) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Clean TwoFactor - Typescript (#3912) * chore: clean TwoFactor * minor tweak * minor refactor * chore: removing console log * Chore: Clean Check component - TypeScript (#3919) * chore: clear Check component * chore: update tests * Chore: Clean InAppNotification - TypeScript (#3920) * Chore: Clean ThreadDetails - TypeScript (#3924) * Chore: Clean MessageErrorActions - TypeScript (#3928) * Chore: Evaluate TextInput - TypeScript (#3908) * update `TextInput` component update: ActivityIndicator * remove: `any` * update: `TextInput` on `UIKit` * Fix returnKeyType Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Evaluate ActionSheet - TypeScript (#3927) * Chore: Clean LoginServices - TypeScript (#3935) * Chore: Evaluate Passcode - TypeScript (#3931) * Chore: Migrate containers: Passcode to Typescript * minor tweak * minor tweak * [FIX] "Sent an attachment" text on media preview for threads (#3947) * update: `Content` component * update: `Message` snapshots * [FIX] Audio thumb's size (#3945) * update: Audio component * Chore: Update codecov version (#3954) * Chore: Evaluate HeaderButton - TypeScript (#3925) * update: `HeaderButton` components * update: types * fix types * fix lint and update snapshot Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> * [FIX] Navigate to team from directory (#3953) * [FIX] Param privacy when editing room info (#3962) * [FIX] Drawer failing to open/close on ProfileView (#3963) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Danish Ahmed Mirza <77742477+try-catch-stack@users.noreply.github.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> Co-authored-by: Snyk bot <snyk-bot@snyk.io> Co-authored-by: lingohub[bot] <69908207+lingohub[bot]@users.noreply.github.com> Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Christian King <cking@vonix.io>
2022-03-28 18:14:26 +00:00
export const isBlocked = (room: TSubscriptionModel): boolean => {
2022-01-24 20:12:36 +00:00
if (room) {
const { t, blocked, blocker } = room;
if (t === SubscriptionType.DIRECT && (blocked || blocker)) {
return true;
}
}
return false;
};
export const capitalize = (s: string): string => {
if (typeof s !== 'string') {
return '';
}
return s.charAt(0).toUpperCase() + s.slice(1);
};
Merge 4.26.0 into master (#3978) * test * Remove console.log * test * [FIX] StoryShots not working for async rendered components (#3677) * remove console.log * Add missing DiscussionsView snapshot * fix build and useless done and async generator * update snapshot * Chore: fix build and useless done and async generator (#3678) * fix build and useless done and async generator * update snapshot * Chore: Migrate Database to Typescript (#3580) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module permissions to typescript (#3630) * Chore: Migrate redux module share to typescript (#3612) * chore: migrate redux module share to typescript * chore: fix types * chore: update types * chore: migrate redux module share to typescript * remove double import * chore: fix import * Chore: Migrate redux module createChannel to typescript (#3602) * chore: migrate createChannel to ts and add tests * chore: fix naming * chore: add more types and remove mapDispatchToProps from components * remove todo * update tests * chore: migrate interface to reducer and fix errors on return * chore: insert IApplicationState to mapStateToProps state type * Remove spread * fix type * fix import and state type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module app to typescript (#3598) * chore: migrate activeUsers reducer and action to TS * chore: init types folder and set redux and BaseScreen interface * chore: remove mapDispatchToProps to use dispatch prop and clear some types * chore: type selectedUsers action and reducer and improvement in the code of other files * chore: move IUser to base types * chore: move state props to ISelectedUsersViewProps * chore: create mocketStore * chore: remove applyAppStateMiddleware * test: create activeUser and selectedUser tests * test: add more selectedUsers tests * chore: fix action type * chore: move types to definition folder and fix imports * chore: remove unused const * chore: migrate redux tests to reducer folder and add eslint jest plugin * chore: exprot initial state and then import on tests * chore: move interfaces to reducer and import on screen * chore: set eslint-plugin-jest version to 24.7.0 * chore: fix IUser import * chore: update interfaces and types names * chore: update definitions * chore: update IBaseScreen definitions * chore: init reducer/app migration to ts * chore: add tests and migrate RootEnum * wip: migrate fixed consts to RootEnum * chore: remove redux action inferences * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module createDiscussion to typescript (#3604) * chore: migrate createDiscussion to ts and add tests * chore: add TActionCreateDiscussion to TApplicationActions * fix types * update types * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] ios-testflight-experimental unable to find cache (#3684) * Chore: Remove Non-null assertion operator in ThreadMessagesView (#3632) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate CannedResponsesListView to Typescript (#3553) * Chore: Migrate CannedResponsesListView to TS * Moved IcannedResponse to definitions and fixed the index * Chore: Migrate CannedResponseDetail to TS * minor tweaks * refactor: update new types and interfaces for use ISubscription * fix lint error and canned responses's dropdown Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate LivechatEditView to Typescript (#3499) * Chore: Migrate LivechatEditView to Typescript * refactor: minor tweak * refactor: fix the interfaces for input * refactor: fix lint erros * minor tweak with new navigation types * function * iroom tweak * livechateditview tweak * TextInput tweak * refactor: update new types and interfaces for use ISubscription * refactor to default useState type * change the component name in SearchBox * changed state type Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Message press navigating to empty RoomView (#3680) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Prevent duplicated .jpg on file upload (#3658) * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * refactored comment * Chore: Migrate lib/utils to TypeScript (#3637) * Migrate utils to TypeScript * Add @types/semver * Refactor compareServerVersion(currentVersion, oldVersion, func) to compareServerVersion(current, func, oldVersion) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate readMessages to TS (#3669) * Migrate readMessages to TS * Update IRocketChat interface * [FIX] Unnecessary login dispatch on adding new server (#3693) * [FIX] Disable tap gesture on call messages (#3694) * [IMPROVE] Keep biometry option from last session (#3668) Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> * Fix reactotron multiple connections (#3622) * Chore: Fix rocketchat interface (#3705) * Chore: Migrate logout to Typescript (#3688) * [NEW] Stream to get individual presence updates (#3606) Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> * [FIX] Inject Redux store to prevent/remove require cycles (#3691) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate lib/rocketchat.js to TS - structure PoC (#3661) Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * [FIX] #3606 merged using wrong JS SDK branch (#3709) * [FIX] Remove deprecated database methods and other database operations (#3686) * Fix PK error on subscriptions/room * Instead of checking for pending update, wrap the call on a try catch and return null in case of error * Generate delete operations before create/update to prevent errors * Apply same logic on encryption * Fix database operations on getRoles * Fix a few database issues found on Bugsnag on ThreadMessagesView * Run prettier :( * Chore: Add REST API definitions from server (#3721) * create first definitions * chore: implements get and post types * fix lint * add ts-ignore * add teams.removeRoom method * Remove unused endpoints Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Move some methods to SDK (#3736) * [IMPROVE] Add support for ephemeral messages inside threads (#3687) * Chore: dehydrate small server requests away from rocketchat.js (#3740) * Bump version to 4.25.0 (#3745) * [Snyk] Security upgrade url-parse from 1.5.1 to 1.5.6 (#3746) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-URLPARSE-2401205 * Language update from LingoHub 🤖 on 2022-02-14Z (#3730) * Language update from LingoHub 🤖 Project Name: Rocket.Chat.ReactNative Project Link: https://translate.lingohub.com/rocketchat/dashboard/rocket-dot-chat-dot-reactnative User: Robot LingoHub Easy language translations with LingoHub 🚀 * remove draft gl Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getSingleMessage to TS (#3700) * migrate getSingleMessage to TS * minor tweak * Chore: Migrate methods/getRooms to TS (#3702) * migrate getRooms to TS * add sdk and set any types * Moved the new variable around and added ts-ignore to follow the pattern from /services/restApi.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate updateMessages to Typescript (#3715) * Chore: Migrate selector/login to TS (#3731) * migrate selector/login to TS * Fix lint errors * set aliases for returns * Chore: Migrate helpers/parseUrls to Typescript (#3735) * Chore: Migrate methods/helpers/parseQuery to Typescript (#3742) * Chore: Migrate methods/helpers/parseQuery to Typescript * tweak in example * Chore: Migrate app/commands to typescript (#3697) * Chore: Migrate lib/encryption folder to TypeScript (#3639) * Initial commit * add types/bytebuffer, add type definitions to params and update interfaces * add more types and type assertions * update types * change bang operator by type assertion and update class variables definitions * add types for deferred class * minor tweaks on types definitions * add ts-ignore * Update encryption.ts * update deferred and encryption * update encryption.ts * Update room.ts * update toDecrypt type * initialize sessionKeyExportedString * remove return types * Chore: Migrate redux actions/enterpriseModules to TS (#3698) * migrate enterpriseModules to TS * update test file * Chore: Migrate database/services and database/utils to TS (#3708) * migrate database services and utils to ts * Migrate tests Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate buildMessage to TS (#3732) * migrate buildMessage to TS * Fix lint * minor tweak * minor tweaks * Chore: Migrate getPermissions to Typescript (#3720) * Migrating... * Fix IPermission * Playing with types * Remove `as const` * Fix lint * Fix test * Apply sdk * Fix lint and autocomplete * [FIX] Add search and fix pagination for omnichannels departments (#3621) * [FIX] Search and pagination for omnichannels departments * pagination complete * minor tweak * renamed a param and workaround for a ux bug * fix style of flatlist and search as header scrollable * stick the header * Merge branch 'fix.forward-department-list' of https://github.com/RocketChat/Rocket.Chat.ReactNative into fix.forward-department-list * refactor pagination * fix value type * refactor render search * refactor layout * make ts happy * Chore: Migrate Markdown to Typescript (#3558) * Chore: Migrate Markdown to TS * Chore: Migrate Markdown to TS * minor tweak * added preview where markdown was preview and fixed params within markdown * removed ts-ignore * fix lint * removed numbersofline={0} and default value to numberOfLines=1 * change how to import markdown preview and remove numberOfLines * using useTheme inside markdownPreview and remove theme from components * minor tweak on interfaces * isNewMarkdown return as boolean * minor tweaks * minor tweaks * removed unused component * fixed markdown stories * updated snapshot because removed numberOfLines={0} from message/content * create IEmoji.ts in definitions and refactor all places where getCustomEmoji was called * onLinkPress typed * todo: refactor navtoroominfo * formatText.test.ts * markdown stories to typescript too * minor tweak * IMessage definition * refactor: update new types and interfaces for use ISubscription * refactor: update threadItem for use new MarkdownPreview * refactor: rollback wrong file commited * formatHyperlink * fix lint * updated item story shot * refactor and refactor some types * Remove non-null assertion * Minor change on useRealName * tweak Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/callJitsi to typescript (#3660) * chore: migrate callJitsi to typescript * change fixed string to type * wip * wip * back to old times :) * back to typescript * Chore: Migrate redux module room to typescript (#3636) * chore: migrate redux module room to typescript and remove dispatch on dependencies * chore: add tests to redux module room * chore: create ERoomType and use on implemention * chore: update enum name * fix test id * Chore: Migrate redux module login to typescript (#3647) * chore: migrate redux module login to typescript chore: update redux module login tests * update workers * wip * fix type * remove partial * add more status * migrate the rest of the stuff to typescript * fix tests and types * fix types and tests * Chore: Migrate method getSettings to typescript (#3703) * chore: migrate getSettings to typescript and and some types * chore: remove this and add current to code * chore: add current * Chore: Migrate getCustomEmojis to TS (#3724) * update customEmoji interface and getCustomEmoji * add sdk * updated emojiCustom rest definition * minor refactor * update params object * [FIX] getRooms request using param with wrong name (#3761) * Chore: Migrate methods/getRoomInfo to TS (#3695) * migrate getRoomInfo to TS * update room type * update types * Fix lint error * Chore: Migrate getSlashCommands to TS (#3711) * migrate getSlashCommands to TS * use sdk and update getSlashCommands * minor tweak * Remove implicit anys Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate getUsersPresence to TS (#3717) * migrate getUsersPresence to ts * use sdk and remove this context from getUsersPresence * Chore: Migrate loadMissedMessages to typescript (#3704) * chore: migrate loadMissedMessages to typescript * remove loaderItem * remove this from functions * Chore: Migrate methods/getRoles to Typescript (#3741) * chore: migrate getRoles to ts * chore: removing unused const * chore: minor tweak * Type batch Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadMessagesForRoom to Typescript (#3701) * chore: change loadMessagesForRoom to typescript * minor tweak * chore: minor tweaks after merge with developer * chore: minor tweaks after merge with developer * chore: minor tweak * chore: minor tweaks * Fix return Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate methods/sendFileMessage to typescript (#3683) * chore: start the migration * chore: update sendFileMessage to ts * chore: removing an `any` from uploadQueue * chore: minor tweak * chore: minor tweak * chore: minor tweaks after merge with developer * chore: minor tweak after merge develop into current * [FIX] Differ to Last Session Authenticated (#3667) * [FIX] Differ to Last Session Authenticated * Added timesync * [FIX] Differ to Last Session Authenticated * Added timesync * timesync tweaks * refactor diffLastLocalSession and saveLastLocalAuthentication * did a race * Update comment in app/utils/localAuthentication.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * refactor getServerTimeSync and when use this route * tweak Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadNextMessages to typescript (#3719) * feat: update loadNextMessages to ts * minor tweak * chore: minor tweaks after merge with developer * chore: migrate getFileUrlFromMessage to ts (#3734) * Chore: Migrate to Typescript mergeSubscriptionRooms and findSubscriptionsRooms (#3747) * fix fromJSONValue type * migrate findSubscription and mergeSubscription to typescript * chore: fix subscription param returning null * Chore: Migrate sendMessage to TS (#3712) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/enterpriseModules to TS (#3706) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getThreadName to typescript (#3707) * chore: change getThreadName to typescript * chore: change types after merge develop into current * chore: minor tweak * Chore: Migrate method canOpenRoom to Typescript (#3650) * chore: migrate canOpenRoom to ts * chore: update rocketchat types * change types to Isubscription types * fix: fix mergeSubscriptionsRooms (#3770) * [IMPROVE] Team system messages feedback (#3771) * almost there * Update stories * chore: removing unused function getTeamInfo (#3773) * Chore: create definitions for e2e.setUserPublicAndPrivateKeys api call (#3775) * Chore: Migrate RoomMembersView to Typescript (#3769) * chore: migrate RoomMembersView to ts * fix goRoom item interface * Chore: Migrate views/RoomListView to typescript (#3758) * chore: migrating RoomListView to ts * chore: migrating RoomListView to ts * chore: implementing types for RoomListView * chore: change ChatsStackParamList for fix RoomListView errors * chore: minor tweak * chore: minor tweak * chore: fix setTimeout type * chore: applying changes requested * chore: minor tweak * Chore: Migrate to TS RommInfoEditView (#3766) * initial commit * fix last types * fix import * fix lint * Chore: Server API types POC - loadMessagesForRoom (#3765) * create interface and implements base types * fix some types * Update app/lib/methods/updateMessages.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * fix date type * apply types changes * fix type * fix date value * fix types * typescript things... Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate RoomView to Typescript (#3754) * Chore: Migrate RoomActionsView to Typescript (#3750) * Chore: Migrate loadThreadMessages to TS (#3718) * Migrate loadThreadMessages to TypeScript * Update interfaces * Bump version to 4.26.0 (#3806) * Chore: Migrate REST API - markAsUnread to TS (#3801) * Migrate `subscriptions.unread` to typescript * Chore: Migrate REST API - convertChannelToTeam to TS (#3792) * migrate channels.convertToTeam and groups.convertToTeam to ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getDepartmentInfo to Typescript (#3795) * Chore: Migrate REST API - sendConfirmationEmail to Typescript (#3807) * Chore: Migrate REST API - getRoutingConfig to Typescript (#3794) * Chore: Migrate REST API - getRoutingConfig to Typescript * minor tweak * Chore: Migrate REST API - createChannel to Typescript (#3786) * Chore: Migrate REST API - createChannel to Typescript * removed success * iserverroomitem * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript (#3793) * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript * Update app/definitions/rest/v1/e2e.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - register to TS (#3796) * Migrate `user.register` to TypeScript * Chore: Migrate REST API - createTeam to TS (#3788) * Migrate `teams.create` REST API to TypeScript * Chore: Migrate REST API - addRoomsToTeam to TS (#3797) * Migrate REST API `teams.addRooms` to TypeScript * Chore: Migrate REST API - removeTeamMember to TS (#3799) * Migrate REST API `teams.removeMember` to TypeScript * Chore: Migrate REST API - toggleArchiveRoom to Typescript (#3791) * Chore: Migrate REST API - toggleArchiveRoom to Typescript * minor tweak * removed success param * minor tweak * Chore: Migrate REST API - convertTeamToChannel to TS (#3800) * Migrate REST API `teams.convertToChannel` to TypeScript * Chore: Migrate REST API - deleteMessage to TS (#3802) * Migrate REST API `chats.delete` to TypeScript * Chore: Server API types - user.setPreferences (#3781) * chore: implementing type for test api - user.setPreferences * chore: minor tweak * Chore: Server API types - teams.updateRoom (#3774) * chore: type the API call `teams.updateRoom` * chore: creating the interface `IServerTeamUpdateRoom` * chore: minor tweak after merge * Chore: Migrate REST API - teamListRoomsOfUser to TS (#3805) * migrate REST API `teams.listRoomsOfUser` to TypeScript * update: `rooms` type on `teams.listRoomsOfUser` * update: if-conditionals on `RoomActionsView` * Chore: Migrate REST API - toggleBlockUser to Typescript (#3808) * Chore: Migrate REST API - saveRoomSettings to Typescript (#3787) * Chore: Migrate methods/loadSurroundingMessages to Typescript (#3733) * Chore: Migrate methods/loadSurroundingMessages to Typescript * tweaks * tweak * tweak * tweaks to make ts happy * instead as IMessage is optional u * enum to MessageTypeLoad * minor tweaks * Chore: Migrate RoomInfoView to Typescript (#3778) * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * react.reactelement | null * minor tweak * minor tweak livechatvisitor * remove console.log * Tweaks * Fix: fix the command to run detox on android (#3812) * fix the command to run detox on android (#3812) * Chore: Migrate subscriptions/rooms to TS (#3748) * chore: migrate subscriptions rooms to ts * chore: adding a TODO to remember this problem * chore: removing unnecessary todos * chore: minor tweak after develop updates * chore: migrate message service to ts * chore: minor tweaks * chore: minor tweak * chore: minor tweak after merge develop into this branch * chore: minor tweak after merge with dev * minor tweak * Chore: Migrate subscriptions/room to TS (#3752) * chore: initial commit * chore: fix readMessages * chore: removing some `any` * chore: removing some `any` * chore: removing some `any` * chore: fix erros after merge develop inside this branch * chore: minor tweak * chore: applying changes requested * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - e2eRequestSubscriptionKeys to Typescript (#3813) * Chore: Migrate REST API - merge v1/user in v1/users (#3827) * Chore: Migrate REST API - toggleRead to Typescript (#3820) * Chore: Migrate REST API - e2eSetRoomKeyID to Typescript (#3816) * Chore: Migrate REST API - removeTeamRoom to Typescript (#3819) * Chore: Migrate REST API - updateGroupKey to Typescript (#3817) * Chore: Migrate REST API - forgotPassword to Typescript (#3818) * Chore: Migrate REST API - updateJitsiTimeout to Typescript (#3822) * chore: add rest api return * chore: add rest api return * chore: add rest api return (#3824) * chore: add rest api return (#3825) * chore: add rest api return (#3829) * chore: add rest api return (#3826) * Chore: Delete unused function getUserRoles (#3836) * Chore: Migrate REST API - leaveRoom to Typescript (#3833) * chore: add rest api type * remove any * Chore: Migrate REST API - deleteRoom to Typescript (#3834) * Chore: Migrate REST API - removeUserFromRoom to Typescript (#3837) * Chore: Migrate REST API - hideRoom to Typescript (#3832) * chore: add rest api return (#3850) * chore: add rest api return (#3849) * Chore: Migrate REST API - setUserStatus to Typescript (#3828) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - spotlight to Typescript (#3821) * Chore: Migrate REST API - spotlight to Typescript * minor tweak * chore: add rest api return (#3844) * Chore: Migrate REST API - usersAutoComplete to Typescript (#3845) * chore: add rest api return (#3847) * chore: add rest api return (#3848) * Chore: Migrate REST API - joinRoom to Typescript (#3835) * Chore: Migrate REST API - joinRoom to Typescript * join to discussion * Chore: Migrate REST API - returnLivechat to Typescript (#3843) * Chore: Migrate REST API - getRoomCounters to Typescript (#3842) * Chore: Migrate REST API - getRoomCounters to Typescript * minor tweak * [FIX] Condensed layout cutting text on smaller text sizes (#3831) * Chore: Migrate ee/omnichannel folder to Typescript (#3749) * Chore: Migrate ee/omnichannel folder to Typescript * omnichannelstatus and queue list * boolean searching and react.ref * test initi * test and refactor interfaces * minor tweak * minor tweaks * [FIX] Hardcoded E2E password for Detox workflow (#3809) * [FIX] Removed account from E2E Data and create a file responsible for this account * Updated e2e/README.md * minor tweak * Update e2e/README.md Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> * Chore: Migrate REST API - getTagsList to Typescript (#3854) * Chore: Migrate normalizeMessage to TS (#3743) * migrate normalizeMessage to ts * fix: missing null validations and type aliases * Chore: Migrate REST API - e2eRequestRoomKey to Typescript (#3814) * Chore: Remove Teams migration (#3857) * Chore: Migrate REST API - getChannelInfo to TS (#3839) * add: type for REST API `channels.info` * add: `ts-ignore` to `RoomActionsView` * Chore: Migrate search and localSearch methods to Typescript (#3751) * chore: migrate search to typescript * fix types * fix type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getListCannedResponse to Typescript (#3858) * Chore: Migrate REST API - getCustomFields to Typescript (#3856) * Chore: Migrate REST API - getCustomFields to Typescript * minor tweak * Chore: Migrate REST API - getAgentDepartments to Typescript (#3855) * Chore: Create IServerRoom and IServerSubscription (#3782) * Chore: Server API types - chat.getDiscussions (#3776) * chore: implementing type for test api - getDiscussions * Fix DiscussionDetails count usage * chore: update getDiscussions to use IMessageFromServer Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getTeamListRoom to TS (#3840) * add: `teams.listRooms` types * add: `PaginatedResult<T>` to `teams.ts` * Chore: Dehydrate login methods from rocketchat.js (#3759) * dehydrate login methods from rocketchat.js * [FIX] Merge subscription and room logic using unparsed data (#3859) * chore: add rest api return (#3864) * chore: add rest api return (#3865) * Chore: Migrate REST API - saveUserProfile to Typescript (#3863) * Chore: Migrate REST API - saveUserProfile to Typescript * minor tweak * Chore: Update react-native-mmkv-storage to 0.6.12 (#3634) * chore: updating mmkv library * feat: updating android ejson to use the getSecureKey new version * feat: updating IOS files to use the getSecureKey new version * feat: changing all mmkv methods to use sync calls * feat: changing mmkv methods from Screen lock * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from logout * feat: changing all mmkv methods from e2e * fix: small fix at encryption and server drop down * feat: changing all mmkv methods from set theme * feat: changing all mmkv methods from openLink * fix: setting up mmkv to works property on Android * fix: fix an error to set the theme when open the app * refactor: change the react-native branch (temporary) * refactor: removing all `Async` from mmkv functions name * refactor: removing await from unnecessary functions, removing console.log and update cocoapods * refactor: removing unnecessary undefined from methods * feat: creating a custom hook for mmkv * refactor: changing the fetchPasscode to use the useUserPreferences hook * refactor: changing setTheme from app/index * refactor: small fix on setTheme * chore: update mmkv to 0.6.11 * chore: update mmkv to 0.6.11 * chore: minor tweak * chore: update mmkv to 0.6.12 * chore: mock NativeModules * chore: fix test mmkv * chore: removing custom MMKV JSI module, since is no more necessary after 0.6.11 version * feat: removing some async calls from mmkv after update from develop * feat: creating a function to get the initialTheme * feat: removing unnecessary try/catch * fix: fixing the blink white when open the app * feat: changing useMMKVStorage to create from mmkv lib * test: creating a mock for mmkv create function * chore: fix errors on tablet * minor tweak * Chore: Migrate REST API - getUserPreferences to Typescript (#3830) * Chore: Migrate REST API - getAvatarSuggestion to Typescript (#3869) * Chore: Migrate REST API - resetAvatar to Typescript (#3870) * Chore: Migrate REST API - setAvatarFromService to Typescript (#3871) * Chore: Migrate REST API - getUsernameSuggestion to Typescript (#3872) * Chore: Migrate REST API - getMessages to Typescript (#3875) * Chore: Migrate REST API - searchMessages to Typescript (#3874) * Chore: Migrate REST API - getFiles to Typescript (#3873) * [FIX] Issues after reconnecting (#3815) * [FIX] Fix synchronization of removed subscriptions (#3768) When a subscription is removed from the server via another client, when the mobile app is relaunched the subscriptions were not being removed properly. Changed the logic to use the subscriptionResult.remove array from the server and the _id property to fix. Co-authored-by: Christian King <cking@vonix.io> * Chore: Migrate REST API - editLivechat to Typescript (#3878) * Chore: Migrate REST API - getReadReceipts to Typescript (#3877) * [FIX] ReactNativeUiLib are not installed after run pod install (#3882) * fix ReactNativeUiLib not installed when run pod install * committing Podfile.lock * Chore: Migrate REST API - editMessage to Typescript (#3887) * Chore: Migrate REST API - editMessage to Typescript * minor tweak * Chore: Migrate REST API - e2eResetOwnKey to Typescript (#3888) * Chore: Migrate REST API - e2eResetOwnKey to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - emitTyping to Typescript (#3886) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers (#3868) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers * change GetRoomRoles local * Chore: Migrate REST API - addUsersToRoom to Typescript (#3884) * Chore: Migrate REST API - addUsersToRoom to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - createGroupChat to Typescript (#3885) * Chore: Migrate REST API - createGroupChat to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getCommandPreview to Typescript (#3894) * Chore: Migrate REST API - getCommandPreview and executeCommandPreview to Typescript (#3897) * Chore: Migrate REST API - getDirectory to Typescript (#3898) * Chore: Migrate REST API - getServerInfo to Typescript (#3900) * [FIX] Mention from suggestions concatenates to query string on autocomplete (#3696) * [FIX] Mention suggestion concatenate to query string * Add function to get regexp and its tests in separate files * Update getRegexp.ts * Update file names * Try new regex * One regex for all mention types Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - readThreads to Typescript (#3866) * chore: migrate readThreads to typescript * fix imports * Chore: Migrate REST API - getRoomInfo to Typescript (#3823) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - sendEmailCode to Typescript (#3891) * Chore: Migrate REST API - sendEmailCode to Typescript (#3905) * Chore: Migrate REST API - saveAutoTranslate to Typescript (#3892) * Chore: Migrate REST API - runSlashCommand to Typescript (#3893) * Chore: Migrate REST API - getSyncThreadsList to Typescript (#3896) * Chore: Migrate REST API - getRoomMembers to Typescript (#3899) * Chore: Migrate methods/actions to Typescript and refactor UiKit folder (#3716) * Chore: Migrate methods/actions to Typescript * tweak in actions * Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * refactor sdk.current * interface and uikit done * refactor interface, index and utils from UiKit * minor tweak * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - removePushToken to Typescript (#3903) * Chore: Migrate REST API - registerPushToken to Typescript (#3902) * Chore: Dehydrate share extension from rocketchat.js (#3753) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getThreadsList to Typescript (#3895) * chore: add rest api return * chore: removing sort param * Chore: evaluate Header components - TypeScript (#3918) * update: Header components * Chore: Evaluate BackgroundContainer - TypeScript (#3917) * update: `BackgroundContainer` * remove: `theme` from `IBackgroundContainer` * update: return type for `BackgroundContainer` * Chore: Evaluate ActivityIndicator - TypeScript (#3914) * update: `BackgroundContainer` and `ActivityIndicator` * update: return type for `RCActivityIndicator` * update: return type for `BackgroundContainer` * [NEW] Collapsible Message (#3879) * create new collapsible component * create collapsible tests and update snapshot * fix quote :) * update snapshot * add support to color * add collapsed prop * fix some styles * fix tests * wip * clean * add CollapsibleQuote story * better style * update snapshots * add better tests * remove testID * update storyshot * Chore: Migrate containers: Toast to Typescript (#3913) * Chore: Migrate containers: Loading to Typescript (#3915) * Chore: Migrate REST API - e2eFetchMyKeys to Typescript (#3942) * [FIX] Messages not loading for unjoined channels (#3904) * Fix message loading for unjoined channels * Update updateMessages.ts * log -> console.log Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: StatusBar theme and style props (#3906) * chore: clean status bar and remove useless theme * mend * wip * remove unused props * chore: Evaluate SearchBox (#3909) * [FIX] Wrong param sent to system message (#3943) * [FIX] Display added user to team * tweak when remove members from team too * update storyshot Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> * [NEW] Redesign quoted messages (#3883) * Language update from LingoHub 🤖 on 2022-03-21Z (#3940) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Clean TwoFactor - Typescript (#3912) * chore: clean TwoFactor * minor tweak * minor refactor * chore: removing console log * Chore: Clean Check component - TypeScript (#3919) * chore: clear Check component * chore: update tests * Chore: Clean InAppNotification - TypeScript (#3920) * Chore: Clean ThreadDetails - TypeScript (#3924) * Chore: Clean MessageErrorActions - TypeScript (#3928) * Chore: Evaluate TextInput - TypeScript (#3908) * update `TextInput` component update: ActivityIndicator * remove: `any` * update: `TextInput` on `UIKit` * Fix returnKeyType Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Evaluate ActionSheet - TypeScript (#3927) * Chore: Clean LoginServices - TypeScript (#3935) * Chore: Evaluate Passcode - TypeScript (#3931) * Chore: Migrate containers: Passcode to Typescript * minor tweak * minor tweak * [FIX] "Sent an attachment" text on media preview for threads (#3947) * update: `Content` component * update: `Message` snapshots * [FIX] Audio thumb's size (#3945) * update: Audio component * Chore: Update codecov version (#3954) * Chore: Evaluate HeaderButton - TypeScript (#3925) * update: `HeaderButton` components * update: types * fix types * fix lint and update snapshot Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> * [FIX] Navigate to team from directory (#3953) * [FIX] Param privacy when editing room info (#3962) * [FIX] Drawer failing to open/close on ProfileView (#3963) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Danish Ahmed Mirza <77742477+try-catch-stack@users.noreply.github.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> Co-authored-by: Snyk bot <snyk-bot@snyk.io> Co-authored-by: lingohub[bot] <69908207+lingohub[bot]@users.noreply.github.com> Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Christian King <cking@vonix.io>
2022-03-28 18:14:26 +00:00
export const formatDate = (date: string | Date): string =>
2022-01-24 20:12:36 +00:00
moment(date).calendar(null, {
lastDay: `[${I18n.t('Yesterday')}]`,
sameDay: 'LT',
lastWeek: 'dddd',
sameElse: 'L'
});
Merge 4.26.0 into master (#3978) * test * Remove console.log * test * [FIX] StoryShots not working for async rendered components (#3677) * remove console.log * Add missing DiscussionsView snapshot * fix build and useless done and async generator * update snapshot * Chore: fix build and useless done and async generator (#3678) * fix build and useless done and async generator * update snapshot * Chore: Migrate Database to Typescript (#3580) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module permissions to typescript (#3630) * Chore: Migrate redux module share to typescript (#3612) * chore: migrate redux module share to typescript * chore: fix types * chore: update types * chore: migrate redux module share to typescript * remove double import * chore: fix import * Chore: Migrate redux module createChannel to typescript (#3602) * chore: migrate createChannel to ts and add tests * chore: fix naming * chore: add more types and remove mapDispatchToProps from components * remove todo * update tests * chore: migrate interface to reducer and fix errors on return * chore: insert IApplicationState to mapStateToProps state type * Remove spread * fix type * fix import and state type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module app to typescript (#3598) * chore: migrate activeUsers reducer and action to TS * chore: init types folder and set redux and BaseScreen interface * chore: remove mapDispatchToProps to use dispatch prop and clear some types * chore: type selectedUsers action and reducer and improvement in the code of other files * chore: move IUser to base types * chore: move state props to ISelectedUsersViewProps * chore: create mocketStore * chore: remove applyAppStateMiddleware * test: create activeUser and selectedUser tests * test: add more selectedUsers tests * chore: fix action type * chore: move types to definition folder and fix imports * chore: remove unused const * chore: migrate redux tests to reducer folder and add eslint jest plugin * chore: exprot initial state and then import on tests * chore: move interfaces to reducer and import on screen * chore: set eslint-plugin-jest version to 24.7.0 * chore: fix IUser import * chore: update interfaces and types names * chore: update definitions * chore: update IBaseScreen definitions * chore: init reducer/app migration to ts * chore: add tests and migrate RootEnum * wip: migrate fixed consts to RootEnum * chore: remove redux action inferences * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module createDiscussion to typescript (#3604) * chore: migrate createDiscussion to ts and add tests * chore: add TActionCreateDiscussion to TApplicationActions * fix types * update types * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] ios-testflight-experimental unable to find cache (#3684) * Chore: Remove Non-null assertion operator in ThreadMessagesView (#3632) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate CannedResponsesListView to Typescript (#3553) * Chore: Migrate CannedResponsesListView to TS * Moved IcannedResponse to definitions and fixed the index * Chore: Migrate CannedResponseDetail to TS * minor tweaks * refactor: update new types and interfaces for use ISubscription * fix lint error and canned responses's dropdown Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate LivechatEditView to Typescript (#3499) * Chore: Migrate LivechatEditView to Typescript * refactor: minor tweak * refactor: fix the interfaces for input * refactor: fix lint erros * minor tweak with new navigation types * function * iroom tweak * livechateditview tweak * TextInput tweak * refactor: update new types and interfaces for use ISubscription * refactor to default useState type * change the component name in SearchBox * changed state type Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Message press navigating to empty RoomView (#3680) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Prevent duplicated .jpg on file upload (#3658) * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * refactored comment * Chore: Migrate lib/utils to TypeScript (#3637) * Migrate utils to TypeScript * Add @types/semver * Refactor compareServerVersion(currentVersion, oldVersion, func) to compareServerVersion(current, func, oldVersion) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate readMessages to TS (#3669) * Migrate readMessages to TS * Update IRocketChat interface * [FIX] Unnecessary login dispatch on adding new server (#3693) * [FIX] Disable tap gesture on call messages (#3694) * [IMPROVE] Keep biometry option from last session (#3668) Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> * Fix reactotron multiple connections (#3622) * Chore: Fix rocketchat interface (#3705) * Chore: Migrate logout to Typescript (#3688) * [NEW] Stream to get individual presence updates (#3606) Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> * [FIX] Inject Redux store to prevent/remove require cycles (#3691) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate lib/rocketchat.js to TS - structure PoC (#3661) Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * [FIX] #3606 merged using wrong JS SDK branch (#3709) * [FIX] Remove deprecated database methods and other database operations (#3686) * Fix PK error on subscriptions/room * Instead of checking for pending update, wrap the call on a try catch and return null in case of error * Generate delete operations before create/update to prevent errors * Apply same logic on encryption * Fix database operations on getRoles * Fix a few database issues found on Bugsnag on ThreadMessagesView * Run prettier :( * Chore: Add REST API definitions from server (#3721) * create first definitions * chore: implements get and post types * fix lint * add ts-ignore * add teams.removeRoom method * Remove unused endpoints Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Move some methods to SDK (#3736) * [IMPROVE] Add support for ephemeral messages inside threads (#3687) * Chore: dehydrate small server requests away from rocketchat.js (#3740) * Bump version to 4.25.0 (#3745) * [Snyk] Security upgrade url-parse from 1.5.1 to 1.5.6 (#3746) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-URLPARSE-2401205 * Language update from LingoHub 🤖 on 2022-02-14Z (#3730) * Language update from LingoHub 🤖 Project Name: Rocket.Chat.ReactNative Project Link: https://translate.lingohub.com/rocketchat/dashboard/rocket-dot-chat-dot-reactnative User: Robot LingoHub Easy language translations with LingoHub 🚀 * remove draft gl Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getSingleMessage to TS (#3700) * migrate getSingleMessage to TS * minor tweak * Chore: Migrate methods/getRooms to TS (#3702) * migrate getRooms to TS * add sdk and set any types * Moved the new variable around and added ts-ignore to follow the pattern from /services/restApi.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate updateMessages to Typescript (#3715) * Chore: Migrate selector/login to TS (#3731) * migrate selector/login to TS * Fix lint errors * set aliases for returns * Chore: Migrate helpers/parseUrls to Typescript (#3735) * Chore: Migrate methods/helpers/parseQuery to Typescript (#3742) * Chore: Migrate methods/helpers/parseQuery to Typescript * tweak in example * Chore: Migrate app/commands to typescript (#3697) * Chore: Migrate lib/encryption folder to TypeScript (#3639) * Initial commit * add types/bytebuffer, add type definitions to params and update interfaces * add more types and type assertions * update types * change bang operator by type assertion and update class variables definitions * add types for deferred class * minor tweaks on types definitions * add ts-ignore * Update encryption.ts * update deferred and encryption * update encryption.ts * Update room.ts * update toDecrypt type * initialize sessionKeyExportedString * remove return types * Chore: Migrate redux actions/enterpriseModules to TS (#3698) * migrate enterpriseModules to TS * update test file * Chore: Migrate database/services and database/utils to TS (#3708) * migrate database services and utils to ts * Migrate tests Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate buildMessage to TS (#3732) * migrate buildMessage to TS * Fix lint * minor tweak * minor tweaks * Chore: Migrate getPermissions to Typescript (#3720) * Migrating... * Fix IPermission * Playing with types * Remove `as const` * Fix lint * Fix test * Apply sdk * Fix lint and autocomplete * [FIX] Add search and fix pagination for omnichannels departments (#3621) * [FIX] Search and pagination for omnichannels departments * pagination complete * minor tweak * renamed a param and workaround for a ux bug * fix style of flatlist and search as header scrollable * stick the header * Merge branch 'fix.forward-department-list' of https://github.com/RocketChat/Rocket.Chat.ReactNative into fix.forward-department-list * refactor pagination * fix value type * refactor render search * refactor layout * make ts happy * Chore: Migrate Markdown to Typescript (#3558) * Chore: Migrate Markdown to TS * Chore: Migrate Markdown to TS * minor tweak * added preview where markdown was preview and fixed params within markdown * removed ts-ignore * fix lint * removed numbersofline={0} and default value to numberOfLines=1 * change how to import markdown preview and remove numberOfLines * using useTheme inside markdownPreview and remove theme from components * minor tweak on interfaces * isNewMarkdown return as boolean * minor tweaks * minor tweaks * removed unused component * fixed markdown stories * updated snapshot because removed numberOfLines={0} from message/content * create IEmoji.ts in definitions and refactor all places where getCustomEmoji was called * onLinkPress typed * todo: refactor navtoroominfo * formatText.test.ts * markdown stories to typescript too * minor tweak * IMessage definition * refactor: update new types and interfaces for use ISubscription * refactor: update threadItem for use new MarkdownPreview * refactor: rollback wrong file commited * formatHyperlink * fix lint * updated item story shot * refactor and refactor some types * Remove non-null assertion * Minor change on useRealName * tweak Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/callJitsi to typescript (#3660) * chore: migrate callJitsi to typescript * change fixed string to type * wip * wip * back to old times :) * back to typescript * Chore: Migrate redux module room to typescript (#3636) * chore: migrate redux module room to typescript and remove dispatch on dependencies * chore: add tests to redux module room * chore: create ERoomType and use on implemention * chore: update enum name * fix test id * Chore: Migrate redux module login to typescript (#3647) * chore: migrate redux module login to typescript chore: update redux module login tests * update workers * wip * fix type * remove partial * add more status * migrate the rest of the stuff to typescript * fix tests and types * fix types and tests * Chore: Migrate method getSettings to typescript (#3703) * chore: migrate getSettings to typescript and and some types * chore: remove this and add current to code * chore: add current * Chore: Migrate getCustomEmojis to TS (#3724) * update customEmoji interface and getCustomEmoji * add sdk * updated emojiCustom rest definition * minor refactor * update params object * [FIX] getRooms request using param with wrong name (#3761) * Chore: Migrate methods/getRoomInfo to TS (#3695) * migrate getRoomInfo to TS * update room type * update types * Fix lint error * Chore: Migrate getSlashCommands to TS (#3711) * migrate getSlashCommands to TS * use sdk and update getSlashCommands * minor tweak * Remove implicit anys Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate getUsersPresence to TS (#3717) * migrate getUsersPresence to ts * use sdk and remove this context from getUsersPresence * Chore: Migrate loadMissedMessages to typescript (#3704) * chore: migrate loadMissedMessages to typescript * remove loaderItem * remove this from functions * Chore: Migrate methods/getRoles to Typescript (#3741) * chore: migrate getRoles to ts * chore: removing unused const * chore: minor tweak * Type batch Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadMessagesForRoom to Typescript (#3701) * chore: change loadMessagesForRoom to typescript * minor tweak * chore: minor tweaks after merge with developer * chore: minor tweaks after merge with developer * chore: minor tweak * chore: minor tweaks * Fix return Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate methods/sendFileMessage to typescript (#3683) * chore: start the migration * chore: update sendFileMessage to ts * chore: removing an `any` from uploadQueue * chore: minor tweak * chore: minor tweak * chore: minor tweaks after merge with developer * chore: minor tweak after merge develop into current * [FIX] Differ to Last Session Authenticated (#3667) * [FIX] Differ to Last Session Authenticated * Added timesync * [FIX] Differ to Last Session Authenticated * Added timesync * timesync tweaks * refactor diffLastLocalSession and saveLastLocalAuthentication * did a race * Update comment in app/utils/localAuthentication.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * refactor getServerTimeSync and when use this route * tweak Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadNextMessages to typescript (#3719) * feat: update loadNextMessages to ts * minor tweak * chore: minor tweaks after merge with developer * chore: migrate getFileUrlFromMessage to ts (#3734) * Chore: Migrate to Typescript mergeSubscriptionRooms and findSubscriptionsRooms (#3747) * fix fromJSONValue type * migrate findSubscription and mergeSubscription to typescript * chore: fix subscription param returning null * Chore: Migrate sendMessage to TS (#3712) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/enterpriseModules to TS (#3706) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getThreadName to typescript (#3707) * chore: change getThreadName to typescript * chore: change types after merge develop into current * chore: minor tweak * Chore: Migrate method canOpenRoom to Typescript (#3650) * chore: migrate canOpenRoom to ts * chore: update rocketchat types * change types to Isubscription types * fix: fix mergeSubscriptionsRooms (#3770) * [IMPROVE] Team system messages feedback (#3771) * almost there * Update stories * chore: removing unused function getTeamInfo (#3773) * Chore: create definitions for e2e.setUserPublicAndPrivateKeys api call (#3775) * Chore: Migrate RoomMembersView to Typescript (#3769) * chore: migrate RoomMembersView to ts * fix goRoom item interface * Chore: Migrate views/RoomListView to typescript (#3758) * chore: migrating RoomListView to ts * chore: migrating RoomListView to ts * chore: implementing types for RoomListView * chore: change ChatsStackParamList for fix RoomListView errors * chore: minor tweak * chore: minor tweak * chore: fix setTimeout type * chore: applying changes requested * chore: minor tweak * Chore: Migrate to TS RommInfoEditView (#3766) * initial commit * fix last types * fix import * fix lint * Chore: Server API types POC - loadMessagesForRoom (#3765) * create interface and implements base types * fix some types * Update app/lib/methods/updateMessages.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * fix date type * apply types changes * fix type * fix date value * fix types * typescript things... Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate RoomView to Typescript (#3754) * Chore: Migrate RoomActionsView to Typescript (#3750) * Chore: Migrate loadThreadMessages to TS (#3718) * Migrate loadThreadMessages to TypeScript * Update interfaces * Bump version to 4.26.0 (#3806) * Chore: Migrate REST API - markAsUnread to TS (#3801) * Migrate `subscriptions.unread` to typescript * Chore: Migrate REST API - convertChannelToTeam to TS (#3792) * migrate channels.convertToTeam and groups.convertToTeam to ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getDepartmentInfo to Typescript (#3795) * Chore: Migrate REST API - sendConfirmationEmail to Typescript (#3807) * Chore: Migrate REST API - getRoutingConfig to Typescript (#3794) * Chore: Migrate REST API - getRoutingConfig to Typescript * minor tweak * Chore: Migrate REST API - createChannel to Typescript (#3786) * Chore: Migrate REST API - createChannel to Typescript * removed success * iserverroomitem * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript (#3793) * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript * Update app/definitions/rest/v1/e2e.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - register to TS (#3796) * Migrate `user.register` to TypeScript * Chore: Migrate REST API - createTeam to TS (#3788) * Migrate `teams.create` REST API to TypeScript * Chore: Migrate REST API - addRoomsToTeam to TS (#3797) * Migrate REST API `teams.addRooms` to TypeScript * Chore: Migrate REST API - removeTeamMember to TS (#3799) * Migrate REST API `teams.removeMember` to TypeScript * Chore: Migrate REST API - toggleArchiveRoom to Typescript (#3791) * Chore: Migrate REST API - toggleArchiveRoom to Typescript * minor tweak * removed success param * minor tweak * Chore: Migrate REST API - convertTeamToChannel to TS (#3800) * Migrate REST API `teams.convertToChannel` to TypeScript * Chore: Migrate REST API - deleteMessage to TS (#3802) * Migrate REST API `chats.delete` to TypeScript * Chore: Server API types - user.setPreferences (#3781) * chore: implementing type for test api - user.setPreferences * chore: minor tweak * Chore: Server API types - teams.updateRoom (#3774) * chore: type the API call `teams.updateRoom` * chore: creating the interface `IServerTeamUpdateRoom` * chore: minor tweak after merge * Chore: Migrate REST API - teamListRoomsOfUser to TS (#3805) * migrate REST API `teams.listRoomsOfUser` to TypeScript * update: `rooms` type on `teams.listRoomsOfUser` * update: if-conditionals on `RoomActionsView` * Chore: Migrate REST API - toggleBlockUser to Typescript (#3808) * Chore: Migrate REST API - saveRoomSettings to Typescript (#3787) * Chore: Migrate methods/loadSurroundingMessages to Typescript (#3733) * Chore: Migrate methods/loadSurroundingMessages to Typescript * tweaks * tweak * tweak * tweaks to make ts happy * instead as IMessage is optional u * enum to MessageTypeLoad * minor tweaks * Chore: Migrate RoomInfoView to Typescript (#3778) * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * react.reactelement | null * minor tweak * minor tweak livechatvisitor * remove console.log * Tweaks * Fix: fix the command to run detox on android (#3812) * fix the command to run detox on android (#3812) * Chore: Migrate subscriptions/rooms to TS (#3748) * chore: migrate subscriptions rooms to ts * chore: adding a TODO to remember this problem * chore: removing unnecessary todos * chore: minor tweak after develop updates * chore: migrate message service to ts * chore: minor tweaks * chore: minor tweak * chore: minor tweak after merge develop into this branch * chore: minor tweak after merge with dev * minor tweak * Chore: Migrate subscriptions/room to TS (#3752) * chore: initial commit * chore: fix readMessages * chore: removing some `any` * chore: removing some `any` * chore: removing some `any` * chore: fix erros after merge develop inside this branch * chore: minor tweak * chore: applying changes requested * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - e2eRequestSubscriptionKeys to Typescript (#3813) * Chore: Migrate REST API - merge v1/user in v1/users (#3827) * Chore: Migrate REST API - toggleRead to Typescript (#3820) * Chore: Migrate REST API - e2eSetRoomKeyID to Typescript (#3816) * Chore: Migrate REST API - removeTeamRoom to Typescript (#3819) * Chore: Migrate REST API - updateGroupKey to Typescript (#3817) * Chore: Migrate REST API - forgotPassword to Typescript (#3818) * Chore: Migrate REST API - updateJitsiTimeout to Typescript (#3822) * chore: add rest api return * chore: add rest api return * chore: add rest api return (#3824) * chore: add rest api return (#3825) * chore: add rest api return (#3829) * chore: add rest api return (#3826) * Chore: Delete unused function getUserRoles (#3836) * Chore: Migrate REST API - leaveRoom to Typescript (#3833) * chore: add rest api type * remove any * Chore: Migrate REST API - deleteRoom to Typescript (#3834) * Chore: Migrate REST API - removeUserFromRoom to Typescript (#3837) * Chore: Migrate REST API - hideRoom to Typescript (#3832) * chore: add rest api return (#3850) * chore: add rest api return (#3849) * Chore: Migrate REST API - setUserStatus to Typescript (#3828) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - spotlight to Typescript (#3821) * Chore: Migrate REST API - spotlight to Typescript * minor tweak * chore: add rest api return (#3844) * Chore: Migrate REST API - usersAutoComplete to Typescript (#3845) * chore: add rest api return (#3847) * chore: add rest api return (#3848) * Chore: Migrate REST API - joinRoom to Typescript (#3835) * Chore: Migrate REST API - joinRoom to Typescript * join to discussion * Chore: Migrate REST API - returnLivechat to Typescript (#3843) * Chore: Migrate REST API - getRoomCounters to Typescript (#3842) * Chore: Migrate REST API - getRoomCounters to Typescript * minor tweak * [FIX] Condensed layout cutting text on smaller text sizes (#3831) * Chore: Migrate ee/omnichannel folder to Typescript (#3749) * Chore: Migrate ee/omnichannel folder to Typescript * omnichannelstatus and queue list * boolean searching and react.ref * test initi * test and refactor interfaces * minor tweak * minor tweaks * [FIX] Hardcoded E2E password for Detox workflow (#3809) * [FIX] Removed account from E2E Data and create a file responsible for this account * Updated e2e/README.md * minor tweak * Update e2e/README.md Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> * Chore: Migrate REST API - getTagsList to Typescript (#3854) * Chore: Migrate normalizeMessage to TS (#3743) * migrate normalizeMessage to ts * fix: missing null validations and type aliases * Chore: Migrate REST API - e2eRequestRoomKey to Typescript (#3814) * Chore: Remove Teams migration (#3857) * Chore: Migrate REST API - getChannelInfo to TS (#3839) * add: type for REST API `channels.info` * add: `ts-ignore` to `RoomActionsView` * Chore: Migrate search and localSearch methods to Typescript (#3751) * chore: migrate search to typescript * fix types * fix type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getListCannedResponse to Typescript (#3858) * Chore: Migrate REST API - getCustomFields to Typescript (#3856) * Chore: Migrate REST API - getCustomFields to Typescript * minor tweak * Chore: Migrate REST API - getAgentDepartments to Typescript (#3855) * Chore: Create IServerRoom and IServerSubscription (#3782) * Chore: Server API types - chat.getDiscussions (#3776) * chore: implementing type for test api - getDiscussions * Fix DiscussionDetails count usage * chore: update getDiscussions to use IMessageFromServer Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getTeamListRoom to TS (#3840) * add: `teams.listRooms` types * add: `PaginatedResult<T>` to `teams.ts` * Chore: Dehydrate login methods from rocketchat.js (#3759) * dehydrate login methods from rocketchat.js * [FIX] Merge subscription and room logic using unparsed data (#3859) * chore: add rest api return (#3864) * chore: add rest api return (#3865) * Chore: Migrate REST API - saveUserProfile to Typescript (#3863) * Chore: Migrate REST API - saveUserProfile to Typescript * minor tweak * Chore: Update react-native-mmkv-storage to 0.6.12 (#3634) * chore: updating mmkv library * feat: updating android ejson to use the getSecureKey new version * feat: updating IOS files to use the getSecureKey new version * feat: changing all mmkv methods to use sync calls * feat: changing mmkv methods from Screen lock * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from logout * feat: changing all mmkv methods from e2e * fix: small fix at encryption and server drop down * feat: changing all mmkv methods from set theme * feat: changing all mmkv methods from openLink * fix: setting up mmkv to works property on Android * fix: fix an error to set the theme when open the app * refactor: change the react-native branch (temporary) * refactor: removing all `Async` from mmkv functions name * refactor: removing await from unnecessary functions, removing console.log and update cocoapods * refactor: removing unnecessary undefined from methods * feat: creating a custom hook for mmkv * refactor: changing the fetchPasscode to use the useUserPreferences hook * refactor: changing setTheme from app/index * refactor: small fix on setTheme * chore: update mmkv to 0.6.11 * chore: update mmkv to 0.6.11 * chore: minor tweak * chore: update mmkv to 0.6.12 * chore: mock NativeModules * chore: fix test mmkv * chore: removing custom MMKV JSI module, since is no more necessary after 0.6.11 version * feat: removing some async calls from mmkv after update from develop * feat: creating a function to get the initialTheme * feat: removing unnecessary try/catch * fix: fixing the blink white when open the app * feat: changing useMMKVStorage to create from mmkv lib * test: creating a mock for mmkv create function * chore: fix errors on tablet * minor tweak * Chore: Migrate REST API - getUserPreferences to Typescript (#3830) * Chore: Migrate REST API - getAvatarSuggestion to Typescript (#3869) * Chore: Migrate REST API - resetAvatar to Typescript (#3870) * Chore: Migrate REST API - setAvatarFromService to Typescript (#3871) * Chore: Migrate REST API - getUsernameSuggestion to Typescript (#3872) * Chore: Migrate REST API - getMessages to Typescript (#3875) * Chore: Migrate REST API - searchMessages to Typescript (#3874) * Chore: Migrate REST API - getFiles to Typescript (#3873) * [FIX] Issues after reconnecting (#3815) * [FIX] Fix synchronization of removed subscriptions (#3768) When a subscription is removed from the server via another client, when the mobile app is relaunched the subscriptions were not being removed properly. Changed the logic to use the subscriptionResult.remove array from the server and the _id property to fix. Co-authored-by: Christian King <cking@vonix.io> * Chore: Migrate REST API - editLivechat to Typescript (#3878) * Chore: Migrate REST API - getReadReceipts to Typescript (#3877) * [FIX] ReactNativeUiLib are not installed after run pod install (#3882) * fix ReactNativeUiLib not installed when run pod install * committing Podfile.lock * Chore: Migrate REST API - editMessage to Typescript (#3887) * Chore: Migrate REST API - editMessage to Typescript * minor tweak * Chore: Migrate REST API - e2eResetOwnKey to Typescript (#3888) * Chore: Migrate REST API - e2eResetOwnKey to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - emitTyping to Typescript (#3886) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers (#3868) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers * change GetRoomRoles local * Chore: Migrate REST API - addUsersToRoom to Typescript (#3884) * Chore: Migrate REST API - addUsersToRoom to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - createGroupChat to Typescript (#3885) * Chore: Migrate REST API - createGroupChat to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getCommandPreview to Typescript (#3894) * Chore: Migrate REST API - getCommandPreview and executeCommandPreview to Typescript (#3897) * Chore: Migrate REST API - getDirectory to Typescript (#3898) * Chore: Migrate REST API - getServerInfo to Typescript (#3900) * [FIX] Mention from suggestions concatenates to query string on autocomplete (#3696) * [FIX] Mention suggestion concatenate to query string * Add function to get regexp and its tests in separate files * Update getRegexp.ts * Update file names * Try new regex * One regex for all mention types Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - readThreads to Typescript (#3866) * chore: migrate readThreads to typescript * fix imports * Chore: Migrate REST API - getRoomInfo to Typescript (#3823) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - sendEmailCode to Typescript (#3891) * Chore: Migrate REST API - sendEmailCode to Typescript (#3905) * Chore: Migrate REST API - saveAutoTranslate to Typescript (#3892) * Chore: Migrate REST API - runSlashCommand to Typescript (#3893) * Chore: Migrate REST API - getSyncThreadsList to Typescript (#3896) * Chore: Migrate REST API - getRoomMembers to Typescript (#3899) * Chore: Migrate methods/actions to Typescript and refactor UiKit folder (#3716) * Chore: Migrate methods/actions to Typescript * tweak in actions * Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * refactor sdk.current * interface and uikit done * refactor interface, index and utils from UiKit * minor tweak * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - removePushToken to Typescript (#3903) * Chore: Migrate REST API - registerPushToken to Typescript (#3902) * Chore: Dehydrate share extension from rocketchat.js (#3753) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getThreadsList to Typescript (#3895) * chore: add rest api return * chore: removing sort param * Chore: evaluate Header components - TypeScript (#3918) * update: Header components * Chore: Evaluate BackgroundContainer - TypeScript (#3917) * update: `BackgroundContainer` * remove: `theme` from `IBackgroundContainer` * update: return type for `BackgroundContainer` * Chore: Evaluate ActivityIndicator - TypeScript (#3914) * update: `BackgroundContainer` and `ActivityIndicator` * update: return type for `RCActivityIndicator` * update: return type for `BackgroundContainer` * [NEW] Collapsible Message (#3879) * create new collapsible component * create collapsible tests and update snapshot * fix quote :) * update snapshot * add support to color * add collapsed prop * fix some styles * fix tests * wip * clean * add CollapsibleQuote story * better style * update snapshots * add better tests * remove testID * update storyshot * Chore: Migrate containers: Toast to Typescript (#3913) * Chore: Migrate containers: Loading to Typescript (#3915) * Chore: Migrate REST API - e2eFetchMyKeys to Typescript (#3942) * [FIX] Messages not loading for unjoined channels (#3904) * Fix message loading for unjoined channels * Update updateMessages.ts * log -> console.log Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: StatusBar theme and style props (#3906) * chore: clean status bar and remove useless theme * mend * wip * remove unused props * chore: Evaluate SearchBox (#3909) * [FIX] Wrong param sent to system message (#3943) * [FIX] Display added user to team * tweak when remove members from team too * update storyshot Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> * [NEW] Redesign quoted messages (#3883) * Language update from LingoHub 🤖 on 2022-03-21Z (#3940) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Clean TwoFactor - Typescript (#3912) * chore: clean TwoFactor * minor tweak * minor refactor * chore: removing console log * Chore: Clean Check component - TypeScript (#3919) * chore: clear Check component * chore: update tests * Chore: Clean InAppNotification - TypeScript (#3920) * Chore: Clean ThreadDetails - TypeScript (#3924) * Chore: Clean MessageErrorActions - TypeScript (#3928) * Chore: Evaluate TextInput - TypeScript (#3908) * update `TextInput` component update: ActivityIndicator * remove: `any` * update: `TextInput` on `UIKit` * Fix returnKeyType Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Evaluate ActionSheet - TypeScript (#3927) * Chore: Clean LoginServices - TypeScript (#3935) * Chore: Evaluate Passcode - TypeScript (#3931) * Chore: Migrate containers: Passcode to Typescript * minor tweak * minor tweak * [FIX] "Sent an attachment" text on media preview for threads (#3947) * update: `Content` component * update: `Message` snapshots * [FIX] Audio thumb's size (#3945) * update: Audio component * Chore: Update codecov version (#3954) * Chore: Evaluate HeaderButton - TypeScript (#3925) * update: `HeaderButton` components * update: types * fix types * fix lint and update snapshot Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> * [FIX] Navigate to team from directory (#3953) * [FIX] Param privacy when editing room info (#3962) * [FIX] Drawer failing to open/close on ProfileView (#3963) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Danish Ahmed Mirza <77742477+try-catch-stack@users.noreply.github.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> Co-authored-by: Snyk bot <snyk-bot@snyk.io> Co-authored-by: lingohub[bot] <69908207+lingohub[bot]@users.noreply.github.com> Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Christian King <cking@vonix.io>
2022-03-28 18:14:26 +00:00
export const formatDateThreads = (date: string | Date): string =>
2022-01-24 20:12:36 +00:00
moment(date).calendar(null, {
sameDay: 'LT',
lastDay: `[${I18n.t('Yesterday')}] LT`,
lastWeek: 'dddd LT',
sameElse: 'LL'
});
export const getBadgeColor = ({
subscription,
messageId,
theme
}: {
// TODO: Refactor when migrate model folder
subscription: any;
messageId: string;
theme: string;
}): string | undefined => {
if (subscription?.tunreadUser?.includes(messageId)) {
return themes[theme].mentionMeColor;
}
if (subscription?.tunreadGroup?.includes(messageId)) {
return themes[theme].mentionGroupColor;
}
if (subscription?.tunread?.includes(messageId)) {
return themes[theme].tunreadColor;
}
};
export const makeThreadName = (messageRecord: { id?: string; msg?: string; attachments?: IAttachment[] }): string | undefined =>
messageRecord.msg || messageRecord?.attachments?.[0]?.title;
Merge 4.26.0 into master (#3978) * test * Remove console.log * test * [FIX] StoryShots not working for async rendered components (#3677) * remove console.log * Add missing DiscussionsView snapshot * fix build and useless done and async generator * update snapshot * Chore: fix build and useless done and async generator (#3678) * fix build and useless done and async generator * update snapshot * Chore: Migrate Database to Typescript (#3580) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module permissions to typescript (#3630) * Chore: Migrate redux module share to typescript (#3612) * chore: migrate redux module share to typescript * chore: fix types * chore: update types * chore: migrate redux module share to typescript * remove double import * chore: fix import * Chore: Migrate redux module createChannel to typescript (#3602) * chore: migrate createChannel to ts and add tests * chore: fix naming * chore: add more types and remove mapDispatchToProps from components * remove todo * update tests * chore: migrate interface to reducer and fix errors on return * chore: insert IApplicationState to mapStateToProps state type * Remove spread * fix type * fix import and state type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module app to typescript (#3598) * chore: migrate activeUsers reducer and action to TS * chore: init types folder and set redux and BaseScreen interface * chore: remove mapDispatchToProps to use dispatch prop and clear some types * chore: type selectedUsers action and reducer and improvement in the code of other files * chore: move IUser to base types * chore: move state props to ISelectedUsersViewProps * chore: create mocketStore * chore: remove applyAppStateMiddleware * test: create activeUser and selectedUser tests * test: add more selectedUsers tests * chore: fix action type * chore: move types to definition folder and fix imports * chore: remove unused const * chore: migrate redux tests to reducer folder and add eslint jest plugin * chore: exprot initial state and then import on tests * chore: move interfaces to reducer and import on screen * chore: set eslint-plugin-jest version to 24.7.0 * chore: fix IUser import * chore: update interfaces and types names * chore: update definitions * chore: update IBaseScreen definitions * chore: init reducer/app migration to ts * chore: add tests and migrate RootEnum * wip: migrate fixed consts to RootEnum * chore: remove redux action inferences * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate redux module createDiscussion to typescript (#3604) * chore: migrate createDiscussion to ts and add tests * chore: add TActionCreateDiscussion to TApplicationActions * fix types * update types * fix types Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] ios-testflight-experimental unable to find cache (#3684) * Chore: Remove Non-null assertion operator in ThreadMessagesView (#3632) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate CannedResponsesListView to Typescript (#3553) * Chore: Migrate CannedResponsesListView to TS * Moved IcannedResponse to definitions and fixed the index * Chore: Migrate CannedResponseDetail to TS * minor tweaks * refactor: update new types and interfaces for use ISubscription * fix lint error and canned responses's dropdown Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate LivechatEditView to Typescript (#3499) * Chore: Migrate LivechatEditView to Typescript * refactor: minor tweak * refactor: fix the interfaces for input * refactor: fix lint erros * minor tweak with new navigation types * function * iroom tweak * livechateditview tweak * TextInput tweak * refactor: update new types and interfaces for use ISubscription * refactor to default useState type * change the component name in SearchBox * changed state type Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Message press navigating to empty RoomView (#3680) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Regression: Prevent duplicated .jpg on file upload (#3658) * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * [FIX] Regression: Prevent duplicated .jpg on file upload * refactor to all files typed as image/jpeg * isolate regexp to function * refactor forceJpgExtension * clean * minor tweak * refactored comment * Chore: Migrate lib/utils to TypeScript (#3637) * Migrate utils to TypeScript * Add @types/semver * Refactor compareServerVersion(currentVersion, oldVersion, func) to compareServerVersion(current, func, oldVersion) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate readMessages to TS (#3669) * Migrate readMessages to TS * Update IRocketChat interface * [FIX] Unnecessary login dispatch on adding new server (#3693) * [FIX] Disable tap gesture on call messages (#3694) * [IMPROVE] Keep biometry option from last session (#3668) Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> * Fix reactotron multiple connections (#3622) * Chore: Fix rocketchat interface (#3705) * Chore: Migrate logout to Typescript (#3688) * [NEW] Stream to get individual presence updates (#3606) Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> * [FIX] Inject Redux store to prevent/remove require cycles (#3691) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate lib/rocketchat.js to TS - structure PoC (#3661) Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * [FIX] #3606 merged using wrong JS SDK branch (#3709) * [FIX] Remove deprecated database methods and other database operations (#3686) * Fix PK error on subscriptions/room * Instead of checking for pending update, wrap the call on a try catch and return null in case of error * Generate delete operations before create/update to prevent errors * Apply same logic on encryption * Fix database operations on getRoles * Fix a few database issues found on Bugsnag on ThreadMessagesView * Run prettier :( * Chore: Add REST API definitions from server (#3721) * create first definitions * chore: implements get and post types * fix lint * add ts-ignore * add teams.removeRoom method * Remove unused endpoints Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Move some methods to SDK (#3736) * [IMPROVE] Add support for ephemeral messages inside threads (#3687) * Chore: dehydrate small server requests away from rocketchat.js (#3740) * Bump version to 4.25.0 (#3745) * [Snyk] Security upgrade url-parse from 1.5.1 to 1.5.6 (#3746) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-URLPARSE-2401205 * Language update from LingoHub 🤖 on 2022-02-14Z (#3730) * Language update from LingoHub 🤖 Project Name: Rocket.Chat.ReactNative Project Link: https://translate.lingohub.com/rocketchat/dashboard/rocket-dot-chat-dot-reactnative User: Robot LingoHub Easy language translations with LingoHub 🚀 * remove draft gl Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getSingleMessage to TS (#3700) * migrate getSingleMessage to TS * minor tweak * Chore: Migrate methods/getRooms to TS (#3702) * migrate getRooms to TS * add sdk and set any types * Moved the new variable around and added ts-ignore to follow the pattern from /services/restApi.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate updateMessages to Typescript (#3715) * Chore: Migrate selector/login to TS (#3731) * migrate selector/login to TS * Fix lint errors * set aliases for returns * Chore: Migrate helpers/parseUrls to Typescript (#3735) * Chore: Migrate methods/helpers/parseQuery to Typescript (#3742) * Chore: Migrate methods/helpers/parseQuery to Typescript * tweak in example * Chore: Migrate app/commands to typescript (#3697) * Chore: Migrate lib/encryption folder to TypeScript (#3639) * Initial commit * add types/bytebuffer, add type definitions to params and update interfaces * add more types and type assertions * update types * change bang operator by type assertion and update class variables definitions * add types for deferred class * minor tweaks on types definitions * add ts-ignore * Update encryption.ts * update deferred and encryption * update encryption.ts * Update room.ts * update toDecrypt type * initialize sessionKeyExportedString * remove return types * Chore: Migrate redux actions/enterpriseModules to TS (#3698) * migrate enterpriseModules to TS * update test file * Chore: Migrate database/services and database/utils to TS (#3708) * migrate database services and utils to ts * Migrate tests Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate buildMessage to TS (#3732) * migrate buildMessage to TS * Fix lint * minor tweak * minor tweaks * Chore: Migrate getPermissions to Typescript (#3720) * Migrating... * Fix IPermission * Playing with types * Remove `as const` * Fix lint * Fix test * Apply sdk * Fix lint and autocomplete * [FIX] Add search and fix pagination for omnichannels departments (#3621) * [FIX] Search and pagination for omnichannels departments * pagination complete * minor tweak * renamed a param and workaround for a ux bug * fix style of flatlist and search as header scrollable * stick the header * Merge branch 'fix.forward-department-list' of https://github.com/RocketChat/Rocket.Chat.ReactNative into fix.forward-department-list * refactor pagination * fix value type * refactor render search * refactor layout * make ts happy * Chore: Migrate Markdown to Typescript (#3558) * Chore: Migrate Markdown to TS * Chore: Migrate Markdown to TS * minor tweak * added preview where markdown was preview and fixed params within markdown * removed ts-ignore * fix lint * removed numbersofline={0} and default value to numberOfLines=1 * change how to import markdown preview and remove numberOfLines * using useTheme inside markdownPreview and remove theme from components * minor tweak on interfaces * isNewMarkdown return as boolean * minor tweaks * minor tweaks * removed unused component * fixed markdown stories * updated snapshot because removed numberOfLines={0} from message/content * create IEmoji.ts in definitions and refactor all places where getCustomEmoji was called * onLinkPress typed * todo: refactor navtoroominfo * formatText.test.ts * markdown stories to typescript too * minor tweak * IMessage definition * refactor: update new types and interfaces for use ISubscription * refactor: update threadItem for use new MarkdownPreview * refactor: rollback wrong file commited * formatHyperlink * fix lint * updated item story shot * refactor and refactor some types * Remove non-null assertion * Minor change on useRealName * tweak Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/callJitsi to typescript (#3660) * chore: migrate callJitsi to typescript * change fixed string to type * wip * wip * back to old times :) * back to typescript * Chore: Migrate redux module room to typescript (#3636) * chore: migrate redux module room to typescript and remove dispatch on dependencies * chore: add tests to redux module room * chore: create ERoomType and use on implemention * chore: update enum name * fix test id * Chore: Migrate redux module login to typescript (#3647) * chore: migrate redux module login to typescript chore: update redux module login tests * update workers * wip * fix type * remove partial * add more status * migrate the rest of the stuff to typescript * fix tests and types * fix types and tests * Chore: Migrate method getSettings to typescript (#3703) * chore: migrate getSettings to typescript and and some types * chore: remove this and add current to code * chore: add current * Chore: Migrate getCustomEmojis to TS (#3724) * update customEmoji interface and getCustomEmoji * add sdk * updated emojiCustom rest definition * minor refactor * update params object * [FIX] getRooms request using param with wrong name (#3761) * Chore: Migrate methods/getRoomInfo to TS (#3695) * migrate getRoomInfo to TS * update room type * update types * Fix lint error * Chore: Migrate getSlashCommands to TS (#3711) * migrate getSlashCommands to TS * use sdk and update getSlashCommands * minor tweak * Remove implicit anys Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate getUsersPresence to TS (#3717) * migrate getUsersPresence to ts * use sdk and remove this context from getUsersPresence * Chore: Migrate loadMissedMessages to typescript (#3704) * chore: migrate loadMissedMessages to typescript * remove loaderItem * remove this from functions * Chore: Migrate methods/getRoles to Typescript (#3741) * chore: migrate getRoles to ts * chore: removing unused const * chore: minor tweak * Type batch Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadMessagesForRoom to Typescript (#3701) * chore: change loadMessagesForRoom to typescript * minor tweak * chore: minor tweaks after merge with developer * chore: minor tweaks after merge with developer * chore: minor tweak * chore: minor tweaks * Fix return Co-authored-by: Diego Mello <diegolmello@gmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate methods/sendFileMessage to typescript (#3683) * chore: start the migration * chore: update sendFileMessage to ts * chore: removing an `any` from uploadQueue * chore: minor tweak * chore: minor tweak * chore: minor tweaks after merge with developer * chore: minor tweak after merge develop into current * [FIX] Differ to Last Session Authenticated (#3667) * [FIX] Differ to Last Session Authenticated * Added timesync * [FIX] Differ to Last Session Authenticated * Added timesync * timesync tweaks * refactor diffLastLocalSession and saveLastLocalAuthentication * did a race * Update comment in app/utils/localAuthentication.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * refactor getServerTimeSync and when use this route * tweak Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/loadNextMessages to typescript (#3719) * feat: update loadNextMessages to ts * minor tweak * chore: minor tweaks after merge with developer * chore: migrate getFileUrlFromMessage to ts (#3734) * Chore: Migrate to Typescript mergeSubscriptionRooms and findSubscriptionsRooms (#3747) * fix fromJSONValue type * migrate findSubscription and mergeSubscription to typescript * chore: fix subscription param returning null * Chore: Migrate sendMessage to TS (#3712) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/enterpriseModules to TS (#3706) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate methods/getThreadName to typescript (#3707) * chore: change getThreadName to typescript * chore: change types after merge develop into current * chore: minor tweak * Chore: Migrate method canOpenRoom to Typescript (#3650) * chore: migrate canOpenRoom to ts * chore: update rocketchat types * change types to Isubscription types * fix: fix mergeSubscriptionsRooms (#3770) * [IMPROVE] Team system messages feedback (#3771) * almost there * Update stories * chore: removing unused function getTeamInfo (#3773) * Chore: create definitions for e2e.setUserPublicAndPrivateKeys api call (#3775) * Chore: Migrate RoomMembersView to Typescript (#3769) * chore: migrate RoomMembersView to ts * fix goRoom item interface * Chore: Migrate views/RoomListView to typescript (#3758) * chore: migrating RoomListView to ts * chore: migrating RoomListView to ts * chore: implementing types for RoomListView * chore: change ChatsStackParamList for fix RoomListView errors * chore: minor tweak * chore: minor tweak * chore: fix setTimeout type * chore: applying changes requested * chore: minor tweak * Chore: Migrate to TS RommInfoEditView (#3766) * initial commit * fix last types * fix import * fix lint * Chore: Server API types POC - loadMessagesForRoom (#3765) * create interface and implements base types * fix some types * Update app/lib/methods/updateMessages.ts Co-authored-by: Diego Mello <diegolmello@gmail.com> * fix date type * apply types changes * fix type * fix date value * fix types * typescript things... Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate RoomView to Typescript (#3754) * Chore: Migrate RoomActionsView to Typescript (#3750) * Chore: Migrate loadThreadMessages to TS (#3718) * Migrate loadThreadMessages to TypeScript * Update interfaces * Bump version to 4.26.0 (#3806) * Chore: Migrate REST API - markAsUnread to TS (#3801) * Migrate `subscriptions.unread` to typescript * Chore: Migrate REST API - convertChannelToTeam to TS (#3792) * migrate channels.convertToTeam and groups.convertToTeam to ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getDepartmentInfo to Typescript (#3795) * Chore: Migrate REST API - sendConfirmationEmail to Typescript (#3807) * Chore: Migrate REST API - getRoutingConfig to Typescript (#3794) * Chore: Migrate REST API - getRoutingConfig to Typescript * minor tweak * Chore: Migrate REST API - createChannel to Typescript (#3786) * Chore: Migrate REST API - createChannel to Typescript * removed success * iserverroomitem * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript (#3793) * Chore: Migrate REST API - e2eGetUsersOfRoomWithoutKey to Typescript * Update app/definitions/rest/v1/e2e.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - register to TS (#3796) * Migrate `user.register` to TypeScript * Chore: Migrate REST API - createTeam to TS (#3788) * Migrate `teams.create` REST API to TypeScript * Chore: Migrate REST API - addRoomsToTeam to TS (#3797) * Migrate REST API `teams.addRooms` to TypeScript * Chore: Migrate REST API - removeTeamMember to TS (#3799) * Migrate REST API `teams.removeMember` to TypeScript * Chore: Migrate REST API - toggleArchiveRoom to Typescript (#3791) * Chore: Migrate REST API - toggleArchiveRoom to Typescript * minor tweak * removed success param * minor tweak * Chore: Migrate REST API - convertTeamToChannel to TS (#3800) * Migrate REST API `teams.convertToChannel` to TypeScript * Chore: Migrate REST API - deleteMessage to TS (#3802) * Migrate REST API `chats.delete` to TypeScript * Chore: Server API types - user.setPreferences (#3781) * chore: implementing type for test api - user.setPreferences * chore: minor tweak * Chore: Server API types - teams.updateRoom (#3774) * chore: type the API call `teams.updateRoom` * chore: creating the interface `IServerTeamUpdateRoom` * chore: minor tweak after merge * Chore: Migrate REST API - teamListRoomsOfUser to TS (#3805) * migrate REST API `teams.listRoomsOfUser` to TypeScript * update: `rooms` type on `teams.listRoomsOfUser` * update: if-conditionals on `RoomActionsView` * Chore: Migrate REST API - toggleBlockUser to Typescript (#3808) * Chore: Migrate REST API - saveRoomSettings to Typescript (#3787) * Chore: Migrate methods/loadSurroundingMessages to Typescript (#3733) * Chore: Migrate methods/loadSurroundingMessages to Typescript * tweaks * tweak * tweak * tweaks to make ts happy * instead as IMessage is optional u * enum to MessageTypeLoad * minor tweaks * Chore: Migrate RoomInfoView to Typescript (#3778) * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * Chore: Migrate RoomInfoView to Typescript * tweak in avatar * tweak with SubscriptionType * minor tweak package * react.reactelement | null * minor tweak * minor tweak livechatvisitor * remove console.log * Tweaks * Fix: fix the command to run detox on android (#3812) * fix the command to run detox on android (#3812) * Chore: Migrate subscriptions/rooms to TS (#3748) * chore: migrate subscriptions rooms to ts * chore: adding a TODO to remember this problem * chore: removing unnecessary todos * chore: minor tweak after develop updates * chore: migrate message service to ts * chore: minor tweaks * chore: minor tweak * chore: minor tweak after merge develop into this branch * chore: minor tweak after merge with dev * minor tweak * Chore: Migrate subscriptions/room to TS (#3752) * chore: initial commit * chore: fix readMessages * chore: removing some `any` * chore: removing some `any` * chore: removing some `any` * chore: fix erros after merge develop inside this branch * chore: minor tweak * chore: applying changes requested * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - e2eRequestSubscriptionKeys to Typescript (#3813) * Chore: Migrate REST API - merge v1/user in v1/users (#3827) * Chore: Migrate REST API - toggleRead to Typescript (#3820) * Chore: Migrate REST API - e2eSetRoomKeyID to Typescript (#3816) * Chore: Migrate REST API - removeTeamRoom to Typescript (#3819) * Chore: Migrate REST API - updateGroupKey to Typescript (#3817) * Chore: Migrate REST API - forgotPassword to Typescript (#3818) * Chore: Migrate REST API - updateJitsiTimeout to Typescript (#3822) * chore: add rest api return * chore: add rest api return * chore: add rest api return (#3824) * chore: add rest api return (#3825) * chore: add rest api return (#3829) * chore: add rest api return (#3826) * Chore: Delete unused function getUserRoles (#3836) * Chore: Migrate REST API - leaveRoom to Typescript (#3833) * chore: add rest api type * remove any * Chore: Migrate REST API - deleteRoom to Typescript (#3834) * Chore: Migrate REST API - removeUserFromRoom to Typescript (#3837) * Chore: Migrate REST API - hideRoom to Typescript (#3832) * chore: add rest api return (#3850) * chore: add rest api return (#3849) * Chore: Migrate REST API - setUserStatus to Typescript (#3828) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - spotlight to Typescript (#3821) * Chore: Migrate REST API - spotlight to Typescript * minor tweak * chore: add rest api return (#3844) * Chore: Migrate REST API - usersAutoComplete to Typescript (#3845) * chore: add rest api return (#3847) * chore: add rest api return (#3848) * Chore: Migrate REST API - joinRoom to Typescript (#3835) * Chore: Migrate REST API - joinRoom to Typescript * join to discussion * Chore: Migrate REST API - returnLivechat to Typescript (#3843) * Chore: Migrate REST API - getRoomCounters to Typescript (#3842) * Chore: Migrate REST API - getRoomCounters to Typescript * minor tweak * [FIX] Condensed layout cutting text on smaller text sizes (#3831) * Chore: Migrate ee/omnichannel folder to Typescript (#3749) * Chore: Migrate ee/omnichannel folder to Typescript * omnichannelstatus and queue list * boolean searching and react.ref * test initi * test and refactor interfaces * minor tweak * minor tweaks * [FIX] Hardcoded E2E password for Detox workflow (#3809) * [FIX] Removed account from E2E Data and create a file responsible for this account * Updated e2e/README.md * minor tweak * Update e2e/README.md Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z. <gerzonzcanario@gmail.com> * Chore: Migrate REST API - getTagsList to Typescript (#3854) * Chore: Migrate normalizeMessage to TS (#3743) * migrate normalizeMessage to ts * fix: missing null validations and type aliases * Chore: Migrate REST API - e2eRequestRoomKey to Typescript (#3814) * Chore: Remove Teams migration (#3857) * Chore: Migrate REST API - getChannelInfo to TS (#3839) * add: type for REST API `channels.info` * add: `ts-ignore` to `RoomActionsView` * Chore: Migrate search and localSearch methods to Typescript (#3751) * chore: migrate search to typescript * fix types * fix type Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getListCannedResponse to Typescript (#3858) * Chore: Migrate REST API - getCustomFields to Typescript (#3856) * Chore: Migrate REST API - getCustomFields to Typescript * minor tweak * Chore: Migrate REST API - getAgentDepartments to Typescript (#3855) * Chore: Create IServerRoom and IServerSubscription (#3782) * Chore: Server API types - chat.getDiscussions (#3776) * chore: implementing type for test api - getDiscussions * Fix DiscussionDetails count usage * chore: update getDiscussions to use IMessageFromServer Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Migrate REST API - getTeamListRoom to TS (#3840) * add: `teams.listRooms` types * add: `PaginatedResult<T>` to `teams.ts` * Chore: Dehydrate login methods from rocketchat.js (#3759) * dehydrate login methods from rocketchat.js * [FIX] Merge subscription and room logic using unparsed data (#3859) * chore: add rest api return (#3864) * chore: add rest api return (#3865) * Chore: Migrate REST API - saveUserProfile to Typescript (#3863) * Chore: Migrate REST API - saveUserProfile to Typescript * minor tweak * Chore: Update react-native-mmkv-storage to 0.6.12 (#3634) * chore: updating mmkv library * feat: updating android ejson to use the getSecureKey new version * feat: updating IOS files to use the getSecureKey new version * feat: changing all mmkv methods to use sync calls * feat: changing mmkv methods from Screen lock * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from login, ssl certificate and change/add server * feat: changing all mmkv methods from logout * feat: changing all mmkv methods from e2e * fix: small fix at encryption and server drop down * feat: changing all mmkv methods from set theme * feat: changing all mmkv methods from openLink * fix: setting up mmkv to works property on Android * fix: fix an error to set the theme when open the app * refactor: change the react-native branch (temporary) * refactor: removing all `Async` from mmkv functions name * refactor: removing await from unnecessary functions, removing console.log and update cocoapods * refactor: removing unnecessary undefined from methods * feat: creating a custom hook for mmkv * refactor: changing the fetchPasscode to use the useUserPreferences hook * refactor: changing setTheme from app/index * refactor: small fix on setTheme * chore: update mmkv to 0.6.11 * chore: update mmkv to 0.6.11 * chore: minor tweak * chore: update mmkv to 0.6.12 * chore: mock NativeModules * chore: fix test mmkv * chore: removing custom MMKV JSI module, since is no more necessary after 0.6.11 version * feat: removing some async calls from mmkv after update from develop * feat: creating a function to get the initialTheme * feat: removing unnecessary try/catch * fix: fixing the blink white when open the app * feat: changing useMMKVStorage to create from mmkv lib * test: creating a mock for mmkv create function * chore: fix errors on tablet * minor tweak * Chore: Migrate REST API - getUserPreferences to Typescript (#3830) * Chore: Migrate REST API - getAvatarSuggestion to Typescript (#3869) * Chore: Migrate REST API - resetAvatar to Typescript (#3870) * Chore: Migrate REST API - setAvatarFromService to Typescript (#3871) * Chore: Migrate REST API - getUsernameSuggestion to Typescript (#3872) * Chore: Migrate REST API - getMessages to Typescript (#3875) * Chore: Migrate REST API - searchMessages to Typescript (#3874) * Chore: Migrate REST API - getFiles to Typescript (#3873) * [FIX] Issues after reconnecting (#3815) * [FIX] Fix synchronization of removed subscriptions (#3768) When a subscription is removed from the server via another client, when the mobile app is relaunched the subscriptions were not being removed properly. Changed the logic to use the subscriptionResult.remove array from the server and the _id property to fix. Co-authored-by: Christian King <cking@vonix.io> * Chore: Migrate REST API - editLivechat to Typescript (#3878) * Chore: Migrate REST API - getReadReceipts to Typescript (#3877) * [FIX] ReactNativeUiLib are not installed after run pod install (#3882) * fix ReactNativeUiLib not installed when run pod install * committing Podfile.lock * Chore: Migrate REST API - editMessage to Typescript (#3887) * Chore: Migrate REST API - editMessage to Typescript * minor tweak * Chore: Migrate REST API - e2eResetOwnKey to Typescript (#3888) * Chore: Migrate REST API - e2eResetOwnKey to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - emitTyping to Typescript (#3886) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers (#3868) * Chore: Migrate REST API - getRoomRoles to Typescript and fix getRoomMembers * change GetRoomRoles local * Chore: Migrate REST API - addUsersToRoom to Typescript (#3884) * Chore: Migrate REST API - addUsersToRoom to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - createGroupChat to Typescript (#3885) * Chore: Migrate REST API - createGroupChat to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getCommandPreview to Typescript (#3894) * Chore: Migrate REST API - getCommandPreview and executeCommandPreview to Typescript (#3897) * Chore: Migrate REST API - getDirectory to Typescript (#3898) * Chore: Migrate REST API - getServerInfo to Typescript (#3900) * [FIX] Mention from suggestions concatenates to query string on autocomplete (#3696) * [FIX] Mention suggestion concatenate to query string * Add function to get regexp and its tests in separate files * Update getRegexp.ts * Update file names * Try new regex * One regex for all mention types Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - readThreads to Typescript (#3866) * chore: migrate readThreads to typescript * fix imports * Chore: Migrate REST API - getRoomInfo to Typescript (#3823) * chore: add rest api return * chore: add rest api return * Chore: Migrate REST API - sendEmailCode to Typescript (#3891) * Chore: Migrate REST API - sendEmailCode to Typescript (#3905) * Chore: Migrate REST API - saveAutoTranslate to Typescript (#3892) * Chore: Migrate REST API - runSlashCommand to Typescript (#3893) * Chore: Migrate REST API - getSyncThreadsList to Typescript (#3896) * Chore: Migrate REST API - getRoomMembers to Typescript (#3899) * Chore: Migrate methods/actions to Typescript and refactor UiKit folder (#3716) * Chore: Migrate methods/actions to Typescript * tweak in actions * Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * refactor sdk.current * interface and uikit done * refactor interface, index and utils from UiKit * minor tweak * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - removePushToken to Typescript (#3903) * Chore: Migrate REST API - registerPushToken to Typescript (#3902) * Chore: Dehydrate share extension from rocketchat.js (#3753) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * Chore: Migrate REST API - getThreadsList to Typescript (#3895) * chore: add rest api return * chore: removing sort param * Chore: evaluate Header components - TypeScript (#3918) * update: Header components * Chore: Evaluate BackgroundContainer - TypeScript (#3917) * update: `BackgroundContainer` * remove: `theme` from `IBackgroundContainer` * update: return type for `BackgroundContainer` * Chore: Evaluate ActivityIndicator - TypeScript (#3914) * update: `BackgroundContainer` and `ActivityIndicator` * update: return type for `RCActivityIndicator` * update: return type for `BackgroundContainer` * [NEW] Collapsible Message (#3879) * create new collapsible component * create collapsible tests and update snapshot * fix quote :) * update snapshot * add support to color * add collapsed prop * fix some styles * fix tests * wip * clean * add CollapsibleQuote story * better style * update snapshots * add better tests * remove testID * update storyshot * Chore: Migrate containers: Toast to Typescript (#3913) * Chore: Migrate containers: Loading to Typescript (#3915) * Chore: Migrate REST API - e2eFetchMyKeys to Typescript (#3942) * [FIX] Messages not loading for unjoined channels (#3904) * Fix message loading for unjoined channels * Update updateMessages.ts * log -> console.log Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: StatusBar theme and style props (#3906) * chore: clean status bar and remove useless theme * mend * wip * remove unused props * chore: Evaluate SearchBox (#3909) * [FIX] Wrong param sent to system message (#3943) * [FIX] Display added user to team * tweak when remove members from team too * update storyshot Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> * [NEW] Redesign quoted messages (#3883) * Language update from LingoHub 🤖 on 2022-03-21Z (#3940) Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Clean TwoFactor - Typescript (#3912) * chore: clean TwoFactor * minor tweak * minor refactor * chore: removing console log * Chore: Clean Check component - TypeScript (#3919) * chore: clear Check component * chore: update tests * Chore: Clean InAppNotification - TypeScript (#3920) * Chore: Clean ThreadDetails - TypeScript (#3924) * Chore: Clean MessageErrorActions - TypeScript (#3928) * Chore: Evaluate TextInput - TypeScript (#3908) * update `TextInput` component update: ActivityIndicator * remove: `any` * update: `TextInput` on `UIKit` * Fix returnKeyType Co-authored-by: Diego Mello <diegolmello@gmail.com> * Chore: Evaluate ActionSheet - TypeScript (#3927) * Chore: Clean LoginServices - TypeScript (#3935) * Chore: Evaluate Passcode - TypeScript (#3931) * Chore: Migrate containers: Passcode to Typescript * minor tweak * minor tweak * [FIX] "Sent an attachment" text on media preview for threads (#3947) * update: `Content` component * update: `Message` snapshots * [FIX] Audio thumb's size (#3945) * update: Audio component * Chore: Update codecov version (#3954) * Chore: Evaluate HeaderButton - TypeScript (#3925) * update: `HeaderButton` components * update: types * fix types * fix lint and update snapshot Co-authored-by: GleidsonDaniel <gleidson10daniel@hotmail.com> * [FIX] Navigate to team from directory (#3953) * [FIX] Param privacy when editing room info (#3962) * [FIX] Drawer failing to open/close on ProfileView (#3963) Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com> Co-authored-by: Gerzon Z <gerzonc@icloud.com> Co-authored-by: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com> Co-authored-by: Danish Ahmed Mirza <77742477+try-catch-stack@users.noreply.github.com> Co-authored-by: Reinaldo Neto <reinaldonetof@hotmail.com> Co-authored-by: Snyk bot <snyk-bot@snyk.io> Co-authored-by: lingohub[bot] <69908207+lingohub[bot]@users.noreply.github.com> Co-authored-by: Robot LingoHub <robot@lingohub.com> Co-authored-by: Christian King <cking@vonix.io>
2022-03-28 18:14:26 +00:00
export const isTeamRoom = ({ teamId, joined }: { teamId?: string; joined?: boolean }): boolean => (!!teamId && joined) ?? false;