Commit Graph

262 Commits

Author SHA1 Message Date
Konrad Pozniak 526f170d51
don't crash on invalid json response for push subscription (#2613) 2022-07-11 18:17:58 +02:00
Konrad Pozniak 62c4cfde89
improve media upload error messages (#2602) 2022-06-30 20:51:05 +02:00
Konrad Pozniak 8a0848d252
fix data loss when re-adding existing account (#2601) 2022-06-30 20:49:48 +02:00
Konrad Pozniak 9dcb1b666c
show push migration snackbar above floating action button (#2598) 2022-06-30 20:49:27 +02:00
mcclure 3ca8a0b549
Use specific term "image" in error UI, not "attachment" (#2592)
The new message for the crop feature, "The attachment could not be edited.", turned out to be awkward in some languages (French) where according to the translator it would be better to more specifically say "The image could not be edited." (as currently we can only edit images). Patch replaces error_media_edit_failed with a error_image_edit_failed and deletes the existing error_media_edit_failed-s.
2022-06-21 22:14:11 +02:00
Konrad Pozniak f419e83c16
improve logout (#2579)
* improve logout

* fix tests

* add db migration

* delete wrongly committed file again

* improve LogoutUsecase
2022-06-20 16:45:54 +02:00
Konrad Pozniak dba2fbc5c1
fix empty timeline on initial load (#2586) 2022-06-20 16:11:30 +02:00
Karmanyaah Malhotra cbc5077b1f
UnifiedPush: FEATURE_BYTES_MESSAGE distributors (#2581)
Only use distributors which are compatible with FEATURE_BYTES_MESSAGE
This is because Mastodon sends notifications that are arbritary bytes,
not UTF-8. This causes issues in older versions of UnifiedPush
distributors and providers that don't support FEATURE_BYTES_MESSAGE
2022-06-09 20:03:27 +02:00
tobi 530eb61505
Use NetworkResult in MediaUploadApi (#2577) 2022-06-06 16:04:33 +02:00
Konrad Pozniak e1c8461423
replace kotlin-result-calladapter with networkresult-calladapter (#2569)
* replace kotlin-result-calladapter with networkresult-calladapter

* fix tests
2022-05-30 20:03:40 +02:00
Konrad Pozniak 131309e99c
Fix conversations (#2556)
* fix conversations

* cleanup ConversationsRemoteMediator

* update conversation timestamps regularly

* improve loadStateListener

* add db migration

* make deleting from conversation db suspending

* reorganize code in ConversationsFragment

* delete NetworkStateViewHolder

* cleanup imports

* add 38.json

* honor fabHide setting in ConversationsFragment

* set page size to 30
2022-05-30 19:06:14 +02:00
Konrad Pozniak 434d345d01
remove unused member vars from TimelineFragment (#2561) 2022-05-29 19:23:08 +02:00
Ivan Kupalov e63cd68baf
Fix filters in timelines in a simple way, fix #2546 (#2566)
Loading of statuses and loading of filters is an "intended" race:
we want to display statuses first, especially if they are cached.
Unfortunately we do not cache filters themselves so when we load cached
statuses we do not apply filters.

One part of the solution is to re-filter the statuses once we fetch the
filters. This commit implements it. Caching of filters is not included
yet.
2022-05-29 19:22:59 +02:00
mcclure 06e32f703a
Fix unintended [mismatched] show-replies preference (with key force-reset) (#2568)
* Fix unintended [mismatched] show-replies preference and add a comment to prevent confusion.

* Change the key on TAB_FILTER_HOME_REPLIES to reset everyone's value here once.
2022-05-29 19:21:33 +02:00
Konrad Pozniak becb677176
make WebView debuggable in debug builds (#2548) 2022-05-27 18:44:16 +02:00
UlrichKu 2424dde9cc
Fire observable to update timestamps directly on resume (#2554) (#2555) 2022-05-27 18:43:10 +02:00
Konrad Pozniak fd9d48e4a6
remove legacy notification channel cleanup (#2550) 2022-05-25 20:54:25 +02:00
mcclure 00c139190e
Ability to crop images attached to posts (#2531)
* First attachment crop attempt: Can crop in place, but does not delete/replace on server so has no effect

* Attachment crop feature works

* ktlint fixes on attachment crop patch

* Upgrade Android-Image-Cropper to 4.2.1

* An error message should be displayed if attachment cropping fails and it is not because the user intentionally cancelled.

* Remove 2 of the 3 "state passing" variables by using MediaUtils

* Cropper should use content uri (MIME type bearing) and setOutputCompressFormat so that PNGs reach the server safely.

* Change to crop requested by Conny: Store inflight cropImageItemOld in view model

* Change to crop requested by Conny: Sort cropImage with the other contracts

* ktlint fixes on attachment crop patch (again)
2022-05-22 21:01:14 +02:00
Levi Bard 4188670b42
Implement reply count indicator to track web UI (#2467)
Addresses #882
2022-05-20 16:47:45 +02:00
Konrad Pozniak cec8f6dd65
modernize autocomplete (#2510)
* modernize autocomplete

* use @WorkerThread annotation
2022-05-17 19:55:37 +02:00
Martin Marconcini d97493d312
Issue 2477: Show account's creation date in Profile. (#2480)
* Show account's creation date in Profile.

* Fix broken test.

* Store account creation date in the Database.

* Reformat and reposition Joined Date according to PR Feedback.

* Revert "Store account creation date in the Database."

This reverts commit d9761f53 as it's not needed.

* Change Account's Creation Date to a java.util.Date.
Update Test.

* Fix wildcard import.

* Show full month instead of an abbreviation.

* Remove `lazy` usage in favor of local instantiation.

Co-authored-by: Martin Marconcini <martin.marconcini.rodriguez@nl.abnamro.com>
Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
2022-05-17 19:49:42 +02:00
Peter Cai 9ec5d6e3b0
Push notifications support via UnifiedPush (#2303)
Fixes #793.

This is an implementation for push notifications based on UnifiedPush
for Tusky. No push gateway (other than UP itself) is needed, since
UnifiedPush is simple enough such that it can act as a catch-all
endpoint for WebPush messages. When a UnifiedPush distributor is present
on-device, we will by default register Tusky as a receiver; if no
UnifiedPush distributor is available, then pull notifications are used
as a fallback mechanism.

Because WebPush messages are encrypted, and Mastodon does not send the
keys and IV needed for decryption in the request body, for now the push
handler simply acts as a trigger for the pre-existing NotificationWorker
which is also used for pull notifications. Nevertheless, I have
implemented proper key generation and storage, just in case we would
like to implement full decryption support in the future when Mastodon
upgrades to the latest WebPush encryption scheme that includes all
information in the request body.

For users with existing accounts, push notifications will not be enabled
until all of the accounts have been re-logged in to grant the new push
OAuth scope. A small prompt will be shown (until dismissed) as a
Snackbar to explain to the user about this, and an option is added in
Account Preferences to facilitate re-login without deleting local drafts
and cache.
2022-05-17 19:32:09 +02:00
Konrad Pozniak d9c6269d44
fix deleting media attachments removing the wrong ones (#2517) 2022-05-12 18:21:43 +02:00
Konrad Pozniak beaed6b875
Fix crash when saving redrafted media to drafts (#2502)
* fix crash when saving draft from redraft

* fix crash when saving draft from redraft

* replace ... with …
2022-05-09 19:39:43 +02:00
Levi Bard b4eda5ea65
Unbreak link previews in timelines (#2506) 2022-05-05 18:27:05 +02:00
Konrad Pozniak db81ede04a
fix login webview title color with light theme (#2497) 2022-05-04 18:40:29 +02:00
Konrad Pozniak a2cc622683
fix EmojiCompat.get().process crash in polls (#2494) 2022-05-03 19:15:59 +02:00
Ivan Kupalov f3d7923803
Improve UX when Login WebView fails to load the page (#2492)
Previously we simply closed the screen with the login WebView which
could cause confusion. Now we specify that page could not be loaded.

As a side effect it will also show the error message which the server
returns (if any).
2022-05-03 19:14:55 +02:00
Konrad Pozniak 444e7365c9
fix race condition where multiple uploaded media can get same internal id (#2479)
* fix race condition where multiple uploaded media can get same internal id

* atomically update media stateflow

* atomically update media stateflow
2022-05-03 19:12:35 +02:00
Konrad Pozniak ce5ec15ff1
increase timeout for media uploads (#2489) 2022-05-01 17:16:22 +02:00
Konrad Pozniak 7fd54e3b4f fix timeline refresh spinner finishing before updates are visible 2022-04-30 08:09:59 +02:00
Guntbert Reiter 9a8dfaa744
Remove code to check the server version (#2469)
solves #2439
2022-04-29 18:35:25 +02:00
Konrad Pozniak e5b58770ce
improve LoginWebViewActivityUX (#2465) 2022-04-28 20:38:51 +02:00
Konrad Pozniak 28ac190212
fix SearchActivity transition animations (#2464) 2022-04-28 20:37:46 +02:00
Konrad Pozniak 671d2c6a45
Check if media processing finished before sending status (#2458)
* make MastodonApi.createStatus suspending

* check if media processing has finished before sending status

* add backoff for retrying processed media check
2022-04-28 20:37:31 +02:00
moddedBear 0e9d362351
Remove Identity Proof Support (#2456)
* Remove IdentityProof.kt and refactor

* Remove accountFieldData from viewmodel

* Remove unused imports
2022-04-27 19:58:39 +02:00
Constantin A f15b3e61bb
New emoji picker (#2395)
* Update to Emoji2

* Hopefully fix the emoji picker preference

* Switch to released Filemojicompat version

* Filemojicompat version as an own var

* Remove an unused import

* Small cleanup

* Correct onDisplayPreferenceDialog; test TuskyApplication

* Use TextViews instead of EmojiTextViews

* Recreate the Main Activity if the emoji pack is updated

* Enable coreLibraryDesugaring (for Java Streams); update Filemojicompat, downgrade Emoji2

* Update emoji font versions to 14

* Use FilemojiCompat 3.2.0-beta01

* Make ktLint happy again

* Remove coreLibraryDesugaring and a FIXME

* Use EmojiPickerPreference.get()

* Disable emoji pack import

* Update FilemojiCompat to Beta 2

* Update FilemojiCompat to Beta 3

* Update FilemojiCompat to Beta 3.2.0 final

* Update FilemojiCompat to 3.2.1
2022-04-26 18:50:58 +02:00
Konrad Pozniak adcbe1a831
fix unparsed html in announcements (#2451) 2022-04-21 18:47:05 +02:00
Konrad Pozniak 43709532d6
fix unparsed html in "replying to" toggle (#2448) 2022-04-21 18:46:43 +02:00
Konrad Pozniak d2bfceae7b
refactor compose & announcements to coroutines (#2446)
* refactor compose & announcements to coroutines

* fix code formatting

* add javadoc to InstanceInfoRepository

* fix comments in ImageDownsizer

* remove unused Either extensions

* add explicit return type for InstanceInfoRepository.getEmojis

* make ComposeViewModel.pickMedia return Result

* cleanup code in ImageDownsizer
2022-04-21 18:46:21 +02:00
Konrad Pozniak b5d8b73044
fix "account moved" on profiles not being clickable (#2438) 2022-04-19 11:10:23 +02:00
Levi Bard dff039e123
Add support for post edit notifications (#2431)
* Add support for post edit notifications

* Update notification icon
2022-04-19 11:10:13 +02:00
Mélanie Chauvel e0abcbfada
Improve time format of posts when using absolute time (#2413)
* Improve time format of posts when using absolute time

* fix AbsoluteTimeFormatter, add tests

* fix tests

Co-authored-by: Conny Duck <k.pozniak@gmx.at>
2022-04-18 21:41:18 +02:00
Konrad Pozniak 027b659d1c
fix notifications showing unparsed html (#2436) 2022-04-16 09:44:05 +02:00
Konrad Pozniak 3e849244f9
move Html parsing to ViewData (#2414)
* move Html parsing to ViewData

* refactor reports to use viewdata

* cleanup code

* refactor conversations

* fix getEditableText

* rename StatusParsingHelper

* fix tests

* commit db schema file

* add file header

* rename helper function to parseAsMastodonHtml

* order imports correctly

* move mapping off main thread to default dispatcher

* fix ktlint
2022-04-15 13:20:27 +02:00
Konrad Pozniak 7aa328b3dc
fix login on Android API level <24 (#2432) 2022-04-15 10:50:28 +02:00
Konrad Pozniak 3e8c6a318a
introduce KotlinResultCallAdapter for nice suspending network calls (#2415)
* introduce KotlinResultCallAdapter for nice suspending network calls

* fix tests
2022-04-14 19:49:49 +02:00
kyori19 d21d045eda
Support new signup notifications (#2357) 2022-04-14 19:39:30 +02:00
Konrad Pozniak 1d20a02d17
fix crash in ConversationsFragment (#2426) 2022-04-13 19:22:19 +02:00
Konrad Pozniak b4a913b2d5
fix black theme on Android 12 (#2424)
* fix black theme on Android 12

* Revert "fix black theme on Android 12"

This reverts commit 2286706fdb239e15be72ac8943405ffeb2258219.

* bring back SplashActivity
2022-04-13 19:22:01 +02:00