From 474c5014d9dd6154b57829cfa4a096f05bbbf33b Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Thu, 9 Oct 2025 15:32:54 +0300 Subject: [PATCH] feat(ProfileEditor): proper bio validation --- src/Dialogs/ProfileEdit.vala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Dialogs/ProfileEdit.vala b/src/Dialogs/ProfileEdit.vala index df9a6126a..37814cc12 100644 --- a/src/Dialogs/ProfileEdit.vala +++ b/src/Dialogs/ProfileEdit.vala @@ -164,7 +164,14 @@ public class Tuba.Dialogs.ProfileEdit : Adw.Dialog { } void on_bio_text_changed () { - var valid = bio_text_view.buffer.get_char_count () <= 500; + string replaced_urls = Utils.Tracking.cleanup_content_with_uris ( + bio_text_view.buffer.text, + Utils.Tracking.extract_uris (bio_text_view.buffer.text), + Utils.Tracking.CleanupType.SPECIFIC_LENGTH, + accounts.active.instance_info.compat_status_characters_reserved_per_url + ); + string replaced_mentions = Utils.Counting.replace_mentions (replaced_urls); + var valid = Utils.Counting.chars (replaced_mentions) <= 500; Tuba.toggle_css (bio_row, !valid, "error"); }