chinwag-android/app
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
..
schemas/com.keylesspalace.tusky.db.AppDatabase Support the mastodon 4 filter api (#3188) 2023-03-11 13:12:50 +01:00
src Ignore "@instance..." part of username when computing status length (#3392) 2023-03-13 10:22:33 +01:00
build.gradle Update Robolectric to 4.9.2 (#3422) 2023-03-13 10:18:41 +01:00
getGitSha.gradle Previous attempt to fix git sha on non-git build broke git build. (#3322) 2023-02-16 20:20:52 +01:00
proguard-rules.pro Add extra proguard rules for OkHttp (#3350) 2023-02-25 21:40:13 +01:00