Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2021-02-27 12:11:37 +0300
committerlovetox <philipp@hoerist.com>2021-02-27 12:11:37 +0300
commitb3da8835e231c4512bf46de7a41203a3f1a37703 (patch)
tree93f57e5957a4faa0a40573b0f718a71c71cfbf96
parent6f0329870288135502b9329422ba27685a7b7faf (diff)
Windows: Open uris with webbrowser lib
Trying to work around #10455
-rw-r--r--gajim/common/helpers.py16
1 files 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)