Philipp Hörist pushed to branch master at gajim / gajim
Commits:
2b5ab697 by Philipp Hörist at 2022-12-09T00:13:08+01:00
fix: Remember last folder correctly after sending file
- - - - -
1 changed file:
- gajim/gtk/file_transfer_selector.py
Changes:
=====================================
gajim/gtk/file_transfer_selector.py
=====================================
@@ -168,7 +168,7 @@ def add_files(self, uris: list[str]) -> None:
row = FileRow(path, size_warning, jingle_warning)
self._ui.listbox.add(row)
- app.settings.set('last_send_dir', str(path))
+ app.settings.set('last_send_dir', str(path.parent))
self._ui.listbox.show_all()
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2b5ab69751f687f6dd188d7346ff8833…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2b5ab69751f687f6dd188d7346ff8833…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
2a595826 by mjk at 2022-12-08T22:55:46+00:00
fix: Preview: Don't treat multi-line message body as previewable URL
- - - - -
1 changed file:
- gajim/common/preview.py
Changes:
=====================================
gajim/common/preview.py
=====================================
@@ -21,6 +21,7 @@
import logging
import os
+import re
from pathlib import Path
from urllib.parse import urlparse
from urllib.parse import ParseResult
@@ -33,6 +34,7 @@
from gajim.common import app
from gajim.common import configpaths
+from gajim.common import regex
from gajim.common.const import MIME_TYPES
from gajim.common.helpers import AdditionalDataDict
from gajim.common.helpers import load_file_async
@@ -53,6 +55,8 @@
log = logging.getLogger('gajim.c.preview')
+IRI_RX = re.compile(regex.IRI)
+
PREVIEWABLE_MIME_TYPES = get_previewable_mime_types()
mime_types = set(MIME_TYPES)
# Merge both: if it’s a previewable image, it should be allowed
@@ -333,8 +337,9 @@ def _accept_uri(urlparts: ParseResult,
def is_previewable(self,
text: str,
additional_data: AdditionalDataDict) -> bool:
- if len(text.split(' ')) > 1:
- # urlparse doesn't recognise spaces as URL delimiter
+ if not IRI_RX.fullmatch(text):
+ # urlparse removes whitespace (and who knows what else) from URLs,
+ # so can't be used for validation.
return False
uri = text
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2a5958265717a72181156511bb8521c4…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2a5958265717a72181156511bb8521c4…
You're receiving this email because of your account on dev.gajim.org.