From a3e651b28862eb65068f8f8a6b2064ac087b964f Mon Sep 17 00:00:00 2001 From: Daniel <mailtrash@posteo.de> Date: Wed, 28 Feb 2018 09:01:52 +0100 Subject: [PATCH] Handle geo:-URIs --- gajim/conversation_textview.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gajim/conversation_textview.py b/gajim/conversation_textview.py index e3e8f4976a..e1965563bc 100644 --- a/gajim/conversation_textview.py +++ b/gajim/conversation_textview.py @@ -803,6 +803,17 @@ class ConversationTextview(GObject.GObject): self.on_start_chat_activate(None, jid) else: self.on_start_chat_activate(None, word) + # handle geo:-URIs + elif word[:4] == 'geo:': + location = word[4:] + lat, _, lon = location.partition(',') + if lon == '': + return + uri = 'https://www.openstreetmap.org/?' \ + 'mlat=%(lat)s&mlon=%(lon)s&zoom=16' % \ + {'lat': lat, 'lon': lon} + helpers.launch_browser_mailer(kind, uri) + # other URIs else: helpers.launch_browser_mailer(kind, word) -- GitLab