File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
vector/src/main/java/im/vector/app/core/extensions Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package im.vector.app.core.extensions
1919import android.util.Patterns
2020import com.google.i18n.phonenumbers.NumberParseException
2121import com.google.i18n.phonenumbers.PhoneNumberUtil
22+ import org.matrix.android.sdk.api.MatrixPatterns
2223import org.matrix.android.sdk.api.extensions.ensurePrefix
2324
2425fun Boolean.toOnOff () = if (this ) " ON" else " OFF"
@@ -30,6 +31,8 @@ inline fun <T> T.ooi(block: (T) -> Unit): T = also(block)
3031 */
3132fun CharSequence.isEmail () = Patterns .EMAIL_ADDRESS .matcher(this ).matches()
3233
34+ fun CharSequence.isMatrixId () = MatrixPatterns .isUserId(this .toString())
35+
3336/* *
3437 * Return empty CharSequence if the CharSequence is null.
3538 */
You can’t perform that action at this time.
0 commit comments