GNOME Bugzilla – Bug 586401
Clicking URLs don't work in adium's themes
Last modified: 2009-08-18 20:24:31 UTC
I am unsure what does this theme do, but it inserts a URL button instead of URLs and it doesn't work (because the URL is appended to the basedir).
I hit the same bug with the renkoo theme which doesn't hide the urls so it's probably a bug with the adium engine The link was www.espacemagh.be and I got a message saying it can't open URI : /home/olivier/renkoo/renkoo.AdiumMessageStyle/Contents/Resources/www.espacemagh.be
Created attachment 137424 [details] [review] Fix such urls on branch fix-586301 http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/fix-586401 libempathy-gtk/empathy-theme-adium.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
Brackets don't respect coding style. uri = &uri[len]; --> I prefer uri = uri + len or uri += len but that's fine I guess :p
Created attachment 137649 [details] [review] Update branch fix-586401 http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/fix-586401 libempathy-gtk/empathy-theme-adium.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
Created attachment 137748 [details] [review] Completely new fix on branch fix-586401 where the http:// is added before hand and not when clicking on the link http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/fix-586401 libempathy-gtk/empathy-theme-adium.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
There is not only http(s) and mailto. The regex to catch URI has that (empathy-ui-utils.h): #define SCHEMES "(https?|s?ftps?|nntp|news|javascript|about|ghelp|apt|telnet|"\ "file|webcal|mailto)" Probably the correct fix is if (g_str_has_prefix (url, "www.") ||g_str_has_prefix (url, "ftp."). It seems those are the 2 only non-absolute links we support. Or if (g_uri_parse_scheme(url)==NULL)
Oh and last possibility, see fixup_url() in empathy-ui-utils.c. That's the function used to make the clicked URL absolute to work with gtk_show_uri(). It is a bit more agressive :)
Created attachment 141004 [details] [review] New fix using Xavier's comments on branch fix-586401 http://git.collabora.co.uk/?p=user/pierlux/empathy.git;a=shortlog;h=refs/heads/fix-586401 libempathy-gtk/empathy-theme-adium.c | 10 +++++++++- libempathy-gtk/empathy-ui-utils.c | 6 +++--- libempathy-gtk/empathy-ui-utils.h | 2 ++ 3 files changed, 14 insertions(+), 4 deletions(-)
Merged after applying Xavier's comment (empathy_make_absolute_url should not return NULL) and a re-review.