[preview] Handly encoded URIs correctly
This commit is contained in:
@@ -21,7 +21,6 @@ import mimetypes
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from urllib.parse import unquote
|
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
@@ -232,7 +231,7 @@ class UrlImagePreviewPlugin(GajimPlugin):
|
|||||||
return
|
return
|
||||||
|
|
||||||
uri = text
|
uri = text
|
||||||
urlparts = urlparse(unquote(uri))
|
urlparts = urlparse(uri)
|
||||||
if not self._accept_uri(urlparts, uri, additional_data):
|
if not self._accept_uri(urlparts, uri, additional_data):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ def parse_fragment(fragment):
|
|||||||
|
|
||||||
|
|
||||||
def get_image_paths(uri, urlparts, size, orig_dir, thumb_dir):
|
def get_image_paths(uri, urlparts, size, orig_dir, thumb_dir):
|
||||||
path = Path(urlparts.path)
|
path = Path(unquote(urlparts.path))
|
||||||
web_stem = path.stem
|
web_stem = path.stem
|
||||||
extension = path.suffix
|
extension = path.suffix
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user