Yuito-app-android/app/src/main/java/com/keylesspalace/tusky
Nik Clayton 6dfdaec425
Ignore "@instance..." part of username when computing status length (#3392)
* Move compose.* tests to own namespace

* Ignore "@instance..." part of username when computing status length

In a status with a mention ("@foo@example.org") only the "@foo" part should
be included in the calculated status length. It wasn't, so the app was
prevening people from posting statuses that should have been allowed.

Fix this.

- Lift the length calculation code in to a separate static function (easier
  and faster to test)
- Add a `MentionSpan` type, to reuse existing code for detecting mentions
- Fix a bug in `FakeSpannable.getSpans()` (it was returning the outer type,
  not the wrapped inner span)
- Add additional fast tests

The tests made sense under the `components.compose.ComposeActivity` package,
so I also created that and moved the existing ComposeActivity tests there.

Fixes https://github.com/tuskyapp/Tusky/issues/3339

* Static import assertEquals
2023-03-13 10:22:33 +01:00
..
adapter Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
appstore Remove stale pre-edit statuses from the thread view. (#3377) 2023-03-10 20:24:41 +01:00
components Ignore "@instance..." part of username when computing status length (#3392) 2023-03-13 10:22:33 +01:00
db Fixup DAO function (#3441) 2023-03-13 09:57:59 +01:00
di Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
entity Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
fragment Convert NotificationsFragment and related code to Kotlin, use the Paging library (#3159) 2023-03-10 20:12:33 +01:00
interfaces Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
json don't crash on unparseable date (#3129) 2023-01-09 21:24:04 +01:00
network Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
pager Keep the tabs adapter over the life of the viewpager (#3255) 2023-02-15 19:17:59 +01:00
receiver Use more orEmpty extensions (#3399) 2023-03-01 21:06:55 +01:00
service Remove stale pre-edit statuses from the thread view. (#3377) 2023-03-10 20:24:41 +01:00
settings 3204: Add an account based preference store (#3205) 2023-02-27 14:07:28 +01:00
usecase Convert NotificationsFragment and related code to Kotlin, use the Paging library (#3159) 2023-03-10 20:12:33 +01:00
util Ignore "@instance..." part of username when computing status length (#3392) 2023-03-13 10:22:33 +01:00
view Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
viewdata Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
viewmodel Handle even more instance defaults (#2612) 2022-07-26 20:24:50 +02:00
AboutActivity.kt add ktlint plugin to project and apply default code style (#2209) 2021-06-28 21:13:24 +02:00
AccountsInListFragment.kt Use more orEmpty extensions (#3399) 2023-03-01 21:06:55 +01:00
BaseActivity.java Code cleanups (#3264) 2023-02-20 19:58:37 +01:00
BottomSheetActivity.kt When looking up fediverse urls, verify that account results returned match the input query. (#3341) 2023-02-25 21:27:26 +01:00
EditProfileActivity.kt Don't display error message if user cancels picking an image (#3427) 2023-03-13 10:17:41 +01:00
LicenseActivity.kt migrate `IOUtils` to Kotlin (#2763) 2022-11-07 20:10:06 +01:00
ListsActivity.kt Replace DefaultTextWatcher with extensions in core-ktx (#3401) 2023-03-10 20:27:24 +01:00
MainActivity.kt Add "Refresh" accessibility menu (#3121) 2023-03-01 19:58:18 +01:00
SplashActivity.kt remove legacy notification channel cleanup (#2550) 2022-05-25 20:54:25 +02:00
StatusListActivity.kt Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
TabData.kt Convert NotificationsFragment and related code to Kotlin, use the Paging library (#3159) 2023-03-10 20:12:33 +01:00
TabPreferenceActivity.kt Replace DefaultTextWatcher with extensions in core-ktx (#3401) 2023-03-10 20:27:24 +01:00
TuskyApplication.kt 3204: Add an account based preference store (#3205) 2023-02-27 14:07:28 +01:00
ViewMediaActivity.kt Support a swipe down to dismiss video (#2879) 2022-12-05 14:33:38 +01:00