From b3da8835e231c4512bf46de7a41203a3f1a37703 Mon Sep 17 00:00:00 2001 From: lovetox Date: Sat, 27 Feb 2021 10:11:37 +0100 Subject: Windows: Open uris with webbrowser lib Trying to work around #10455 --- gajim/common/helpers.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gajim/common/helpers.py b/gajim/common/helpers.py index f8d942d9a..679e41cab 100644 --- a/gajim/common/helpers.py +++ b/gajim/common/helpers.py @@ -47,6 +47,7 @@ import random import weakref import inspect import string +import webbrowser from string import Template import urllib from urllib.parse import unquote @@ -1097,13 +1098,22 @@ def open_uri(uri, account=None): open_file(uri.data) elif uri.type == URIType.TEL: - Gio.AppInfo.launch_default_for_uri(f'tel:{uri.data}') + if sys.platform == 'win32': + webbrowser.open(f'tel:{uri.data}') + else: + Gio.AppInfo.launch_default_for_uri(f'tel:{uri.data}') elif uri.type == URIType.MAIL: - Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}') + if sys.platform == 'win32': + webbrowser.open(f'mailto:{uri.data}') + else: + Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}') elif uri.type in (URIType.WEB, URIType.GEO): - Gio.AppInfo.launch_default_for_uri(uri.data) + if sys.platform == 'win32': + webbrowser.open(uri.data) + else: + Gio.AppInfo.launch_default_for_uri(uri.data) elif uri.type == URIType.AT: app.interface.new_chat_from_jid(account, uri.data) -- cgit v1.2.3