GNOME Bugzilla – Bug 331813
SIP/H.323 Addresses
Last modified: 2007-04-20 04:57:23 UTC
Evolution should highlight sip/h323 URLs and allow them to be clickable.
Agreed. :) Confirming. This is GtkHTML, Rendering.
guess first step is to add it to "static HTMLMagicInsertMatch mim []" in gtkhtml/src/htmltext.c.
let's integrate with gnome.
See also bug 265254.
Created attachment 80247 [details] [review] gtkhtml-3.12.2-sip-magiclink.diff this is a patch against gtkhtml-3.12.2 which allows gtkhtml to render sip links. Tested with evolution-2.8/gnome-2.16. I didn't add h323, because I'm not sure of the forms allowed for the URL. The other fix is changing nttp to nntp (I'm pretty sure this was a mistake in the first place).
h323 could be of the following forms : h323:something h323:something@host h323:@host h323:host h323:something@host:port h323:@host:port h323:host:port
could the address be of the form : h323:([0-9]{1,3}\.){3}[0-9]{1,3} (meaning ip address) because I remember using it on a lan (but maybe I'm wrong).
yes : host can be an IP Address or an hostname, just like for SIP (but it is unusual).
Created attachment 80276 [details] [review] gtkhtml-3.12.2-magiclinks.diff This one should be ok. Here is the explanation of the regex : "sip:( ([0-9]{1,3}\.){3}[0-9]{1,3} // ip address | // or [-_a-z0-9.'\\+]+ // user or host or something (@[-_a-z0-9.%=?]+)? // @host (eventually optional) ) (:[0-9]{1,5})? // optional port number " and same thing for h323 according to damien's comment.
Created attachment 80278 [details] [review] gtkhtml-3.12.2-magiclinks.diff hum, no not right ! "sip: ([-_a-z0-9.'\\+]+)? // optional user ( @([-_a-z0-9.%=?]+ // optional hostname |([0-9]{1,3}\.){3}[0-9]{1,3})? // or optional IP )? (:[0-9]{1,5})?" // optional port number This sounds better but could lead to "sip:" being a link by itself. Comments ?
Please someone review this patch.
Looks fine. Please commit.
Commited on both branches.
Reopening to get comments on these warnings: htmltext.c:2969:61: warning: Unknown escape '.' htmltext.c:2970:60: warning: Unknown escape '.' Could we get those fixed too?
looks like espacing . in ([0-9]{1,3}\.) is not necessary, sorry about that
Fixed. Thanks.
Seems like the . was removed in svn. This is wrong since it is the ip address separator. The correct version of the expresion in comment #15 is ([0-9]{1,3}.)
Created attachment 82376 [details] [review] gtkhtml-3.13.6-sip.h323.callto-hyperlinks.patch after messing more with gtkhtml/evolution, I found that preceding patch is good but not enough to be homogeneous throughout evo UI. Here is a revisited patch that fixes this bug and the bug for callto URIs in gtkhtml part.
Created attachment 82377 [details] [review] evolution-HEAD-hyperlinks-unification.patch Here is the evolution part. It should unify display in mail views and in mail editor. Note that I couldn't test it yet so I'm not sure about the espacing in this patch. I'm just posting those in the hope that someone can test/validate those before next tarball release.
REOPENing according to comment 17.
*** Bug 242936 has been marked as a duplicate of this bug. ***
ok, evolution part is not yet enough to get the mail view to show up properly (altought there is a little typo in the patch). Any hint on the direction to look at would be appreciated.
Created attachment 82497 [details] [review] evolution-data-server-1.9.91-hyperlinks.patch Thanks to fejj hints (on IRC) it's finally working, this patch is against e-d-s-1.9.91 (svn head) and fixes some typos and add support for callto/sip/h323 urls in mail view pane. The gtkhtml patch still applys to gtkhtml svn head and should fix composer part. Please note that regarding urls of the type h323:@host(:port), the composer does an hyperlink while the mail view doesn't. If you feel it is improper to let the composer make an hyperlink for this type of URL please comment, I'll cook a revised patch for that. I mark the evolution patch as obsolete since nothing in evolution uses it.
Fixed to TRUNK. Thanks for your patch Gilles.
Gilles, As we discussed on IRC, you can do the evolution UI part and post that in a seperate bug. We should take that in the next version. Thanks.
Gilles, sorry to reopen again. regression!! Go to a new line. Press tab then type https://novell.com[ENTER] It doesn't recognize. But if you do it otherwise it works.
aaaaaaaaarrrrrrgggg regression !!! This is my fault, I didn't think of the tab. You can either strip "(^| )" of each expression (which would lead to link being created for things like this: "thisisatesthttp://novell.com[enter] ) or add tab (and any other blank space I may have missed or any separator you think is reasonable) in the expression, resulting in the beginning of each expression looking something like this : "(^| |\t)"
coming to think of it, you could even say, anything that is not alpha char is considered as a separator. But it would introduce the problem of accentuated characters and cie. gnome-terminal seems to have a slightly different approach to handle url surrounding but I didn't looked deeply enough.
Im not sure. But atleast some commonly used stuff could be categorized as seperator and rest we can take a stand. I use tab very often, and Im sure many others :)
would probably be a good idea to sort this out before 2.18.1 release ?
Gilles, can you patch with tab atleast?
Created attachment 86069 [details] [review] gtkhtml-3.14-url-separation.patch this patch is against svn head and removes the part that is problematic. We need something smarter to get proper url separations if really wanted.
Great. Please commit to stable/head.
Committed to stable/trunk.