Skip to content

Commit

Permalink
Merge beta into master (#2032)
Browse files Browse the repository at this point in the history
* [FIX] Remove setState from notifications view causing watermelon object to be updated outside an action (#1342)

* [IMPROVEMENT] Save last message as message when subscription is updated (#1344)

* [UPDATE DEPS] Update RN to 0.61.3 (#1345)

* [DOCS] Update Readme (#1346)

* [CHORE] Remove react-native-scrollable-tab-view fork (#1352)

* [FIX] URL preview (#1360)

* [REGRESSION] Decrease list view memory size (#1361)

* [FIX] Paste (#1350)

* [CHORE] Update gems (#1365)

* Bump version to 1.20.3 (#1366)

* [FIX] Use Ruby 2.4 on TestFlight upload (#1368)

* [FIX] Parse Urls (#1371)

* [FIX] Parse image URL only if it's not empty (#1372)

* [FIX] Load messages issues (#1373)

* Bump version to 1.21.0 (#1376)

* [FIX] Crowd login (#1381)

* [FIX] Clicking user avatar in thread previews crashes app (#1363)

* [IMPROVEMENT] Error messages on connect (#1379)

* [FIX] ProfileView input navigation error when custom fields aren't set (#1383)

* [FIX] Batch server deletion on logout (#1382)

* Bump app to 1.22.0 (#1387)

* [FIX] Server Version (#1392)

* Update patch and minor deps (#1386)

* [FIX] Crash when open thread (#1395)

* Bump version to 1.23.0 (#1394)

* [I18N] Update ru.js (#1384)

* [FIX] CAS building wrong URL (#1362)

* [FIX] Delete messages (#1399)

* [FIX] In-app notification showing wrong content on channels (#1400)

* Bump version to 1.24.0 (#1404)

* [FIX] Prevent server with whitespace (#1402)

* [IMPROVEMENT] Keyboard and content type on login (#1403)

* [FIX] Messages stop loading (#1410)

* [NEW] Tablet support (#1300)

* [IMPROVEMENT] Authentication via deep linking (#1418)

* [IMPROVEMENT] Markdown performance when identifying emoji only content (#1422)

* [FIX] BackHandler remove random failing on development (#1423)

* Bump version to 1.25.0 (#1424)

* [CHORE] Update CI Xcode Image (#1430)

* [FIX] Rooms grouping not working properly (#1435)

* [FIX] Take a video (#1437)

* [NEW] Themes (#1298)

* [FIX] Share extension doesn't reconnect to previous selected server on Android (#1429)

* [FIX] Init local settings on notification tap (#1438)

* Bump version to 1.26.0 (#1450)

* [FIX] Emoji parser not working on Hermes  (#1445)

* [NEW] Enable Hermes (#1446)

* [FIX] Automatic theme repeating (#1457)

* [CHORE] Sync Experimental and Official app versions (#1458)

* [DOCS] Update readme (#1459)

* [FIX] Messages being sent but showing as temp status (#1469)

* [FIX] Missing messages after reconnect (#1470)

* [FIX] Few fixes on themes (#1477)

* [I18N] Missing German translations (#1465)

* Missing German translation

* adding a missing space behind colon

* added a missing space after colon

* and another attempt to finally fix this – got confused by all the branches

* some smaller fixes for the translation

* better wording

* fixed another typo

* [FIX] Crash while displaying the attached image with http on file name (#1401)

* [IMPROVEMENT] Tap app and server version to copy to clipboard (#1425)

* [NEW] Reply notification (#1448)

* [FIX] Incorrect background color login on iPad (#1480)

* [FIX] Prevent multiple tap on send (Share Extension) (#1481)

* [NEW] Image Viewer (#1479)

* [DOCS] Update Readme (#1485)

* [FIX] Jitsi with Hermes Enabled (#1523)

* [FIX] Draft messages not working with themed Messagebox (#1525)

* [FIX] Go to direct message from members list (#1519)

* [FIX] Make SAML wait for idp token instead of creating it on client (#1527)

* [FIX] Server Test Push Notification (#1508)

Co-authored-by: Diego Mello <[email protected]>

* [CHORE] Update to new server response (#1509)

* [FIX] Insert messages with blank users (#1529)

* Bump version to 4.2.1 (#1530)

* [FIX] Error when normalizing empty messages (#1532)

* [REGRESSION] CAS (#1570)

* Bump version to 4.2.2 (#1571)

* [FIX] Add username block condition to prevent error (#1585)

* Bump version to 4.2.3

* Bump version to 4.2.4

* Bump version to 4.3.0 (#1630)

* [FIX] Channels doesn't load (#1586)

* [FIX] Channels doesn't load

* [FIX] Update roomsUpdatedAt when subscriptions.length is 0

* [FIX] Remove unnecessary changes

* [FIX] Improve the code

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Make SAML to work on Rocket.Chat < 2.3.0 (#1629)

* [NEW] Invite links (#1534)

* [FIX] Set the http-agent to the form that Rocket.Chat requires for logging (#1482)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] "Following thread" and "Unfollowed Thread" is hardcoded and not translated (#1625)

* [FIX] Disable reset button if form didn't changed (#1569)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Header title of RoomInfoView (#1553)

* [I18N] Gallery Permissions DE (#1542)

* [FIX] Not allow to send messages to archived room (#1623)

* [FIX] Profile fields automatically reset (#1502)

* [FIX] Show attachment on ThreadMessagesView (#1493)

* [NEW] Wordpress auth (#1633)

* [CHORE] Add Start Packager script (#1639)

* [CHORE] Update RN to 0.61.5 (#1638)

* [CHORE] Update RN to 0.61.5

* [CHORE] Update react-native patch

Co-authored-by: Djorkaeff Alexandre <[email protected]>

* Bump version to 4.3.1 (#1641)

* [FIX] Change force logout rule (#1640)

* Bump version to 4.4.0 (#1643)

* [IMPROVEMENT] Use MessagingStyle on Android Notification (#1575)

* [NEW] Request review (#1627)

* [NEW] Pull to refresh RoomView (#1657)

* [FIX] Unsubscribe from room (#1655)

* [FIX] Server with subdirs (#1646)

* [NEW] Clear cache (#1660)

* [IMPROVEMENT] Memoize and batch subscriptions updates (#1642)

* [FIX] Disallow empty sharing (#1664)

* [REGRESSION] Use HTTPS links for sharing and markets protocol for review (#1663)

* [FIX] In some cases, share extension doesn't load images (#1649)

* [i18n] DE translations for new invite function and some minor fixes (#1631)

* [FIX] Remove duplicate jetify step (#1628)

minor: also remove 'cd' calls

Co-authored-by: Diego Mello <[email protected]>

* [REGRESSION] Read messages (#1666)

* [i18n] German translations missing (#1670)

* [FIX] Notifications crash on older Android Versions (#1672)

* [i18n] Added Dutch translation (#1676)

* [NEW] Omnichannel Beta (#1674)

* [NEW] Confirm logout/clear cache (#1688)

* [I18N] Add es-ES language  (#1495)

* [NEW] UiKit Beta (#1497)

* [IMPROVEMENT] Use reselect (#1696)

* [FIX] Notification in Android API level less than 24 (#1692)

* [IMPROVEMENT] Send tmid on slash commands and media (#1698)

* [FIX] Unhandled action on UIKit (#1703)

* [NEW] Pull to refresh RoomsList (#1701)

* [IMPROVEMENT] Reset app when language is changed (#1702)

* [FIX] Small fixes on UIKit (#1709)

* [FIX] Spotlight (#1719)

* [CHORE] Update react-native-image-crop-picker (#1712)

* [FIX] Messages Overlapping (Android) and MessageBox Scroll (iOS) (#1720)

* [REGRESSION] Remove @ and # from mention (#1721)

* [NEW] Direct message from user info (#1516)

* [FIX] Delete slash commands (#1723)

* [IMPROVEMENT] Hold URL to copy (#1684)

* [FIX] Different sourcemaps generation for Hermes (#1724)

* [FIX] Different sourcemaps generation for Hermes

* Upload sourcemaps after build

* [REVERT] Show emoji keyboard on Android (#1738)

* [FIX] Stop logging react-native-image-crop-picker (#1745)

* [FIX] Prevent toast ref error (#1744)

* [FIX] Prevent reaction map error (#1743)

* [FIX] Add missing calls to user info (#1741)

* [FIX] Catch room unsubscribe error (#1739)

* [i18n] Missing German keys (#1735)

* [FIX] Missing i18n on MessagesView title (#1733)

* [FIX]  UIKit Modal: Weird behavior on Android Tablet (#1742)

* [i18n] Missing key on German (#1747)

Co-authored-by: Diego Mello <[email protected]>

* [i18n] Add Italian (#1736)

* [CHORE] Memory leaks investigation (#1675)

* [IMPROVEMENT] Alert verify email when enabled (#1725)

* [NEW] Jitsi JWT added to URL (#1746)

* [FIX] UIKit submit when connection lost (#1748)

* Bump version to 4.5.0 (#1761)

* [NEW] Default browser (#1752)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] HTTP Basic Auth (#1753)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Honor profile fields edit settings (#1687)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Room announcements (#1726)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Honor Register/Login settings (#1727)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Make links clickable on Room Info (#1730)

Co-authored-by: Diego Mello <[email protected]>

* [NEW] Hide system messages (#1755)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Honor "Message_AudioRecorderEnabled" (#1764)

Co-authored-by: Diego Mello <[email protected]>

* [i18n] Missing de keys (#1765)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Redirect user to SetUsernameView (#1728)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Join Room (#1769)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Accept all media types using * (#1770)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Use RealName when necessary (#1758)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Markdown Line Break (#1783)

* [IMPROVEMENT] Remove useMarkdown (#1774)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Open browser rather than webview on Create Workspace (#1788)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Markdown perf (#1796)

* [FIX] Stop video when modal is closed (#1787)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Hide reply notification action when there are missing data (#1771)

Co-authored-by: Diego Mello <[email protected]>

* [i18n] Added Japanese translation (#1781)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Reset password error message (#1772)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Close tablet modal (#1773)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Setting not present (#1775)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Thread header (#1776)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Keyboard tracking loses input ref (#1784)

Co-authored-by: Diego Mello <[email protected]>

* [NEW] Mark message as unread (#1785)

Co-authored-by: Djorkaeff Alexandre <[email protected]>

* [IMPROVEMENT] Log server version (#1786)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Add loading message on long running tasks (#1798)

Co-authored-by: Diego Mello <[email protected]>

* [CHORE] Switch Apple account on Fastlane (#1810)

* [FIX] Watermelon throwing "Cannot update a record with pending updates" (#1754)

* [FIX] Detox tests (#1790)

* [CHORE] Use markdown preview on RoomView Header (#1807)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] LoginSignup blink services (#1809)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Request user presence on demand (#1813)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Remove all invited users when create a channel (#1814)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Pop from room which you have been removed (#1819)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Room Info styles (#1820)

Co-authored-by: Diego Mello <[email protected]>

* [i18n] Add missing German keys (#1800)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Empty mentions for @ALL and @here when real name is enabled (#1822)

Co-authored-by: Diego Mello <[email protected]>

* [TESTS] Markdown added to Storybook (#1812)

Co-authored-by: Diego Mello <[email protected]>

* [REGRESSION] Room View header title (#1827)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Storybook snapshots (#1831)

Co-authored-by: Djorkaeff Alexandre <[email protected]>

* [FIX] Mentions (#1829)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Thread message not found (#1830)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Separate delete and remove channel (#1832)

* Rename to delete room

* Separate delete and remove channel

* handleRemoved -> handleRoomRemoved

* [FIX] Navigate to RoomsList & Handle tablet case

Co-authored-by: Djorkaeff Alexandre <[email protected]>

* [NEW] Filter system messages per room (#1815)

Co-authored-by: Djorkaeff Alexandre <[email protected]>
Co-authored-by: Diego Mello <[email protected]>

* [FIX] e2e tests (#1838)

* [FIX] Consecutive clear cache calls freezing app (#1851)

* Bump version to 4.5.1 (#1853)

* [FIX][iOS] Ignore silent mode on audio player (#1862)

* [IMPROVEMENT] Create App Group property on Info.plist (#1858)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Make username clickable on message (#1618)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Show proper error message on profile (#1768)

Co-authored-by: Diego Mello <[email protected]>

* [IMPROVEMENT] Show toast when a message is starred/unstarred (#1616)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Incorrect size params to avatar endpoint (#1875)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Remove unrecognized emoji flags on android  (#1887)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Remove react-native global installs (#1886)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Emojis transparent on android (#1881)

Co-authored-by: Diego Mello <[email protected]>

* Bump acorn from 5.7.3 to 5.7.4 (#1876)

Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Diego Mello <[email protected]>

* Bump version to 4.6.0 (#1911)

* [FIX] Encode Image URI (#1909)

* [FIX] Encode Image URI

* [FIX] Check if Image is Valid

Co-authored-by: Diego Mello <[email protected]>

* [NEW] Adaptive Icons (#1904)

* Remove unnecessary stuff from debug build

* Adaptive icon for experimental app

* [FIX] Stop showing message on leave channel (#1896)

* [FIX] Leave room don't show 'was removed' message

* [FIX] Remove duplicated code

Co-authored-by: Diego Mello <[email protected]>

* [i18n] Added missing German translations(#1900)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Linkedin OAuth login (#1913)

* [CHORE] Fix typo in CreateChannel View (#1930)

* [FIX] Respect protocol in HTTP Auth IPs (#1933)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Use new LinkedIn OAuth url (#1935)

Co-authored-by: Diego Mello <[email protected]>

* [CHORE] Use storyboard on splash screen (#1939)

* Update react-native-bootsplash

* iOS

* Fix android

* [FIX] Check if avatar exists before create Icon (#1927)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Ignore self typing event (#1950)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Change default directory listing to Users (#1948)

* fix: change default directory listing to Users

* follow server settings

* Fix state to props

Co-authored-by: Diego Mello <[email protected]>

* [NEW] Onboarding layout (#1954)

* Onboarding texts

* OnboardingView

* FormContainer

* Minor fixes

* NewServerView

* Remove code

* Refactor

* WorkspaceView

* Stash

* Login with email working

* Login with

* Join open

* Revert "Login with"

This reverts commit d05dc50.

* Fix create account styles

* Register

* Refactor

* LoginServices component

* Refactor

* Multiple servers

* Remove native images

* Refactor styles

* Fix testid

* Fix add server on tablet

* i18n

* Fix close modal

* Fix TOTP

* [FIX] Registration disabled

* [FIX] Login Services separator

* Fix logos

* Fix AppVersion name

* I18n

* Minor fixes

* [FIX] Custom Fields

Co-authored-by: Djorkaeff Alexandre <[email protected]>

* [NEW] Create discussions (#1942)

* [WIP][NEW] Create Discussion

* [FIX] Clear multiselect & Translations

* [NEW] Create Discussion at MessageActions

* [NEW] Disabled Multiselect

* [FIX] Initial channel

* [NEW] Create discussion on MessageBox Actions

* [FIX] Crashing on edit name

* [IMPROVEMENT] New message layout

* [CHORE] Update README

* [NEW] Avatars on MultiSelect

* [FIX] Select Users

* [FIX] Add redirect and Handle tablet

* [IMPROVEMENT] Split CreateDiscussionView

* [FIX] Create a discussion inner discussion

* [FIX] Create a discussion

* [I18N] Add pt-br

* Change icons

* [FIX] Nav to discussion & header title

* Fix header

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Load messages (#1910)

* Create updateLastOpen param on readMessages

* Remove InteractionManager from load messages

* [NEW] Custom Status (#1811)

* [NEW] Custom Status

* [FIX] Subscribe to changes

* [FIX] Improve code using Banner component

* [IMPROVEMENT] Toggle modal

* [NEW] Edit custom status from Sidebar

* [FIX] Modal when tablet

* [FIX] Styles

* [FIX] Switch to react-native-promp-android

* [FIX] Custom Status UI

* [TESTS] E2E Custom Status

* Fix banner

* Fix banner

* Fix subtitle

* status text

* Fix topic header

* Fix RoomActionsView topic

* Fix header alignment on Android

* [FIX] RoomInfo crashes when without statusText

* [FIX] Use users.setStatus

* [FIX] Remove customStatus of ProfileView

* [FIX] Room View Thread Header

Co-authored-by: Diego Mello <[email protected]>

* [FIX] UI issues of Create Discussion View (#1965)

* [NEW] Direct Message between multiple users (#1958)

* [WIP] DM between multiple users

* [WIP][NEW] Create new DM between multiple users

* [IMPROVEMENT] Improve createChannel Sagas

* [IMPROVEMENT] Selected Users view

* [IMPROVEMENT] Room Actions of Group DM

* [NEW] Create new DM between multiple users

* [NEW] Group DM avatar

* [FIX] Directory border

* [IMPROVEMENT] Use isGroupChat

* [CHORE] Remove legacy getRoomMemberId

* [NEW] RoomTypeIcon

* [FIX] No use legacy method on RoomInfoView

* [FIX] Blink header when create new DM

* [FIX] Only show create direct message option when allowed

* [FIX] RoomInfoView

* pt-BR

* Few fixes

* Create button name

* Show create button only after a user is selected

* Fix max users issues

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Add server and hide login (#1968)

* Navigate to new server workspace from ServerDropdown if there's no token

* Hide login button based on login services and Accounts_ShowFormLogin setting

* [FIX] Lint

Co-authored-by: Djorkaeff Alexandre <[email protected]>

* [FIX] MultiSelect Keyboard behavior (Android) (#1969)

* fixed-modal-position

* made-changes

Co-authored-by: Djorkaeff Alexandre <[email protected]>

* [FIX] Bottom border style on DirectoryView (#1963)

* [FIX] Border style

* [FIX] Refactoring

* [FIX] fix color of border

* Undo

Co-authored-by: Aroo <[email protected]>
Co-authored-by: Diego Mello <[email protected]>

* [FIX] Clear settings on server change (#1967)

* [FIX] Deeplinking without RoomId (#1925)

* [FIX] Deeplinking without rid

* [FIX] Join channel

* [FIX] Deep linking without rid

* Update app/lib/methods/canOpenRoom.js

Co-authored-by: Diego Mello <[email protected]>

* [NEW] Two Factor authentication via email (#1961)

* First api call working

* [NEW] REST API Post wrapper 2FA

* [NEW] Send 2FA on Email

* [I18n] Add translations

* [NEW] Translations & Cancel totp

* [CHORE] Totp -> TwoFactor

* [NEW] Two Factor by email

* [NEW] Tablet Support

* [FIX] Text colors

* [NEW] Password 2fa

* [FIX] Encrypt password on 2FA

* [NEW] MethodCall2FA

* [FIX] Password fallback

* [FIX] Wrap all post/methodCall with 2fa

* [FIX] Wrap missed function

* few fixes

* [FIX] Use new TOTP on Login

* [improvement] 2fa methodCall

Co-authored-by: Djorkaeff Alexandre <[email protected]>

* [FIX] Correct message for manual approval user Registration (#1906)

* [FIX] Correct message for manual approval from admin shown on Registeration

* lint fix - added semicolon

* Updated the translations

* [FIX] Translations

* i18n to match server

Co-authored-by: Djorkaeff Alexandre <[email protected]>
Co-authored-by: Diego Mello <[email protected]>

* [FIX] Direct Message between multiple users REST (#1974)

* [FIX] Investigate app losing connection issues (#1890)

* [WIP] Reopen without timeOut & ping with 5 sec & Fix Unsubscribe

* [FIX] Remove duplicated close

* [FIX] Use no-dist lib

* [FIX] Try minor fix

* [FIX] Try reopen connection when app was put on foreground

* [FIX] Remove timeout

* [FIX] Build

* [FIX] Patch

* [FIX] Snapshot

* [IMPROVEMENT] Decrease time to reopen

* [FIX] Some fixes

* [FIX] Update sdk version

* [FIX] Subscribe Room Once

* [CHORE] Update sdk

* [FIX] Subscribe Room

* [FIX] Try to resend missed subs

* [FIX] Users never show status when start app without network

* [FIX] Subscribe to room

* [FIX] Multiple servers

* [CHORE] Update SDK

* [FIX] Don't duplicate streams on subscribeAll

* [FIX] Server version when start the app offline

* [FIX] Server version cached

* [CHORE] Remove unnecessary code

* [FIX] Offline server version

* [FIX] Subscribe before connect

* [FIX] Remove unncessary props

* [FIX] Update sdk

* [FIX] User status & Unsubscribe Typing

* [FIX] Typing at incorrect room

* [FIX] Multiple Servers

* [CHORE] Update SDK

* [REVERT] Undo some changes on SDK

* [CHORE] Update sdk to prevent incorrect subscribes

* [FIX] Prevent no reconnect

* [FIX] Remove close on open

* [FIX] Clear typing when disconnect/connect to SDK

* [CHORE] Update SDK

* [CHORE] Update SDK

* Update SDK

* fix merge develop

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Single message thread inserting thread without rid (#1999)

* [FIX] ThreadMessagesView crashing on load (#1997)

* [FIX] Saml (#1996)

* [FIX] SAML incorrect close

* [FIX] Pathname

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Change user own status (#1995)

* [FIX] Change user own status

* [IMPROVEMENT] Set activeUsers

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Loading all updated rooms after app resume (#1998)

* [FIX] Loading all updated rooms after app resume

* Fix room date on RoomItem

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Change notifications preferences (#2000)

* [FIX] Change notifications preferences

* [IMPROVEMENT] Picker View

* [I18N] Translations

* [FIX] Picker Selection

* [FIX] List border

* [FIX] Prevent crash

* [FIX] Not-Pref tablet

* [FIX] Use same style of LanguageView

* [IMPROVEMENT] Send listItem title

Co-authored-by: Diego Mello <[email protected]>

* Bump version to 4.6.1 (#2001)

* [FIX] DM header blink (#2011)

* [FIX] Split get settings into two requests (#2017)

* [FIX] Split get settings into two requests

* [FIX] Clear settings only when change server

* [IMPROVEMENT] Move the way to clear settings

* [REVERT] Revert some changes

* [FIX] Server Icon

Co-authored-by: Diego Mello <[email protected]>

* [REGRESSION] Invite Links (#2007)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Read only channel/broadcast (#1951)

* [FIX] Read only channel/broadcast

* [FIX] Roles missing

* [FIX] Check roles to readOnly

* [FIX] Can post

* [FIX] Respect post-readonly permission

* [FIX] Search a room readOnly

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Cas auth (#2024)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Login TOTP Compatibility to older servers (#2018)

* [FIX] Login TOTP Compatibility to older servers

* [FIX] Android crashes if use double negation

Co-authored-by: Diego Mello <[email protected]>

* Bump version to 4.6.4 (#2029)

Co-authored-by: Diego Mello <[email protected]>

* [FIX] Lint (#2030)

* [FIX] UIKit with only one block (#2022)

* [FIX] Message with only one block

* [FIX] Update headers

Co-authored-by: Diego Mello <[email protected]>

Co-authored-by: Djorkaeff Alexandre <[email protected]>
Co-authored-by: Prateek Jain <[email protected]>
Co-authored-by: Pitstopper <[email protected]>
Co-authored-by: phriedrich <[email protected]>
Co-authored-by: Guilherme Siqueira <[email protected]>
Co-authored-by: Prateek Jain <[email protected]>
Co-authored-by: devyaniChoubey <[email protected]>
Co-authored-by: Bernard Seow <[email protected]>
Co-authored-by: Hiroki Ishiura <[email protected]>
Co-authored-by: Exordian <[email protected]>
Co-authored-by: Daanchaam <[email protected]>
Co-authored-by: Youssef Muhamad <[email protected]>
Co-authored-by: Iván Álvarez <[email protected]>
Co-authored-by: Sarthak Pranesh <[email protected]>
Co-authored-by: Michele Pellegrini <[email protected]>
Co-authored-by: Tanmoy Bhowmik <[email protected]>
Co-authored-by: Hibikine Kage <[email protected]>
Co-authored-by: Ezequiel de Oliveira <[email protected]>
Co-authored-by: Neil Agarwal <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Govind Dixit <[email protected]>
Co-authored-by: Zhaubassarova Aruzhan <[email protected]>
Co-authored-by: Aroo <[email protected]>
Co-authored-by: Sarthak Pranesh <[email protected]>
  • Loading branch information
1 parent 230c336 commit 933362e
Show file tree
Hide file tree
Showing 26 changed files with 285 additions and 82 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.6.1"
versionName "4.6.4"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
}
Expand Down
3 changes: 2 additions & 1 deletion app/containers/TwoFactor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const TwoFactor = React.memo(({ theme, split }) => {

useDeepCompareEffect(() => {
if (!_.isEmpty(data)) {
setCode('');
setVisible(true);
} else {
setVisible(false);
Expand Down Expand Up @@ -94,7 +95,7 @@ const TwoFactor = React.memo(({ theme, split }) => {
<View style={styles.container}>
<View style={[styles.content, split && [sharedStyles.modal, sharedStyles.modalFormSheet], { backgroundColor: themes[theme].backgroundColor }]}>
<Text style={[styles.title, { color }]}>{I18n.t(method?.title || 'Two_Factor_Authentication')}</Text>
<Text style={[styles.subtitle, { color }]}>{I18n.t(method?.text)}</Text>
{method?.text ? <Text style={[styles.subtitle, { color }]}>{I18n.t(method.text)}</Text> : null}
<TextInput
value={code}
theme={theme}
Expand Down
3 changes: 2 additions & 1 deletion app/containers/TwoFactor/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ export default StyleSheet.create({
},
title: {
fontSize: 14,
paddingBottom: 8,
...sharedStyles.textBold
},
subtitle: {
fontSize: 14,
paddingVertical: 8,
paddingBottom: 8,
...sharedStyles.textRegular,
...sharedStyles.textAlignCenter
},
Expand Down
3 changes: 1 addition & 2 deletions app/containers/message/Blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const Blocks = React.memo(({
blocks, id: mid, rid, blockAction
}) => {
if (blocks && blocks.length > 0) {
const [, secondBlock] = blocks;
const { appId = '' } = secondBlock;
const appId = blocks[0]?.appId || '';
return React.createElement(
messageBlockWithContext({
action: async({ actionId, value, blockId }) => {
Expand Down
3 changes: 2 additions & 1 deletion app/lib/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ class DB {
Message,
Thread,
ThreadMessage,
Upload
Upload,
Permission
],
actionsEnabled: true
});
Expand Down
11 changes: 9 additions & 2 deletions app/lib/methods/canOpenRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,15 @@ export default async function canOpenRoom({ rid, path }) {

if (rid) {
try {
await subsCollection.find(rid);
return { rid };
const room = await subsCollection.find(rid);
return {
rid,
t: room.t,
name: room.name,
fname: room.fname,
prid: room.prid,
uids: room.uids
};
} catch (e) {
// Do nothing
}
Expand Down
20 changes: 18 additions & 2 deletions app/lib/methods/getSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ import fetch from '../../utils/fetch';

const serverInfoKeys = ['Site_Name', 'UI_Use_Real_Name', 'FileUpload_MediaTypeWhiteList', 'FileUpload_MaxFileSize'];

// these settings are used only on onboarding process
const loginSettings = [
'API_Gitlab_URL',
'CAS_enabled',
'CAS_login_url',
'Accounts_EmailVerification',
'Accounts_ManuallyApproveNewUsers',
'Accounts_ShowFormLogin',
'Site_Url',
'Accounts_RegistrationForm',
'Accounts_RegistrationForm_LinkReplacementText',
'Accounts_EmailOrUsernamePlaceholder',
'Accounts_PasswordPlaceholder',
'Accounts_PasswordReset'
];

const serverInfoUpdate = async(serverInfo, iconSetting) => {
const serversDB = database.servers;
const serverId = reduxStore.getState().server.server;
Expand Down Expand Up @@ -54,7 +70,7 @@ const serverInfoUpdate = async(serverInfo, iconSetting) => {

export async function getLoginSettings({ server }) {
try {
const settingsParams = JSON.stringify(['Accounts_ShowFormLogin', 'Accounts_RegistrationForm']);
const settingsParams = JSON.stringify(loginSettings);
const result = await fetch(`${ server }/api/v1/settings.public?query={"_id":{"$in":${ settingsParams }}}`).then(response => response.json());

if (result.success && result.settings.length) {
Expand Down Expand Up @@ -84,7 +100,7 @@ export async function setSettings() {
export default async function() {
try {
const db = database.active;
const settingsParams = JSON.stringify(Object.keys(settings));
const settingsParams = JSON.stringify(Object.keys(settings).filter(key => !loginSettings.includes(key)));
// RC 0.60.0
const result = await fetch(`${ this.sdk.client.host }/api/v1/settings.public?query={"_id":{"$in":${ settingsParams }}}`).then(response => response.json());

Expand Down
1 change: 1 addition & 0 deletions app/lib/methods/subscriptions/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const createOrUpdateSubscription = async(subscription, room) => {
autoTranslate: s.autoTranslate,
autoTranslateLanguage: s.autoTranslateLanguage,
lastMessage: s.lastMessage,
roles: s.roles,
usernames: s.usernames,
uids: s.uids
};
Expand Down
38 changes: 27 additions & 11 deletions app/lib/rocketchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,11 @@ const RocketChat = {
user = {
id: userRecord.id,
token: userRecord.token,
username: userRecord.username
username: userRecord.username,
roles: userRecord.roles
};
}
reduxStore.dispatch(shareSetUser({
id: user.id,
token: user.token,
username: user.username
}));
reduxStore.dispatch(shareSetUser(user));
await RocketChat.login({ resume: user.token });
} catch (e) {
log(e);
Expand All @@ -308,6 +305,8 @@ const RocketChat = {
this.shareSDK = null;
}
database.share = null;

reduxStore.dispatch(shareSetUser(null));
},

updateJitsiTimeout(rid) {
Expand Down Expand Up @@ -338,8 +337,8 @@ const RocketChat = {
if (e.data?.error && (e.data.error === 'totp-required' || e.data.error === 'totp-invalid')) {
const { details } = e.data;
try {
await twoFactor({ method: details?.method, invalid: e.data.error === 'totp-invalid' });
return resolve(this.loginTOTP(params));
const code = await twoFactor({ method: details?.method || 'totp', invalid: e.data.error === 'totp-invalid' });
return resolve(this.loginTOTP({ ...params, code: code?.twoFactorCode }));
} catch {
// twoFactor was canceled
return reject();
Expand Down Expand Up @@ -580,6 +579,19 @@ const RocketChat = {
}
data = data.slice(0, 7);

data = data.map((sub) => {
if (sub.t !== 'd') {
return ({
rid: sub.rid,
name: sub.name,
fname: sub.fname,
t: sub.t,
search: true
});
}
return sub;
});

const usernames = data.map(sub => sub.name);
try {
if (data.length < 7) {
Expand Down Expand Up @@ -812,7 +824,9 @@ const RocketChat = {
return this.sdk.get('rooms.info', { roomId });
},

getUidDirectMessage(room, userId) {
getUidDirectMessage(room) {
const { id: userId } = reduxStore.getState().login.user;

// legacy method
if (!room.uids && room.rid && room.t === 'd') {
return room.rid.replace(userId, '').trim();
Expand Down Expand Up @@ -949,7 +963,7 @@ const RocketChat = {
// get the room from database
const room = await subsCollection.find(rid);
// get room roles
roomRoles = room.roles;
roomRoles = room.roles || [];
} catch (error) {
console.log('hasPermission -> Room not found');
return permissions.reduce((result, permission) => {
Expand All @@ -960,8 +974,10 @@ const RocketChat = {
// get permissions from database
try {
const permissionsFiltered = await permissionsCollection.query(Q.where('id', Q.oneOf(permissions))).fetch();
const shareUser = reduxStore.getState().share.user;
const loginUser = reduxStore.getState().login.user;
// get user roles on the server from redux
const userRoles = (reduxStore.getState().login.user && reduxStore.getState().login.user.roles) || [];
const userRoles = (shareUser.roles || loginUser.roles) || [];
// merge both roles
const mergedRoles = [...new Set([...roomRoles, ...userRoles])];

Expand Down
19 changes: 13 additions & 6 deletions app/sagas/deepLinking.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,21 @@ const handleInviteLink = function* handleInviteLink({ params, requireLogin = fal
const navigate = function* navigate({ params }) {
yield put(appStart('inside'));
if (params.path) {
const room = yield RocketChat.canOpenRoom(params);
const [type, name] = params.path.split('/');
if (room) {
yield Navigation.navigate('RoomsListView');
Navigation.navigate('RoomView', { name, t: roomTypes[type], ...room });
if (type !== 'invite') {
const room = yield RocketChat.canOpenRoom(params);
if (room) {
yield Navigation.navigate('RoomsListView');
Navigation.navigate('RoomView', {
name,
t: roomTypes[type],
roomUserId: RocketChat.getUidDirectMessage(room),
...room
});
}
} else {
yield handleInviteLink({ params });
}
} else {
yield handleInviteLink({ params });
}
};

Expand Down
5 changes: 2 additions & 3 deletions app/sagas/selectServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import * as actions from '../actions';
import {
serverFailure, selectServerRequest, selectServerSuccess, selectServerFailure
} from '../actions/server';
import { setUser } from '../actions/login';
import { clearSettings } from '../actions/settings';
import { setUser } from '../actions/login';
import RocketChat from '../lib/rocketchat';
import database from '../lib/database';
import log, { logServerVersion } from '../utils/log';
Expand Down Expand Up @@ -98,9 +98,8 @@ const handleSelectServer = function* handleSelectServer({ server, version, fetch
const basicAuth = yield RNUserDefaults.get(`${ BASIC_AUTH_KEY }-${ server }`);
setBasicAuth(basicAuth);

yield put(clearSettings());

if (user) {
yield put(clearSettings());
yield RocketChat.connect({ server, user, logoutOnError: true });
yield put(setUser(user));
yield put(actions.appStart('inside'));
Expand Down
24 changes: 24 additions & 0 deletions app/utils/isReadOnly.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import RocketChat from '../lib/rocketchat';

const canPost = async({ rid }) => {
try {
const permission = await RocketChat.hasPermission(['post-readonly'], rid);
return permission && permission['post-readonly'];
} catch {
// do nothing
}
return false;
};

const isMuted = (room, user) => room && room.muted && room.muted.find && !!room.muted.find(m => m === user.username);

export const isReadOnly = async(room, user) => {
if (room.archived) {
return true;
}
const allowPost = await canPost(room);
if (allowPost) {
return false;
}
return (room && room.ro) || isMuted(room, user);
};
11 changes: 0 additions & 11 deletions app/utils/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ import moment from 'moment';

import I18n from '../i18n';

export const isOwner = room => room && room.roles && room.roles.length && !!room.roles.find(role => role === 'owner');

export const isMuted = (room, user) => room && room.muted && room.muted.find && !!room.muted.find(m => m === user.username);

export const isReadOnly = (room, user) => {
if (isOwner(room)) {
return false;
}
return (room && room.ro) || isMuted(room, user);
};

export const isBlocked = (room) => {
if (room) {
const { t, blocked, blocker } = room;
Expand Down
3 changes: 2 additions & 1 deletion app/views/AuthenticationWebView.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ class AuthenticationWebView extends React.PureComponent {
const { navigation } = this.props;
const ssoToken = navigation.getParam('ssoToken');
const parsedUrl = parse(url, true);
if (parsedUrl.pathname?.includes('ticket') || parsedUrl.pathname?.includes('validate') || parsedUrl.query?.saml_idp_credentialToken) {
// ticket -> cas / validate & saml_idp_credentialToken -> saml
if (parsedUrl.pathname?.includes('validate') || parsedUrl.query?.ticket || parsedUrl.query?.saml_idp_credentialToken) {
let payload;
if (this.authType === 'saml') {
const token = parsedUrl.query?.saml_idp_credentialToken || ssoToken;
Expand Down
12 changes: 9 additions & 3 deletions app/views/DirectoryView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ class DirectoryView extends React.Component {
this.setState(({ showOptionsDropdown }) => ({ showOptionsDropdown: !showOptionsDropdown }));
}

goRoom = async({ rid, name, t }) => {
goRoom = async({
rid, name, t, search
}) => {
const { navigation } = this.props;
await navigation.navigate('RoomsListView');
navigation.navigate('RoomView', { rid, name, t });
navigation.navigate('RoomView', {
rid, name, t, search
});
}

onPressItem = async(item) => {
Expand All @@ -139,7 +143,9 @@ class DirectoryView extends React.Component {
this.goRoom({ rid: result.room._id, name: item.username, t: 'd' });
}
} else {
this.goRoom({ rid: item._id, name: item.name, t: 'c' });
this.goRoom({
rid: item._id, name: item.name, t: 'c', search: true
});
}
}

Expand Down
12 changes: 7 additions & 5 deletions app/views/ModalBlockView.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ModalBlockView extends React.Component {
return {
title: textParser([title]),
...themedHeader(theme),
headerLeft: (
headerLeft: close ? (
<CustomHeaderButtons>
<Item
title={textParser([close.text])}
Expand All @@ -76,8 +76,8 @@ class ModalBlockView extends React.Component {
testID='close-modal-uikit'
/>
</CustomHeaderButtons>
),
headerRight: (
) : null,
headerRight: submit ? (
<CustomHeaderButtons>
<Item
title={textParser([submit.text])}
Expand All @@ -86,7 +86,7 @@ class ModalBlockView extends React.Component {
testID='submit-modal-uikit'
/>
</CustomHeaderButtons>
)
) : null
};
}

Expand Down Expand Up @@ -136,7 +136,7 @@ class ModalBlockView extends React.Component {
const { navigation } = this.props;
const oldData = prevProps.navigation.getParam('data', {});
const newData = navigation.getParam('data', {});
if (!isEqual(oldData, newData)) {
if (oldData.viewId !== newData.viewId) {
navigation.push('ModalBlockView', { data: newData });
}
}
Expand All @@ -148,12 +148,14 @@ class ModalBlockView extends React.Component {
}

handleUpdate = ({ type, ...data }) => {
const { navigation } = this.props;
if ([MODAL_ACTIONS.ERRORS].includes(type)) {
const { errors } = data;
this.setState({ errors });
} else {
this.setState({ data });
}
navigation.setParams({ data });
};

cancel = async({ closeModal }) => {
Expand Down
Loading

0 comments on commit 933362e

Please sign in to comment.