Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
51aa3f6a by wurstsalat at 2024-08-02T17:41:53+02:00
change: Search: Use quotes to mark search filter content

Since nicknames can contain spaces, using the "from:" filter with a 
word boundry
search would only match until the first space is encountered.
To circumvent this limitation, quotation marks are now expected to be used 
around
search terms, e.g. from:"cal0pteryx" or from:"Gajim Dev"
This applies to all search filters, including "before" and 
"after".

Fixes #11355

- - - - -


1 changed file:

- gajim/gtk/search_view.py


Changes:

=====================================
gajim/gtk/search_view.py
=====================================
@@ -189,10 +189,10 @@ def _strip_filters(text: str,
         filters: list[str] = []
         start = 0
         new_text = ''
-        for search_filter in re.finditer(filter_name + r':(\S+)\s?', text):
+        for search_filter in re.finditer(filter_name + r'(:\")(.*?)\"', text):
             end, new_start = search_filter.span()
             new_text += text[start:end]
-            filters.append(search_filter.group(1))
+            filters.append(search_filter.group(2))
             start = new_start
         new_text += text[start:]
         return new_text, filters or None



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/51aa3f6acd82a5f3b66b05509c9e1d43369b1afa

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/51aa3f6acd82a5f3b66b05509c9e1d43369b1afa
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- commits@gajim.org
To unsubscribe send an email to commits-le...@gajim.org

Reply via email to