Compare commits

..

979 Commits

Author SHA1 Message Date
eb32c5455f Merge branch 'release/0.8.0' 2019-11-19 09:47:57 +01:00
57dcd569f3 Prepare release 0.8.0 2019-11-19 09:47:12 +01:00
fe17050580 Merge pull request #685 from vector-im/feature/timeline_items
Feature/timeline items
2019-11-15 16:11:37 +01:00
ec40a8c969 Update CHANGES 2019-11-14 13:26:25 +01:00
6b1b3bec85 Clean code for klint 2019-11-14 13:25:04 +01:00
6bd6ececb7 Timeline: handle sticker events 2019-11-14 13:23:12 +01:00
c7db695e67 Timeline: handle join rules event 2019-11-14 12:21:55 +01:00
4cefdfedce Home: use detach/attach instead of hide/show 2019-11-14 11:18:45 +01:00
6ce241163e Merge pull request #679 from vector-im/feature/perf_again
Feature/perf again
2019-11-13 19:43:07 +01:00
79350899c5 Read receipts: use primary key to query 2019-11-13 19:21:14 +01:00
f265724a3c Login sso: handle failure 2019-11-13 19:20:03 +01:00
2e50d2a36e Clean code for klint 2019-11-13 11:38:30 +01:00
643c062858 Merge branch 'develop' into feature/perf_again 2019-11-13 10:44:59 +01:00
0e0db67aef Timeline: clear some resources when unbind 2019-11-12 20:34:19 +01:00
6dc5b126d6 Optimize room list processing 2019-11-12 19:53:07 +01:00
d2acabddd9 RoomDetail: fix enter/exit mode again after merge 2019-11-12 19:25:57 +01:00
ec71b53c1e RoomSummary: don't map read receipts 2019-11-12 19:25:21 +01:00
fc3d4187d1 Merge pull request #676 from vector-im/feature/long_click_room
Add help to reveal the long click on a room
2019-11-12 18:29:42 +01:00
a25f309990 Merge pull request #678 from vector-im/feature/block_user_menu
Add action to block user in the message action bottom sheet
2019-11-12 18:17:18 +01:00
5449592422 Add action to block user in the message action bottom sheet (following Nad's design) 2019-11-12 17:52:03 +01:00
19b415871d Extract displaymode, clear adapter on roomList/timeline and use commitNow when possible 2019-11-12 15:13:20 +01:00
6463f3439f Update Mvrx to 1.3 2019-11-12 15:11:52 +01:00
f2320f9571 Merge pull request #665 from vector-im/feature/color_theme
Ensure color is retrieved from current theme, even when theme change
2019-11-12 12:29:27 +01:00
fc91694bdd Merge pull request #673 from vector-im/feature/us
Update strings
2019-11-12 12:08:55 +01:00
dbb41108ef Improve layout 2019-11-12 11:50:16 +01:00
08c864bad7 Add help to reveal the long click on a room 2019-11-12 11:39:47 +01:00
9c5c65a243 Cleanup 2019-11-12 10:36:53 +01:00
b6199b1f27 Fix some issues with fragments managers (Home fragments) and lifecycle 2019-11-08 19:49:08 +01:00
38da54119a Merge branch 'develop' into feature/perf_again 2019-11-08 18:39:06 +01:00
65b09ad4f0 Merge pull request #675 from vector-im/feature/cleanup
Cleanup ViewModel for code clarity
2019-11-08 18:19:22 +01:00
603b8fae45 Add missing binding 2019-11-08 17:30:04 +01:00
50e2e6a823 Cleanup 2019-11-08 17:23:21 +01:00
bb237e3bbb Fix ViewModel for Signout 2019-11-08 17:21:46 +01:00
1bd2c0d220 Merge branch 'develop' into feature/perf_again 2019-11-08 17:09:22 +01:00
bcb811a7e8 Realm perf: use Dispatchers.Default for write, as we don't want to create so many threads (and we can only have one write transaction at a time) 2019-11-08 17:08:44 +01:00
ec4d7e29ec Ensure we use the correct viewModelProvider 2019-11-08 17:08:29 +01:00
a6df63f6d9 Fix crash 2019-11-08 16:56:45 +01:00
ea7213a5ae Split long lines 2019-11-08 16:16:42 +01:00
590a13334d ktlint 2019-11-08 16:04:41 +01:00
631448335d Rename stuff for code coherence 2019-11-08 15:36:12 +01:00
12376368c7 Rename class 2019-11-08 15:20:55 +01:00
f17564d743 Simple code 2019-11-08 15:08:50 +01:00
a6fcc7dca6 Move class to dedicated file 2019-11-08 15:07:01 +01:00
70bce9e7dd Ensure ViewModel follow the same pattern to handle actions 2019-11-08 15:05:11 +01:00
17f3614288 Perf: try to optimize room summary updates 2019-11-08 13:48:35 +01:00
238d1d87c6 Rename class 2019-11-08 13:31:39 +01:00
82f639b91f Rename to Shared 2019-11-08 12:09:08 +01:00
c8bc553caa Move class to dedicated file 2019-11-08 12:01:36 +01:00
fa5d44af65 Create common parent for Action view model, to handle navigation, action, or other type of event 2019-11-08 11:54:17 +01:00
cbdbe5033f Merge pull request #664 from vector-im/feature/room_list_actions
Feature/room list actions
2019-11-07 15:45:45 +01:00
61ac250e2b Merge branch 'develop' into feature/room_list_actions 2019-11-07 15:43:21 +01:00
04f72dfcb8 Clean code after Benoit's review 2019-11-07 15:19:12 +01:00
10ca5d94ea Fix issue after rebase 2019-11-07 14:29:08 +01:00
c5b8c69ae5 Merge pull request #668 from vector-im/feature/block_user
Block user and display ignored users list
2019-11-07 14:28:23 +01:00
d3d7f7cc61 Split long lines 2019-11-07 14:18:57 +01:00
b6bb714264 Display name and avatar of the user 2019-11-07 14:18:57 +01:00
a87310ac15 update comment 2019-11-07 14:18:57 +01:00
032e1b3d19 ktlint 2019-11-07 14:18:57 +01:00
d9f15c1d21 Block user possibility after reporting event content 2019-11-07 14:18:57 +01:00
99d09f71ad Changelog 2019-11-07 14:18:57 +01:00
9c952b6bc8 Display ignored users list 2019-11-07 14:18:57 +01:00
fbae3d27c2 Ignore/Unignore userIds 2019-11-07 14:13:29 +01:00
2f7d1f9f01 Ignored Users account data 2019-11-07 14:13:29 +01:00
114101699d Fix potential ignoring of account data (return@foreach) 2019-11-07 14:13:29 +01:00
f5c0dcb5ea Merge pull request #670 from vector-im/feature/fragment_factory
Feature/fragment factory
2019-11-07 13:59:46 +01:00
241220ce1f remove unused import 2019-11-07 13:59:21 +01:00
98d97e574c Fix regression when filtering emojis 2019-11-07 12:23:21 +01:00
96e610970a Finish the work 2019-11-07 12:08:17 +01:00
2027802f82 Add debug screen for all SAS emoji 2019-11-07 10:37:49 +01:00
54f93db632 RoomDetail : enter/exit special mode without waiting for draft to update 2019-11-06 20:08:19 +01:00
3af7ca9ab0 Retrofit: lazy init okhttp 2019-11-06 20:07:28 +01:00
93ef3edab3 Remove some use of sync write in realm 2019-11-06 18:47:11 +01:00
c85852262e Remove bad value 2019-11-06 18:28:16 +01:00
d0c3271628 Import string from Riot-Android and fix #671 2019-11-06 18:19:37 +01:00
ad9a48d5fa Clean code 2019-11-05 18:36:30 +01:00
219d1383e5 Fragments: use FragmentContainerView 2019-11-05 18:13:55 +01:00
8871280fab Fragments: use constructor injections in most of the Fragments 2019-11-05 18:12:04 +01:00
fb3e953e28 Merge pull request #667 from vector-im/feature/realm_cleanup
Import change form https://github.com/matrix-org/matrix-android-sdk/pull/505
2019-11-05 12:13:25 +01:00
10712fd6ab ktlint 2019-11-05 12:13:06 +01:00
9d478dbfe2 Import change form https://github.com/matrix-org/matrix-android-sdk/pull/505 2019-11-05 11:18:22 +01:00
3013d67c16 Fragment factory: start including the new version with FragmentFactory [WIP] 2019-11-04 19:33:56 +01:00
bee8c2d159 Ensure color is retrieved from current theme, even when theme change 2019-11-04 18:12:24 +01:00
945e5d5a74 Merge branch 'develop' into feature/room_list_actions 2019-11-04 17:17:43 +01:00
93df8c56a8 Fix compilation error and use mockk instead of manual mocking (prone to error) 2019-11-04 17:09:03 +01:00
cd1a964067 Merge pull request #649 from vector-im/feature/spoiler_support
Support spoilers in messages
2019-11-04 16:54:43 +01:00
e4b829f0cf Lift of 'return' 2019-11-04 16:53:51 +01:00
7206d84a6b Add FIXME 2019-11-04 16:51:45 +01:00
b3233d3eb7 Change spoiler bg colors 2019-11-04 16:50:32 +01:00
3c4c0ed46a Add /spoiler command 2019-11-04 16:50:32 +01:00
24f1262005 Merge refactoring 2019-11-04 16:49:53 +01:00
86667a6d8a Passes text color instead of context 2019-11-04 16:49:53 +01:00
42e0d0f769 Improve code to check url validity 2019-11-04 16:49:53 +01:00
e976055253 Support spoilers in messages 2019-11-04 16:49:53 +01:00
84d6c8ec16 Merge pull request #646 from vector-im/feature/search_reaction
Search reaction by name/keywords
2019-11-04 15:51:24 +01:00
9fdfd091ac Merge branch 'develop' into feature/search_reaction 2019-11-04 15:51:16 +01:00
e66766f41c Update CHANGES 2019-11-04 15:12:30 +01:00
6177e69855 Merge branch 'develop' into feature/room_list_actions 2019-11-04 15:11:20 +01:00
5c71cabb5f Clean code 2019-11-04 15:08:08 +01:00
6ebe5532c5 Room list actions: use new strings 2019-11-04 14:59:12 +01:00
8030c44f44 Room list actions: fix some UI issues and render selected notification state 2019-11-04 14:31:03 +01:00
a85b5af761 Merge pull request #641 from vector-im/feature/fix_crash
Fix crash
2019-11-04 14:28:31 +01:00
d780c74abf Merge pull request #657 from vector-im/feature/locales
Support Cyrillic script
2019-11-04 14:27:24 +01:00
5d7efa7f8f Merge pull request #660 from vector-im/feature/permission
Ask for permission to write external storage when uri comes from the keyboard (#658)
2019-11-04 14:26:12 +01:00
7e467443ed Merge pull request #651 from vector-im/feature/markdown_off
Markdown off
2019-11-04 10:23:21 +01:00
8439c337f7 Merge branch 'develop' into feature/markdown_off 2019-11-04 10:22:20 +01:00
151ad01038 Use RxBinding on searchView 2019-11-01 11:57:15 +01:00
73267442bb Fix / remove listener 2019-11-01 11:30:13 +01:00
43fd794c96 Ask for permission to write external storage when uri comes from the keyboard (#658) 2019-10-31 15:48:07 +01:00
36060fe332 Merge pull request #654 from vector-im/feature/timeline_message_code
Feature/timeline message code
2019-10-31 15:08:13 +01:00
3483debcc1 Little cleanup 2019-10-31 12:08:55 +01:00
4324f6abbd Add paragraph about a11y 2019-10-31 11:11:03 +01:00
43f8d8d8aa Merge pull request #656 from pvagner/a11y_file_type_selector
a11y: file type selector
2019-10-31 10:52:28 +01:00
fb1ff77ec4 Add string from Riot-Android 2019-10-31 10:09:27 +01:00
e355a7f6dd Changelog entry 2019-10-31 07:58:08 +01:00
33e35368fc a11y: better presentation for file type selector buttons to screen reader users
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-31 06:36:28 +01:00
0e49a11e5e Merge pull request #648 from vector-im/feature/fix_#498
Feature/fix #498
2019-10-30 19:28:35 +01:00
d47cf7e932 Merge branch 'develop' into feature/fix_#498 2019-10-30 19:26:11 +01:00
101057520b Fix disambiguated with empty senderName 2019-10-30 19:25:24 +01:00
30b2e53002 Update CHANGES 2019-10-30 19:02:44 +01:00
5ab31a0ef5 Fix klint 2019-10-30 19:00:56 +01:00
b4ae331086 Timeline: render inline and block code 2019-10-30 19:00:00 +01:00
3f447df13c Support local script (imported from https://github.com/vector-im/riot-android/pull/3364) 2019-10-30 16:59:31 +01:00
3517873156 Timeline: Start handling code blocks. [WIP] 2019-10-29 19:08:48 +01:00
118870bc41 ktlint cleanup 2019-10-29 17:02:55 +01:00
d001ab5bef Merge pull request #640 from Dominaezzz/kotlinify
The last of the clean up.
2019-10-29 17:01:38 +01:00
7496a88dcd Markdown set to off by default (Fixes #412) 2019-10-29 16:22:12 +01:00
6567c5e6c7 Small kotlin improvement 2019-10-29 16:20:22 +01:00
361427488f Passphrase does not match (Export room keys) (Fixes #644) 2019-10-29 14:38:04 +01:00
7272343e6d Update comment 2019-10-29 14:32:05 +01:00
f0b3151d71 Merge pull request #639 from vector-im/feature/compile_tests
Build and run test on CI
2019-10-29 14:27:47 +01:00
035359cb35 Update CHANGES and clean code 2019-10-28 17:01:41 +01:00
57b640622b Sender Name: we should use disambiguated display name over senderName. PrevContent fallback is now handled in SDK 2019-10-28 16:48:55 +01:00
de4c389c76 klint cleaning 2019-10-28 15:12:49 +01:00
199456487c Search reaction by name/keywords 2019-10-28 14:36:15 +01:00
00ca5dc70a RoomListActions: handle room notification state. Still need to branch UI 2019-10-25 18:23:47 +02:00
a04802b238 CI / upgrade queue to xlarge 2019-10-25 11:14:17 +02:00
cb275aee37 Room list actions: start showing items and refact a bit RxStore 2019-10-24 19:11:49 +02:00
fbf73c7c8e shorter code 2019-10-24 18:52:34 +02:00
0040f8e924 Fix crash reported by Rageshake, stateKey can be null 2019-10-24 18:51:47 +02:00
6cca242f77 Fix Android test compilation issue 2019-10-24 17:49:34 +02:00
2929b8f617 Ensure Android tests compile and fix warnings 2019-10-24 17:24:42 +02:00
8422c6de17 Remove test sample 2019-10-24 17:21:19 +02:00
7c567b04bb Make test compile and pass 2019-10-24 16:36:12 +02:00
1ac99e92a6 Light refactoring.
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-10-24 14:58:11 +01:00
5ab975cc5c General kotlinification.
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-10-24 14:53:44 +01:00
2cf63ea92a Remove import java.util.* from kotlin files.
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-10-24 14:53:10 +01:00
9e8d8ce878 Build and run test on CI 2019-10-24 15:52:40 +02:00
b766bce07d Version++ 2019-10-24 14:40:31 +02:00
01452efd8d Merge branch 'release/0.7.0' 2019-10-24 14:37:52 +02:00
0a0af221f0 Merge branch 'release/0.7.0' into develop 2019-10-24 14:37:51 +02:00
af08759af6 Prepare release 0.7.0 2019-10-24 14:37:28 +02:00
e52f0faaa7 Merge pull request #638 from vector-im/feature/filter
Fix 2 issues with share Activity: filter and room lists
2019-10-24 14:03:08 +02:00
8fa676d034 Share Activity: display rooms of all communities 2019-10-24 12:19:25 +02:00
b6594599c4 Rename member 2019-10-24 10:53:19 +02:00
8be8cc9ef7 Filter rooms when sharing element 2019-10-24 10:45:53 +02:00
9762d5be40 Room list actions: start creating all the components 2019-10-23 19:05:59 +02:00
b17b54d218 Merge pull request #637 from vector-im/feature/fix_room_summary
Feature/fix some room related stuff
2019-10-23 17:29:14 +02:00
187e2a26db Clean after Benoit's review 2019-10-23 17:26:56 +02:00
2f5fdbb7e2 Clean and fix lint 2019-10-23 16:20:38 +02:00
8b1411f533 Read marker: test if local echo before hitting the SDK to change read marker id + reduce a bit delay 2019-10-23 16:13:35 +02:00
bdee5e0687 Fix warning on Strings 2019-10-23 15:17:21 +02:00
ce4e244a3b Merge pull request #635 from vector-im/feature/strings
Import Strings from Riot
2019-10-23 15:09:58 +02:00
ff81715783 Import Strings from Riot 2019-10-23 14:18:40 +02:00
3196dcb57e MessageActions: disable if not synced atm 2019-10-23 12:20:03 +02:00
50bf6df7fe Room summary: fix some issues with local echo and sending event 2019-10-23 11:55:19 +02:00
02914495ce Merge pull request #632 from vector-im/feature/cleanuo
More cleanup
2019-10-23 10:26:54 +02:00
70a14f6350 Merge pull request #619 from vector-im/feature/attachments
Feature/attachments
2019-10-23 10:09:57 +02:00
cac5fb725a Code cleanup 2019-10-22 18:35:05 +02:00
dbc17ae515 Use AppCompatEditText instead of EditText 2019-10-22 18:23:53 +02:00
1de02c2fbb Ensure android.text.TextUtils will never be used again 2019-10-22 17:41:59 +02:00
6d55c15761 Fix lint issue 2019-10-22 17:41:21 +02:00
377a228f88 Improve code 2019-10-22 17:31:07 +02:00
2974f8b200 Merge branch 'develop' into feature/attachments 2019-10-22 17:27:15 +02:00
7388a408b8 Permissions: allow to provide the rationale message as it requires "context" and cannot be generic 2019-10-22 17:13:38 +02:00
f43dcb1183 Update room summary when saving local echo from DefaultRelationService 2019-10-22 16:54:48 +02:00
492ed3954a code cleanup 2019-10-22 16:54:48 +02:00
7890e83204 Merge pull request #630 from vector-im/feature/crypto_lock
Fix dead lock on crypto
2019-10-22 16:53:33 +02:00
00d1a2c380 Merge pull request #629 from vector-im/feature/fix_malformed_event_bug
Fix / event mapper persist the clear type in type
2019-10-22 14:47:08 +02:00
78dfd6b3e6 Fix potential lock due to nested synchronized(unknownSessionsFailure) 2019-10-22 14:20:43 +02:00
3abce34484 Add in existingRequest only if not filtered 2019-10-22 12:45:36 +02:00
4204ab262c Fix compilation issue 2019-10-22 12:42:01 +02:00
c7a4d34192 Attachments: handle rich content from keyboard 2019-10-22 12:37:59 +02:00
7416fec93e Do not decrypt event if session is unknown 2019-10-22 12:37:17 +02:00
3c40f64fb7 Add a few comments 2019-10-22 12:33:25 +02:00
b57c71b1c9 Remove unused import 2019-10-22 12:27:55 +02:00
fea54952d3 Code quality 2019-10-22 12:26:56 +02:00
3dc5ef54ab Fix compilation warnings 2019-10-22 12:21:50 +02:00
9092b97fb8 Merge pull request #622 from Dominaezzz/kotlinify
Some more clean up
2019-10-22 12:17:25 +02:00
cebd8136da Merge branch 'develop' into kotlinify 2019-10-22 12:16:20 +02:00
64b3568d51 Fix / event mapper persist the clear type in type 2019-10-22 11:57:11 +02:00
5e4e54153c Fix build error.
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-10-21 22:52:58 +01:00
d071324694 Address review comments.
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-10-21 22:29:36 +01:00
2c8cd89533 Handle rich content from app (WIP not compiling) 2019-10-21 19:02:28 +02:00
11b5c2c3ba Restore previous log level 2019-10-21 18:17:03 +02:00
9d7c4abb97 Merge pull request #615 from vector-im/feature/report_content
Add ability to report content
2019-10-21 18:13:44 +02:00
8e3234d188 Clean some code 2019-10-21 18:08:42 +02:00
b253722b98 Disable animation 2019-10-21 17:22:28 +02:00
fce576e3a4 Message action bottom sheet expanded 2019-10-21 17:22:28 +02:00
7ed7b18ccd Remove unused import 2019-10-21 17:22:28 +02:00
053bf7aeac Improve layout preview a bit 2019-10-21 17:22:28 +02:00
6ccd083451 Bottom sheet: fix RecyclerView usage 2019-10-21 17:22:28 +02:00
e39c4a7925 fix ktlint issue 2019-10-21 17:22:28 +02:00
abdb83b9fd Report content: change log 2019-10-21 17:22:28 +02:00
0bcc84cbd6 Try to fix the bottom sheet showing expanded by default #2
Seems ok now
2019-10-21 17:22:00 +02:00
b2f6fb8c91 Try to fix the bottom sheet showing expanded by default.
The second time it's open, it's not expanded... With this fix, the bug appear only at the third time...
2019-10-21 17:22:00 +02:00
36042ed145 Report content: red color for "block user" button 2019-10-21 17:22:00 +02:00
6ad1932fe5 Report content: custom reason 2019-10-21 17:22:00 +02:00
4a6237b50e Report content: confirmation dialogs 2019-10-21 17:22:00 +02:00
a7a19dab11 Report content: Service and REST request 2019-10-21 17:22:00 +02:00
8d0aa0437c Report content: UI menu 2019-10-21 17:21:26 +02:00
0a79b8b315 Cleanup 2019-10-21 17:21:26 +02:00
1dacfa6744 Rework message menu bottom sheet: remove sub Fragment and use Epoxy
- Also move some class to some dedicated package
2019-10-21 17:21:26 +02:00
723a007c39 Merge pull request #626 from vector-im/feature/myUserIdInject
Inject userId where possible
2019-10-21 16:01:48 +02:00
eaa1b04a4a Merge pull request #616 from vector-im/feature/big_font_regression
Fix regression after merge conflict: big font for messages with only big emoji
2019-10-18 15:03:43 +02:00
b1710fde60 Merge pull request #618 from vector-im/feature/mark_all_read
Mark all as read
2019-10-18 15:02:16 +02:00
cd0a40c18d Fix compil test issue 2019-10-18 14:34:44 +02:00
17636019e0 Change order of parameters 2019-10-18 14:32:34 +02:00
8078c39d6e Rename parameter 2019-10-18 14:29:32 +02:00
be94b2f90a Change order of parameters (no effect) 2019-10-18 14:28:12 +02:00
eff04be247 Change order of class (no effect) 2019-10-18 14:26:24 +02:00
3986839801 Inject userId 2019-10-18 14:25:19 +02:00
9e436483de Use klint 2019-10-16 10:39:42 +02:00
05a069be04 Attachments: fix themes for selection view 2019-10-16 10:04:33 +02:00
a1a71e2f1d App state: fix session 2019-10-16 10:04:11 +02:00
203da0f37e Mark all as read: not for all Room list and look if there is unread rooms 2019-10-16 10:03:30 +02:00
6cd04525aa Clean after Benoit's review 2019-10-15 11:37:22 +02:00
3c3c6aeac6 Removes the RoomList handling from a viewmodel as it doesn't have a ViewState and should be provided globally (IE, from application state) 2019-10-15 11:24:20 +02:00
e71311f576 Merge pull request #612 from vector-im/feature/browser_tab
Opening links from RiotX reuses browser tab (#599)
2019-10-15 11:05:06 +02:00
e4d0e0b0bf Update after Ganfra's review 2019-10-15 11:03:30 +02:00
28e5e42ab1 Merge pull request #614 from vector-im/feature/recycler_view_upgrade
Upgrade RecyclerView version to fix issues with a11y.
2019-10-15 10:47:59 +02:00
b860c3b0e3 Merge pull request #623 from Dominaezzz/typos
Fix some typos/errors in documentation.
2019-10-12 21:06:09 +02:00
f7f97e2098 Typos
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-10-12 16:04:47 +01:00
e28e2dadb9 Some more clean up
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-10-12 15:37:20 +01:00
c28be6adb0 Fix code quality check 2019-10-11 17:23:25 +02:00
c57af9cf3e Better formatting 2019-10-11 17:18:54 +02:00
679b0fff98 Use klint and update CHANGES 2019-10-11 17:12:53 +02:00
946fc36a26 Update contributing doc 2019-10-11 17:12:51 +02:00
13a5f784dc Merge branch 'develop' into feature/attachments 2019-10-11 17:05:03 +02:00
0ca8696e88 Attachments/Share: cleaning code and add contact picking 2019-10-11 16:41:04 +02:00
3622c0ecb4 Mark all as read 2019-10-11 16:22:32 +02:00
116d569fa8 Fix regression after merge conflict: big font for messages with only big emoji 2019-10-11 14:35:37 +02:00
ee5ebb4b83 Attachments: get better layout 2019-10-11 12:20:39 +02:00
0a0c344bfb Upgrade RecyclerView version to fix issues with a11y.
Also minor upgrade of some other libs
2019-10-11 10:10:16 +02:00
82fc97f619 Add dictionary specific to the project to VCS 2019-10-11 09:32:43 +02:00
20696353b8 Attachments: try to improve a bit the UI and adding options [WIP] 2019-10-10 19:12:16 +02:00
ae5b6bd2b9 Attachments/Sharing: refact a bit and handle more data. 2019-10-10 16:55:50 +02:00
1e11d4492b Merge pull request #610 from vector-im/feature/warnings
Fix all warnings and ensure they will not come back
2019-10-10 10:37:49 +02:00
6e39164b20 Sharing: start handling incoming share [WIP] 2019-10-09 20:05:37 +02:00
0a9ebb6bf6 Attachments: use a lib which handles for us all the intent stuff. 2019-10-09 19:51:00 +02:00
db009ce683 Fix warning on release build 2019-10-09 16:47:27 +02:00
55c80d3743 ktlint: ignore (experimental:annotation) rule 2019-10-09 16:44:45 +02:00
fbb23dfb66 ktlint: fix (no-empty-first-line-in-method-block) issues 2019-10-09 16:43:12 +02:00
e5779d425a ktlint: fix (experimental:multiline-if-else) issues 2019-10-09 16:40:44 +02:00
99d9704a50 ktlint: enable experimental features 2019-10-09 16:38:23 +02:00
3f8ddbe880 Opening links from RiotX reuses browser tab (#599) 2019-10-09 16:23:35 +02:00
30e43e47cd Fix filename ktlint issues 2019-10-09 15:44:01 +02:00
15dc4d6369 Fix ktlint issue automatically by running ./ktlint --android -v -F 2019-10-09 15:24:05 +02:00
dceb5ffd8d ktlint needs java 2019-10-09 15:19:07 +02:00
eec470f2ce Fix code quality issues 2019-10-09 15:15:15 +02:00
68db9c1cc0 Create a specific step for ktlint 2019-10-09 15:11:21 +02:00
cdfc402599 Fix Timber error in formatting 2019-10-09 15:06:38 +02:00
72d3f1e909 Configure ktlint 2019-10-09 15:06:38 +02:00
255fa11e89 Remove extra spaces 2019-10-09 12:49:00 +02:00
119e4c0d32 Fix warnings in the App 2019-10-09 12:49:00 +02:00
a9c474105a Fix warnings in the SDK 2019-10-09 12:49:00 +02:00
6de64cbedd Treat warnings from the kotlin compiler as errors 2019-10-09 12:49:00 +02:00
546c537e3b Upgrade build tools version from 3.5.0 to 3.5.1 2019-10-09 12:49:00 +02:00
36c5f9af13 Merge pull request #583 from vector-im/feature/invot_notification
Invitation notifications are not dismissed automatically if room is joined from another client (#347)
2019-10-09 12:48:07 +02:00
c2682c7f4b Merge pull request #609 from vector-im/feature/remove_event_bus
Stop sending bus event from SDK to App.
2019-10-09 12:47:06 +02:00
3073470c38 Attachments: start working on new UI (using system file picker) [WIP] 2019-10-08 19:59:09 +02:00
549f749682 Nest the try catch blocks 2019-10-08 14:00:11 +02:00
d4dfb76e80 Change constant value (for application upgrade reason) 2019-10-08 13:57:32 +02:00
e80191b2e0 Use mutableSet 2019-10-08 13:52:26 +02:00
c62c77f14c Stop sending bus event from SDK to App. 2019-10-08 12:00:40 +02:00
d6e5c5a857 Merge pull request #608 from vector-im/feature/a11y_review
Feature/a11y review
2019-10-08 11:16:08 +02:00
50a0660ab6 Invitation notifications are not dismissed automatically if room is joined from another client (#347) 2019-10-08 10:56:47 +02:00
ecdb3c3326 Merge pull request #591 from vector-im/feature/image_orientation
Fix issue with image orientation
2019-10-08 10:53:46 +02:00
2cd1d697fe Cleanup after Gafnra's review 2019-10-08 10:53:21 +02:00
3f9b7813bc Remove undocumented attribute and fix issue with image size when it contains exif rotation 2019-10-08 10:53:21 +02:00
f34f28b668 Add Exif orientation info to ContentAttachmentData 2019-10-08 10:52:54 +02:00
53572a3be6 Fix crash observed on the PlayStore 2019-10-08 10:52:54 +02:00
90b6199e10 Fix compilation issue 2019-10-08 10:45:45 +02:00
0aa299aa37 Private 2019-10-07 19:11:53 +02:00
d387c310c8 Cleanup code after a11y PR (#596) and fix some merging issues 2019-10-07 18:41:44 +02:00
8bd1fb08f7 Update template 2019-10-07 17:18:07 +02:00
ac6aff9175 Merge pull request #596 from pvagner/a11y
more a11y tweaks
2019-10-07 17:15:29 +02:00
adf0382d28 Merge pull request #603 from vector-im/feature/clear_corrupted_realm
Feature/clear corrupted realm
2019-10-07 16:35:23 +02:00
51554f7be0 Merge pull request #595 from vector-im/feature/lib_upgrade
Upgrade some dependencies
2019-10-07 16:22:30 +02:00
c1c1c3f999 Use latest coroutine lib: v1.3.2 2019-10-07 16:22:09 +02:00
8b04fdab77 Upgrade other libraries 2019-10-07 16:22:09 +02:00
f8b665a245 Fix warning 2019-10-07 16:21:18 +02:00
d68a9a5342 Split long line 2019-10-07 16:21:18 +02:00
5d2ff589f8 Upgrade gradle plugins 2019-10-07 16:21:18 +02:00
e85a0783fc Upgrade kotlin version 2019-10-07 16:21:18 +02:00
d6c278288d upgrade google play services plugin 2019-10-07 16:21:18 +02:00
4ad86a13a0 Upgrade the dependencies to the latest version 2019-10-07 16:21:18 +02:00
4f7ec91255 Merge pull request #604 from vector-im/feature/performance
Feature/performance
2019-10-07 16:08:39 +02:00
979b42aa30 Do not delete the crypto DB when deleting the session DB 2019-10-07 16:07:57 +02:00
fc49de080c Clean after benoit's review 2019-10-07 16:00:11 +02:00
d2b9668d4e Inject element where they are used 2019-10-07 15:25:54 +02:00
0632870be1 Merge pull request #605 from vector-im/feature/fixing_crashes
Feature/fixing crashes
2019-10-07 14:51:50 +02:00
8e39fd2a70 Clean after benoit's review 2019-10-07 14:45:58 +02:00
abbc62dd35 Clear corrupted db: add some logs 2019-10-04 19:42:27 +02:00
77de059dc9 Timeline: fix potential issues when starting/disposing the timeline 2019-10-04 19:37:44 +02:00
1931a1a4a4 Sync: use some suspending function where it makes sense 2019-10-04 19:37:23 +02:00
9c5987b682 SAS: fix potential crash 2019-10-04 19:36:22 +02:00
4e4fb4c565 Crypto store: fix potential issue with realm open/close process 2019-10-04 19:36:10 +02:00
0582d0f641 Timeline: fix some crashes 2019-10-04 12:12:39 +02:00
ef2af14529 Realm: remove RealmLiveData and use Optional for LiveData with potential null value 2019-10-03 19:19:53 +02:00
525da17678 Optimization: try to get a more performant reactions display management 2019-10-03 19:15:11 +02:00
aab41d7358 Code quality
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-03 16:34:31 +02:00
5db3c81aa9 Add contentDescription to the jump to botton view
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-02 20:51:57 +02:00
c763635845 Optimize: try to optimize a text message items 2019-10-02 20:36:52 +02:00
11d72b81f6 Add CHANGES.md entry 2019-10-02 20:04:33 +02:00
53543453b3 Login: add contentDescription to password reveal
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-02 20:04:33 +02:00
d4be68191c Fix conflicts after rebase
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-02 20:04:33 +02:00
7ef471ad0d Add contentDescription for the read receipts
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-02 20:04:33 +02:00
73dd735ba6 Reactions: Add content descriptions to emoji chooser category tabs and individual emojis
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-02 20:04:33 +02:00
2f6d3adb17 Message composer: describe the image button for dismissing as cancel rather than close
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-02 20:04:33 +02:00
2edfd4e830 Message composer: add content descriptions to image buttons
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
2019-10-02 20:04:33 +02:00
ff7856c535 Optimize: start removing some constraint layout from timeline 2019-10-02 19:30:01 +02:00
650a151b18 Optimize: remove some epoxy building from main thread 2019-10-01 20:12:15 +02:00
275dd20412 Optimize: don't build OkHttp in Application OnCreate if we don't need it 2019-10-01 20:12:01 +02:00
44f6391cb4 Optimize: use LazyThreeTen 2019-10-01 20:11:15 +02:00
588e5d6e63 Hot fix: fix home navigation issue 2019-10-01 17:39:20 +02:00
716999eec6 Merge pull request #592 from vector-im/feature/read_marker
Feature/read marker
2019-10-01 13:55:09 +02:00
42e0a45f3f Merge branch 'develop' into feature/read_marker 2019-10-01 13:37:21 +02:00
31397869b2 Read marker: refine JumpToReafMarkerView 2019-10-01 12:33:38 +02:00
e842bf13b2 Timeline: fix back pagination state 2019-10-01 12:32:48 +02:00
aea34da81e Merge pull request #593 from vector-im/feature/group_avatar
Group avatar live
2019-10-01 11:45:43 +02:00
0814f53fed Group avatar: clean and optimize a bit. 2019-10-01 11:25:41 +02:00
b5c6c1af0d Realm: allow to clear corrupted session db 2019-09-30 19:09:10 +02:00
de30e7c1c6 Code cleanup 2019-09-26 19:00:38 +02:00
2d95fe921d after login, the icon in the top left is a green 'A' for (all communities) rather than my avatar (#267) - part2 (Toolbar) 2019-09-26 18:42:27 +02:00
84542326f4 HomeDetailFragment observe the selectedGroupStore instead of passing argument 2019-09-26 18:06:24 +02:00
53b1b89c47 after login, the icon in the top left is a green 'A' for (all communities) rather than my avatar (#267) 2019-09-26 17:30:30 +02:00
28315be7b9 Update CHANGES 2019-09-26 17:05:18 +02:00
8605095668 Fix quality code issues 2019-09-26 16:49:41 +02:00
737959f616 Merge branch 'develop' into feature/read_marker 2019-09-26 15:15:34 +02:00
7817f49072 Merge pull request #590 from vector-im/feature/quickfix
Fix my dirty code
2019-09-26 14:50:38 +02:00
a060431aaf Fix my dirty code 2019-09-26 13:51:44 +02:00
a3f561d788 Merge branch 'develop' into feature/read_marker 2019-09-26 12:19:40 +02:00
0ea878af8a Timeline: fix some more issues 2019-09-26 11:55:16 +02:00
99de40c980 Merge pull request #589 from vector-im/feature/media_upload_failure
Fix media upload failure
2019-09-26 11:30:54 +02:00
810a97c639 Import string from Android-SDK (#355) 2019-09-26 11:14:13 +02:00
f02f16d9c5 Use IEC units instead of SI units for file sizes 2019-09-26 10:41:52 +02:00
62b7a83a31 Update after Dominaezzz's review 2019-09-26 10:08:44 +02:00
4a80df082c Timeline: refact [WIP] 2019-09-25 19:14:12 +02:00
60f6b3ef02 Auto review 2019-09-25 17:08:58 +02:00
a0b1ef3216 Do not upload file to big for the homeserver (#587)
Also create a HomeServerCapabilitiesService which provide configuration of the homeserver.
Data are retrieved every 8 hours (as RiotWeb?)
2019-09-25 16:59:50 +02:00
1b66d1f746 Fix bad rendering of file item if the filename is long 2019-09-25 15:25:26 +02:00
643a2baabf Set click and long click listener even if information data are not displayed 2019-09-25 15:03:16 +02:00
cd62e87266 Human readable error 2019-09-25 14:44:34 +02:00
17cba1a432 Display progress in the timeline when uploading file 2019-09-25 14:39:33 +02:00
f077cc8467 Stop sending media in an infinite loop in case of error (part of #587)
Not sure how this commit fix it, but the issue is not observed anymore with it
2019-09-25 14:09:26 +02:00
f3039601bf throw Failure instead of meaning less IOException 2019-09-25 11:27:23 +02:00
4c04014e4d Do not log big data request (ex: file upload) 2019-09-25 11:26:49 +02:00
ae8bceacba Create Extension to convert a Response to a Failure -> expose to other object 2019-09-25 11:26:13 +02:00
9b91b6ea87 Create Extension to convert a Response to a Failure 2019-09-25 10:56:18 +02:00
b24a372262 Show "Clear message queue" option (in debug mode) 2019-09-25 10:50:13 +02:00
63b43de4b8 Read marker: final refact [WIP] 2019-09-24 22:52:43 +02:00
d1a61f29e4 Merge pull request #586 from vector-im/feature/persist_tab
Persist opened tab between session (i.e. after application restart)
2019-09-24 16:12:28 +02:00
f6373221de Dagger cleanup 2019-09-24 16:05:08 +02:00
ec0974f72c Merge branch 'hotfix/dimensionConverter' 2019-09-24 14:28:51 +02:00
b5f2f01c8d Merge branch 'hotfix/dimensionConverter' into develop 2019-09-24 14:28:51 +02:00
21d808c1ce Fix crash: MergedHeaderItem was missing dimensionConverter 2019-09-24 14:28:34 +02:00
1e963bc0dc Fix crash: MergedHeaderItem was missing dimensionConverter 2019-09-24 14:23:13 +02:00
0d80750507 Create interface for UiStateRepository and an implementation with SharedPrefs 2019-09-24 13:43:50 +02:00
1c9cf7a810 Dagger code cleanup 2019-09-24 13:40:03 +02:00
c6d01fbcf4 ReadMarker: extract from ViewModel the jump to read marker visibility logic as it's easier to deal with. 2019-09-24 12:57:32 +02:00
9e1ded941f Persist active tab between sessions (#503) 2019-09-24 12:29:37 +02:00
af433266c8 Move currentDisplayMode to the ViewState 2019-09-24 11:32:55 +02:00
05d09bf950 Merge branch 'develop' into feature/read_marker 2019-09-24 11:10:59 +02:00
6890f83810 Cleanup dead code 2019-09-24 10:47:29 +02:00
51568c30a6 Version++ 2019-09-24 10:23:51 +02:00
cc832633a5 Merge branch 'release/0.6.0' 2019-09-24 10:22:42 +02:00
e019ec6596 Merge branch 'release/0.6.0' into develop 2019-09-24 10:22:42 +02:00
eadea9016b Prepare release 0.6.0 2019-09-24 10:22:36 +02:00
6422d946c9 Merge pull request #584 from vector-im/feature/hasUnread
isEventRead() returns true if the event has been sent by the user
2019-09-24 10:17:52 +02:00
5cc3dc00e3 Merge pull request #581 from vector-im/feature/talk_back
Fix a few accessibility issues
2019-09-24 10:06:28 +02:00
5a2a9f908a isEventRead() returns true if the event has been sent by the user 2019-09-24 10:04:57 +02:00
c1f2e9f171 Fix a few accessibility issues - home menu (best compromise) 2019-09-23 17:48:13 +02:00
f6d34ec7fd Timeline: update state management 2019-09-23 17:43:37 +02:00
620ba279d8 Fix a few accessibility issues 2019-09-23 16:32:54 +02:00
3fcfa33364 Merge pull request #573 from vector-im/feature/notif_invit
Clean up push rules management and fixes several issues
2019-09-23 16:23:35 +02:00
546da0f173 Merge branch 'develop' into feature/notif_invit 2019-09-23 16:23:22 +02:00
001711d5a3 Merge pull request #574 from vector-im/feature/big_emoji
Embiggen messages with multiple emojis also for edited messages
2019-09-23 16:22:53 +02:00
8e1a964679 After Ganfra's review 2019-09-23 15:08:18 +02:00
b25a130db1 Rename DimensionUtils to DimensionConverter, and inject resources instead of context. 2019-09-23 14:39:52 +02:00
8a9e6497e8 Merge pull request #578 from vector-im/feature/fix_focus_login
Fix infinite focus on HS field
2019-09-23 10:05:43 +02:00
47e3797b7e Fix infinite focus on HS field 2019-09-23 09:44:32 +02:00
5cbc90e06a Embiggen messages with multiple emojis also for edited messages (#458)
And daggerize DimensionUtils
2019-09-20 19:22:42 +02:00
b6e18e4a8f Timeline: add badge also when unread without notif 2019-09-20 18:34:58 +02:00
7e29665fd0 Timeline: add some comments and checks 2019-09-20 18:34:31 +02:00
e04bf31faa Fix wrong "no network" banner 2019-09-20 18:18:55 +02:00
d25cf79b07 Cleanup 2019-09-20 17:50:57 +02:00
faa8e6bbb2 m.notice messages trigger push notifications (#238) 2019-09-20 17:50:57 +02:00
d3d4deb884 Rework Action (better kotlin code) 2019-09-20 17:50:57 +02:00
f6b8e0c479 Fix issue: push rules was not retrieved after a clear cache.
We now store push rules from the sync response
2019-09-20 17:50:57 +02:00
2a726f54a2 Remove userId from PushRulesEntity and PusherEntity objects 2019-09-20 17:50:15 +02:00
1197d4021d Fix regression on PushRulesApi 2019-09-20 17:50:15 +02:00
03f8120b7d Create enum for Push rules. Also add some TODOs 2019-09-20 17:50:15 +02:00
acd7a709de Dagger: create @UserId to inject userId 2019-09-20 17:50:15 +02:00
5651ea515b Merge pull request #570 from vector-im/feature/left_group
Handle left group from sync
2019-09-20 17:44:13 +02:00
9794b3a49d Fix compilation issue of F-Droid build 2019-09-20 17:35:10 +02:00
b3e1c3969d Little changes after review 2019-09-20 17:34:50 +02:00
90eeb68d36 Timeline: fix permalink towards an hidden event 2019-09-20 17:22:04 +02:00
d1ff3314a7 Timeline : add badge on jump to bottom view 2019-09-19 19:12:45 +02:00
f24bed17a2 Add missing issue number 2019-09-19 17:56:34 +02:00
a993a30203 Handle left group from sync 2019-09-19 17:08:22 +02:00
ea0809ff87 Merge branch 'develop' into feature/read_marker 2019-09-19 16:57:00 +02:00
9668487b6b Timeline/Read: update read receipt locally to 2019-09-19 16:17:58 +02:00
91cc78d2ad Merge pull request #552 from vector-im/feature/draft
Save draft of a message when exiting a room with non empty composer (#329)
2019-09-19 13:11:35 +02:00
562acc9702 Save Draft only when app goes to background. 2019-09-19 13:09:08 +02:00
dfab88ed95 Display room with draft in the Catchup screen 2019-09-19 13:09:08 +02:00
36866dd24e Save draft of a message when exiting a room with non empty composer (#329) 2019-09-19 13:09:08 +02:00
c728834273 Merge pull request #566 from vector-im/feature/redact_notification
Redact notification
2019-09-19 13:02:17 +02:00
f5020d0f63 Daggerization and cleanup of NotificationUtils 2019-09-19 13:01:00 +02:00
7da9cafcc2 Remove any notification of a redacted event (#563)
Also do some cleanup and kotlinification on the code
2019-09-19 13:01:00 +02:00
6f09eea248 Merge pull request #562 from vector-im/feature/notification_edited
Message Editing: Update notifications (#128)
2019-09-19 12:59:10 +02:00
468bd5bcc9 Message Editing: Update notifications (#128) 2019-09-19 12:57:58 +02:00
3169093c50 Quick fix on the no connection banner displayed when internet is available 2019-09-19 12:55:39 +02:00
d60d766354 Merge pull request #524 from vector-im/feature/indicate_unread_rooms
Add unread indent on room list
2019-09-19 12:50:55 +02:00
0ffb5e627e Cleanup injected constructors 2019-09-19 12:43:39 +02:00
b4a13f9504 Add unread indent on room list 2019-09-19 12:43:39 +02:00
88fb9667a3 Timeline: continue fixing issues + read marker 2019-09-18 20:21:42 +02:00
ffa8b7e73a Better fix 2019-09-18 11:24:29 +02:00
528958b3de Avoid export on env variable 2019-09-18 10:58:03 +02:00
3ffe2f7d40 Fix (again) issue with bad versionCode generated by Buildkite (#553) 2019-09-18 10:29:29 +02:00
3066d5f303 Timeline\ReadMarker: continue fixing issues 2019-09-17 19:38:05 +02:00
bf42b73713 Merge pull request #555 from vector-im/feature/room_search
Cleanup on the room search screen
2019-09-17 15:28:54 +02:00
ed93f4a6c1 Cancel any request properly 2019-09-17 14:55:57 +02:00
b3d649a4d9 Fix characters erased from the Search field when the result are coming (#545) 2019-09-17 14:55:57 +02:00
3739e50d46 Better error message for timeout 2019-09-17 14:55:48 +02:00
9bf484cf1e Create a Failure to handle cancellation, and use it to ignore cancellation on room search 2019-09-17 14:55:48 +02:00
6c2faff1f0 Version++ (0.6.0) 2019-09-17 14:53:50 +02:00
07fca0922b Merge branch 'release/0.5.0' 2019-09-17 14:50:55 +02:00
282de21708 Merge branch 'release/0.5.0' into develop 2019-09-17 14:50:55 +02:00
ba9d119892 Prepare release 0.5.0 2019-09-17 14:50:43 +02:00
4453f0ced9 Merge pull request #560 from vector-im/feature/no_network
Display a "No network" banner when the device has no network
2019-09-17 14:40:42 +02:00
77168bfd6a Merge pull request #558 from vector-im/feature/login_sso
Quick implementation of SSO login - Also handling of magic link
2019-09-17 14:28:04 +02:00
25e9a179d2 SyncThread: Fix issue when network is back and the app was in background: do not restart the thread 2019-09-17 14:26:30 +02:00
73ec0f5a83 NetworkConnectivityChecker: filter onConnected callbacks (several callback if Wifi and LTE is connected)
Also do not use merlinsBeard.isConnected, which return trus even if there is no internet access (ex: with Wifi hotspot)
2019-09-17 14:22:08 +02:00
993fa74252 Cleanup after BillCarsonFr's review 2019-09-17 11:24:37 +02:00
38fc4984fe Display a no network indicator when there is no network: Create a dedicated View 2019-09-17 11:13:00 +02:00
695d8cce00 Display a no network indicator when there is no network (#559) 2019-09-17 10:59:58 +02:00
07e99901e1 SecretStoringUtils -> move to internal package 2019-09-17 10:38:37 +02:00
20f53e9a58 Signout: propose the user to retry in case of error 2019-09-17 10:33:27 +02:00
ced72aff4f Revert change done to save alias for the client 2019-09-17 10:32:09 +02:00
fdaaca49c2 Code quality (bad import) 2019-09-16 19:27:13 +02:00
3485f023b0 All current notifications were dismissed by mistake when the app is launched from the launcher 2019-09-16 19:24:52 +02:00
384dd100e9 Daggerization and Kotlinification of SecretStoringUtils 2019-09-16 19:19:14 +02:00
1ba8a58219 Cleanup SecretStoringUtils, and delete keys when user signs out 2019-09-16 18:29:06 +02:00
69fb7bdf95 Timeline\Read marker: continue fixing potential issues 2019-09-16 18:14:41 +02:00
c8010561fc Rework on sign out task 2019-09-16 17:45:26 +02:00
1f127335bc Daggerization of RealmKeysUtils 2019-09-16 15:50:56 +02:00
138a210a73 Dagger: Screen component now exposes ActiveSessionHolder instead of Session 2019-09-16 14:43:39 +02:00
ca6bcde82d Re add the remove CurlLoggingInterceptor 2019-09-16 14:43:08 +02:00
6bda437f5d Auto configure homeserver and identity server URLs of LoginActivity with a magic link 2019-09-16 10:58:51 +02:00
5d6d0202a9 Timeline: try to fix some issues with permalink [WIP] 2019-09-14 14:11:41 +02:00
3e6b65e174 Handle M_CONSENT_NOT_GIVEN error (#64) 2019-09-13 18:21:56 +02:00
137dcab734 Curl login interceptor now log the AT (on debug mode) 2019-09-13 16:20:19 +02:00
b22b8fba02 Fix the mess up with OnBackPress support on Fragment 2019-09-13 15:55:33 +02:00
3ccdf4a244 Login: some cleanup 2019-09-13 15:35:44 +02:00
5fbd271b1c Login: add SSO support 2019-09-13 15:19:45 +02:00
db8ea0f5e8 Login: check login flow - step 1 2019-09-13 11:08:54 +02:00
a47a3ead1f Login: move login code to the ViewModel 2019-09-13 10:39:22 +02:00
05b2092ffc Login: move existing code to a Fragment, MvRx style 2019-09-13 10:07:55 +02:00
f4ab770be9 Merge branch 'develop' into feature/read_marker 2019-09-12 17:24:50 +02:00
6249a59203 Merge pull request #554 from vector-im/feature/build_number
Fix issue with bad versionCode generated by Buildkite (#553)
2019-09-12 17:24:46 +02:00
d4111d053d Read marker: only show banner until scrolled to read marker 2019-09-12 16:35:45 +02:00
618e9a4f52 Fix issue with bad versionCode generated by Buildkite (#553) 2019-09-12 16:17:44 +02:00
b8ebe3570b Timeline: refact epoxy attributes 2019-09-11 18:04:17 +02:00
f2c8d4ad02 Merge pull request #549 from vector-im/feature/third_party_invite
Fix rendering issue of accepted third party invitation event
2019-09-06 16:36:30 +02:00
be524472ec Merge pull request #546 from vector-im/feature/cleanup
Cleanup
2019-09-06 16:25:08 +02:00
1b82a1a24d Cleanup 2019-09-06 15:52:29 +02:00
cf0b331c3b Handle invite to the current user rendering 2019-09-06 15:48:42 +02:00
2a92a3dc80 Fix rendering issue of accepted third party invitation event 2019-09-06 14:34:52 +02:00
012840abba Progress in initial sync dialog is decreasing for a step and should not (#532) 2019-09-05 18:14:05 +02:00
a5975a099e Cleanup and document DefaultInitialSyncProgressService 2019-09-05 17:23:09 +02:00
38da4b9ee5 Cleanup and document DefaultInitialSyncProgressService 2019-09-05 17:02:03 +02:00
242e60fcaa Rename CryptoManager to DefaultCryptoService 2019-09-05 16:14:34 +02:00
a23be05cbf Better type 2019-09-05 16:04:41 +02:00
ed39b02924 Avoid using keyword for variable names 2019-09-05 16:04:41 +02:00
fe931b5361 Merge pull request #418 from Dominaezzz/kotlinify-1
Some more kotlinification
2019-09-05 16:02:30 +02:00
90d9cd0587 Merge pull request #416 from Dominaezzz/kt-remove_java_util
Remove most usages of the java.util package
2019-09-05 15:33:03 +02:00
9cedb18921 Merge pull request #538 from vector-im/feature/log_mgmt
Reduce release build log level
2019-09-05 15:24:04 +02:00
e89ba7b87b Update wording 2019-09-05 15:23:38 +02:00
902657c22a Merge pull request #537 from vector-im/feature/fix_crash
Fix crash due to missing informationData (#535)
2019-09-02 15:31:28 +02:00
eec2abf164 Reduce release build log level 2019-09-02 14:33:53 +02:00
6879cc8ca8 Fix crash due to missing informationData (#535) 2019-09-02 14:24:36 +02:00
fd6bbbd3b5 Fix issue with version name (Fixes #533) 2019-08-30 15:57:39 +02:00
0ff0b014a9 Version++ (0.5.0) 2019-08-30 15:07:04 +02:00
a89f0ddd1d Merge branch 'release/0.4.0' 2019-08-30 15:04:43 +02:00
fdc9e84dd5 Merge branch 'release/0.4.0' into develop 2019-08-30 15:04:43 +02:00
58f878fca9 Prepare version 0.4.0 2019-08-30 15:04:28 +02:00
88095e4bd9 Add entry in change file 2019-08-30 14:54:15 +02:00
47d22a3d5e Import translation from Riot and MatrixSDK 2019-08-30 11:21:43 +02:00
28e82cb8ea Merge pull request #531 from vector-im/feature/fix_crash_530
Fix / EmojiCompat not initialized
2019-08-29 17:46:51 +02:00
35817245cb refactoring, code review 2019-08-29 17:27:49 +02:00
75266f42bb Fix / EmojiCompat not initialized 2019-08-29 16:49:22 +02:00
95c4c9ce56 Merge pull request #527 from vector-im/feature/privacy
Privacy: remove log of notifiable event (#519)
2019-08-29 12:16:34 +02:00
ce5570105d Privacy: remove log of notifiable event (#519) 2019-08-29 10:36:45 +02:00
188a9aebfa Merge pull request #525 from vector-im/feature/read_receipt_cleanup
Feature/read receipt cleanup
2019-08-29 10:19:06 +02:00
c95223f5d2 Add long click support on unsupported event 2019-08-28 18:17:37 +02:00
ef0362ba9c Display Read Receipt on unsupported events 2019-08-28 17:31:31 +02:00
ea242f6737 Hide ReadReceipt View when it is not relevant 2019-08-28 17:17:37 +02:00
cbc08d834b Merge pull request #522 from vector-im/feature/fix_e2e_reply
Fix / regression on e2e reply and edit of reply
2019-08-28 10:38:22 +02:00
0ab6b33fb6 Merge branch 'develop' into feature/fix_e2e_reply 2019-08-28 10:38:12 +02:00
1b394527b6 cleaning + code review 2019-08-28 10:22:51 +02:00
a8f1388721 Merge pull request #520 from vector-im/feature/read_receipts_511
Improve read receipt design
2019-08-28 10:17:56 +02:00
166be4e289 Improve read receipt design 2019-08-28 09:56:10 +02:00
b49ccefe63 Merge pull request #521 from vector-im/feature/fix_dome_video_wont_play
Some video won't play
2019-08-28 03:43:35 -04:00
825760d17e Fix / regression on e2e reply and edit of reply 2019-08-27 17:05:04 +02:00
b5af62c3ea Some video won't play
VideoView fails to play some remote uri video on some device. For now video is downloaded locally in internal cache then played. This offers basic support before full media preview implementation
2019-08-27 16:50:02 +02:00
a51d96bf00 Merge pull request #325 from vector-im/feature/non_unicode_reaction
Accept non unicode reactions
2019-08-27 08:10:51 -04:00
7e142d201d Use EmojiCompat to build EmojiSpans from text 2019-08-27 11:06:52 +02:00
2be6058971 accept non unicode reactions 2019-08-27 10:58:21 +02:00
49d73f360e Merge pull request #494 from vector-im/feature/fix_441
Fix text diff removed linebreak
2019-08-27 04:36:03 -04:00
bd88d85a21 Merge branch 'develop' into feature/fix_441 2019-08-27 04:35:17 -04:00
be4fc5cce6 Merge pull request #493 from vector-im/feature/fix_358
Date change message repeats for each redaction until a normal message
2019-08-27 04:34:35 -04:00
704da1be55 Merge branch 'develop' into feature/fix_358 2019-08-27 04:34:24 -04:00
5d002532d3 Merge pull request #495 from vector-im/feature/fix_423
Slide-in reply icon is distorted
2019-08-27 04:22:02 -04:00
d4161e9a1a Fix text diff removed linebreak 2019-08-27 10:17:42 +02:00
7966ebef03 Date change message repeats for each redaction until a normal message 2019-08-27 10:16:11 +02:00
ed5faca5d2 Slide-in reply icon is distorted 2019-08-27 10:06:20 +02:00
51a4c93676 Read markers: continue working on ui 2019-08-23 16:54:32 +02:00
d8f449388c Read marker: start working on it (no UI) 2019-08-20 18:30:24 +02:00
8ca829d538 An error was displayed by mistake 2019-08-19 17:22:04 +02:00
e7819ce678 Merge pull request #496 from vector-im/feature/di_clean
Dagger clean
2019-08-19 16:41:50 +02:00
5402902bc2 Merge branch 'develop' into feature/di_clean 2019-08-19 15:04:26 +02:00
bc1350aaf5 Merge pull request #484 from vector-im/feature/timeline_read_receipts
Feature/timeline read receipts
2019-08-19 14:29:59 +02:00
fd74e3dfb1 Read receipts: clean code after review 2019-08-19 14:08:15 +02:00
e0628da1cb Dagger: use AssistedInjectModule for viewModel + use AssistedFactory for room dependencies 2019-08-14 19:09:56 +02:00
aa4e74e986 Merge pull request #487 from vector-im/feature/fix_ui_issues
Feature/fix ui issues
2019-08-14 18:20:08 +02:00
6cc0c0672e Merge pull request #474 from vector-im/feature/dev_suffix
Automatic "-dev" version suffix on non master branch
2019-08-14 18:15:44 +02:00
501474b720 Fix code quality issues 2019-08-14 14:53:40 +02:00
e11c66035c Theme: the action menu text items should use colorAccent 2019-08-14 14:19:21 +02:00
3d2d219d79 Room list: let the fab animation be quicker 2019-08-14 14:18:56 +02:00
63af03bedd List: add overScroll 2019-08-14 14:18:42 +02:00
d3827b8673 Read receipts: branch settings to show/hide them 2019-08-14 10:51:09 +02:00
4ca2531e47 develop branch will have version code from timestamp, to ensure each build from CI has a incremented versionCode
Other branches (master, features, etc.) will have version code based on application version.
2019-08-14 10:45:17 +02:00
4e8dc72439 Update CHANGES 2019-08-13 15:17:04 +02:00
25a4240a5a Merge branch 'develop' into feature/timeline_read_receipts 2019-08-13 15:16:10 +02:00
b9cfda23b6 Read receipts: just juste invisible on hidden avatars, to have a bigger touch zone 2019-08-13 15:06:00 +02:00
06dcf75a32 Read receipts: fix not appearing RR 2019-08-13 12:06:49 +02:00
21deb2551d Read receipts: handle read receipts set on filtered events + let BottomSheet takes a snapshot instead of being live. 2019-08-12 17:59:07 +02:00
70639f180c Read receipts: add read receipts bottom sheet 2019-08-08 19:59:20 +02:00
1dbb02a80d Read receipts: create custom view to use it wherever we want easily 2019-08-08 17:51:06 +02:00
825463d9cd Change package for NotificationAreaView 2019-08-08 17:50:33 +02:00
c313ce78cb Read receipts: sort descending by timestamp 2019-08-08 17:49:50 +02:00
39f58d048b Read receipts: fix dummy being overrided 2019-08-08 17:49:31 +02:00
3f792c7a84 Automatic "-dev" version suffix on non master branch 2019-08-08 16:57:03 +02:00
347dcb469a Version++ 2019-08-08 16:47:13 +02:00
9cd69d1e33 Merge branch 'release/0.3.0' 2019-08-08 16:45:03 +02:00
79fb1985aa Merge branch 'release/0.3.0' into develop 2019-08-08 16:45:02 +02:00
e216cd15a8 Prepare release 0.3.0 2019-08-08 16:44:53 +02:00
37fde374b3 Merge pull request #469 from vector-im/feature/versionCode_auto
Ensure versionCode is the wanted one for GPlay and F-Droid build
2019-08-08 16:32:10 +02:00
f7b471f141 Stop using BuildConfig.VERSION_CODE, it is not the correct value 2019-08-08 16:31:45 +02:00
93fd56a7ca Ensure versionCode is the wanted one for GPlay and F-Droid build 2019-08-08 16:30:44 +02:00
5a9d88e791 Merge pull request #473 from vector-im/feature/sync_room
Feature/sync room
2019-08-08 16:15:26 +02:00
eaf6a9923a Cancel sync request on pause and timeout to 0 after pause (#404) 2019-08-08 16:04:53 +02:00
d98567045c Read receipts: use a simpler strategy when it's initialSync 2019-08-08 15:03:36 +02:00
b4ce8748cb First step in handling read receipts 2019-08-08 14:32:11 +02:00
9d5433a857 Show sync progress also in room detail screen (#403) 2019-08-08 14:14:10 +02:00
6d4ee83e65 Merge pull request #472 from vector-im/feature/vectorPref
Dagger for VectorPreferences and /markdown command as a bonus
2019-08-08 12:43:22 +02:00
6e44cca17d Handle /markdown command 2019-08-08 12:09:05 +02:00
0a73887c70 Daggerization of VectorPreferences 2019-08-08 11:52:50 +02:00
7fef063e15 Merge pull request #468 from vector-im/feature/fix_realm_issues
Feature/fix realm issues
2019-08-07 18:05:06 +02:00
24f391dac0 Merge pull request #467 from vector-im/feature/playstore_crash
Feature/playstore crash
2019-08-07 17:10:49 +02:00
81c7f694d6 Import Strings form Riot 2019-08-07 16:10:50 +02:00
80e2fc0ca3 Merge pull request #466 from vector-im/feature/edit_history_item
Add "View Edit History" item in the message bottom sheet (#401)
2019-08-07 15:08:26 +02:00
9f53406e99 Fix crash (KotlinNullPointerException) observed on PlayStore 2019-08-07 13:35:44 +02:00
3584658c36 Fix crash (IllegalStateException) observed on PlayStore 2019-08-07 13:24:43 +02:00
12a0cbb400 Fix crash observed on PlayStore 2019-08-07 13:16:04 +02:00
20437446b4 Add "View Edit History" item in the message bottom sheet (#401) 2019-08-07 13:05:22 +02:00
35229882e3 Fix (edited) link can be copied to clipboard (#402) 2019-08-07 12:28:21 +02:00
a04f4421f6 Merge pull request #464 from vector-im/feature/splitApk
Split apk
2019-08-07 12:11:13 +02:00
af1e81f65e Remove unused react native lib, and ensure dependencies lib are explicitly declared 2019-08-07 11:53:59 +02:00
63f6081fa5 Split APK: generate one APK per arch, to reduce APK size of about 30% 2019-08-07 11:46:38 +02:00
ee2e575211 Display VersionCode of the app in the settings, because Android system does not display it anymore 2019-08-07 11:44:51 +02:00
0949d29f9c Let TimelineEvent be queried by SendState 2019-08-07 10:54:54 +02:00
23466fb5a4 Merge pull request #463 from vector-im/feature/fix_theme
Fix theme not well defined at runtime after configurationChange
2019-08-07 10:40:33 +02:00
7f09e64d63 Fix timeline forward loader showing when sending events 2019-08-07 09:59:37 +02:00
585f0ba4b7 Add an identifier method on ChunkEntity 2019-08-06 21:32:45 +02:00
245fbe86d9 Get enum safe with realm entities 2019-08-06 21:32:40 +02:00
456908c851 Merge branch 'develop' into kt-remove_java_util 2019-08-06 18:27:39 +01:00
b79fdf6a85 Fix theme not well defined at runtime after configurationChange 2019-08-06 18:55:38 +02:00
d9f448c9aa Merge pull request #459 from vector-im/feature/clenup_after_hol
Review of merged PRs
2019-08-06 18:39:37 +02:00
7a6fc4936b Start chain: create extension 2019-08-06 18:15:15 +02:00
d82fd10f3b Start chain: add missing cases 2019-08-06 18:15:15 +02:00
4009f2c176 Add comment to explain why we use a AlwaysSuccessfulWorker 2019-08-06 18:15:15 +02:00
15c4b03340 Event: do not display sendState in View Source and cleanup the class 2019-08-06 18:14:24 +02:00
7b5dff3dcf Mutualize :? part 2019-08-06 18:14:24 +02:00
357123743f Search firstIndexOf, because server url can contains port (This is what JS does, but Riot Android is also bugged) 2019-08-06 18:14:24 +02:00
bb04af1e2c Remove useless code 2019-08-06 18:14:24 +02:00
2f94fbd7eb Use existing method 2019-08-06 18:14:24 +02:00
f2a3bdb68e Kotlin style 2019-08-06 18:14:24 +02:00
097e9714ff Cleaner code 2019-08-06 18:14:24 +02:00
acae0fad3e Better private method name 2019-08-06 18:14:24 +02:00
4deb7eb865 Javadoc for NoMerger 2019-08-06 18:14:24 +02:00
f910cd6f97 More robust SDK: retry only when on failure 2019-08-06 18:14:24 +02:00
652ac81fa1 simple code 2019-08-06 18:14:24 +02:00
99f4196388 More code cleanup/review 2019-08-06 18:14:24 +02:00
c0b94f4111 Typo 2019-08-06 18:14:24 +02:00
1462fa0484 Simple code 2019-08-06 18:14:24 +02:00
dafdc1d3ad Cleaner API 2019-08-06 18:07:35 +02:00
394b89e76b Avoid duplicated code 2019-08-06 18:07:35 +02:00
0db8e7da43 Format 2019-08-06 18:07:35 +02:00
dae8b5c196 Merge pull request #460 from vector-im/feature/fix_cancellations
Feature/fix cancellations
2019-08-06 18:06:05 +02:00
215324a03e Some kotlinification
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-08-06 11:36:39 +01:00
d3ce4c491c Clean code after review 2019-08-06 11:45:06 +02:00
ed6d28bd3b Merge pull request #417 from Dominaezzz/kt-opt
Some optimisations
2019-08-06 11:42:07 +02:00
c2e053b62b Merge pull request #414 from Dominaezzz/kt-leak
Fix potential resource leak
2019-08-06 11:39:51 +02:00
c450849cc3 Merge pull request #425 from Cadair/patch-1
Fix reply fallback prefix
2019-08-06 11:23:37 +02:00
fe884dba2d Update CHANGES.md and fix code quality 2019-08-05 20:28:50 +02:00
3fa4dbaa25 Make async transaction working with suspend method 2019-08-05 20:17:59 +02:00
4a74f58516 Task: use a builder with DSL and introduce Constraints (only boolean connectedToNetwork at the moment) 2019-08-05 20:17:36 +02:00
c413321a22 Remove unnecessary code and fix signout 2019-08-02 13:15:56 +02:00
d696bd2830 Send worker: let LIMIT_EXCEEDED error to be retry 2019-08-02 11:36:32 +02:00
a2b6bd0f62 Fix network reconnection with sync 2019-08-02 11:35:58 +02:00
9cc922a8a2 Optimize imports 2019-08-02 11:35:27 +02:00
c36d1bcd06 Merge pull request #456 from vector-im/feature/fix_image_transition_overlap
Fix / Shared element transition overlap
2019-08-02 10:18:14 +02:00
85499c6b33 fix for background overlaps 2019-08-02 10:00:33 +02:00
8076eab4b5 Fix / Shared element transition overlap
Shared element was overlapping top system bars
2019-08-02 10:00:33 +02:00
d47c0f5ebc Fix / layout res in debug instead of main 2019-08-02 09:59:59 +02:00
fd09a1224e Remove Try from suspending functions 2019-08-01 17:15:17 +02:00
c300c50093 Merge pull request #449 from vector-im/feature/room_update
Feature/room upgrade
2019-07-31 15:34:38 +02:00
77c4355aed Merge branch 'develop' into feature/room_update 2019-07-31 14:27:12 +02:00
1a92562182 Clean code after review 2019-07-31 14:06:10 +02:00
9c390dcc0c Merge pull request #453 from vector-im/feature/fix_code_quality
Fix code quality issues
2019-07-30 21:54:38 +02:00
95089b91b8 UserAccountData: optimize helper and clean code. 2019-07-30 21:41:29 +02:00
eb446d7b49 Fix code quality issues 2019-07-30 21:20:30 +02:00
dc4786ecf0 Room upgrade: add rx flux and handle failures more precisely 2019-07-30 19:13:09 +02:00
e245023add Merge pull request #444 from vector-im/feature/fail_to_send_msg
Basic Message Failure support + Resend (text only)
2019-07-30 18:31:53 +02:00
90fad23493 Fix reply fallback prefix
Plain text reply fallback should be prefixed with "> " not ">" (as per spec).

Signed-off-by: Stuart Mumford <stuart@cadair.com>
2019-07-30 12:09:29 -04:00
000db4b192 Basic Message Failure support + Resend (text only)
+ clean worker inputs when starting new independent task in unique queue
2019-07-30 17:53:43 +02:00
2a16c36a59 Merge pull request #451 from vector-im/feature/fix_user_account_data_direct
User Account Data: fix sync issues with direct invites
2019-07-30 17:39:12 +02:00
ef6c1cfc63 RoomSummaryUpdater: remove unused params 2019-07-30 17:37:16 +02:00
4b4156996d User Account Data: fix sync issues with direct invites 2019-07-30 17:32:31 +02:00
087cc0e6e3 Merge pull request #448 from danteissaias/develop
Fix #447
2019-07-30 17:07:22 +02:00
f4df27c2dc Merge branch 'develop' into feature/room_update 2019-07-30 15:51:56 +02:00
ab25980c4e Merge pull request #437 from vector-im/feature/create_direct_room
Feature/create direct room
2019-07-30 15:13:30 +02:00
77b402ce70 updates CHANGES.md
Signed-off-by: Dante Issaias <dante.issaias@gmail.com>
2019-07-30 14:01:41 +01:00
2763fbb496 fix #447
Signed-off-by: Dante Issaias <dante.issaias@gmail.com>
2019-07-30 13:57:04 +01:00
6deba31111 Direct room: finally use PagedList as we can get a lot of users in DB. 2019-07-30 14:51:14 +02:00
ff6ce8a4b7 Create direct : remove letter headers when filtering 2019-07-29 19:13:06 +02:00
d0cff219aa Merge pull request #446 from vector-im/feature/remove_identity_default
Remove default identity server as we don't use it.
2019-07-29 18:32:07 +02:00
65f0af918f Remove default identity server as we don't use it. 2019-07-29 18:26:26 +02:00
ac38a6461c Tombstone : handle joining viaserver params 2019-07-26 19:17:12 +02:00
9a1e16a170 Tombstone : add notification area and handle links 2019-07-26 14:51:14 +02:00
9e5c70dda3 Room update: start handling tombstone and room create events [WIP] 2019-07-25 19:34:39 +02:00
0255696c88 Update CHANGES 2019-07-25 16:49:15 +02:00
76a9625f25 Direct chat : finalize flow 2019-07-25 16:34:27 +02:00
5af6bf3762 Direct room: finally handle selection with chips (not as Nad design) 2019-07-25 16:34:27 +02:00
507bc2f622 UserEntity: fix not inserted at all 2019-07-23 21:31:58 +02:00
125eacb20b Direct messages: try to handle selecting/deselecting users (WIP) 2019-07-23 19:53:47 +02:00
6176520805 Merge pull request #407 from vector-im/feature/pending_edits_ux
Feature/pending edits ux
2019-07-22 23:53:26 +02:00
3aea0a50ca Merge branch 'develop' into feature/pending_edits_ux 2019-07-22 23:53:16 +02:00
ab87a3caea Merge pull request #397 from vector-im/feature/animation_image_preview
Better image fullscreen preview animation
2019-07-22 23:37:15 +02:00
c58328f94e cleaning / review 2019-07-22 23:36:19 +02:00
03974c8bdf Create Direct Room : fix loading/error state (WIP) 2019-07-22 19:01:17 +02:00
151ae7f4dd Direct chat: handle user account data 2019-07-22 18:58:55 +02:00
a34b053efe Some optimisations
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-07-21 23:35:38 +01:00
02e342849f Remove most usages of the java.util package
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-07-21 23:23:56 +01:00
b59017938b Fix potential leak
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-07-21 19:11:53 +01:00
2c81e41288 Merge branch 'develop' into feature/create_direct_room 2019-07-19 18:18:22 +02:00
cb44ab547c Create direct room: almost finished, still need to handle showing selected users in search field 2019-07-19 18:12:42 +02:00
6d01a570fd Clear notification for a room left on another client 2019-07-19 16:44:30 +02:00
4a2bf0d6c6 Cleaning Lint 2019-07-19 16:18:47 +02:00
36af8a6a9f Lab / show replace in timeline when show hidden event selected 2019-07-19 16:13:55 +02:00
40a68c3e9f Show pending edits by fading the event body #193
+ Fix issues with edits local echo management in aggregation
2019-07-19 16:13:35 +02:00
1a4ec34bb2 Code cleanup 2019-07-19 16:03:37 +02:00
10490e3aa6 Close detail room screen when the room is left with another client (#256) 2019-07-19 16:00:06 +02:00
cd6624a8a6 Fix issue on setting screen: bad alignment of title 2019-07-19 15:15:29 +02:00
3965218bf9 Cleaning / Review 2019-07-19 12:12:17 +02:00
d78ff7ab08 Fix / can't zoom after rotation 2019-07-19 11:58:24 +02:00
cb274d6a33 Add some cancelable on service methods and start branching Rx 2019-07-19 11:21:16 +02:00
c00dbce536 Fix #390
(edited) string in edited message body
2019-07-19 09:58:53 +02:00
db88caf7fa Better image fullscreen preview animation 2019-07-18 18:53:46 +02:00
c3d945d6bb Version++ 2019-07-18 17:48:56 +02:00
df6080b1da Merge branch 'release/0.2.0' 2019-07-18 17:47:39 +02:00
4c128602b2 Merge branch 'release/0.2.0' into develop 2019-07-18 17:47:39 +02:00
d609c49b31 Prepare release 0.2.0 2019-07-18 17:47:24 +02:00
001603cf9a Create direct room: add filtering and enhance design a bit 2019-07-18 17:42:22 +02:00
d87ee32422 Merge pull request #384 from vector-im/feature/edit_e2e
Feature/edit e2e
2019-07-18 16:44:44 +02:00
f0671b9e73 "Riot X" -> "RiotX" 2019-07-18 14:28:46 +02:00
e218691bf2 Import strings and translation from Riot 2019-07-18 14:25:34 +02:00
9c67036c08 Fix / keyboard won't show when using reply from long tap menu 2019-07-18 12:13:17 +02:00
62657538af Merge pull request #389 from vector-im/feature/cleanup
Do not show invitation in the filtered room list
2019-07-18 12:10:47 +02:00
5438207fba faster animation for quick reply 2019-07-18 12:01:23 +02:00
fe88aaffbd Inject RoomListNameFilter 2019-07-18 11:39:13 +02:00
21ba72e5e7 Do not show invitation in the filtered room list 2019-07-18 11:34:49 +02:00
d48ae967bd Remove dead code 2019-07-18 11:11:42 +02:00
0afde3b021 Rename class member for code clarity 2019-07-18 11:07:09 +02:00
49ae954183 Merge remote-tracking branch 'origin/develop' into develop 2019-07-18 10:58:40 +02:00
64bee91f7a Merge pull request #387 from vector-im/feature/fix_sync_state
Fix sync state progress bar
2019-07-18 10:57:46 +02:00
4341b0d0f5 Merge branch 'develop' into feature/create_direct_room 2019-07-18 09:47:25 +02:00
51fdccb393 cleaning 2019-07-18 09:29:27 +02:00
7e3b300130 Fix sync state progress bar 2019-07-17 19:45:35 +02:00
a98b324c89 Merge pull request #385 from vector-im/feature/invit_notif
Cancel invitation notification when handling the invitation in the application
2019-07-17 18:39:40 +02:00
977721881f Cancel invitation notification when handling the invitation in the application 2019-07-17 18:35:41 +02:00
838003b68a Create direct room: start creating all the required stuff 2019-07-17 18:30:14 +02:00
7d41352918 Fix / edit reply was quoting wrong text
+ e2e reply of edit
2019-07-17 16:46:56 +02:00
077396a832 E2E replies
+ Edit History / support e2e and use original event
2019-07-17 16:20:12 +02:00
32b79bd50e Remove extra space around userId 2019-07-17 15:13:12 +02:00
844f6d16a4 Code quality 2019-07-17 15:05:29 +02:00
fc9ef579ca Merge pull request #381 from vector-im/feature/room_members_perf
Feature/room members perf
2019-07-17 15:01:06 +02:00
77fa5af1b8 Fix compilation issue after merge 2019-07-17 14:58:23 +02:00
2948018453 Clean code after review 2019-07-17 14:56:00 +02:00
90d25ff45e Code cleanup 2019-07-17 14:41:01 +02:00
173452d38c Merge pull request #367 from Dominaezzz/kotlinify-3
Some more kotlinification.
2019-07-17 14:38:16 +02:00
a9f9083745 Merge pull request #374 from vector-im/feature/quick_fix_long_click_link
WIP /  Fix Copying link from a message shouldn't open context menu
2019-07-17 14:37:11 +02:00
22dc2a6790 Fix Copying link from a message shouldn't open context menu 2019-07-17 14:36:47 +02:00
927cd7285d Merge pull request #378 from vector-im/feature/fix_sync_thread_wrong_autostart
Fix / SyncThread was started in background
2019-07-17 14:32:19 +02:00
4d5bdecec6 Merge pull request #382 from vector-im/feature/better_long_tap_menu
Feature/better long tap menu
2019-07-17 14:28:51 +02:00
0be987ac0d Merge branch 'develop' into feature/better_long_tap_menu 2019-07-17 14:28:36 +02:00
4bfaa00be4 Fix / clean bad method name 2019-07-17 14:27:02 +02:00
8e78d8a58d Merge pull request #380 from vector-im/feature/rs_crash_steve
Fix a crash in notificationwhen display name is empty
2019-07-17 14:22:45 +02:00
e3e86c0a41 Merge pull request #383 from vector-im/feature/filter_params
Pass filter to room directory screen or create room screen
2019-07-17 14:20:29 +02:00
8a5fddd952 Merge pull request #379 from vector-im/feature/small_fixes
Fix bad View used for searching in room directory.
2019-07-17 14:19:37 +02:00
208460850e Dagger: activate incremental build 2019-07-17 14:16:20 +02:00
0ddef67cc9 Migrate to rxbinding 3 and fix bad layout for room directory filter (Fixes #349) 2019-07-17 14:16:20 +02:00
896e582a9c Create style VectorSearchView 2019-07-17 14:16:20 +02:00
477920f411 Add some comment 2019-07-17 14:14:02 +02:00
c647648e79 Merge pull request #371 from vector-im/feature/composer_fix_edit_reply
Feature/composer fix edit reply
2019-07-17 14:03:10 +02:00
b654025a3b Fix alignment issue in toolbars 2019-07-17 12:38:35 +02:00
786a7d7560 Rename id 2019-07-17 12:20:11 +02:00
b935b9311e Scroll the list to top after each new filter 2019-07-17 12:18:45 +02:00
8e12f71535 Add top left back button 2019-07-17 12:16:10 +02:00
7eea2ccfb4 Fix infinite opening of room once the room is created 2019-07-17 12:09:09 +02:00
c32ef02a12 Pre fill the room directory filter and and the room name with the already entered string from the user 2019-07-17 12:04:19 +02:00
3651ec4870 Add some doc 2019-07-17 11:58:18 +02:00
87de7bd3e6 fix lint code quality 2019-07-17 11:41:14 +02:00
9494174c33 Swipe to reply in timeline (lab) 2019-07-17 10:54:15 +02:00
b7e0b400fb Timeline : set bigger initial load size 2019-07-16 17:48:32 +02:00
a8f06f609b Use latest retrofit version to properly cancel requests
Fix cancelation requests
2019-07-16 17:46:52 +02:00
d469299f42 RoomMembers: should fix state events issues 2019-07-16 17:46:52 +02:00
9bdea5b325 Change order of actions (and reply on top) 2019-07-16 16:35:57 +02:00
2f01ad99b3 Compact long tap menu 2019-07-16 16:35:36 +02:00
bb3b5788ba Update hint from design 2019-07-16 16:35:10 +02:00
45f7d3e9c4 Kotlin style 2019-07-16 15:59:08 +02:00
0f7a56d005 Use Session.myUserId whereas it's possible 2019-07-16 15:54:00 +02:00
63d2861bc8 Fix / SyncThread was started in background
Upon reception of a push, is the session is instantiated the sync thread was starting to loop
2019-07-16 15:44:08 +02:00
6bbc784c29 Fix crash (from Steve's rageshake) 2019-07-16 15:42:02 +02:00
c6fd625761 code review 2019-07-16 14:56:16 +02:00
d8092abc4e fix / strip reply prefix on history 2019-07-16 14:39:46 +02:00
6effb90361 Fix / edit of reply and edit of edit of reply 2019-07-16 14:39:05 +02:00
42584fc55a Merge pull request #372 from vector-im/feature/room_filtering
Room filtering
2019-07-16 11:41:08 +02:00
30d9ddb3e8 Merge pull request #373 from vector-im/feature/fix_composer_separator_dark
Fix / composer separator color was using a clear theme color
2019-07-15 18:16:06 +02:00
020c32bb1a Fix / composer separator color was using a clear theme color 2019-07-15 17:46:24 +02:00
efd973208f Green close icon 2019-07-15 17:35:51 +02:00
30a6c98c08 Room name in bold 2019-07-15 17:29:37 +02:00
1440080d04 Changes 2019-07-15 17:27:49 +02:00
61bb4c0427 Introduce CreateRoomActivity, a simple container for [CreateRoomFragment] 2019-07-15 17:26:48 +02:00
3c25088243 Filter rooms 2019-07-15 17:26:48 +02:00
fc1c0caea3 Avoid displaying two loaders if there is no elements between them 2019-07-15 17:25:59 +02:00
8901a5e09a Merge pull request #342 from vector-im/feature/edit_history
Feature/edit history
2019-07-15 15:15:45 +02:00
25f1d21bc7 Edit history
Get history from API


cleaning


Updated change log


Missing copyrights


Code review


cleaning
2019-07-15 14:57:12 +02:00
4d2ab9fa31 Merge pull request #344 from vector-im/feature/play_store_crash
Feature/play store crash
2019-07-15 10:49:20 +02:00
0289d2ee87 Simpler code 2019-07-15 10:48:44 +02:00
222201cc64 Fix crash observe on the PlayStore (#341) 2019-07-15 10:48:44 +02:00
b15dea6de3 Merge pull request #338 from vector-im/feature/green_encrypt
Text in green when encrypting
2019-07-15 10:46:44 +02:00
2ba83e456d Merge pull request #343 from vector-im/feature/click_on_redacted_event
Handle click on redacted event
2019-07-15 10:46:06 +02:00
1822fc4fbb Some more kotlinification
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-07-13 15:35:10 +01:00
e6dd1fbfec Use GlobalScope instead of temp scope
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-07-13 15:18:16 +01:00
e2ea76f871 Fix crash reported by PlayStore 2019-07-12 16:48:35 +02:00
9182f2ce4e RoomMembers/User : get a better and faster handling (still need to fix one small issue) 2019-07-12 13:59:37 +02:00
34d14eb304 Fix regression on permalink click 2019-07-12 13:51:37 +02:00
3625c462f0 Click on redacted event 2019-07-12 13:51:37 +02:00
fe69206340 Prepare next release 2019-07-12 11:39:26 +02:00
f9885fd04c Update CHANGES.md 2019-07-12 11:38:55 +02:00
316c8ec27e Merge pull request #265 from vector-im/readme_update_for_beta
README: Update it for the beta launch
2019-07-12 11:36:49 +02:00
41465450d8 Code cleanup 2019-07-12 10:45:08 +02:00
bd009caaf1 Code cleanup 2019-07-12 10:22:58 +02:00
33252c3b65 Green text color during encrypting 2019-07-12 10:16:43 +02:00
10e4d0190f Try to insert users directly to see if perfs are better [WIP] 2019-07-11 18:55:13 +02:00
b77310fe92 Merge pull request #337 from vector-im/feature/debug_suffix
Add ".debug" to the applicationId to be able to install the app along with the prod version
2019-07-11 18:33:43 +02:00
919dec4a56 Add ".debug" to the applicationId to be able to install the app along with the prod version 2019-07-11 17:59:07 +02:00
43b3680774 Prepare next release 2019-07-11 17:44:58 +02:00
bfb5fce809 Update CHANGES.md 2019-07-11 17:43:56 +02:00
1f3731aae7 Merge branch 'master' into develop 2019-07-11 17:42:11 +02:00
52dced43ff Fix version code issue 2019-07-11 16:49:06 +02:00
ff80c3c8d5 Add script to sign the APK. 2019-07-11 16:41:45 +02:00
34e4d27573 Add missing space in pipeline 2019-07-11 16:00:45 +02:00
6522148e63 Merge branch 'release/0.1.0' 2019-07-11 15:54:48 +02:00
252b2ea30a Merge pull request #334 from vector-im/feature/general_perf
Feature/general perf
2019-07-11 15:52:00 +02:00
f493ce44f2 RealmLiveEntity: passes the results and changeSet instead of filtering as it's more efficient 2019-07-11 15:30:01 +02:00
c4c5069ee5 Merge pull request #332 from vector-im/feature/login_warning
Improve login screen
2019-07-11 15:25:11 +02:00
423125b5d9 Merge pull request #333 from vector-im/feature/timeout
Create a TimeOutInterceptor to set specific timeout on some request
2019-07-11 15:24:54 +02:00
9e3d29b7d7 Create a TimeOutInterceptor to set specific timeout on some request: login and sync (Fixes #170) 2019-07-11 15:16:25 +02:00
f65becf7c0 Rework login screen before release 2019-07-11 14:38:30 +02:00
80a61cf6b5 Improve dependency download safe path 2019-07-11 14:03:20 +02:00
77056aff94 Merge pull request #330 from vector-im/feature/edit_emote
Edit emote
2019-07-11 13:34:46 +02:00
65e123d87f Split long lines 2019-07-11 13:32:28 +02:00
d0b145d031 Edit emote 2019-07-11 12:29:02 +02:00
98306e223b Merge pull request #322 from vector-im/feature/clean
Improve reply feature
2019-07-11 11:46:00 +02:00
c9fe1adb77 Add a debug button to test crash of the app 2019-07-11 10:36:59 +02:00
1b95336ad3 EventEntity|TimelineEventEntity : remove UUID as primary key and use auto-incremented Long 2019-07-11 10:25:30 +02:00
f007fb04b8 Timeline: clean listeners 2019-07-11 10:25:30 +02:00
141434e8f8 Try getting things off the main thread 2019-07-11 10:25:30 +02:00
b8669d5ed2 Sync: use a single threaded executor to ensure we have only one sync at a time 2019-07-11 10:23:24 +02:00
7a08a11b19 Fix compilation of test 2019-07-10 18:17:03 +02:00
54b1d18812 Merge remote-tracking branch 'origin/feature/clean' into feature/clean 2019-07-10 18:07:03 +02:00
3aa30e5f15 Fix reply of reply 2019-07-10 18:06:44 +02:00
ddf4a81905 Do not display the banner when keys backup is sending keys 2019-07-10 18:04:27 +02:00
794fd650a4 Mutualize code, and also, when replying to an edited event, use the last text in the reply prefix content 2019-07-10 17:37:22 +02:00
9a57a02996 Cleaner code: add TimelineEvent to special modes 2019-07-10 17:05:32 +02:00
7e8cd07e1e Do not send edition if text is identical 2019-07-10 16:32:44 +02:00
d613abf4b4 i18n edited_suffix 2019-07-10 15:29:52 +02:00
06699eaefc Cleaner code 2019-07-10 14:40:08 +02:00
e5082f662c Fix actually done TODO 2019-07-10 14:19:59 +02:00
c8ab53e39c Video visibility fix 2019-07-10 14:11:49 +02:00
d424a135a9 Merge pull request #324 from vector-im/feature/quick_react_e2e
Quick react on e2e was not displayed
2019-07-10 14:08:46 +02:00
e6409d4c60 Create a common canReact() method 2019-07-10 12:10:55 +02:00
19c7de687e We can react on e2e room text event 2019-07-10 11:51:09 +02:00
1918302297 Reply with formatted content 2019-07-10 11:29:47 +02:00
92e3a02389 Create data class instead of Pair 2019-07-10 10:34:32 +02:00
0a54801fcc Code clarity 2019-07-10 10:16:21 +02:00
228ee52563 Remove extra space in <mx-reply> 2019-07-10 10:07:45 +02:00
e6c74dc1fe Convert a Task to a ConfigurableTask without parameter 2019-07-09 18:41:08 +02:00
fe82ad2002 Format 2019-07-09 18:31:04 +02:00
f66739491a Merge pull request #321 from vector-im/feature/workManager_clean
Fix bug on WorkManager: clean by tag
2019-07-09 18:30:07 +02:00
c5dc9d4a9a Fix test 2019-07-09 18:29:32 +02:00
8f858f8119 Fix / line too long 2019-07-09 18:20:00 +02:00
6e036c24b8 Make the test be runnable 2019-07-09 18:14:58 +02:00
5e832e07cd Code cleanup 2019-07-09 18:04:19 +02:00
e9700e04d8 Move method to JsonCanonicalizer and fix test compilation 2019-07-09 18:04:19 +02:00
c19b1f917f Javadoc 2019-07-09 18:04:19 +02:00
4281b5967a Create object for work constraint 2019-07-09 18:04:19 +02:00
aa743d8469 Ensure we do not cancel Work from other lib or SDK client 2019-07-09 18:04:19 +02:00
a09850b16c Merge pull request #316 from vector-im/feature/initial_sync_progress
Feature/initial sync progress
2019-07-09 17:58:24 +02:00
6cb94dd4d6 Fine tune task weights + more measure 2019-07-09 17:42:53 +02:00
c9931e3ba3 Block interaction on initial sync 2019-07-09 17:36:08 +02:00
fc302c1b5a FIx / crash notification drawer empty nam 2019-07-09 17:35:50 +02:00
34ac987494 Cleanup 2019-07-09 16:36:46 +02:00
24b2387703 Merge pull request #319 from vector-im/feature/code_quality
Feature/code quality
2019-07-09 16:29:44 +02:00
8a0c9ae9b0 Rename PreferencesManager to VectorPreferences for code clarity 2019-07-09 16:29:24 +02:00
a79227424f Convert PreferencesManager file to Kotlin 2019-07-09 16:07:16 +02:00
ffe0b9712c Convert file to Kotlin 2019-07-09 15:50:15 +02:00
d92c090c30 Code quality: HashMap / HashSet 2019-07-09 15:40:49 +02:00
1a4157a663 review 2019-07-09 15:38:44 +02:00
fa81d1a9c7 Fix / revert bad refactor rename 2019-07-09 15:38:44 +02:00
dba4df6836 clean 2019-07-09 15:38:44 +02:00
4aae1f78d8 moved new strings + @StringRes annotation 2019-07-09 15:38:44 +02:00
8159a52bd7 cleaning 2019-07-09 15:38:44 +02:00
95d83db90c WIP 2019-07-09 15:38:44 +02:00
ac5b0af63e Code quality: remove rule for map() 2019-07-09 15:37:20 +02:00
e80473903e Code quality: import static 2019-07-09 15:35:27 +02:00
d08778c674 Code quality: equalTo 2019-07-09 15:33:31 +02:00
0919b9460d Code quality: split long lines 2019-07-09 15:26:32 +02:00
66a018c79e Code quality: trim() 2019-07-09 15:11:20 +02:00
dcd64de4b8 Check sdk modules 2019-07-09 15:07:11 +02:00
a0bd206308 Merge pull request #318 from vector-im/feature/send_state
Fix some bugs on e2e rooms
2019-07-09 15:03:39 +02:00
ba589e7961 Add missing permission request 2019-07-09 15:03:21 +02:00
5dc83d64c1 Fix compilation issue 2019-07-09 15:03:21 +02:00
9a4eb8e9a4 add getFileUrl extension 2019-07-09 15:03:21 +02:00
058e7153a1 Fix bug 2019-07-09 15:03:21 +02:00
d7b2371854 Add long click listener to file items 2019-07-09 15:03:21 +02:00
b0c939866f Download file - typo 2019-07-09 15:03:21 +02:00
a07f8b615e Download file - WIP 2019-07-09 15:03:21 +02:00
12bd85e0a9 Decrypt video file 2019-07-09 15:02:31 +02:00
1b82ed5abb Fix regression 2019-07-09 15:02:31 +02:00
c13ab62187 Fix issue when sending video in encrypted room 2019-07-09 15:02:31 +02:00
ea77686746 Send file: cleanup 2019-07-09 15:02:31 +02:00
8a5612be3d Send file: improve UI feedback 2019-07-09 15:02:31 +02:00
d24ce27903 Add missing call to contentUploadStateTracker.setFailure 2019-07-09 15:02:31 +02:00
2099965508 Avoid returning Result.failure() from appendable worker. 2019-07-09 15:02:31 +02:00
829e8da8dc lastFailureMessage is val, not var 2019-07-09 15:02:31 +02:00
e149ee53de Fix bad mime type for encrypted thumbnail 2019-07-09 15:02:31 +02:00
b73d3b15f8 Merge pull request #317 from vector-im/feature/realm_entity_rework
Feature/realm entity rework
2019-07-09 15:01:05 +02:00
61d7f23870 remove dead code 2019-07-09 15:00:37 +02:00
b5650b2b8f Pagination : avoid breaking timeline when paginating twice from same token (race condition) 2019-07-09 14:44:59 +02:00
8777d13d8b Fix / view source, decrypted source was not correct 2019-07-09 14:22:40 +02:00
d52613d723 Trick / Remove home progress blank paddings 2019-07-09 11:17:36 +02:00
7ce476f858 Merge pull request #313 from vector-im/feature/notif_optim
Improve notification drawer manager: Dagger, throttle, and icon for API 9
2019-07-08 17:44:10 +02:00
dd07f5c2a6 TimelineEvent : update sender data when loading room members and prune event (+ remove RoomSummaryMapper param) 2019-07-08 15:32:24 +02:00
7e6e09bc19 fix / compilation 2019-07-08 15:30:11 +02:00
1d11a163af Notification resolver try to decrypt 2019-07-08 15:08:49 +02:00
57bd103de8 Fix / decrypt room summary latest event 2019-07-08 14:58:49 +02:00
25bc5001f9 RoomSummary / Use encrypted message screen 2019-07-08 14:57:37 +02:00
e4c52484b1 Fix / ensure equals check for encryption result 2019-07-08 14:57:02 +02:00
a30da07fd1 Fix / timeline auto refresh on new session 2019-07-08 14:12:46 +02:00
ee27d3e047 Fix / clear unknown session map before re-request decrypt 2019-07-08 12:49:22 +02:00
7096094224 wip crypto 2019-07-08 12:05:41 +02:00
443fb41d18 Cleanup 2019-07-08 11:21:26 +02:00
94b4351e19 wip async crypto + persist 2019-07-08 11:18:27 +02:00
e90aeff417 ThrottleLast the notification drawer manager 2019-07-08 11:08:23 +02:00
e50dd265d4 merge develop 2019-07-08 10:58:41 +02:00
4521ea14ee Merge branch 'develop' into feature/realm_entity_rework 2019-07-08 10:55:20 +02:00
535b41d818 Rename Debouncer to FirstThrottler 2019-07-08 10:49:32 +02:00
21357a1ec7 private fun 2019-07-08 10:32:38 +02:00
8c872caf78 Inject IconLoader and BitmapLoader 2019-07-08 10:30:45 +02:00
62a81a556e Refresh notification drawer in a background thread. It also fixes the person and room avatar display 2019-07-08 10:26:22 +02:00
568e8c8bc0 Do not load user icon before Android Pie 2019-07-08 10:10:39 +02:00
98a7652403 Put back local echo 2019-07-05 19:13:34 +02:00
78951b9155 Timeline event: handle displayName/avatar [WIP] 2019-07-05 19:07:33 +02:00
8c86a653b2 Merge pull request #309 from vector-im/feature/crypto_cleanup
Rework Crypto using Try
2019-07-05 19:03:59 +02:00
ea0526821e Top left Back does not go to previous Activity anymore (Fixes #275) 2019-07-05 18:44:09 +02:00
c503445092 Branch back relation summaries 2019-07-05 18:38:20 +02:00
205af8b122 Merge pull request #280 from Dominaezzz/kotlinify-1
Enhance CancelableBag
2019-07-05 18:34:28 +02:00
3abb7c8de6 Merge pull request #308 from Dominaezzz/kotlinify-2
Some "Kotlinification"
2019-07-05 18:11:18 +02:00
a40510da3b Merge pull request #310 from vector-im/feature/buildkite_pr
Build every branch which is not master, to be able to build PR from external repository
2019-07-05 18:06:14 +02:00
a6ab4a349d Build every branch which is not master, to be able to build PR from external repository 2019-07-05 18:02:13 +02:00
79a704d240 Timeline : Uncomment liveChunk to make pagination working 2019-07-05 17:27:24 +02:00
e5adf174a8 Fix crash when invalid urls for image 2019-07-05 17:00:57 +02:00
f01e796271 Timeline is back 2019-07-05 17:00:13 +02:00
302d23ba96 Create a realm locker to fast up next Realm.getInstance calls 2019-07-05 16:28:15 +02:00
03050c3f25 Cleanup 2019-07-05 16:11:54 +02:00
cbfd2af74b Start branching TimelineEventEntity 2019-07-05 16:07:12 +02:00
f3fab0dc08 Rename ErrorTypes 2019-07-05 15:52:37 +02:00
4a512d2425 Create enum for errorType and fix a few issues 2019-07-05 15:43:28 +02:00
07f80f43bd Display clear type 2019-07-05 15:15:55 +02:00
87dec337d8 Rework Crypto using Try 2019-07-05 14:41:32 +02:00
b37877746a Introduce TimelineEventEntity to begin with the rework 2019-07-05 14:39:15 +02:00
b0e5612bdc Convert java-esque code to Kotlin
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-07-05 12:32:21 +01:00
25b0cd0e4b Remove some work from UI thread 2019-07-04 19:02:37 +02:00
2800d86a57 Merge pull request #302 from vector-im/feature/invitation
Quick action in invitation and composer input type
2019-07-04 18:47:44 +02:00
01bc0de2c2 Set again input type for composer, lost after merge 2019-07-04 18:43:36 +02:00
857a4c5a26 Quick implementation of accept/reject invitation from notification 2019-07-04 18:14:39 +02:00
063c35380a Fix regression on invitation full screen display 2019-07-04 16:44:37 +02:00
5322251bc0 Fix wording for direct message tab 2019-07-04 15:37:19 +02:00
c21b9df9a5 Fix issue with notification from previous account displayed after logout 2019-07-04 15:23:59 +02:00
f2a52f0253 Merge pull request #297 from vector-im/feature/crypto_stabilization
Safely remove all usage of `!![`
2019-07-04 15:17:26 +02:00
baaf493cb4 Merge pull request #299 from vector-im/feature/dix_concurrent_sync
Fix / Push worker could launch concurrent syncs
2019-07-04 15:10:18 +02:00
6cbd6d3a33 Valere's review 2019-07-04 14:59:29 +02:00
72e5aa981a Merge pull request #298 from vector-im/feature/quote
Fix issue when quoting event in e2e rooms (Fixes #295)
2019-07-04 14:49:53 +02:00
c0f085cdf8 SyncTask now handles by itself the sync token 2019-07-04 14:46:59 +02:00
10bc2297d4 Fix / Push worker could launch concurrent syncs 2019-07-04 14:04:36 +02:00
8fa5e63b07 Fix issue: reply to e2e event does not contain the base message 2019-07-04 12:52:43 +02:00
9d0c50907c Fix issue when quoting event in e2e rooms (Fixes #295) 2019-07-04 12:39:59 +02:00
e5958983d8 Safely remove all usage of !![ 2019-07-04 11:44:09 +02:00
ab23ec3f35 Fix https://github.com/matrix-org/riot-android-rageshakes/issues/5851 (DI) 2019-07-04 10:20:50 +02:00
a79a6443e7 Realm: update realm dependencie 2019-07-03 20:08:27 +02:00
9ff24cbf2a Merge branch 'feature/fix_issues' into develop 2019-07-03 19:46:34 +02:00
2eee25bbc1 Fix / crash not called on UI Thread 2019-07-03 19:36:25 +02:00
2a2431e490 Merge pull request #290 from vector-im/feature/fix_crash_npe_cryptomanager
Fix / Rageshake crashes + cleaning
2019-07-03 18:47:45 +02:00
4041e2e8ca code review 2019-07-03 18:40:42 +02:00
031c4e5746 Crash on loggout
https://github.com/matrix-org/riot-android-rageshakes/issues/5881
2019-07-03 18:40:04 +02:00
b4ea85fc76 Fix / Rageshake crashes + cleaning !!
https://github.com/matrix-org/riot-android-rageshakes/issues/5880
https://github.com/matrix-org/riot-android-rageshakes/issues/5877
https://github.com/matrix-org/riot-android-rageshakes/issues/5873
https://github.com/matrix-org/riot-android-rageshakes/issues/5871
2019-07-03 18:40:04 +02:00
480f14902d Rx: observe on computation by default 2019-07-03 18:28:56 +02:00
20c8e8d922 Change the test to apply Google Service plugin to be able to run sonar 2019-07-03 18:18:07 +02:00
9cdecced57 Merge pull request #291 from vector-im/feature/start_crypto_earlier
Start crypto manager before handling first sync events
2019-07-03 18:05:44 +02:00
60d46538de Merge pull request #292 from vector-im/feature/sonar_fix
Feature sonar fix and convert remaining Java files to Kotlin
2019-07-03 18:03:23 +02:00
223295c2f1 Convert MXUsersDevicesMap to kotlin - Fix issue 2019-07-03 18:01:28 +02:00
f789fb275d Convert MXUsersDevicesMap to kotlin 2019-07-03 17:34:22 +02:00
a7c12aeb93 Start crypto manager before handling first sync events 2019-07-03 17:17:58 +02:00
0ca9a5f68b Convert MXKey to kotlin 2019-07-03 16:45:08 +02:00
842345df9b Merge pull request #284 from vector-im/feature/better_incoming_key_verif_mgmt
Moved incoming key/verif to active session holder
2019-07-03 15:54:15 +02:00
7d5c31c510 Fix Javadoc issues 2019-07-03 15:52:53 +02:00
1ee1c31b9c Fix bugs detected by Sonar 2019-07-03 15:42:35 +02:00
e9eada77f9 Add comment to run sonar analysis and fix compilation issue 2019-07-03 15:42:35 +02:00
93ce0cc5e9 Realm: avoid using monarchy thread for custom work 2019-07-03 14:48:45 +02:00
eefd09d022 Dagger: don't create MatrixCoroutineDispatchers multiple time!! 2019-07-03 14:48:03 +02:00
ef597cc67a RoomSummary: set unreadNotification to 0 by default 2019-07-03 14:47:33 +02:00
5d171e0240 Moved incoming key/verif to active session holder 2019-07-03 12:56:08 +02:00
39070820be Merge pull request #283 from vector-im/feature/check_pushrule_on_sync_only
Check Push rule on sync only + fix bad room name in notif
2019-07-03 12:37:49 +02:00
1fdad38b9d Check Push rule on sync only + fix bad room name in notif 2019-07-03 11:59:45 +02:00
f41c0311fa Fix done TODO 2019-07-03 11:58:50 +02:00
a476ac71da Import translations from Riot 2019-07-03 10:20:07 +02:00
4b971a9e67 README: Fix develop build links 2019-07-03 10:04:35 +02:00
bc2d321a84 Merge branch 'feature/Perf' into develop 2019-07-02 23:07:16 +02:00
9adeab6bae Perf: revert constraintLayout version as it breaks at the moment 2019-07-02 23:06:40 +02:00
0f3a63e366 Enhance CancelableBag
Signed-off-by: Dominic Fischer <dominicfischer7@gmail.com>
2019-07-02 21:46:44 +01:00
d90698fe92 Merge pull request #279 from vector-im/feature/clear_glide_cache
Clear media cache from the settings and clear cache when signing out
2019-07-02 21:56:31 +02:00
af0af6e260 Fix bad background color in dark theme 2019-07-02 21:49:52 +02:00
6e71fb565a Fix bad layout for button when keyboard is opened (Fixes #268) 2019-07-02 21:23:57 +02:00
6c66ab1568 Fix code quality 2019-07-02 21:17:41 +02:00
0d329f0338 Clear media cache from the settings and clear cache when signing out 2019-07-02 20:21:40 +02:00
2f66321c2a RoomSummary: don't fetch last event by default as it takes some time 2019-07-02 19:59:01 +02:00
5b102485bc Perf: timeline should reuse one background looper thread 2019-07-02 19:12:20 +02:00
698fc35704 README: Put back link to #riotx:matrix.org 2019-07-02 18:41:28 +02:00
37199da52f Merge branch 'develop' into feature/Perf 2019-07-02 18:29:59 +02:00
1c69d8e425 README: Update it for the beta launch 2019-07-02 18:06:43 +02:00
11bf00030d Merge branch 'develop' into feature/Perf 2019-07-02 17:00:09 +02:00
9378d30601 Merge branch 'develop' into feature/Perf 2019-07-02 11:25:39 +02:00
41ed4b23d8 Update dependencies (tested ok) 2019-07-02 09:39:45 +02:00
de9a5a3d12 Perf: eventHtmlRenderer is slow to build, get only one instance 2019-07-01 20:19:50 +02:00
19202cfca6 Perf: try to get better 2019-07-01 20:05:48 +02:00
1389 changed files with 41083 additions and 18012 deletions

View File

@ -1,43 +1,68 @@
# Use Docker file from https://hub.docker.com/r/runmymind/docker-android-sdk
# Last docker plugin version can be found here:
# https://github.com/buildkite-plugins/docker-buildkite-plugin/releases
# Build debug version of the RiotX application, from the develop branch and the features branches
# We propagate the environment to the container (sse https://github.com/buildkite-plugins/docker-buildkite-plugin#propagate-environment-optional-boolean)
steps:
- label: "Assemble GPlay Debug version"
- label: "Compile and run Unit tests"
agents:
# We use a medium sized instance instead of the normal small ones because
# gradle build is long
# gradle build can be memory hungry
queue: "medium"
commands:
- "./gradlew clean test --stacktrace"
plugins:
- docker#v3.1.0:
image: "runmymind/docker-android-sdk"
propagate-environment: true
- label: "Compile Android tests"
agents:
# We use a medium sized instance instead of the normal small ones because
# gradle build can be memory hungry
queue: "medium"
commands:
- "./gradlew clean assembleAndroidTest --stacktrace"
plugins:
- docker#v3.1.0:
image: "runmymind/docker-android-sdk"
propagate-environment: true
- label: "Assemble GPlay Debug version"
agents:
# We use a xlarge sized instance instead of the normal small ones because
# gradle build can be memory hungry
queue: "xlarge"
commands:
- "./gradlew clean lintGplayRelease assembleGplayDebug --stacktrace"
artifact_paths:
- "vector/build/outputs/apk/gplay/debug/*.apk"
branches: "develop feature/*"
branches: "!master"
plugins:
- docker#v3.1.0:
image: "runmymind/docker-android-sdk"
propagate-environment: true
- label: "Assemble FDroid Debug version"
agents:
# We use a medium sized instance instead of the normal small ones because
# gradle build is long
queue: "medium"
# We use a xlarge sized instance instead of the normal small ones because
# gradle build can be memory hungry
queue: "xlarge"
commands:
- "./gradlew clean lintFdroidRelease assembleFdroidDebug --stacktrace"
artifact_paths:
- "vector/build/outputs/apk/fdroid/debug/*.apk"
branches: "develop feature/*"
branches: "!master"
plugins:
- docker#v3.1.0:
image: "runmymind/docker-android-sdk"
propagate-environment: true
- label: "Build Google Play unsigned APK"
agents:
# We use a medium sized instance instead of the normal small ones because
# gradle build is long
queue: "medium"
# We use a xlarge sized instance instead of the normal small ones because
# gradle build can be memory hungry
queue: "xlarge"
commands:
- "./gradlew clean assembleGplayRelease --stacktrace"
artifact_paths:
@ -45,9 +70,19 @@ steps:
branches: "master"
plugins:
- docker#v3.1.0:
image: "runmymind/docker-android-sdk"
image: "runmymind/docker-android-sdk"
propagate-environment: true
# Code quality
- label: "Code quality"
command: "./tools/check/check_code_quality.sh"
command:
- "./tools/check/check_code_quality.sh"
- label: "ktlint"
command:
- "curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.34.2/ktlint && chmod a+x ktlint"
- "./ktlint --android --experimental -v"
plugins:
- docker#v3.1.0:
image: "openjdk"

32
.editorconfig Normal file
View File

@ -0,0 +1,32 @@
# For ktlint configuration. Ref: https://ktlint.github.io/
[*.{kt,kts}]
# possible values: number (e.g. 2), "unset" (makes ktlint ignore indentation completely)
indent_size=unset
# true (recommended) / false
insert_final_newline=true
# possible values: number (e.g. 120) (package name, imports & comments are ignored), "off"
# it's automatically set to 100 on `ktlint --android ...` (per Android Kotlin Style Guide)
max_line_length=off
# Comma-separated list of rules to disable (Since 0.34.0)
# Note that rules in any ruleset other than the standard ruleset will need to be prefixed
# by the ruleset identifier.
disabled_rules=no-wildcard-imports,no-multi-spaces,colon-spacing,chain-wrapping,import-ordering,experimental:annotation
# The following (so far identified) rules are kept:
# no-blank-line-before-rbrace
# final-newline
# no-consecutive-blank-lines
# comment-spacing
# filename
# comma-spacing
# paren-spacing
# op-spacing
# string-template
# no-unused-imports
# curly-spacing
# no-semi
# no-empty-class-body
# experimental:multiline-if-else
# experimental:no-empty-first-line-in-method-block

14
.gitignore vendored
View File

@ -1,14 +1,18 @@
*.iml
.gradle
/local.properties
.idea/*
/.idea/*
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
# idea files: exclude everything except dictionnaries
.idea/caches
.idea/codeStyles
.idea/libraries
.idea/*.xml
.DS_Store
/build
/captures
.externalNativeBuild
/tmp
ktlint
.idea/copyright/New_vector.xml
.idea/copyright/profiles_settings.xml

19
.idea/dictionaries/bmarty.xml generated Normal file
View File

@ -0,0 +1,19 @@
<component name="ProjectDictionaryState">
<dictionary name="bmarty">
<words>
<w>backstack</w>
<w>bytearray</w>
<w>ciphertext</w>
<w>decryptor</w>
<w>emoji</w>
<w>emojis</w>
<w>hmac</w>
<w>ktlint</w>
<w>linkified</w>
<w>linkify</w>
<w>megolm</w>
<w>pbkdf</w>
<w>pkcs</w>
</words>
</dictionary>
</component>

View File

@ -1,24 +1,186 @@
Changes in RiotX 0.XX (2019-XX-XX)
Changes in RiotX 0.8.0 (2019-11-19)
===================================================
Features ✨:
- Handle long click on room in the room list (#395)
- Ignore/UnIgnore users, and display list of ignored users (#542, #617)
Improvements 🙌:
- Search reaction by name or keyword in emoji picker
- Handle code tags (#567)
- Support spoiler messages
- Support m.sticker and m.room.join_rules events in timeline
Other changes:
- Markdown set to off by default (#412)
- Accessibility improvements to the attachment file type chooser
Bugfix 🐛:
- Fix issues with some member events rendering (#498)
- Passphrase does not match (Export room keys) (#644)
- Ask for permission to write external storage when uri comes from the keyboard (#658)
- Fix issue with english US/GB translation (#671)
Changes in RiotX 0.7.0 (2019-10-24)
===================================================
Features:
- Contextual action menu for messages in room
- Share elements from other app to RiotX (#58)
- Read marker (#84)
- Add ability to report content (#515)
Improvements:
-
- Persist active tab between sessions (#503)
- Do not upload file too big for the homeserver (#587)
- Attachments: start using system pickers (#52)
- Mark all messages as read (#396)
Other changes:
-
- Accessibility improvements to read receipts in the room timeline and reactions emoji chooser
Bugfix:
-
- Fix issue on upload error in loop (#587)
- Fix opening a permalink: the targeted event is displayed twice (#556)
- Fix opening a permalink paginates all the history up to the last event (#282)
- after login, the icon in the top left is a green 'A' for (all communities) rather than my avatar (#267)
- Picture uploads are unreliable, pictures are shown in wrong aspect ratio on desktop client (#517)
- Invitation notifications are not dismissed automatically if room is joined from another client (#347)
- Opening links from RiotX reuses browser tab (#599)
Translations:
-
Changes in RiotX 0.6.1 (2019-09-24)
===================================================
Bugfix:
- Fix crash: MergedHeaderItem was missing dimensionConverter
Changes in RiotX 0.6.0 (2019-09-24)
===================================================
Features:
- Save draft of a message when exiting a room with non empty composer (#329)
Improvements:
- Add unread indent on room list (#485)
- Message Editing: Update notifications (#128)
- Remove any notification of a redacted event (#563)
Other changes:
- Fix a few accessibility issues
Bugfix:
- Fix characters erased from the Search field when the result are coming (#545)
- "No connection" banner was displayed by mistake
- Leaving community (from another client) has no effect on RiotX (#497)
- Push rules was not retrieved after a clear cache
- m.notice messages trigger push notifications (#238)
- Embiggen messages with multiple emojis also for edited messages (#458)
Build:
-
- Fix (again) issue with bad versionCode generated by Buildkite (#553)
Changes in RiotX 0.5.0 (2019-09-17)
===================================================
Features:
- Implementation of login to homeserver with SSO (#557)
- Handle M_CONSENT_NOT_GIVEN error (#64)
- Auto configure homeserver and identity server URLs of LoginActivity with a magic link
Improvements:
- Reduce default release build log level, and lab option to enable more logs.
- Display a no network indicator when there is no network (#559)
Bugfix:
- Fix crash due to missing informationData (#535)
- Progress in initial sync dialog is decreasing for a step and should not (#532)
- Fix rendering issue of accepted third party invitation event
- All current notifications were dismissed by mistake when the app is launched from the launcher
Build:
- Fix issue with version name (#533)
- Fix issue with bad versionCode generated by Buildkite (#553)
Changes in RiotX 0.4.0 (2019-08-30)
===================================================
Features:
- Display read receipts in timeline (#81)
Improvements:
- Reactions: Reinstate the ability to react with non-unicode keys (#307)
Bugfix:
- Fix text diff linebreak display (#441)
- Date change message repeats for each redaction until a normal message (#358)
- Slide-in reply icon is distorted (#423)
- Regression / e2e replies not encrypted
- Some video won't play
- Privacy: remove log of notifiable event (#519)
- Fix crash with EmojiCompat (#530)
Changes in RiotX 0.3.0 (2019-08-08)
===================================================
Features:
- Create Direct Room flow
- Handle `/markdown` command
Improvements:
- UI for pending edits (#193)
- UX image preview screen transition (#393)
- Basic support for resending failed messages (retry/remove)
- Enable proper cancellation of suspending functions (including db transaction)
- Enhances network connectivity checks in SDK
- Add "View Edit History" item in the message bottom sheet (#401)
- Cancel sync request on pause and timeout to 0 after pause (#404)
Other changes:
- Show sync progress also in room detail screen (#403)
Bugfix:
- Edited message: link confusion when (edited) appears in body (#398)
- Close detail room screen when the room is left with another client (#256)
- Clear notification for a room left on another client
- Fix messages with empty `in_reply_to` not rendering (#447)
- Fix clear cache (#408) and Logout (#205)
- Fix `(edited)` link can be copied to clipboard (#402)
Build:
- Split APK: generate one APK per arch, to reduce APK size of about 30%
Changes in RiotX 0.2.0 (2019-07-18)
===================================================
Features:
- Message Editing: View edit history (#121)
- Rooms filtering (#304)
- Edit in encrypted room
Improvements:
- Handle click on redacted events: view source and create permalink
- Improve long tap menu: reply on top, more compact (#368)
- Quick reply in timeline with swipe gesture (#167)
- Improve edit of replies
- Improve performance on Room Members and Users management (#381)
Other changes:
- migrate from rxbinding 2 to rxbinding 3
Bugfix:
- Fix regression on permalink click
- Fix crash reported by the PlayStore (#341)
- Fix Chat composer separator color in dark/black theme
- Fix bad layout for room directory filter (#349)
- Fix Copying link from a message shouldn't open context menu (#364)
Changes in RiotX 0.1.0 (2019-07-11)
===================================================
First release!
Mode details here: https://medium.com/@RiotChat/introducing-the-riotx-beta-for-android-b17952e8f771
=======================================================
@ -26,24 +188,24 @@ Build:
=======================================================
Changes in RiotX 0.XX (2019-XX-XX)
Changes in RiotX 0.0.0 (2019-XX-XX)
===================================================
Features:
Features:
-
Improvements:
Improvements 🙌:
-
Other changes:
-
Bugfix:
Bugfix 🐛:
-
Translations:
Translations 🗣:
-
Build:
Build 🧱:
-

View File

@ -40,19 +40,45 @@ Please add a line to the top of the file `CHANGES.md` describing your change.
Make sure the following commands execute without any error:
> ./tools/check/check_code_quality.sh
#### Internal tool
> ./gradlew lintGplayRelease
<pre>
./tools/check/check_code_quality.sh
</pre>
#### ktlint
<pre>
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.34.2/ktlint && chmod a+x ktlint
./ktlint --android --experimental -v
</pre>
Note that you can run
<pre>
./ktlint --android --experimental -v -F
</pre>
For ktlint to fix some detected errors for you (you still have to check and commit the fix of course)
#### lint
<pre>
./gradlew lintGplayRelease
./gradlew lintFdroidRelease
</pre>
### Unit tests
Make sure the following commands execute without any error:
> ./gradlew testGplayReleaseUnitTest
<pre>
./gradlew testGplayReleaseUnitTest
</pre>
### Tests
RiotX is currently supported on Android Jelly Bean (API 16+): please test your change on an Android device (or Android emulator) running with API 16. Many issues can happen (including crashes) on older devices.
RiotX is currently supported on Android KitKat (API 19+): please test your change on an Android device (or Android emulator) running with API 19. Many issues can happen (including crashes) on older devices.
Also, if possible, please test your change on a real device. Testing on Android emulator may not be sufficient.
### Internationalisation
@ -60,6 +86,10 @@ Also, if possible, please test your change on a real device. Testing on Android
When adding new string resources, please only add new entries in file `value/strings.xml`. Translations will be added later by the community of translators with a specific tool named [Weblate](https://translate.riot.im/projects/riot-android/).
Do not hesitate to use plurals when appropriate.
### Accessibility
Please consider accessibility as an important point. As a minimum requirement, in layout XML files please use attributes such as `android:contentDescription` and `android:importantForAccessibility`, and test with a screen reader if it's working well. You can add new string resources, dedicated to accessibility, in this case, please prefix theirs id with `a11y_`.
### Layout
When adding or editing layouts, make sure the layout will render correctly if device uses a RTL (Right To Left) language.

View File

@ -1,4 +1,4 @@
[![Buildkite](https://badge.buildkite.com/657d3db27364448d69d54f66c690f7788bc6aa80a7628e37f3.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riotx-android)
[![Buildkite](https://badge.buildkite.com/657d3db27364448d69d54f66c690f7788bc6aa80a7628e37f3.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riotx-android/builds?branch=develop)
[![Weblate](https://translate.riot.im/widgets/riot-android/-/svg-badge.svg)](https://translate.riot.im/engage/riot-android/?utm_source=widget)
[![RiotX Android Matrix room #riot-android:matrix.org](https://img.shields.io/matrix/riotx:matrix.org.svg?label=%23RiotX:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#riotx:matrix.org)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riotx&metric=alert_status)](https://sonarcloud.io/dashboard?id=vector.android.riotx)
@ -7,14 +7,31 @@
# RiotX Android
RiotX is an Android Matrix Client currently in development. The application is not yet available on the PlayStore.
RiotX is an Android Matrix Client currently in beta but in active development.
It's based on a new Matrix SDK, written in Kotlin.
It is a total rewrite of [Riot-Android](https://github.com/vector-im/riot-android) with a new user experience. RiotX will become the official replacement as soon as all features are implemented.
Download nightly build here: [![Buildkite](https://badge.buildkite.com/657d3db27364448d69d54f66c690f7788bc6aa80a7628e37f3.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riotx-android/builds?branch=develop)
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" alt="Get it on Google Play" height="60">](https://play.google.com/store/apps/details?id=im.vector.riotx)
Nightly build: [![Buildkite](https://badge.buildkite.com/657d3db27364448d69d54f66c690f7788bc6aa80a7628e37f3.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riotx-android/builds?branch=develop)
# New Android SDK
RiotX is based on a new Android SDK fully written in Kotlin (like RiotX). In order to make the early development as fast as possible, RiotX and the new SDK currently share the same git repository. We will make separate repos once the API is stable enough.
# Roadmap
The current target is to release an application out of beta with the same level of features (and even more) as Riot.
The roadmap has 3 phases:
- [phase 0](https://github.com/vector-im/riotX-android/labels/phase0): Prototyping / Project setup
- [phase 1](https://github.com/vector-im/riotX-android/labels/phase1): Beta release to the Play Store
- [phase 2](https://github.com/vector-im/riotX-android/labels/phase2): Out of beta
Matrix Room: [![RiotX Android Matrix room #riot-android:matrix.org](https://img.shields.io/matrix/riotx:matrix.org.svg?label=%23RiotX:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#riotx:matrix.org)
## Contributing
Please refer to [CONTRIBUTING.md](https://github.com/vector-im/riotX-android/blob/develop/CONTRIBUTING.md) if you want to contribute the Matrix on Android projects!
Please refer to [CONTRIBUTING.md](https://github.com/vector-im/riotX-android/blob/develop/CONTRIBUTING.md) if you want to contribute on Matrix Android projects!
Come chat with the community in the dedicated Matrix [room](https://matrix.to/#/#riotx:matrix.org).

View File

@ -1,9 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.21'
ext.koin_version = '1.0.2'
// TODO ext.koin_version = '2.0.0-GA'
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
@ -12,11 +10,11 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath "com.airbnb.okreplay:gradle-plugin:1.4.0"
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:4.3.2'
classpath "com.airbnb.okreplay:gradle-plugin:1.5.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1'
classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5'
// NOTE: Do not place your application dependencies here; they belong
@ -26,16 +24,52 @@ buildscript {
allprojects {
repositories {
maven { url "http://dl.bintray.com/piasy/maven" }
maven { url 'https://jitpack.io' }
// For olm library. This has to be declared first, to ensure that Olm library is not downloaded from another repo
maven {
url 'https://jitpack.io'
content {
// Use this repo only for olm library
includeGroupByRegex "org\\.matrix\\.gitlab\\.matrix-org"
// And also for FilePicker
includeGroupByRegex "com\\.github\\.jaiselrahman"
// And monarchy
includeGroupByRegex "com\\.github\\.Zhuinden"
}
}
maven {
url "http://dl.bintray.com/piasy/maven"
content {
includeGroupByRegex "com\\.github\\.piasy"
}
}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
google()
jcenter()
// For Olm SDK
maven {
url 'https://jitpack.io'
url 'https://repo.adobe.com/nexus/content/repositories/public/'
content {
includeGroupByRegex "diff_match_patch"
}
}
}
tasks.withType(JavaCompile).all {
options.compilerArgs += [
'-Adagger.gradle.incremental=enabled'
]
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
// Warnings are potential errors, so stop ignoring them
kotlinOptions.allWarningsAsErrors = true
}
afterEvaluate {
extensions.findByName("kapt")?.arguments {
arg("dagger.gradle.incremental", "enabled")
}
}
}
task clean(type: Delete) {
@ -44,6 +78,10 @@ task clean(type: Delete) {
apply plugin: 'org.sonarqube'
// To run a sonar analysis:
// Run './gradlew sonarqube -Dsonar.login=<REPLACE_WITH_SONAR_KEY>'
// The SONAR_KEY is stored in passbolt
sonarqube {
properties {
property "sonar.projectName", "RiotX-Android"
@ -69,3 +107,23 @@ project(":vector") {
}
}
}
//project(":matrix-sdk-android") {
// sonarqube {
// properties {
// property "sonar.sources", project(":matrix-sdk-android").android.sourceSets.main.java.srcDirs
// // exclude source code from analyses separated by a colon (:)
// // property "sonar.exclusions", "**/*.*"
// }
// }
//}
//
//project(":matrix-sdk-android-rx") {
// sonarqube {
// properties {
// property "sonar.sources", project(":matrix-sdk-android-rx").android.sourceSets.main.java.srcDirs
// // exclude source code from analyses separated by a colon (:)
// // property "sonar.exclusions", "**/*.*"
// }
// }
//}

View File

@ -1,4 +1,4 @@
This document aims to describe how Riot X android displays notifications to the end user. It also clarifies notifications and background settings in the app.
This document aims to describe how RiotX android displays notifications to the end user. It also clarifies notifications and background settings in the app.
# Table of Contents
1. [Prerequisites Knowledge](#prerequisites-knowledge)
@ -50,7 +50,7 @@ By default, this is 0, so the server will return immediately even if the respons
**delay** is a client preference. When the server responds to a sync request, the client waits for `delay`before calling a new sync.
When the Riot X Android app is open (i.e in foreground state), the default timeout is 30 seconds, and delay is 0.
When the RiotX Android app is open (i.e in foreground state), the default timeout is 30 seconds, and delay is 0.
## How does a mobile app receives push notification
@ -86,7 +86,7 @@ This need some disambiguation, because it is the source of common confusion:
In order to send a push to a mobile, App developers need to have a server that will use the FCM APIs, and these APIs requires authentication!
This server is called a **Push Gateway** in the matrix world
That means that Riot X Android, a matrix client created by New Vector, is using a **Push Gateway** with the needed credentials (FCM API secret Key) in order to send push to the New Vector client.
That means that RiotX Android, a matrix client created by New Vector, is using a **Push Gateway** with the needed credentials (FCM API secret Key) in order to send push to the New Vector client.
If you create your own matrix client, you will also need to deploy an instance of a **Push Gateway** with the credentials needed to use FCM for your app.
@ -223,7 +223,7 @@ Upon reception of the FCM push, RiotX will perform a sync call to the Home Serve
* The sync generates additional notifications (e.g an encrypted message where the user is mentioned detected locally)
* The sync takes too long and the process is killed before completion, or network is not reliable and the sync fails.
Riot X implements several strategies in these cases (TODO document)
RiotX implements several strategies in these cases (TODO document)
## FCM Fallback mode

View File

@ -1,6 +1,6 @@
#Tue Mar 19 09:53:05 CET 2019
#Fri Sep 27 10:10:35 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

View File

@ -5,16 +5,15 @@ apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
// Multidex is useful for tests
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
@ -29,17 +28,20 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(":matrix-sdk-android")
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
// Paging
implementation "androidx.paging:paging-runtime-ktx:2.1.0"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

View File

@ -1,42 +0,0 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.rx;
import android.content.Context;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("im.vector.matrix.rx.test", appContext.getPackageName());
}
}

View File

@ -20,6 +20,7 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.reactivex.Observable
import io.reactivex.android.MainThreadDisposable
import io.reactivex.schedulers.Schedulers
private class LiveDataObservable<T>(
private val liveData: LiveData<T>,
@ -56,6 +57,6 @@ private class LiveDataObservable<T>(
}
}
fun <T> LiveData<T>.asObservable(defaultValue: T? = null): Observable<T> {
return LiveDataObservable(this, defaultValue)
}
fun <T> LiveData<T>.asObservable(): Observable<T> {
return LiveDataObservable(this).observeOn(Schedulers.computation())
}

View File

@ -0,0 +1,38 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.rx
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.util.Cancelable
import io.reactivex.CompletableEmitter
internal class MatrixCallbackCompletable<T>(private val completableEmitter: CompletableEmitter) : MatrixCallback<T> {
override fun onSuccess(data: T) {
completableEmitter.onComplete()
}
override fun onFailure(failure: Throwable) {
completableEmitter.tryOnError(failure)
}
}
fun Cancelable.toCompletable(completableEmitter: CompletableEmitter) {
completableEmitter.setCancellable {
this.cancel()
}
}

View File

@ -0,0 +1,38 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.rx
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.util.Cancelable
import io.reactivex.SingleEmitter
internal class MatrixCallbackSingle<T>(private val singleEmitter: SingleEmitter<T>) : MatrixCallback<T> {
override fun onSuccess(data: T) {
singleEmitter.onSuccess(data)
}
override fun onFailure(failure: Throwable) {
singleEmitter.tryOnError(failure)
}
}
fun <T> Cancelable.toSingle(singleEmitter: SingleEmitter<T>) {
singleEmitter.setCancellable {
this.cancel()
}
}

View File

@ -0,0 +1,24 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.rx
import im.vector.matrix.android.api.util.Optional
import io.reactivex.Observable
fun <T : Any> Observable<Optional<T>>.unwrap(): Observable<T> {
return filter { it.hasValue() }.map { it.get() }
}

View File

@ -18,30 +18,62 @@ package im.vector.matrix.rx
import im.vector.matrix.android.api.session.room.Room
import im.vector.matrix.android.api.session.room.model.EventAnnotationsSummary
import im.vector.matrix.android.api.session.room.model.ReadReceipt
import im.vector.matrix.android.api.session.room.model.RoomSummary
import im.vector.matrix.android.api.session.room.notification.RoomNotificationState
import im.vector.matrix.android.api.session.room.send.UserDraft
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
import im.vector.matrix.android.api.util.Optional
import io.reactivex.Observable
import io.reactivex.Single
class RxRoom(private val room: Room) {
fun liveRoomSummary(): Observable<RoomSummary> {
return room.liveRoomSummary.asObservable()
fun liveRoomSummary(): Observable<Optional<RoomSummary>> {
return room.getRoomSummaryLive().asObservable()
}
fun liveRoomMemberIds(): Observable<List<String>> {
return room.getRoomMemberIdsLive().asObservable()
}
fun liveAnnotationSummary(eventId: String): Observable<EventAnnotationsSummary> {
fun liveAnnotationSummary(eventId: String): Observable<Optional<EventAnnotationsSummary>> {
return room.getEventSummaryLive(eventId).asObservable()
}
fun liveTimelineEvent(eventId: String): Observable<TimelineEvent> {
return room.liveTimeLineEvent(eventId).asObservable()
fun liveTimelineEvent(eventId: String): Observable<Optional<TimelineEvent>> {
return room.getTimeLineEventLive(eventId).asObservable()
}
fun liveReadMarker(): Observable<Optional<String>> {
return room.getReadMarkerLive().asObservable()
}
fun liveReadReceipt(): Observable<Optional<String>> {
return room.getMyReadReceiptLive().asObservable()
}
fun loadRoomMembersIfNeeded(): Single<Unit> = Single.create {
room.loadRoomMembersIfNeeded(MatrixCallbackSingle(it)).toSingle(it)
}
fun joinRoom(viaServers: List<String> = emptyList()): Single<Unit> = Single.create {
room.join(viaServers, MatrixCallbackSingle(it)).toSingle(it)
}
fun liveEventReadReceipts(eventId: String): Observable<List<ReadReceipt>> {
return room.getEventReadReceiptsLive(eventId).asObservable()
}
fun liveDrafts(): Observable<List<UserDraft>> {
return room.getDraftsLive().asObservable()
}
fun liveNotificationState(): Observable<RoomNotificationState> {
return room.getLiveRoomNotificationState().asObservable()
}
}
fun Room.rx(): RxRoom {
return RxRoom(this)
}
}

View File

@ -16,13 +16,17 @@
package im.vector.matrix.rx
import androidx.paging.PagedList
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.group.model.GroupSummary
import im.vector.matrix.android.api.session.pushers.Pusher
import im.vector.matrix.android.api.session.room.model.RoomSummary
import im.vector.matrix.android.api.session.room.model.create.CreateRoomParams
import im.vector.matrix.android.api.session.sync.SyncState
import im.vector.matrix.android.api.session.user.model.User
import im.vector.matrix.android.api.util.Optional
import io.reactivex.Observable
import io.reactivex.Single
class RxSession(private val session: Session) {
@ -42,12 +46,37 @@ class RxSession(private val session: Session) {
return session.livePushers().asObservable()
}
fun liveUser(userId: String): Observable<User?> {
return session.observeUser(userId).asObservable(User(userId))
fun liveUser(userId: String): Observable<Optional<User>> {
return session.liveUser(userId).asObservable().distinctUntilChanged()
}
fun liveUsers(): Observable<List<User>> {
return session.liveUsers().asObservable()
}
fun liveIgnoredUsers(): Observable<List<User>> {
return session.liveIgnoredUsers().asObservable()
}
fun livePagedUsers(filter: String? = null): Observable<PagedList<User>> {
return session.livePagedUsers(filter).asObservable()
}
fun createRoom(roomParams: CreateRoomParams): Single<String> = Single.create {
session.createRoom(roomParams, MatrixCallbackSingle(it)).toSingle(it)
}
fun searchUsersDirectory(search: String,
limit: Int,
excludedUserIds: Set<String>): Single<List<User>> = Single.create {
session.searchUsersDirectory(search, limit, excludedUserIds, MatrixCallbackSingle(it)).toSingle(it)
}
fun joinRoom(roomId: String, viaServers: List<String> = emptyList()): Single<Unit> = Single.create {
session.joinRoom(roomId, viaServers, MatrixCallbackSingle(it)).toSingle(it)
}
}
fun Session.rx(): RxSession {
return RxSession(this)
}
}

View File

@ -6,20 +6,14 @@ apply plugin: 'realm-android'
apply plugin: 'okreplay'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.realm:realm-gradle-plugin:5.9.0"
classpath "io.realm:realm-gradle-plugin:5.12.0"
}
}
repositories {
google()
jcenter()
}
androidExtensions {
experimental = true
}
@ -33,6 +27,8 @@ android {
targetSdkVersion 28
versionCode 1
versionName "0.0.1"
// Multidex is useful for tests
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\""
@ -66,6 +62,15 @@ android {
lintOptions {
lintConfig file("lint.xml")
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
static def gitRevision() {
@ -85,49 +90,47 @@ static def gitRevisionDate() {
dependencies {
def arrow_version = "0.8.0"
def support_version = '1.1.0-alpha03'
def arrow_version = "0.8.2"
def moshi_version = '1.8.0'
def lifecycle_version = '2.0.0'
def coroutines_version = "1.0.1"
def markwon_version = '3.0.0'
def daggerVersion = '2.23.1'
def lifecycle_version = '2.1.0'
def coroutines_version = "1.3.2"
def markwon_version = '3.1.0'
def daggerVersion = '2.24'
implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "androidx.appcompat:appcompat:$support_version"
implementation "androidx.recyclerview:recyclerview:$support_version"
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.1.0-beta05"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
// Network
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.novoda:merlin:1.1.6'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-moshi:2.6.2'
implementation 'com.squareup.okhttp3:okhttp:4.2.2'
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
implementation 'com.novoda:merlin:1.2.0'
implementation "com.squareup.moshi:moshi-adapters:$moshi_version"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
implementation "ru.noties.markwon:core:$markwon_version"
// Image
implementation 'androidx.exifinterface:exifinterface:1.0.0'
// Database
implementation 'com.github.Zhuinden:realm-monarchy:0.5.1'
kapt 'dk.ilios:realmfieldnameshelper:1.1.1'
// Work
implementation "androidx.work:work-runtime-ktx:2.1.0-beta01"
implementation "androidx.work:work-runtime-ktx:2.3.0-alpha01"
// FP
implementation "io.arrow-kt:arrow-core:$arrow_version"
implementation "io.arrow-kt:arrow-instances-core:$arrow_version"
implementation "io.arrow-kt:arrow-effects:$arrow_version"
implementation "io.arrow-kt:arrow-effects-instances:$arrow_version"
implementation "io.arrow-kt:arrow-integration-retrofit-adapter:$arrow_version"
// olm lib is now hosted by jitpack: https://jitpack.io/#org.matrix.gitlab.matrix-org/olm
implementation 'org.matrix.gitlab.matrix-org:olm:3.1.2'
@ -135,33 +138,36 @@ dependencies {
// DI
implementation "com.google.dagger:dagger:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
compileOnly 'com.squareup.inject:assisted-inject-annotations-dagger2:0.4.0'
kapt 'com.squareup.inject:assisted-inject-processor-dagger2:0.4.0'
compileOnly 'com.squareup.inject:assisted-inject-annotations-dagger2:0.5.0'
kapt 'com.squareup.inject:assisted-inject-processor-dagger2:0.5.0'
// Logging
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1'
debugImplementation 'com.airbnb.okreplay:okreplay:1.4.0'
releaseImplementation 'com.airbnb.okreplay:noop:1.4.0'
androidTestImplementation 'com.airbnb.okreplay:espresso:1.4.0'
// Bus
implementation 'org.greenrobot:eventbus:3.1.1'
debugImplementation 'com.airbnb.okreplay:okreplay:1.5.0'
releaseImplementation 'com.airbnb.okreplay:noop:1.5.0'
androidTestImplementation 'com.airbnb.okreplay:espresso:1.5.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.0.2'
testImplementation "org.koin:koin-test:$koin_version"
testImplementation 'org.robolectric:robolectric:4.3'
//testImplementation 'org.robolectric:shadows-support-v4:3.0'
testImplementation "io.mockk:mockk:1.8.13.kotlin13"
// Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281
testImplementation 'io.mockk:mockk:1.9.2.kotlin12'
testImplementation 'org.amshove.kluent:kluent-android:1.44'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
androidTestImplementation "org.koin:koin-test:$koin_version"
androidTestImplementation 'androidx.test:core:1.1.0'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'org.amshove.kluent:kluent-android:1.44'
androidTestImplementation "io.mockk:mockk-android:1.8.13.kotlin13"
// Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281
androidTestImplementation 'io.mockk:mockk-android:1.9.2.kotlin12'
androidTestImplementation "androidx.arch.core:core-testing:$lifecycle_version"
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"

View File

@ -17,15 +17,15 @@
package im.vector.matrix.android
import android.content.Context
import androidx.test.InstrumentationRegistry
import androidx.test.core.app.ApplicationProvider
import java.io.File
interface InstrumentedTest {
fun context(): Context {
return InstrumentationRegistry.getTargetContext()
return ApplicationProvider.getApplicationContext()
}
fun cacheDir(): File {
return context().cacheDir
}
}
}

View File

@ -16,10 +16,10 @@
package im.vector.matrix.android;
import androidx.annotation.Nullable;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -29,4 +29,4 @@ class OkReplayRuleChainNoActivity(
return RuleChain.outerRule(PermissionRule(configuration))
.around(RecorderRule(configuration))
}
}
}

View File

@ -19,4 +19,4 @@ package im.vector.matrix.android
import im.vector.matrix.android.internal.util.MatrixCoroutineDispatchers
import kotlinx.coroutines.Dispatchers.Main
internal val testCoroutineDispatchers = MatrixCoroutineDispatchers(Main, Main, Main, Main)
internal val testCoroutineDispatchers = MatrixCoroutineDispatchers(Main, Main, Main, Main, Main)

View File

@ -17,27 +17,19 @@
package im.vector.matrix.android.auth
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.GrantPermissionRule
import androidx.test.runner.AndroidJUnit4
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.OkReplayRuleChainNoActivity
import im.vector.matrix.android.api.auth.Authenticator
import im.vector.matrix.android.internal.auth.AuthModule
import im.vector.matrix.android.internal.di.MatrixModule
import im.vector.matrix.android.internal.di.NetworkModule
import okreplay.*
import org.junit.ClassRule
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.koin.standalone.StandAloneContext.loadKoinModules
import org.koin.standalone.inject
import org.koin.test.KoinTest
@RunWith(AndroidJUnit4::class)
internal class AuthenticatorTest : InstrumentedTest, KoinTest {
internal class AuthenticatorTest : InstrumentedTest {
lateinit var authenticator: Authenticator
lateinit var okReplayInterceptor: OkReplayInterceptor
@ -57,7 +49,6 @@ internal class AuthenticatorTest : InstrumentedTest, KoinTest {
@UiThreadTest
@OkReplay(tape = "auth", mode = TapeMode.READ_WRITE)
fun auth() {
}
companion object {
@ -66,6 +57,4 @@ internal class AuthenticatorTest : InstrumentedTest, KoinTest {
val grantExternalStoragePermissionRule: GrantPermissionRule =
GrantPermissionRule.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
}
}
}

View File

@ -21,7 +21,7 @@ import im.vector.matrix.android.internal.crypto.store.IMXCryptoStore
import im.vector.matrix.android.internal.crypto.store.db.RealmCryptoStore
import im.vector.matrix.android.internal.crypto.store.db.RealmCryptoStoreModule
import io.realm.RealmConfiguration
import java.util.*
import kotlin.random.Random
internal class CryptoStoreHelper {
@ -35,10 +35,10 @@ internal class CryptoStoreHelper {
}
fun createCredential() = Credentials(
userId = "userId_" + Random().nextInt(),
userId = "userId_" + Random.nextInt(),
homeServer = "http://matrix.org",
accessToken = "access_token",
refreshToken = null,
deviceId = "deviceId_sample"
)
}
}

View File

@ -114,4 +114,4 @@ class CryptoStoreTest {
olmAccount1.releaseAccount()
olmAccount2.releaseAccount()
}
}
}

View File

@ -52,7 +52,7 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
@Test
fun realSampleTest() {
assertEquals("""{"algorithms":["m.megolm.v1.aes-sha2","m.olm.v1.curve25519-aes-sha2"],"device_id":"VSCUNFSOUI","keys":{"curve25519:VSCUNFSOUI":"utyOjnhiQ73qNhi9HlN0OgWIowe5gthTS8r0r9TcJ3o","ed25519:VSCUNFSOUI":"qNhEt+Yggaajet0hX/FjTRLfySgs65ldYyomm7PIx6U"},"user_id":"@benoitx:matrix.org"}""",
assertEquals("""{"algorithms":["m.megolm.v1.aes-sha2","m.olm.v1.curve25519-aes-sha2"],"device_id":"VSCUNFSOUI","keys":{"curve25519:VSCUNFSOUI":"utyOjnhiQ73qNhi9HlN0OgWIowe5gthTS8r0r9TcJ3o","ed25519:VSCUNFSOUI":"qNhEt+Yggaajet0hX\/FjTRLfySgs65ldYyomm7PIx6U"},"user_id":"@benoitx:matrix.org"}""",
JsonCanonicalizer.canonicalize("""{"algorithms":["m.megolm.v1.aes-sha2","m.olm.v1.curve25519-aes-sha2"],"device_id":"VSCUNFSOUI","user_id":"@benoitx:matrix.org","keys":{"curve25519:VSCUNFSOUI":"utyOjnhiQ73qNhi9HlN0OgWIowe5gthTS8r0r9TcJ3o","ed25519:VSCUNFSOUI":"qNhEt+Yggaajet0hX/FjTRLfySgs65ldYyomm7PIx6U"}}"""))
}
@ -62,8 +62,6 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
JsonCanonicalizer.canonicalize("{\"a\":\"\\\"\"}"))
}
/* ==========================================================================================
* Test from https://matrix.org/docs/spec/appendices.html#examples
* ========================================================================================== */
@ -74,7 +72,6 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
JsonCanonicalizer.canonicalize("""{}"""))
}
@Test
fun matrixOrg002Test() {
assertEquals("""{"one":1,"two":"Two"}""",
@ -84,7 +81,6 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
}"""))
}
@Test
fun matrixOrg003Test() {
assertEquals("""{"a":"1","b":"2"}""",
@ -94,14 +90,12 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
}"""))
}
@Test
fun matrixOrg004Test() {
assertEquals("""{"a":"1","b":"2"}""",
JsonCanonicalizer.canonicalize("""{"b":"2","a":"1"}"""))
}
@Test
fun matrixOrg005Test() {
assertEquals("""{"auth":{"mxid":"@john.doe:example.com","profile":{"display_name":"John Doe","three_pids":[{"address":"john.doe@example.org","medium":"email"},{"address":"123456789","medium":"msisdn"}]},"success":true}}""",
@ -126,7 +120,6 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
}"""))
}
@Test
fun matrixOrg006Test() {
assertEquals("""{"a":"日本語"}""",
@ -135,7 +128,6 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
}"""))
}
@Test
fun matrixOrg007Test() {
assertEquals("""{"日":1,"本":2}""",
@ -145,7 +137,6 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
}"""))
}
@Test
fun matrixOrg008Test() {
assertEquals("""{"a":"日"}""",
@ -159,4 +150,4 @@ internal class JsonCanonicalizerTest : InstrumentedTest {
"a": null
}"""))
}
}
}

View File

@ -19,11 +19,7 @@ package im.vector.matrix.android.session.room.timeline
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.internal.database.helper.add
import im.vector.matrix.android.internal.database.helper.addAll
import im.vector.matrix.android.internal.database.helper.isUnlinked
import im.vector.matrix.android.internal.database.helper.lastStateIndex
import im.vector.matrix.android.internal.database.helper.merge
import im.vector.matrix.android.internal.database.helper.*
import im.vector.matrix.android.internal.database.model.ChunkEntity
import im.vector.matrix.android.internal.session.room.timeline.PaginationDirection
import im.vector.matrix.android.session.room.timeline.RoomDataHelper.createFakeListOfEvents
@ -39,7 +35,6 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
internal class ChunkEntityTest : InstrumentedTest {
@ -52,14 +47,13 @@ internal class ChunkEntityTest : InstrumentedTest {
monarchy = Monarchy.Builder().setRealmConfiguration(testConfig).build()
}
@Test
fun add_shouldAdd_whenNotAlreadyIncluded() {
monarchy.runTransactionSync { realm ->
val chunk: ChunkEntity = realm.createObject()
val fakeEvent = createFakeMessageEvent()
chunk.add("roomId", fakeEvent, PaginationDirection.FORWARDS)
chunk.events.size shouldEqual 1
chunk.timelineEvents.size shouldEqual 1
}
}
@ -70,7 +64,7 @@ internal class ChunkEntityTest : InstrumentedTest {
val fakeEvent = createFakeMessageEvent()
chunk.add("roomId", fakeEvent, PaginationDirection.FORWARDS)
chunk.add("roomId", fakeEvent, PaginationDirection.FORWARDS)
chunk.events.size shouldEqual 1
chunk.timelineEvents.size shouldEqual 1
}
}
@ -126,7 +120,7 @@ internal class ChunkEntityTest : InstrumentedTest {
chunk1.addAll("roomId", createFakeListOfEvents(30), PaginationDirection.BACKWARDS)
chunk2.addAll("roomId", createFakeListOfEvents(30), PaginationDirection.BACKWARDS)
chunk1.merge("roomId", chunk2, PaginationDirection.BACKWARDS)
chunk1.events.size shouldEqual 60
chunk1.timelineEvents.size shouldEqual 60
}
}
@ -142,7 +136,7 @@ internal class ChunkEntityTest : InstrumentedTest {
chunk1.addAll("roomId", eventsForChunk1, PaginationDirection.FORWARDS)
chunk2.addAll("roomId", eventsForChunk2, PaginationDirection.BACKWARDS)
chunk1.merge("roomId", chunk2, PaginationDirection.BACKWARDS)
chunk1.events.size shouldEqual 40
chunk1.timelineEvents.size shouldEqual 40
chunk1.isLastForward.shouldBeTrue()
}
}
@ -198,5 +192,4 @@ internal class ChunkEntityTest : InstrumentedTest {
chunk1.nextToken shouldEqual nextToken
}
}
}
}

View File

@ -16,7 +16,6 @@
package im.vector.matrix.android.session.room.timeline
import arrow.core.Try
import im.vector.matrix.android.internal.session.room.timeline.GetContextOfEventTask
import im.vector.matrix.android.internal.session.room.timeline.PaginationDirection
import im.vector.matrix.android.internal.session.room.timeline.TokenChunkEventPersistor
@ -24,7 +23,7 @@ import kotlin.random.Random
internal class FakeGetContextOfEventTask constructor(private val tokenChunkEventPersistor: TokenChunkEventPersistor) : GetContextOfEventTask {
override suspend fun execute(params: GetContextOfEventTask.Params): Try<TokenChunkEventPersistor.Result> {
override suspend fun execute(params: GetContextOfEventTask.Params): TokenChunkEventPersistor.Result {
val fakeEvents = RoomDataHelper.createFakeListOfEvents(30)
val tokenChunkEvent = FakeTokenChunkEvent(
Random.nextLong(System.currentTimeMillis()).toString(),
@ -33,6 +32,4 @@ internal class FakeGetContextOfEventTask constructor(private val tokenChunkEvent
)
return tokenChunkEventPersistor.insertInDb(tokenChunkEvent, params.roomId, PaginationDirection.BACKWARDS)
}
}
}

View File

@ -16,7 +16,6 @@
package im.vector.matrix.android.session.room.timeline
import arrow.core.Try
import im.vector.matrix.android.internal.session.room.timeline.PaginationTask
import im.vector.matrix.android.internal.session.room.timeline.TokenChunkEventPersistor
import javax.inject.Inject
@ -24,11 +23,9 @@ import kotlin.random.Random
internal class FakePaginationTask @Inject constructor(private val tokenChunkEventPersistor: TokenChunkEventPersistor) : PaginationTask {
override suspend fun execute(params: PaginationTask.Params): Try<TokenChunkEventPersistor.Result> {
override suspend fun execute(params: PaginationTask.Params): TokenChunkEventPersistor.Result {
val fakeEvents = RoomDataHelper.createFakeListOfEvents(30)
val tokenChunkEvent = FakeTokenChunkEvent(params.from, Random.nextLong(System.currentTimeMillis()).toString(), fakeEvents)
return tokenChunkEventPersistor.insertInDb(tokenChunkEvent, params.roomId, params.direction)
}
}

View File

@ -23,4 +23,4 @@ internal data class FakeTokenChunkEvent(override val start: String?,
override val end: String?,
override val events: List<Event> = emptyList(),
override val stateEvents: List<Event> = emptyList()
) : TokenChunkEvent
) : TokenChunkEvent

View File

@ -88,6 +88,4 @@ object RoomDataHelper {
roomEntity.addOrUpdate(chunkEntity)
}
}
}
}

View File

@ -18,25 +18,6 @@ package im.vector.matrix.android.session.room.timeline
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.api.session.crypto.CryptoService
import im.vector.matrix.android.api.session.room.timeline.Timeline
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
import im.vector.matrix.android.internal.crypto.CryptoManager
import im.vector.matrix.android.internal.database.model.SessionRealmModule
import im.vector.matrix.android.internal.session.room.EventRelationExtractor
import im.vector.matrix.android.internal.session.room.membership.SenderRoomMemberExtractor
import im.vector.matrix.android.internal.session.room.timeline.DefaultTimeline
import im.vector.matrix.android.internal.session.room.timeline.TimelineEventFactory
import im.vector.matrix.android.internal.session.room.timeline.TokenChunkEventPersistor
import im.vector.matrix.android.internal.task.TaskExecutor
import im.vector.matrix.android.testCoroutineDispatchers
import io.realm.Realm
import io.realm.RealmConfiguration
import org.amshove.kluent.shouldEqual
import org.junit.Before
import org.junit.Test
import timber.log.Timber
import java.util.concurrent.CountDownLatch
internal class TimelineTest : InstrumentedTest {
@ -100,6 +81,4 @@ internal class TimelineTest : InstrumentedTest {
// timelineEvents.size shouldEqual initialLoad + paginationCount
// timeline.dispose()
// }
}
}

View File

@ -22,6 +22,7 @@ import okhttp3.Interceptor
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import okio.Buffer
import timber.log.Timber
import java.io.IOException
import java.nio.charset.Charset
import javax.inject.Inject
@ -51,27 +52,33 @@ internal class CurlLoggingInterceptor @Inject constructor(private val logger: Ht
var compressed = false
var curlCmd = "curl"
if (curlOptions != null) {
curlCmd += " " + curlOptions!!
curlOptions?.let {
curlCmd += " $it"
}
curlCmd += " -X " + request.method()
curlCmd += " -X " + request.method
val requestBody = request.body()
val requestBody = request.body
if (requestBody != null) {
val buffer = Buffer()
requestBody.writeTo(buffer)
var charset: Charset? = UTF8
val contentType = requestBody.contentType()
if (contentType != null) {
charset = contentType.charset(UTF8)
if (requestBody.contentLength() > 100_000) {
Timber.w("Unable to log curl command data, size is too big (${requestBody.contentLength()})")
// Ensure the curl command will failed
curlCmd += "DATA IS TOO BIG"
} else {
val buffer = Buffer()
requestBody.writeTo(buffer)
var charset: Charset? = UTF8
val contentType = requestBody.contentType()
if (contentType != null) {
charset = contentType.charset(UTF8)
}
// try to keep to a single line and use a subshell to preserve any line breaks
curlCmd += " --data $'" + buffer.readString(charset!!).replace("\n", "\\n") + "'"
}
// try to keep to a single line and use a subshell to preserve any line breaks
curlCmd += " --data $'" + buffer.readString(charset!!).replace("\n", "\\n") + "'"
}
val headers = request.headers()
val headers = request.headers
var i = 0
val count = headers.size()
val count = headers.size
while (i < count) {
val name = headers.name(i)
val value = headers.value(i)
@ -82,7 +89,7 @@ internal class CurlLoggingInterceptor @Inject constructor(private val logger: Ht
i++
}
curlCmd += ((if (compressed) " --compressed " else " ") + "'" + request.url().toString()
curlCmd += ((if (compressed) " --compressed " else " ") + "'" + request.url.toString()
// Replace localhost for emulator by localhost for shell
.replace("://10.0.2.2:8080/".toRegex(), "://127.0.0.1:8080/")
+ "'")
@ -90,7 +97,7 @@ internal class CurlLoggingInterceptor @Inject constructor(private val logger: Ht
// Add Json formatting
curlCmd += " | python -m json.tool"
logger.log("--- cURL (" + request.url() + ")")
logger.log("--- cURL (" + request.url + ")")
logger.log(curlCmd)
return chain.proceed(request)

View File

@ -51,7 +51,6 @@ class FormattedJsonHttpLogger : HttpLoggingInterceptor.Logger {
// Finally this is not a JSON string...
Timber.e(e)
}
} else if (message.startsWith("[")) {
// JSON Array detected
try {
@ -61,7 +60,6 @@ class FormattedJsonHttpLogger : HttpLoggingInterceptor.Logger {
// Finally not JSON...
Timber.e(e)
}
}
// Else not a json string to log
}
@ -73,4 +71,4 @@ class FormattedJsonHttpLogger : HttpLoggingInterceptor.Logger {
Timber.v(s)
}
}
}
}

View File

@ -38,7 +38,6 @@ data class MatrixConfiguration(
interface Provider {
fun providesMatrixConfiguration(): MatrixConfiguration
}
}
/**
@ -87,7 +86,8 @@ class Matrix private constructor(context: Context, matrixConfiguration: MatrixCo
val matrixConfiguration = (appContext as MatrixConfiguration.Provider).providesMatrixConfiguration()
instance = Matrix(appContext, matrixConfiguration)
} else {
throw IllegalStateException("Matrix is not initialized properly. You should call Matrix.initialize or let your application implements MatrixConfiguration.Provider.")
throw IllegalStateException("Matrix is not initialized properly." +
" You should call Matrix.initialize or let your application implements MatrixConfiguration.Provider.")
}
}
return instance
@ -97,5 +97,4 @@ class Matrix private constructor(context: Context, matrixConfiguration: MatrixCo
return BuildConfig.VERSION_NAME + " (" + BuildConfig.GIT_SDK_REVISION + ")"
}
}
}

View File

@ -27,7 +27,7 @@ interface MatrixCallback<in T> {
* @param data the data successfully returned from the async function
*/
fun onSuccess(data: T) {
//no-op
// no-op
}
/**
@ -35,7 +35,6 @@ interface MatrixCallback<in T> {
* @param failure the failure data returned from the async function
*/
fun onFailure(failure: Throwable) {
//no-op
// no-op
}
}
}

View File

@ -16,8 +16,6 @@
package im.vector.matrix.android.api
import java.util.regex.Pattern
/**
* This class contains pattern to match the different Matrix ids
*/
@ -29,31 +27,31 @@ object MatrixPatterns {
// regex pattern to find matrix user ids in a string.
// See https://matrix.org/speculator/spec/HEAD/appendices.html#historical-user-ids
private const val MATRIX_USER_IDENTIFIER_REGEX = "@[A-Z0-9\\x21-\\x39\\x3B-\\x7F]+$DOMAIN_REGEX"
private val PATTERN_CONTAIN_MATRIX_USER_IDENTIFIER = Pattern.compile(MATRIX_USER_IDENTIFIER_REGEX, Pattern.CASE_INSENSITIVE)
val PATTERN_CONTAIN_MATRIX_USER_IDENTIFIER = MATRIX_USER_IDENTIFIER_REGEX.toRegex(RegexOption.IGNORE_CASE)
// regex pattern to find room ids in a string.
private const val MATRIX_ROOM_IDENTIFIER_REGEX = "![A-Z0-9]+$DOMAIN_REGEX"
private val PATTERN_CONTAIN_MATRIX_ROOM_IDENTIFIER = Pattern.compile(MATRIX_ROOM_IDENTIFIER_REGEX, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_MATRIX_ROOM_IDENTIFIER = MATRIX_ROOM_IDENTIFIER_REGEX.toRegex(RegexOption.IGNORE_CASE)
// regex pattern to find room aliases in a string.
private const val MATRIX_ROOM_ALIAS_REGEX = "#[A-Z0-9._%#@=+-]+$DOMAIN_REGEX"
private val PATTERN_CONTAIN_MATRIX_ALIAS = Pattern.compile(MATRIX_ROOM_ALIAS_REGEX, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_MATRIX_ALIAS = MATRIX_ROOM_ALIAS_REGEX.toRegex(RegexOption.IGNORE_CASE)
// regex pattern to find message ids in a string.
private const val MATRIX_EVENT_IDENTIFIER_REGEX = "\\$[A-Z0-9]+$DOMAIN_REGEX"
private val PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER = Pattern.compile(MATRIX_EVENT_IDENTIFIER_REGEX, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER = MATRIX_EVENT_IDENTIFIER_REGEX.toRegex(RegexOption.IGNORE_CASE)
// regex pattern to find message ids in a string.
private const val MATRIX_EVENT_IDENTIFIER_V3_REGEX = "\\$[A-Z0-9/+]+"
private val PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V3 = Pattern.compile(MATRIX_EVENT_IDENTIFIER_V3_REGEX, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V3 = MATRIX_EVENT_IDENTIFIER_V3_REGEX.toRegex(RegexOption.IGNORE_CASE)
// Ref: https://matrix.org/docs/spec/rooms/v4#event-ids
private const val MATRIX_EVENT_IDENTIFIER_V4_REGEX = "\\$[A-Z0-9\\-_]+"
private val PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V4 = Pattern.compile(MATRIX_EVENT_IDENTIFIER_V4_REGEX, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V4 = MATRIX_EVENT_IDENTIFIER_V4_REGEX.toRegex(RegexOption.IGNORE_CASE)
// regex pattern to find group ids in a string.
private const val MATRIX_GROUP_IDENTIFIER_REGEX = "\\+[A-Z0-9=_\\-./]+$DOMAIN_REGEX"
private val PATTERN_CONTAIN_MATRIX_GROUP_IDENTIFIER = Pattern.compile(MATRIX_GROUP_IDENTIFIER_REGEX, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_MATRIX_GROUP_IDENTIFIER = MATRIX_GROUP_IDENTIFIER_REGEX.toRegex(RegexOption.IGNORE_CASE)
// regex pattern to find permalink with message id.
// Android does not support in URL so extract it.
@ -62,16 +60,16 @@ object MatrixPatterns {
const val SEP_REGEX = "/"
private const val LINK_TO_ROOM_ID_REGEXP = PERMALINK_BASE_REGEX + MATRIX_ROOM_IDENTIFIER_REGEX + SEP_REGEX + MATRIX_EVENT_IDENTIFIER_REGEX
private val PATTERN_CONTAIN_MATRIX_TO_PERMALINK_ROOM_ID = Pattern.compile(LINK_TO_ROOM_ID_REGEXP, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_MATRIX_TO_PERMALINK_ROOM_ID = LINK_TO_ROOM_ID_REGEXP.toRegex(RegexOption.IGNORE_CASE)
private const val LINK_TO_ROOM_ALIAS_REGEXP = PERMALINK_BASE_REGEX + MATRIX_ROOM_ALIAS_REGEX + SEP_REGEX + MATRIX_EVENT_IDENTIFIER_REGEX
private val PATTERN_CONTAIN_MATRIX_TO_PERMALINK_ROOM_ALIAS = Pattern.compile(LINK_TO_ROOM_ALIAS_REGEXP, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_MATRIX_TO_PERMALINK_ROOM_ALIAS = LINK_TO_ROOM_ALIAS_REGEXP.toRegex(RegexOption.IGNORE_CASE)
private const val LINK_TO_APP_ROOM_ID_REGEXP = APP_BASE_REGEX + MATRIX_ROOM_IDENTIFIER_REGEX + SEP_REGEX + MATRIX_EVENT_IDENTIFIER_REGEX
private val PATTERN_CONTAIN_APP_LINK_PERMALINK_ROOM_ID = Pattern.compile(LINK_TO_APP_ROOM_ID_REGEXP, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_APP_LINK_PERMALINK_ROOM_ID = LINK_TO_APP_ROOM_ID_REGEXP.toRegex(RegexOption.IGNORE_CASE)
private const val LINK_TO_APP_ROOM_ALIAS_REGEXP = APP_BASE_REGEX + MATRIX_ROOM_ALIAS_REGEX + SEP_REGEX + MATRIX_EVENT_IDENTIFIER_REGEX
private val PATTERN_CONTAIN_APP_LINK_PERMALINK_ROOM_ALIAS = Pattern.compile(LINK_TO_APP_ROOM_ALIAS_REGEXP, Pattern.CASE_INSENSITIVE)
private val PATTERN_CONTAIN_APP_LINK_PERMALINK_ROOM_ALIAS = LINK_TO_APP_ROOM_ALIAS_REGEXP.toRegex(RegexOption.IGNORE_CASE)
// list of patterns to find some matrix item.
val MATRIX_PATTERNS = listOf(
@ -93,7 +91,7 @@ object MatrixPatterns {
* @return true if the string is a valid user id
*/
fun isUserId(str: String?): Boolean {
return str != null && PATTERN_CONTAIN_MATRIX_USER_IDENTIFIER.matcher(str).matches()
return str != null && str matches PATTERN_CONTAIN_MATRIX_USER_IDENTIFIER
}
/**
@ -103,7 +101,7 @@ object MatrixPatterns {
* @return true if the string is a valid room Id
*/
fun isRoomId(str: String?): Boolean {
return str != null && PATTERN_CONTAIN_MATRIX_ROOM_IDENTIFIER.matcher(str).matches()
return str != null && str matches PATTERN_CONTAIN_MATRIX_ROOM_IDENTIFIER
}
/**
@ -113,7 +111,7 @@ object MatrixPatterns {
* @return true if the string is a valid room alias.
*/
fun isRoomAlias(str: String?): Boolean {
return str != null && PATTERN_CONTAIN_MATRIX_ALIAS.matcher(str).matches()
return str != null && str matches PATTERN_CONTAIN_MATRIX_ALIAS
}
/**
@ -124,9 +122,9 @@ object MatrixPatterns {
*/
fun isEventId(str: String?): Boolean {
return str != null
&& (PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER.matcher(str).matches()
|| PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V3.matcher(str).matches()
|| PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V4.matcher(str).matches())
&& (str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER
|| str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V3
|| str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V4)
}
/**
@ -136,6 +134,24 @@ object MatrixPatterns {
* @return true if the string is a valid group id.
*/
fun isGroupId(str: String?): Boolean {
return str != null && PATTERN_CONTAIN_MATRIX_GROUP_IDENTIFIER.matcher(str).matches()
return str != null && str matches PATTERN_CONTAIN_MATRIX_GROUP_IDENTIFIER
}
/**
* Extract server name from a matrix id
*
* @param matrixId
* @return null if not found or if matrixId is null
*/
fun extractServerNameFromId(matrixId: String?): String? {
if (matrixId == null) {
return null
}
val index = matrixId.indexOf(":")
return if (index == -1) {
null
} else matrixId.substring(index + 1)
}
}

View File

@ -17,16 +17,23 @@
package im.vector.matrix.android.api.auth
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.auth.data.Credentials
import im.vector.matrix.android.api.auth.data.HomeServerConnectionConfig
import im.vector.matrix.android.api.auth.data.SessionParams
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.util.Cancelable
import im.vector.matrix.android.internal.auth.data.LoginFlowResponse
/**
* This interface defines methods to authenticate to a matrix server.
*/
interface Authenticator {
/**
* Request the supported login flows for this homeserver
*/
fun getLoginFlow(homeServerConnectionConfig: HomeServerConnectionConfig, callback: MatrixCallback<LoginFlowResponse>): Cancelable
/**
* @param homeServerConnectionConfig this param is used to configure the Homeserver
* @param login the login field
@ -36,17 +43,15 @@ interface Authenticator {
*/
fun authenticate(homeServerConnectionConfig: HomeServerConnectionConfig, login: String, password: String, callback: MatrixCallback<Session>): Cancelable
//TODO remove this method. Shouldn't be managed like that.
/**
* Check if there is an active [Session].
* Check if there is an authenticated [Session].
* @return true if there is at least one active session.
*/
fun hasAuthenticatedSessions(): Boolean
//TODO remove this method. Shouldn't be managed like that.
/**
* Get the last active [Session], if there is an active session.
* @return the lastActive session if any, or null
* Get the last authenticated [Session], if there is an active session.
* @return the last active session if any, or null
*/
fun getLastAuthenticatedSession(): Session?
@ -59,6 +64,8 @@ interface Authenticator {
*/
fun getSession(sessionParams: SessionParams): Session?
}
/**
* Create a session after a SSO successful login
*/
fun createSessionFromSso(credentials: Credentials, homeServerConnectionConfig: HomeServerConnectionConfig, callback: MatrixCallback<Session>): Cancelable
}

View File

@ -31,7 +31,7 @@ import okhttp3.TlsVersion
@JsonClass(generateAdapter = true)
data class HomeServerConnectionConfig(
val homeServerUri: Uri,
val identityServerUri: Uri,
val identityServerUri: Uri? = null,
val antiVirusServerUri: Uri? = null,
val allowedFingerprints: MutableList<Fingerprint> = ArrayList(),
val shouldPin: Boolean = false,
@ -48,7 +48,7 @@ data class HomeServerConnectionConfig(
class Builder {
private lateinit var homeServerUri: Uri
private lateinit var identityServerUri: Uri
private var identityServerUri: Uri? = null
private var antiVirusServerUri: Uri? = null
private val allowedFingerprints: MutableList<Fingerprint> = ArrayList()
private var shouldPin: Boolean = false
@ -253,13 +253,5 @@ data class HomeServerConnectionConfig(
forceUsageTlsVersions
)
}
}
}

View File

@ -17,7 +17,6 @@
package im.vector.matrix.android.api.comparators
import im.vector.matrix.android.api.interfaces.DatedObject
import java.util.*
object DatedObjectComparators {
@ -38,4 +37,4 @@ object DatedObjectComparators {
(datedObject2.date - datedObject1.date).toInt()
}
}
}
}

View File

@ -0,0 +1,27 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.crypto
import im.vector.matrix.android.api.session.crypto.sas.EmojiRepresentation
import im.vector.matrix.android.internal.crypto.verification.getEmojiForCode
/**
* Provide all the emojis used for SAS verification (for debug purpose)
*/
fun getAllVerificationEmojis(): List<EmojiRepresentation> {
return (0..63).map { getEmojiForCode(it) }
}

View File

@ -19,7 +19,6 @@ package im.vector.matrix.android.api.extensions
import im.vector.matrix.android.api.comparators.DatedObjectComparators
import im.vector.matrix.android.internal.crypto.model.MXDeviceInfo
import im.vector.matrix.android.internal.crypto.model.rest.DeviceInfo
import java.util.*
/* ==========================================================================================
* MXDeviceInfo
@ -29,7 +28,6 @@ fun MXDeviceInfo.getFingerprintHumanReadable() = fingerprint()
?.chunked(4)
?.joinToString(separator = " ")
fun List<DeviceInfo>.sortByLastSeen() {
Collections.sort(this, DatedObjectComparators.descComparator)
}
fun MutableList<DeviceInfo>.sortByLastSeen() {
sortWith(DatedObjectComparators.descComparator)
}

View File

@ -0,0 +1,22 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.failure
// This data class will be sent to the bus
data class ConsentNotGivenError(
val consentUri: String
)

View File

@ -31,6 +31,7 @@ import java.io.IOException
*/
sealed class Failure(cause: Throwable? = null) : Throwable(cause = cause) {
data class Unknown(val throwable: Throwable? = null) : Failure(throwable)
data class Cancelled(val throwable: Throwable? = null) : Failure(throwable)
data class NetworkConnection(val ioException: IOException? = null) : Failure(ioException)
data class ServerError(val error: MatrixError, val httpCode: Int) : Failure(RuntimeException(error.toString()))
// When server send an error, but it cannot be interpreted as a MatrixError
@ -38,8 +39,7 @@ sealed class Failure(cause: Throwable? = null) : Throwable(cause = cause) {
data class RegistrationFlowError(val registrationFlowResponse: RegistrationFlowResponse) : Failure(RuntimeException(registrationFlowResponse.toString()))
data class CryptoError(val error: MXCryptoError) : Failure(RuntimeException(error.toString()))
data class CryptoError(val error: MXCryptoError) : Failure(error)
abstract class FeatureFailure : Failure()
}
}

View File

@ -26,8 +26,12 @@ import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class MatrixError(
@Json(name = "errcode") val code: String,
@Json(name = "error") val message: String
) {
@Json(name = "error") val message: String,
@Json(name = "consent_uri") val consentUri: String? = null,
// RESOURCE_LIMIT_EXCEEDED data
@Json(name = "limit_type") val limitType: String? = null,
@Json(name = "admin_contact") val adminUri: String? = null) {
companion object {
const val FORBIDDEN = "M_FORBIDDEN"
@ -55,5 +59,8 @@ data class MatrixError(
const val M_CONSENT_NOT_GIVEN = "M_CONSENT_NOT_GIVEN"
const val RESOURCE_LIMIT_EXCEEDED = "M_RESOURCE_LIMIT_EXCEEDED"
const val WRONG_ROOM_KEYS_VERSION = "M_WRONG_ROOM_KEYS_VERSION"
// Possible value for "limit_type"
const val LIMIT_TYPE_MAU = "monthly_active_user"
}
}
}

View File

@ -25,4 +25,4 @@ interface ProgressListener {
* @param total
*/
fun onProgress(progress: Int, total: Int)
}
}

View File

@ -31,4 +31,4 @@ interface StepProgressListener {
* @param step The current step, containing progress data if available. Else you should consider progress as indeterminate
*/
fun onStepProgress(step: Step)
}
}

View File

@ -30,22 +30,20 @@ object MatrixLinkify {
*
* @param spannable the text in which the matrix items has to be clickable.
*/
fun addLinks(spannable: Spannable?, callback: MatrixPermalinkSpan.Callback?): Boolean {
fun addLinks(spannable: Spannable, callback: MatrixPermalinkSpan.Callback?): Boolean {
// sanity checks
if (spannable.isNullOrEmpty()) {
if (spannable.isEmpty()) {
return false
}
val text = spannable.toString()
var hasMatch = false
for (index in MatrixPatterns.MATRIX_PATTERNS.indices) {
val pattern = MatrixPatterns.MATRIX_PATTERNS[index]
val matcher = pattern.matcher(spannable)
while (matcher.find()) {
for (pattern in MatrixPatterns.MATRIX_PATTERNS) {
for (match in pattern.findAll(spannable)) {
hasMatch = true
val startPos = matcher.start(0)
val startPos = match.range.first
if (startPos == 0 || text[startPos - 1] != '/') {
val endPos = matcher.end(0)
val url = text.substring(matcher.start(0), matcher.end(0))
val endPos = match.range.last + 1
val url = text.substring(match.range)
val span = MatrixPermalinkSpan(url, callback)
spannable.setSpan(span, startPos, endPos, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
}
@ -53,5 +51,4 @@ object MatrixLinkify {
}
return hasMatch
}
}
}

View File

@ -18,6 +18,7 @@ package im.vector.matrix.android.api.permalinks
import android.text.style.ClickableSpan
import android.view.View
import im.vector.matrix.android.api.permalinks.MatrixPermalinkSpan.Callback
/**
* This MatrixPermalinkSpan is a clickable span which use a [Callback] to communicate back.
@ -34,6 +35,4 @@ class MatrixPermalinkSpan(private val url: String,
override fun onClick(widget: View) {
callback?.onUrlClicked(url)
}
}
}

View File

@ -33,5 +33,4 @@ sealed class PermalinkData {
data class GroupLink(val groupId: String) : PermalinkData()
data class FallbackLink(val uri: Uri) : PermalinkData()
}

View File

@ -16,7 +16,6 @@
package im.vector.matrix.android.api.permalinks
import android.text.TextUtils
import im.vector.matrix.android.api.session.events.model.Event
/**
@ -48,10 +47,9 @@ object PermalinkFactory {
* @return the permalink, or null in case of error
*/
fun createPermalink(id: String): String? {
return if (TextUtils.isEmpty(id)) {
return if (id.isEmpty()) {
null
} else MATRIX_TO_URL_BASE + escape(id)
}
/**
@ -72,16 +70,14 @@ object PermalinkFactory {
* @param url the universal link, Ex: "https://matrix.to/#/@benoit:matrix.org"
* @return the id from the url, ex: "@benoit:matrix.org", or null if the url is not a permalink
*/
fun getLinkedId(url: String?): String? {
val isSupported = url != null && url.startsWith(MATRIX_TO_URL_BASE)
fun getLinkedId(url: String): String? {
val isSupported = url.startsWith(MATRIX_TO_URL_BASE)
return if (isSupported) {
url!!.substring(MATRIX_TO_URL_BASE.length)
url.substring(MATRIX_TO_URL_BASE.length)
} else null
}
/**
* Escape '/' in id, because it is used as a separator
*
@ -89,6 +85,6 @@ object PermalinkFactory {
* @return the escaped id
*/
private fun escape(id: String): String {
return id.replace("/".toRegex(), "%2F")
return id.replace("/", "%2F")
}
}

View File

@ -72,5 +72,4 @@ object PermalinkParser {
else -> PermalinkData.FallbackLink(uri)
}
}
}
}

View File

@ -18,78 +18,111 @@ package im.vector.matrix.android.api.pushrules
import im.vector.matrix.android.api.pushrules.rest.PushRule
import timber.log.Timber
sealed class Action {
object Notify : Action()
object DoNotNotify : Action()
data class Sound(val sound: String = ACTION_OBJECT_VALUE_VALUE_DEFAULT) : Action()
data class Highlight(val highlight: Boolean) : Action()
}
class Action(val type: Type) {
private const val ACTION_NOTIFY = "notify"
private const val ACTION_DONT_NOTIFY = "dont_notify"
private const val ACTION_COALESCE = "coalesce"
enum class Type(val value: String) {
NOTIFY("notify"),
DONT_NOTIFY("dont_notify"),
COALESCE("coalesce"),
SET_TWEAK("set_tweak");
// Ref: https://matrix.org/docs/spec/client_server/latest#tweaks
private const val ACTION_OBJECT_SET_TWEAK_KEY = "set_tweak"
companion object {
private const val ACTION_OBJECT_SET_TWEAK_VALUE_SOUND = "sound"
private const val ACTION_OBJECT_SET_TWEAK_VALUE_HIGHLIGHT = "highlight"
fun safeValueOf(value: String): Type? {
try {
return valueOf(value)
} catch (e: IllegalArgumentException) {
return null
}
private const val ACTION_OBJECT_VALUE_KEY = "value"
private const val ACTION_OBJECT_VALUE_VALUE_DEFAULT = "default"
/**
* Ref: https://matrix.org/docs/spec/client_server/latest#actions
*
* Convert
* <pre>
* "actions": [
* "notify",
* {
* "set_tweak": "sound",
* "value": "default"
* },
* {
* "set_tweak": "highlight"
* }
* ]
*
* To
* [
* Action.Notify,
* Action.Sound("default"),
* Action.Highlight(true)
* ]
*
* </pre>
*/
@Suppress("IMPLICIT_CAST_TO_ANY")
fun List<Action>.toJson(): List<Any> {
return map { action ->
when (action) {
is Action.Notify -> ACTION_NOTIFY
is Action.DoNotNotify -> ACTION_DONT_NOTIFY
is Action.Sound -> {
mapOf(
ACTION_OBJECT_SET_TWEAK_KEY to ACTION_OBJECT_SET_TWEAK_VALUE_SOUND,
ACTION_OBJECT_VALUE_KEY to action.sound
)
}
}
}
var tweak_action: String? = null
var stringValue: String? = null
var boolValue: Boolean? = null
companion object {
fun mapFrom(pushRule: PushRule): List<Action>? {
val actions = ArrayList<Action>()
pushRule.actions.forEach { actionStrOrObj ->
if (actionStrOrObj is String) {
when (actionStrOrObj) {
Action.Type.NOTIFY.value -> Action(Action.Type.NOTIFY)
Action.Type.DONT_NOTIFY.value -> Action(Action.Type.DONT_NOTIFY)
else -> {
Timber.w("Unsupported action type ${actionStrOrObj}")
null
}
}?.let {
actions.add(it)
}
} else if (actionStrOrObj is Map<*, *>) {
val tweakAction = actionStrOrObj["set_tweak"] as? String
when (tweakAction) {
"sound" -> {
(actionStrOrObj["value"] as? String)?.let { stringValue ->
Action(Action.Type.SET_TWEAK).also {
it.tweak_action = "sound"
it.stringValue = stringValue
actions.add(it)
}
}
}
"highlight" -> {
(actionStrOrObj["value"] as? Boolean)?.let { boolValue ->
Action(Action.Type.SET_TWEAK).also {
it.tweak_action = "highlight"
it.boolValue = boolValue
actions.add(it)
}
}
}
else -> {
Timber.w("Unsupported action type ${actionStrOrObj}")
}
}
} else {
Timber.w("Unsupported action type ${actionStrOrObj}")
return null
}
is Action.Highlight -> {
mapOf(
ACTION_OBJECT_SET_TWEAK_KEY to ACTION_OBJECT_SET_TWEAK_VALUE_HIGHLIGHT,
ACTION_OBJECT_VALUE_KEY to action.highlight
)
}
return if (actions.isEmpty()) null else actions
}
}
}
fun PushRule.getActions(): List<Action> {
val result = ArrayList<Action>()
actions.forEach { actionStrOrObj ->
when (actionStrOrObj) {
ACTION_NOTIFY -> Action.Notify
ACTION_DONT_NOTIFY -> Action.DoNotNotify
is Map<*, *> -> {
when (actionStrOrObj[ACTION_OBJECT_SET_TWEAK_KEY]) {
ACTION_OBJECT_SET_TWEAK_VALUE_SOUND -> {
(actionStrOrObj[ACTION_OBJECT_VALUE_KEY] as? String)?.let { stringValue ->
Action.Sound(stringValue)
}
// When the value is not there, default sound (not specified by the spec)
?: Action.Sound(ACTION_OBJECT_VALUE_VALUE_DEFAULT)
}
ACTION_OBJECT_SET_TWEAK_VALUE_HIGHLIGHT -> {
(actionStrOrObj[ACTION_OBJECT_VALUE_KEY] as? Boolean)?.let { boolValue ->
Action.Highlight(boolValue)
}
// When the value is not there, default is true, says the spec
?: Action.Highlight(true)
}
else -> {
Timber.w("Unsupported set_tweak value ${actionStrOrObj[ACTION_OBJECT_SET_TWEAK_KEY]}")
null
}
}
}
else -> {
Timber.w("Unsupported action type $actionStrOrObj")
null
}
}?.let {
result.add(it)
}
}
return result
}

View File

@ -35,9 +35,7 @@ abstract class Condition(val kind: Kind) {
else -> UNRECOGNIZE
}
}
}
}
abstract fun isSatisfied(conditionResolver: ConditionResolver): Boolean
@ -45,4 +43,4 @@ abstract class Condition(val kind: Kind) {
open fun technicalDescription(): String {
return "Kind: $kind"
}
}
}

View File

@ -25,4 +25,4 @@ interface ConditionResolver {
fun resolveRoomMemberCountCondition(roomMemberCountCondition: RoomMemberCountCondition): Boolean
fun resolveSenderNotificationPermissionCondition(senderNotificationPermissionCondition: SenderNotificationPermissionCondition): Boolean
fun resolveContainsDisplayNameCondition(containsDisplayNameCondition: ContainsDisplayNameCondition) : Boolean
}
}

View File

@ -15,14 +15,11 @@
*/
package im.vector.matrix.android.api.pushrules
import android.text.TextUtils
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.events.model.EventType
import im.vector.matrix.android.api.session.events.model.toModel
import im.vector.matrix.android.api.session.room.model.message.MessageContent
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
import timber.log.Timber
import java.util.regex.Pattern
class ContainsDisplayNameCondition : Condition(Kind.contains_display_name) {
@ -35,22 +32,21 @@ class ContainsDisplayNameCondition : Condition(Kind.contains_display_name) {
}
fun isSatisfied(event: Event, displayName: String): Boolean {
//TODO the spec says:
// Matches any message whose content is unencrypted and contains the user's current display name
var message = when (event.type) {
EventType.MESSAGE -> {
val message = when (event.type) {
EventType.MESSAGE -> {
event.content.toModel<MessageContent>()
}
// EventType.ENCRYPTED -> {
// event.root.getClearContent()?.toModel<MessageContent>()
// }
else -> null
// TODO the spec says:
// Matches any message whose content is unencrypted and contains the user's current display name
// EventType.ENCRYPTED -> {
// event.root.getClearContent()?.toModel<MessageContent>()
// }
else -> null
} ?: return false
return caseInsensitiveFind(displayName, message.body)
}
companion object {
/**
* Returns whether a string contains an occurrence of another, as a standalone word, regardless of case.
@ -61,20 +57,18 @@ class ContainsDisplayNameCondition : Condition(Kind.contains_display_name) {
*/
fun caseInsensitiveFind(subString: String, longString: String): Boolean {
// add sanity checks
if (TextUtils.isEmpty(subString) || TextUtils.isEmpty(longString)) {
if (subString.isEmpty() || longString.isEmpty()) {
return false
}
var res = false
try {
val pattern = Pattern.compile("(\\W|^)" + Pattern.quote(subString) + "(\\W|$)", Pattern.CASE_INSENSITIVE)
res = pattern.matcher(longString).find()
val regex = Regex("(\\W|^)" + Regex.escape(subString) + "(\\W|$)", RegexOption.IGNORE_CASE)
return regex.containsMatchIn(longString)
} catch (e: Exception) {
Timber.e(e, "## caseInsensitiveFind() : failed")
}
return res
return false
}
}
}
}

View File

@ -29,28 +29,25 @@ class EventMatchCondition(val key: String, val pattern: String) : Condition(Kind
return "'$key' Matches '$pattern'"
}
fun isSatisfied(event: Event): Boolean {
//TODO encrypted events?
// TODO encrypted events?
val rawJson = MoshiProvider.providesMoshi().adapter(Event::class.java).toJsonValue(event) as? Map<*, *>
?: return false
val value = extractField(rawJson, key) ?: return false
//Patterns with no special glob characters should be treated as having asterisks prepended
// Patterns with no special glob characters should be treated as having asterisks prepended
// and appended when testing the condition.
try {
val modPattern = if (hasSpecialGlobChar(pattern)) simpleGlobToRegExp(pattern) else simpleGlobToRegExp("*$pattern*")
val regex = Regex(modPattern, RegexOption.DOT_MATCHES_ALL)
return regex.containsMatchIn(value)
} catch (e: Throwable) {
//e.g PatternSyntaxException
// e.g PatternSyntaxException
Timber.e(e, "Failed to evaluate push condition")
return false
}
}
private fun extractField(jsonObject: Map<*, *>, fieldPath: String): String? {
val fieldParts = fieldPath.split(".")
if (fieldParts.isEmpty()) return null
@ -77,9 +74,9 @@ class EventMatchCondition(val key: String, val pattern: String) : Condition(Kind
return glob.contains("*") || glob.contains("?")
}
//Very simple glob to regexp converter
// Very simple glob to regexp converter
private fun simpleGlobToRegExp(glob: String): String {
var out = ""//"^"
var out = "" // "^"
for (i in 0 until glob.length) {
val c = glob[i]
when (c) {
@ -90,8 +87,8 @@ class EventMatchCondition(val key: String, val pattern: String) : Condition(Kind
else -> out += c
}
}
out += ""//'$'.toString()
out += "" // '$'.toString()
return out
}
}
}
}

View File

@ -18,20 +18,25 @@ package im.vector.matrix.android.api.pushrules
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.pushrules.rest.PushRule
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.util.Cancelable
interface PushRuleService {
/**
* Fetch the push rules from the server
*/
fun fetchPushRules(scope: String = "global")
fun fetchPushRules(scope: String = RuleScope.GLOBAL)
//TODO get push rule set
fun getPushRules(scope: String = "global"): List<PushRule>
// TODO get push rule set
fun getPushRules(scope: String = RuleScope.GLOBAL): List<PushRule>
//TODO update rule
// TODO update rule
fun updatePushRuleEnableStatus(kind: String, pushRule: PushRule, enabled: Boolean, callback: MatrixCallback<Unit>)
fun updatePushRuleEnableStatus(kind: RuleKind, pushRule: PushRule, enabled: Boolean, callback: MatrixCallback<Unit>): Cancelable
fun addPushRule(kind: RuleKind, pushRule: PushRule, callback: MatrixCallback<Unit>): Cancelable
fun removePushRule(kind: RuleKind, pushRule: PushRule, callback: MatrixCallback<Unit>): Cancelable
fun addPushRuleListener(listener: PushRuleListener)
@ -41,6 +46,9 @@ interface PushRuleService {
interface PushRuleListener {
fun onMatchRule(event: Event, actions: List<Action>)
fun onRoomJoined(roomId: String)
fun onRoomLeft(roomId: String)
fun onEventRedacted(redactedEventId: String)
fun batchFinish()
}
}
}

View File

@ -18,18 +18,17 @@ package im.vector.matrix.android.api.pushrules
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.room.RoomService
import timber.log.Timber
import java.util.regex.Pattern
private val regex = Pattern.compile("^(==|<=|>=|<|>)?(\\d*)$")
private val regex = Regex("^(==|<=|>=|<|>)?(\\d*)$")
class RoomMemberCountCondition(val `is`: String) : Condition(Kind.room_member_count) {
class RoomMemberCountCondition(val iz: String) : Condition(Kind.room_member_count) {
override fun isSatisfied(conditionResolver: ConditionResolver): Boolean {
return conditionResolver.resolveRoomMemberCountCondition(this)
}
override fun technicalDescription(): String {
return "Room member count is $`is`"
return "Room member count is $iz"
}
fun isSatisfied(event: Event, session: RoomService?): Boolean {
@ -56,16 +55,12 @@ class RoomMemberCountCondition(val `is`: String) : Condition(Kind.room_member_co
*/
private fun parseIsField(): Pair<String?, Int>? {
try {
val match = regex.matcher(`is`)
if (match.find()) {
val prefix = match.group(1)
val count = match.group(2).toInt()
return prefix to count
}
val match = regex.find(iz) ?: return null
val (prefix, count) = match.destructured
return prefix to count.toInt()
} catch (t: Throwable) {
Timber.d(t)
}
return null
}
}
}

View File

@ -37,7 +37,7 @@ object RuleIds {
// Default Underride Rules
const val RULE_ID_CALL = ".m.rule.call"
const val RULE_ID_one_to_one_encrypted_room = ".m.rule.encrypted_room_one_to_one"
const val RULE_ID_ONE_TO_ONE_ENCRYPTED_ROOM = ".m.rule.encrypted_room_one_to_one"
const val RULE_ID_ONE_TO_ONE_ROOM = ".m.rule.room_one_to_one"
const val RULE_ID_ALL_OTHER_MESSAGES_ROOMS = ".m.rule.message"
const val RULE_ID_ENCRYPTED = ".m.rule.encrypted"

View File

@ -13,9 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.pushrules
package im.vector.riotx.features.home.room
import im.vector.riotx.core.utils.RxStore
class VisibleRoomStore : RxStore<String>()
object RuleScope {
const val GLOBAL = "global"
}

View File

@ -0,0 +1,33 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.pushrules
/**
* Ref: https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-pushrules
*/
enum class RuleSetKey(val value: String) {
CONTENT("content"),
OVERRIDE("override"),
ROOM("room"),
SENDER("sender"),
UNDERRIDE("underride")
}
/**
* Ref: https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-pushrules-scope-kind-ruleid
*/
typealias RuleKind = RuleSetKey

View File

@ -18,7 +18,6 @@ package im.vector.matrix.android.api.pushrules
import im.vector.matrix.android.api.session.events.model.Event
import im.vector.matrix.android.api.session.room.model.PowerLevels
class SenderNotificationPermissionCondition(val key: String) : Condition(Kind.sender_notification_permission) {
override fun isSatisfied(conditionResolver: ConditionResolver): Boolean {
@ -29,8 +28,7 @@ class SenderNotificationPermissionCondition(val key: String) : Condition(Kind.se
return "User power level <$key>"
}
fun isSatisfied(event: Event, powerLevels: PowerLevels): Boolean {
return event.senderId != null && powerLevels.getUserPowerLevel(event.senderId) >= powerLevels.notificationLevel(key)
}
}
}

View File

@ -40,7 +40,8 @@ data class PushCondition(
/**
* Required for room_member_count conditions.
* A decimal integer optionally prefixed by one of, ==, <, >, >= or <=.
* A prefix of < matches rooms where the member count is strictly less than the given number and so forth. If no prefix is present, this parameter defaults to ==.
* A prefix of < matches rooms where the member count is strictly less than the given number and so forth.
* If no prefix is present, this parameter defaults to ==.
*/
@Json(name = "is") val iz: String? = null
) {
@ -70,9 +71,9 @@ data class PushCondition(
this.key?.let { SenderNotificationPermissionCondition(it) }
}
Condition.Kind.UNRECOGNIZE -> {
Timber.e("Unknwon kind $kind")
Timber.e("Unknown kind $kind")
null
}
}
}
}
}

View File

@ -19,7 +19,6 @@ package im.vector.matrix.android.api.pushrules.rest
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class PushRule(
/**
@ -47,4 +46,3 @@ data class PushRule(
*/
val pattern: String? = null
)

View File

@ -24,4 +24,4 @@ data class Ruleset(
val room: List<PushRule>? = null,
val sender: List<PushRule>? = null,
val underride: List<PushRule>? = null
)
)

View File

@ -0,0 +1,29 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.session
import androidx.annotation.StringRes
import androidx.lifecycle.LiveData
interface InitialSyncProgressService {
fun getInitialSyncProgressStatus() : LiveData<Status?>
data class Status(
@StringRes val statusText: Int,
val percentProgress: Int = 0
)
}

View File

@ -19,15 +19,19 @@ package im.vector.matrix.android.api.session
import androidx.annotation.MainThread
import androidx.lifecycle.LiveData
import im.vector.matrix.android.api.auth.data.SessionParams
import im.vector.matrix.android.api.failure.ConsentNotGivenError
import im.vector.matrix.android.api.pushrules.PushRuleService
import im.vector.matrix.android.api.session.cache.CacheService
import im.vector.matrix.android.api.session.content.ContentUploadStateTracker
import im.vector.matrix.android.api.session.content.ContentUrlResolver
import im.vector.matrix.android.api.session.crypto.CryptoService
import im.vector.matrix.android.api.session.file.FileService
import im.vector.matrix.android.api.session.group.GroupService
import im.vector.matrix.android.api.session.homeserver.HomeServerCapabilitiesService
import im.vector.matrix.android.api.session.pushers.PushersService
import im.vector.matrix.android.api.session.room.RoomDirectoryService
import im.vector.matrix.android.api.session.room.RoomService
import im.vector.matrix.android.api.session.securestorage.SecureStorageService
import im.vector.matrix.android.api.session.signout.SignOutService
import im.vector.matrix.android.api.session.sync.FilterService
import im.vector.matrix.android.api.session.sync.SyncState
@ -46,18 +50,24 @@ interface Session :
CacheService,
SignOutService,
FilterService,
FileService,
PushRuleService,
PushersService {
PushersService,
InitialSyncProgressService,
HomeServerCapabilitiesService,
SecureStorageService {
/**
* The params associated to the session
*/
val sessionParams: SessionParams
val myUserId : String
/**
* Useful shortcut to get access to the userId
*/
val myUserId: String
get() = sessionParams.credentials.userId
/**
* This method allow to open a session. It does start some service on the background.
*/
@ -81,7 +91,7 @@ interface Session :
/**
* This method start the sync thread.
*/
fun startSync()
fun startSync(fromForeground: Boolean)
/**
* This method stop the sync thread.
@ -130,6 +140,9 @@ interface Session :
*/
fun onInvalidToken()
/**
* A M_CONSENT_NOT_GIVEN error has been received from the homeserver
*/
fun onConsentNotGivenError(consentNotGivenError: ConsentNotGivenError)
}
}
}

View File

@ -19,7 +19,7 @@ package im.vector.matrix.android.api.session.cache
import im.vector.matrix.android.api.MatrixCallback
/**
* This interface defines a method to sign out. It's implemented at the session level.
* This interface defines a method to clear the cache. It's implemented at the session level.
*/
interface CacheService {
@ -27,5 +27,4 @@ interface CacheService {
* Clear the whole cached data, except credentials. Once done, the session is closed and has to be opened again
*/
fun clearCache(callback: MatrixCallback<Unit>)
}
}

View File

@ -17,6 +17,7 @@
package im.vector.matrix.android.api.session.content
import android.os.Parcelable
import androidx.exifinterface.media.ExifInterface
import kotlinx.android.parcel.Parcelize
@Parcelize
@ -26,6 +27,7 @@ data class ContentAttachmentData(
val date: Long = 0,
val height: Long? = 0,
val width: Long? = 0,
val exifOrientation: Int = ExifInterface.ORIENTATION_UNDEFINED,
val name: String? = null,
val path: String,
val mimeType: String,
@ -38,5 +40,4 @@ data class ContentAttachmentData(
AUDIO,
VIDEO
}
}
}

View File

@ -28,10 +28,11 @@ interface ContentUploadStateTracker {
sealed class State {
object Idle : State()
data class ProgressData(val current: Long, val total: Long) : State()
object EncryptingThumbnail : State()
data class UploadingThumbnail(val current: Long, val total: Long) : State()
object Encrypting : State()
data class Uploading(val current: Long, val total: Long) : State()
object Success : State()
object Failure : State()
data class Failure(val throwable: Throwable) : State()
}
}
}

View File

@ -44,4 +44,4 @@ interface ContentUrlResolver {
* @return the URL to access the described resource, or null if the url is invalid.
*/
fun resolveThumbnail(contentUrl: String?, width: Int, height: Int, method: ThumbnailMethod): String?
}
}

View File

@ -85,6 +85,8 @@ interface CryptoService {
fun addRoomKeysRequestListener(listener: RoomKeysRequestListener)
fun removeRoomKeysRequestListener(listener: RoomKeysRequestListener)
fun getDevicesList(callback: MatrixCallback<DevicesListResponse>)
fun inboundGroupSessionsCount(onlyBackedUp: Boolean): Int
@ -96,9 +98,10 @@ interface CryptoService {
roomId: String,
callback: MatrixCallback<MXEncryptEventContentResult>)
fun decryptEvent(event: Event, timeline: String): MXEventDecryptionResult?
@Throws(MXCryptoError::class)
fun decryptEvent(event: Event, timeline: String): MXEventDecryptionResult
fun decryptEventAsync(event: Event, timeline: String, callback: MatrixCallback<MXEventDecryptionResult?>)
fun decryptEventAsync(event: Event, timeline: String, callback: MatrixCallback<MXEventDecryptionResult>)
fun getEncryptionAlgorithm(roomId: String): String?
@ -106,10 +109,7 @@ interface CryptoService {
fun downloadKeys(userIds: List<String>, forceDownload: Boolean, callback: MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>>)
fun clearCryptoCache(callback: MatrixCallback<Unit>)
fun addNewSessionListener(newSessionListener: NewSessionListener)
fun removeSessionListener(listener: NewSessionListener)
}
}

View File

@ -18,106 +18,65 @@
package im.vector.matrix.android.api.session.crypto
import android.text.TextUtils
import im.vector.matrix.android.internal.crypto.model.MXDeviceInfo
import im.vector.matrix.android.internal.crypto.model.MXUsersDevicesMap
import org.matrix.olm.OlmException
/**
* Represents a crypto error response.
*/
class MXCryptoError(var code: String,
var message: String) {
sealed class MXCryptoError : Throwable() {
/**
* Describe the error with more details
*/
private var mDetailedErrorDescription: String? = null
data class Base(val errorType: ErrorType,
val technicalMessage: String,
/**
* Describe the error with more details
*/
val detailedErrorDescription: String? = null) : MXCryptoError()
/**
* Data exception.
* Some exceptions provide some data to describe the exception
*/
var mExceptionData: Any? = null
data class OlmError(val olmException: OlmException) : MXCryptoError()
/**
* @return true if the current error is an olm one.
*/
val isOlmError: Boolean
get() = OLM_ERROR_CODE == code
data class UnknownDevice(val deviceList: MXUsersDevicesMap<MXDeviceInfo>) : MXCryptoError()
/**
* @return the detailed error description
*/
val detailedErrorDescription: String?
get() = if (TextUtils.isEmpty(mDetailedErrorDescription)) {
message
} else mDetailedErrorDescription
/**
* Create a crypto error
*
* @param code the error code (see XX_ERROR_CODE)
* @param shortErrorDescription the short error description
* @param detailedErrorDescription the detailed error description
*/
constructor(code: String, shortErrorDescription: String, detailedErrorDescription: String?) : this(code, shortErrorDescription) {
mDetailedErrorDescription = detailedErrorDescription
}
/**
* Create a crypto error
*
* @param code the error code (see XX_ERROR_CODE)
* @param shortErrorDescription the short error description
* @param detailedErrorDescription the detailed error description
* @param exceptionData the exception data
*/
constructor(code: String, shortErrorDescription: String, detailedErrorDescription: String?, exceptionData: Any) : this(code, shortErrorDescription) {
mDetailedErrorDescription = detailedErrorDescription
mExceptionData = exceptionData
enum class ErrorType {
ENCRYPTING_NOT_ENABLED,
UNABLE_TO_ENCRYPT,
UNABLE_TO_DECRYPT,
UNKNOWN_INBOUND_SESSION_ID,
INBOUND_SESSION_MISMATCH_ROOM_ID,
MISSING_FIELDS,
BAD_EVENT_FORMAT,
MISSING_SENDER_KEY,
MISSING_CIPHER_TEXT,
BAD_DECRYPTED_FORMAT,
NOT_INCLUDE_IN_RECIPIENTS,
BAD_RECIPIENT,
BAD_RECIPIENT_KEY,
FORWARDED_MESSAGE,
BAD_ROOM,
BAD_ENCRYPTED_MESSAGE,
DUPLICATED_MESSAGE_INDEX,
MISSING_PROPERTY,
OLM,
UNKNOWN_DEVICES,
UNKNOWN_MESSAGE_INDEX
}
companion object {
/**
* Error codes
* Resource for technicalMessage
*/
const val ENCRYPTING_NOT_ENABLED_ERROR_CODE = "ENCRYPTING_NOT_ENABLED"
const val UNABLE_TO_ENCRYPT_ERROR_CODE = "UNABLE_TO_ENCRYPT"
const val UNABLE_TO_DECRYPT_ERROR_CODE = "UNABLE_TO_DECRYPT"
const val UNKNOWN_INBOUND_SESSION_ID_ERROR_CODE = "UNKNOWN_INBOUND_SESSION_ID"
const val INBOUND_SESSION_MISMATCH_ROOM_ID_ERROR_CODE = "INBOUND_SESSION_MISMATCH_ROOM_ID"
const val MISSING_FIELDS_ERROR_CODE = "MISSING_FIELDS"
const val MISSING_CIPHER_TEXT_ERROR_CODE = "MISSING_CIPHER_TEXT"
const val NOT_INCLUDE_IN_RECIPIENTS_ERROR_CODE = "NOT_INCLUDE_IN_RECIPIENTS"
const val BAD_RECIPIENT_ERROR_CODE = "BAD_RECIPIENT"
const val BAD_RECIPIENT_KEY_ERROR_CODE = "BAD_RECIPIENT_KEY"
const val FORWARDED_MESSAGE_ERROR_CODE = "FORWARDED_MESSAGE"
const val BAD_ROOM_ERROR_CODE = "BAD_ROOM"
const val BAD_ENCRYPTED_MESSAGE_ERROR_CODE = "BAD_ENCRYPTED_MESSAGE"
const val DUPLICATED_MESSAGE_INDEX_ERROR_CODE = "DUPLICATED_MESSAGE_INDEX"
const val MISSING_PROPERTY_ERROR_CODE = "MISSING_PROPERTY"
const val OLM_ERROR_CODE = "OLM_ERROR_CODE"
const val UNKNOWN_DEVICES_CODE = "UNKNOWN_DEVICES_CODE"
const val UNKNOWN_MESSAGE_INDEX = "UNKNOWN_MESSAGE_INDEX"
/**
* short error reasons
*/
const val UNABLE_TO_DECRYPT = "Unable to decrypt"
const val UNABLE_TO_ENCRYPT = "Unable to encrypt"
/**
* Detailed error reasons
*/
const val ENCRYPTING_NOT_ENABLED_REASON = "Encryption not enabled"
const val UNABLE_TO_ENCRYPT_REASON = "Unable to encrypt %s"
const val UNABLE_TO_DECRYPT_REASON = "Unable to decrypt %1\$s. Algorithm: %2\$s"
const val OLM_REASON = "OLM error: %1\$s"
const val DETAILLED_OLM_REASON = "Unable to decrypt %1\$s. OLM error: %2\$s"
const val DETAILED_OLM_REASON = "Unable to decrypt %1\$s. OLM error: %2\$s"
const val UNKNOWN_INBOUND_SESSION_ID_REASON = "Unknown inbound session id"
const val INBOUND_SESSION_MISMATCH_ROOM_ID_REASON = "Mismatched room_id for inbound group session (expected %1\$s, was %2\$s)"
const val MISSING_FIELDS_REASON = "Missing fields in input"
const val BAD_EVENT_FORMAT_TEXT_REASON = "Bad event format"
const val MISSING_SENDER_KEY_TEXT_REASON = "Missing senderKey"
const val MISSING_CIPHER_TEXT_REASON = "Missing ciphertext"
const val BAD_DECRYPTED_FORMAT_TEXT_REASON = "Bad decrypted event format"
const val NOT_INCLUDED_IN_RECIPIENT_REASON = "Not included in recipients"
const val BAD_RECIPIENT_REASON = "Message was intended for %1\$s"
const val BAD_RECIPIENT_KEY_REASON = "Message not intended for this device"
@ -126,7 +85,9 @@ class MXCryptoError(var code: String,
const val BAD_ENCRYPTED_MESSAGE_REASON = "Bad Encrypted Message"
const val DUPLICATE_MESSAGE_INDEX_REASON = "Duplicate message index, possible replay attack %1\$s"
const val ERROR_MISSING_PROPERTY_REASON = "No '%1\$s' property. Cannot prevent unknown-key attack"
const val UNKNOWN_DEVICES_REASON = "This room contains unknown devices which have not been verified.\n" + "We strongly recommend you verify them before continuing."
const val NO_MORE_ALGORITHM_REASON = "Room was previously configured to use encryption, but is no longer." + " Perhaps the homeserver is hiding the configuration event."
const val UNKNOWN_DEVICES_REASON = "This room contains unknown devices which have not been verified.\n" +
"We strongly recommend you verify them before continuing."
const val NO_MORE_ALGORITHM_REASON = "Room was previously configured to use encryption, but is no longer." +
" Perhaps the homeserver is hiding the configuration event."
}
}

View File

@ -40,7 +40,8 @@ interface KeysBackupService {
* @param keysBackupCreationInfo the info object from [prepareKeysBackupVersion].
* @param callback Asynchronous callback
*/
fun createKeysBackupVersion(keysBackupCreationInfo: MegolmBackupCreationInfo, callback: MatrixCallback<KeysVersion>)
fun createKeysBackupVersion(keysBackupCreationInfo: MegolmBackupCreationInfo,
callback: MatrixCallback<KeysVersion>)
/**
* Facility method to get the total number of locally stored keys
@ -58,7 +59,8 @@ interface KeysBackupService {
* @param progressListener the callback to follow the progress
* @param callback the main callback
*/
fun backupAllGroupSessions(progressListener: ProgressListener?, callback: MatrixCallback<Unit>?)
fun backupAllGroupSessions(progressListener: ProgressListener?,
callback: MatrixCallback<Unit>?)
/**
* Check trust on a key backup version.
@ -66,7 +68,8 @@ interface KeysBackupService {
* @param keysBackupVersion the backup version to check.
* @param callback block called when the operations completes.
*/
fun getKeysBackupTrust(keysBackupVersion: KeysVersionResult, callback: MatrixCallback<KeysBackupVersionTrust>)
fun getKeysBackupTrust(keysBackupVersion: KeysVersionResult,
callback: MatrixCallback<KeysBackupVersionTrust>)
/**
* Return the current progress of the backup
@ -80,7 +83,8 @@ interface KeysBackupService {
* @param version the backup version
* @param callback
*/
fun getVersion(version: String, callback: MatrixCallback<KeysVersionResult?>)
fun getVersion(version: String,
callback: MatrixCallback<KeysVersionResult?>)
/**
* This method fetches the last backup version on the server, then compare to the currently backup version use.
@ -114,7 +118,9 @@ interface KeysBackupService {
* @param progressListener a progress listener, as generating private key from password may take a while
* @param callback Asynchronous callback
*/
fun prepareKeysBackupVersion(password: String?, progressListener: ProgressListener?, callback: MatrixCallback<MegolmBackupCreationInfo>)
fun prepareKeysBackupVersion(password: String?,
progressListener: ProgressListener?,
callback: MatrixCallback<MegolmBackupCreationInfo>)
/**
* Delete a keys backup version. It will delete all backed up keys on the server, and the backup itself.
@ -123,7 +129,8 @@ interface KeysBackupService {
* @param version the backup version to delete.
* @param callback Asynchronous callback
*/
fun deleteBackup(version: String, callback: MatrixCallback<Unit>?)
fun deleteBackup(version: String,
callback: MatrixCallback<Unit>?)
/**
* Ask if the backup on the server contains keys that we may do not have locally.
@ -139,7 +146,9 @@ interface KeysBackupService {
* @param trust the trust to set to the keys backup.
* @param callback block called when the operations completes.
*/
fun trustKeysBackupVersion(keysBackupVersion: KeysVersionResult, trust: Boolean, callback: MatrixCallback<Unit>)
fun trustKeysBackupVersion(keysBackupVersion: KeysVersionResult,
trust: Boolean,
callback: MatrixCallback<Unit>)
/**
* Set trust on a keys backup version.
@ -148,7 +157,9 @@ interface KeysBackupService {
* @param recoveryKey the recovery key to challenge with the key backup public key.
* @param callback block called when the operations completes.
*/
fun trustKeysBackupVersionWithRecoveryKey(keysBackupVersion: KeysVersionResult, recoveryKey: String, callback: MatrixCallback<Unit>)
fun trustKeysBackupVersionWithRecoveryKey(keysBackupVersion: KeysVersionResult,
recoveryKey: String,
callback: MatrixCallback<Unit>)
/**
* Set trust on a keys backup version.
@ -157,7 +168,9 @@ interface KeysBackupService {
* @param password the pass phrase to challenge with the keyBackupVersion public key.
* @param callback block called when the operations completes.
*/
fun trustKeysBackupVersionWithPassphrase(keysBackupVersion: KeysVersionResult, password: String, callback: MatrixCallback<Unit>)
fun trustKeysBackupVersionWithPassphrase(keysBackupVersion: KeysVersionResult,
password: String,
callback: MatrixCallback<Unit>)
/**
* Restore a backup with a recovery key from a given backup version stored on the homeserver.
@ -169,7 +182,11 @@ interface KeysBackupService {
* @param stepProgressListener the step progress listener
* @param callback Callback. It provides the number of found keys and the number of successfully imported keys.
*/
fun restoreKeysWithRecoveryKey(keysVersionResult: KeysVersionResult, recoveryKey: String, roomId: String?, sessionId: String?, stepProgressListener: StepProgressListener?, callback: MatrixCallback<ImportRoomKeysResult>)
fun restoreKeysWithRecoveryKey(keysVersionResult: KeysVersionResult,
recoveryKey: String, roomId: String?,
sessionId: String?,
stepProgressListener: StepProgressListener?,
callback: MatrixCallback<ImportRoomKeysResult>)
/**
* Restore a backup with a password from a given backup version stored on the homeserver.
@ -181,12 +198,16 @@ interface KeysBackupService {
* @param stepProgressListener the step progress listener
* @param callback Callback. It provides the number of found keys and the number of successfully imported keys.
*/
fun restoreKeyBackupWithPassword(keysBackupVersion: KeysVersionResult, password: String, roomId: String?, sessionId: String?, stepProgressListener: StepProgressListener?, callback: MatrixCallback<ImportRoomKeysResult>)
fun restoreKeyBackupWithPassword(keysBackupVersion: KeysVersionResult,
password: String,
roomId: String?,
sessionId: String?,
stepProgressListener: StepProgressListener?,
callback: MatrixCallback<ImportRoomKeysResult>)
val keysBackupVersion: KeysVersionResult?
val currentBackupVersion: String?
val isEnabled: Boolean
val isStucked: Boolean
val state: KeysBackupState
}
}

View File

@ -72,4 +72,4 @@ enum class KeysBackupState {
WillBackUp,
// e2e keys are being sent to the homeserver
BackingUp
}
}

View File

@ -23,4 +23,4 @@ interface KeysBackupStateListener {
* @param newState the new state
*/
fun onStateChange(newState: KeysBackupState)
}
}

View File

@ -30,4 +30,4 @@ enum class CancelCode(val value: String, val humanReadable: String) {
fun safeValueOf(code: String?): CancelCode {
return CancelCode.values().firstOrNull { code == it.value } ?: CancelCode.User
}
}

View File

@ -19,4 +19,4 @@ package im.vector.matrix.android.api.session.crypto.sas
import androidx.annotation.StringRes
data class EmojiRepresentation(val emoji: String,
@StringRes val nameResId: Int)
@StringRes val nameResId: Int)

View File

@ -31,4 +31,4 @@ interface IncomingSasVerificationTransaction {
CANCELLED_BY_ME,
CANCELLED_BY_OTHER
}
}
}

View File

@ -29,4 +29,4 @@ interface OutgoingSasVerificationRequest {
CANCELLED_BY_ME,
CANCELLED_BY_OTHER
}
}
}

View File

@ -19,4 +19,4 @@ package im.vector.matrix.android.api.session.crypto.sas
object SasMode {
const val DECIMAL = "decimal"
const val EMOJI = "emoji"
}
}

View File

@ -36,4 +36,4 @@ interface SasVerificationService {
fun transactionUpdated(tx: SasVerificationTransaction)
fun markedAsManuallyVerified(userId: String, deviceId: String)
}
}
}

View File

@ -47,4 +47,4 @@ interface SasVerificationTransaction {
* both short codes do match
*/
fun userHasVerifiedShortCode()
}
}

View File

@ -43,7 +43,7 @@ enum class SasVerificationTxState {
Verifying,
Verified,
//Global: The verification has been cancelled (by me or other), see cancelReason for details
// Global: The verification has been cancelled (by me or other), see cancelReason for details
Cancelled,
OnCancelled
}

View File

@ -34,9 +34,9 @@ import com.squareup.moshi.JsonClass
*/
@JsonClass(generateAdapter = true)
data class AggregatedAnnotation (
data class AggregatedAnnotation(
override val limited: Boolean? = false,
override val count: Int? = 0,
val chunk: List<RelationChunkInfo>? = null
) : UnsignedRelationInfo
) : UnsignedRelationInfo

View File

@ -50,4 +50,4 @@ import com.squareup.moshi.JsonClass
data class AggregatedRelations(
@Json(name = "m.annotation") val annotations: AggregatedAnnotation? = null,
@Json(name = "m.reference") val references: DefaultUnsignedRelationInfo? = null
)
)

View File

@ -23,4 +23,4 @@ data class DefaultUnsignedRelationInfo(
override val count: Int? = 0,
val chunk: List<Map<String, Any>>? = null
) : UnsignedRelationInfo
) : UnsignedRelationInfo

View File

@ -16,16 +16,17 @@
package im.vector.matrix.android.api.session.events.model
import android.text.TextUtils
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import im.vector.matrix.android.api.session.crypto.MXCryptoError
import im.vector.matrix.android.api.session.room.model.message.MessageContent
import im.vector.matrix.android.api.session.room.model.message.MessageType
import im.vector.matrix.android.api.session.room.send.SendState
import im.vector.matrix.android.api.util.JsonDict
import im.vector.matrix.android.internal.crypto.MXEventDecryptionResult
import im.vector.matrix.android.internal.crypto.algorithms.olm.OlmDecryptionResult
import im.vector.matrix.android.internal.di.MoshiProvider
import org.json.JSONObject
import timber.log.Timber
import java.util.*
import kotlin.collections.HashMap
typealias Content = JsonDict
@ -33,18 +34,16 @@ typealias Content = JsonDict
* This methods is a facility method to map a json content to a model.
*/
inline fun <reified T> Content?.toModel(catchError: Boolean = true): T? {
return this?.let {
val moshi = MoshiProvider.providesMoshi()
val moshiAdapter = moshi.adapter(T::class.java)
return try {
moshiAdapter.fromJsonValue(it)
} catch (e: Exception) {
if (catchError) {
Timber.e(e, "To model failed : $e")
null
} else {
throw e
}
val moshi = MoshiProvider.providesMoshi()
val moshiAdapter = moshi.adapter(T::class.java)
return try {
moshiAdapter.fromJsonValue(this)
} catch (e: Exception) {
if (catchError) {
Timber.e(e, "To model failed : $e")
null
} else {
throw e
}
}
}
@ -53,12 +52,10 @@ inline fun <reified T> Content?.toModel(catchError: Boolean = true): T? {
* This methods is a facility method to map a model to a json Content
*/
@Suppress("UNCHECKED_CAST")
inline fun <reified T> T?.toContent(): Content? {
return this?.let {
val moshi = MoshiProvider.providesMoshi()
val moshiAdapter = moshi.adapter(T::class.java)
return moshiAdapter.toJsonValue(it) as Content
}
inline fun <reified T> T.toContent(): Content {
val moshi = MoshiProvider.providesMoshi()
val moshiAdapter = moshi.adapter(T::class.java)
return moshiAdapter.toJsonValue(this) as Content
}
/**
@ -79,6 +76,15 @@ data class Event(
@Json(name = "redacts") val redacts: String? = null
) {
@Transient
var mxDecryptionResult: OlmDecryptionResult? = null
@Transient
var mCryptoError: MXCryptoError.ErrorType? = null
@Transient
var sendState: SendState = SendState.UNKNOWN
/**
* Check if event is a state event.
* @return true if event is state event.
@ -87,149 +93,117 @@ data class Event(
return EventType.isStateEvent(getClearType())
}
//==============================================================================================================
// ==============================================================================================================
// Crypto
//==============================================================================================================
/**
* For encrypted events, the plaintext payload for the event.
* This is a small MXEvent instance with typically value for `type` and 'content' fields.
*/
@Transient
var mClearEvent: Event? = null
private set
/**
* Curve25519 key which we believe belongs to the sender of the event.
* See `senderKey` property.
*/
@Transient
private var mSenderCurve25519Key: String? = null
/**
* Ed25519 key which the sender of this event (for olm) or the creator of the megolm session (for megolm) claims to own.
* See `claimedEd25519Key` property.
*/
@Transient
private var mClaimedEd25519Key: String? = null
/**
* Curve25519 keys of devices involved in telling us about the senderCurve25519Key and claimedEd25519Key.
* See `forwardingCurve25519KeyChain` property.
*/
@Transient
private var mForwardingCurve25519KeyChain: List<String> = ArrayList()
/**
* Decryption error
*/
@Transient
var mCryptoError: MXCryptoError? = null
private set
// ==============================================================================================================
/**
* @return true if this event is encrypted.
*/
fun isEncrypted(): Boolean {
return TextUtils.equals(type, EventType.ENCRYPTED)
}
/**
* Update the clear data on this event.
* This is used after decrypting an event; it should not be used by applications.
*
* @param decryptionResult the decryption result, including the plaintext and some key info.
*/
internal fun setClearData(decryptionResult: MXEventDecryptionResult?) {
mClearEvent = null
if (decryptionResult != null) {
if (decryptionResult.clearEvent != null) {
val adapter = MoshiProvider.providesMoshi().adapter(Event::class.java)
mClearEvent = adapter.fromJsonValue(decryptionResult.clearEvent)
if (mClearEvent != null) {
mSenderCurve25519Key = decryptionResult.senderCurve25519Key
mClaimedEd25519Key = decryptionResult.claimedEd25519Key
mForwardingCurve25519KeyChain = decryptionResult.forwardingCurve25519KeyChain
// For encrypted events with relation, the m.relates_to is kept in clear, so we need to put it back
// in the clear event
try {
content?.get("m.relates_to")?.let { clearRelates ->
mClearEvent = mClearEvent?.copy(
content = HashMap(mClearEvent!!.content).apply {
this["m.relates_to"] = clearRelates
}
)
}
} catch (e: Exception) {
Timber.e(e, "Unable to restore 'm.relates_to' the clear event")
}
}
}
}
mCryptoError = null
return type == EventType.ENCRYPTED
}
/**
* @return The curve25519 key that sent this event.
*/
fun getSenderKey(): String? {
return mClearEvent?.mSenderCurve25519Key ?: mSenderCurve25519Key
return mxDecryptionResult?.senderKey
}
/**
* @return The additional keys the sender of this encrypted event claims to possess.
*/
fun getKeysClaimed(): Map<String, String> {
val res = HashMap<String, String>()
val claimedEd25519Key = if (null != mClearEvent) mClearEvent!!.mClaimedEd25519Key else mClaimedEd25519Key
if (null != claimedEd25519Key) {
res["ed25519"] = claimedEd25519Key
}
return res
return mxDecryptionResult?.keysClaimed ?: HashMap()
}
/**
* @return the event type
*/
fun getClearType(): String {
return mClearEvent?.type ?: type
return mxDecryptionResult?.payload?.get("type")?.toString() ?: type
}
/**
* @return the event content
*/
fun getClearContent(): Content? {
return mClearEvent?.content ?: content
@Suppress("UNCHECKED_CAST")
return mxDecryptionResult?.payload?.get("content") as? Content ?: content
}
/**
* @return the linked crypto error
*/
fun getCryptoError(): MXCryptoError? {
return mCryptoError
fun toContentStringWithIndent(): String {
val contentMap = toContent().toMutableMap()
return JSONObject(contentMap).toString(4)
}
/**
* Update the linked crypto error
*
* @param error the new crypto error.
*/
fun setCryptoError(error: MXCryptoError?) {
mCryptoError = error
if (null != error) {
mClearEvent = null
}
fun toClearContentStringWithIndent(): String? {
val contentMap = this.mxDecryptionResult?.payload?.toMutableMap()
val adapter = MoshiProvider.providesMoshi().adapter(Map::class.java)
return contentMap?.let { JSONObject(adapter.toJson(it)).toString(4) }
}
/**
* Tells if the event is redacted
*/
fun isRedacted() = unsignedData?.redactedEvent != null
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as Event
if (type != other.type) return false
if (eventId != other.eventId) return false
if (content != other.content) return false
if (prevContent != other.prevContent) return false
if (originServerTs != other.originServerTs) return false
if (senderId != other.senderId) return false
if (stateKey != other.stateKey) return false
if (roomId != other.roomId) return false
if (unsignedData != other.unsignedData) return false
if (redacts != other.redacts) return false
if (mxDecryptionResult != other.mxDecryptionResult) return false
if (mCryptoError != other.mCryptoError) return false
if (sendState != other.sendState) return false
return true
}
override fun hashCode(): Int {
var result = type.hashCode()
result = 31 * result + (eventId?.hashCode() ?: 0)
result = 31 * result + (content?.hashCode() ?: 0)
result = 31 * result + (prevContent?.hashCode() ?: 0)
result = 31 * result + (originServerTs?.hashCode() ?: 0)
result = 31 * result + (senderId?.hashCode() ?: 0)
result = 31 * result + (stateKey?.hashCode() ?: 0)
result = 31 * result + (roomId?.hashCode() ?: 0)
result = 31 * result + (unsignedData?.hashCode() ?: 0)
result = 31 * result + (redacts?.hashCode() ?: 0)
result = 31 * result + (mxDecryptionResult?.hashCode() ?: 0)
result = 31 * result + (mCryptoError?.hashCode() ?: 0)
result = 31 * result + sendState.hashCode()
return result
}
}
fun Event.isTextMessage(): Boolean {
return getClearType() == EventType.MESSAGE
&& when (getClearContent()?.toModel<MessageContent>()?.type) {
MessageType.MSGTYPE_TEXT,
MessageType.MSGTYPE_EMOTE,
MessageType.MSGTYPE_NOTICE -> true
else -> false
}
}
fun Event.isImageMessage(): Boolean {
return getClearType() == EventType.MESSAGE
&& when (getClearContent()?.toModel<MessageContent>()?.type) {
MessageType.MSGTYPE_IMAGE -> true
else -> false
}
}

View File

@ -16,7 +16,6 @@
package im.vector.matrix.android.api.session.events.model
/**
* Constants defining known event types from Matrix specifications.
*/
@ -93,7 +92,6 @@ object EventType {
STATE_PINNED_EVENT
)
fun isStateEvent(type: String): Boolean {
return STATE_EVENTS.contains(type)
}

View File

@ -0,0 +1,28 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.session.events.model
import java.util.UUID
object LocalEcho {
private const val PREFIX = "local."
fun isLocalEchoId(eventId: String) = eventId.startsWith(PREFIX)
fun createLocalEchoId() = "${PREFIX}${UUID.randomUUID()}"
}

View File

@ -15,9 +15,8 @@
*/
package im.vector.matrix.android.api.session.events.model
/**
* Constants defining known event relation types from Matrix specifications.
* Constants defining known event relation types from Matrix specifications
*/
object RelationType {
@ -25,7 +24,6 @@ object RelationType {
const val ANNOTATION = "m.annotation"
/** Lets you define an event which replaces an existing event.*/
const val REPLACE = "m.replace"
/** ets you define an event which references an existing event.*/
/** Lets you define an event which references an existing event.*/
const val REFERENCE = "m.reference"
}
}

View File

@ -26,4 +26,4 @@ data class UnsignedData(
@Json(name = "transaction_id") val transactionId: String? = null,
@Json(name = "prev_content") val prevContent: Map<String, Any>? = null,
@Json(name = "m.relations") val relations: AggregatedRelations? = null
)
)

View File

@ -15,8 +15,7 @@
*/
package im.vector.matrix.android.api.session.events.model
interface UnsignedRelationInfo {
val limited : Boolean?
val count: Int?
}
}

View File

@ -0,0 +1,51 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.session.file
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.internal.crypto.attachments.ElementToDecrypt
import java.io.File
/**
* This interface defines methods to get files.
*/
interface FileService {
enum class DownloadMode {
/**
* Download file in external storage
*/
TO_EXPORT,
/**
* Download file in cache
*/
FOR_INTERNAL_USE
}
/**
* Download a file.
* Result will be a decrypted file, stored in the cache folder. id parameter will be used to create a sub folder to avoid name collision.
* You can pass the eventId
*/
fun downloadFile(
downloadMode: DownloadMode,
id: String,
fileName: String,
url: String?,
elementToDecrypt: ElementToDecrypt?,
callback: MatrixCallback<File>)
}

View File

@ -21,4 +21,4 @@ package im.vector.matrix.android.api.session.group
*/
interface Group {
val groupId: String
}
}

View File

@ -19,7 +19,6 @@ package im.vector.matrix.android.api.session.group
import androidx.lifecycle.LiveData
import im.vector.matrix.android.api.session.group.model.GroupSummary
/**
* This interface defines methods to get groups. It's implemented at the session level.
*/
@ -37,4 +36,4 @@ interface GroupService {
* @return the [LiveData] of [GroupSummary]
*/
fun liveGroupSummaries(): LiveData<List<GroupSummary>>
}
}

View File

@ -16,15 +16,18 @@
package im.vector.matrix.android.api.session.group.model
import im.vector.matrix.android.api.session.room.model.Membership
/**
* This class holds some data of a group.
* It can be retrieved through [im.vector.matrix.android.api.session.group.GroupService]
*/
data class GroupSummary(
val groupId: String,
val membership: Membership,
val displayName: String = "",
val shortDescription: String = "",
val avatarUrl: String = "",
val roomIds: List<String> = emptyList(),
val userIds: List<String> = emptyList()
)
)

Some files were not shown because too many files have changed in this diff Show More