Silently accept usernames in front of instances in the login screen, because plenty of folks try including it.

main
Vavassor 8 years ago
parent 632cb0d6e3
commit bfc89b26bd
  1. 6
      app/src/main/java/com/keylesspalace/tusky/LoginActivity.java

@ -78,8 +78,14 @@ public class LoginActivity extends AppCompatActivity {
/** Make sure the user-entered text is just a fully-qualified domain name. */
private static String validateDomain(String s) {
// Strip any schemes out.
s = s.replaceFirst("http://", "");
s = s.replaceFirst("https://", "");
// If a username was included (e.g. username@example.com), just take what's after the '@'.
int at = s.indexOf('@');
if (at != -1) {
s = s.substring(at + 1);
}
return s.trim();
}

Loading…
Cancel
Save