Watch
1
0
Fork
You've already forked nexus
0
forked from Nexus/nexus

treewide: small refactors

This commit is contained in:
Henry Hiles 2026-10-15 20:10:44 -04:00
commit 8d944831f5
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
10 changed files with 63 additions and 63 deletions

View file

@ -1,6 +1,9 @@
extension GetLocalpart on String {
String get localpart => length > 1 ? substring(1).split(":").first : "?";
/// Whether this looks like a valid Matrix user ID, e.g. `@user:example.com`.
bool get isValidUserId => RegExp(r"^@[^:\s]+:[^\s]+$").hasMatch(this);
String? get serverName {
final index = indexOf(":");
return index == -1 ? null : substring(index + 1);