Philipp Hörist pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/common/helpers.py
    ... ... @@ -32,7 +32,6 @@ import sys
    32 32
     import re
    
    33 33
     import os
    
    34 34
     import subprocess
    
    35
    -import webbrowser
    
    36 35
     import base64
    
    37 36
     import hashlib
    
    38 37
     import shlex
    
    ... ... @@ -1101,6 +1100,9 @@ def parse_uri(uri):
    1101 1100
             if not lon:
    
    1102 1101
                 return URI(type=URIType.UNKNOWN, data=uri)
    
    1103 1102
     
    
    1103
    +        if Gio.AppInfo.get_default_for_uri_scheme('geo'):
    
    1104
    +            return URI(type=URIType.GEO, data=uri)
    
    1105
    +
    
    1104 1106
             uri = geo_provider_from_location(lat, lon)
    
    1105 1107
             return URI(type=URIType.GEO, data=uri)
    
    1106 1108
     
    
    ... ... @@ -1119,17 +1121,10 @@ def open_uri(uri, account=None):
    1119 1121
             open_file(uri.data)
    
    1120 1122
     
    
    1121 1123
         elif uri.type == URIType.MAIL:
    
    1122
    -        uri = 'mailto:%s' % uri.data
    
    1123
    -        if os.name == 'nt':
    
    1124
    -            webbrowser.open(uri)
    
    1125
    -        else:
    
    1126
    -            Gio.AppInfo.launch_default_for_uri(uri)
    
    1124
    +        Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}')
    
    1127 1125
     
    
    1128 1126
         elif uri.type in (URIType.WEB, URIType.GEO):
    
    1129
    -        if os.name == 'nt':
    
    1130
    -            webbrowser.open(uri.data)
    
    1131
    -        else:
    
    1132
    -            Gio.AppInfo.launch_default_for_uri(uri.data)
    
    1127
    +        Gio.AppInfo.launch_default_for_uri(uri.data)
    
    1133 1128
     
    
    1134 1129
         elif uri.type == URIType.AT:
    
    1135 1130
             app.interface.new_chat_from_jid(account, uri.data)