gravatar: also with hyperlinks starting with "mailto:"

This commit is contained in:
Boris Faure 2018-10-14 11:57:11 +02:00
parent 0a6589ca31
commit 1b909cb569
2 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@
#include "termio.h" #include "termio.h"
#include "media.h" #include "media.h"
#include "md5/md5.h" #include "md5/md5.h"
#include "utils.h"
/* specific log domain to help debug the gravatar module */ /* specific log domain to help debug the gravatar module */
int _gravatar_log_dom = -1; int _gravatar_log_dom = -1;
@ -76,6 +77,9 @@ gravatar_tooltip(Evas_Object *obj, const Config *config, const char *email)
return; return;
g->config = config; g->config = config;
if (casestartswith(email, "mailto:"))
email += strlen("mailto:");
len = strlen(email); len = strlen(email);
str = strndup(email, len); str = strndup(email, len);
if (!str) if (!str)

View File

@ -1417,12 +1417,13 @@ _hyperlink_end(Termio *sd,
popup_exists = main_term_popup_exists(sd->term); popup_exists = main_term_popup_exists(sd->term);
if (!popup_exists && add_tooltip) if (!popup_exists && add_tooltip)
{ {
/* display tooltip */
elm_object_tooltip_text_set(o, hl->url);
if (link_is_email(hl->url)) if (link_is_email(hl->url))
{ {
gravatar_tooltip(o, sd->config, hl->url); gravatar_tooltip(o, sd->config, hl->url);
} }
/* display tooltip */
elm_object_tooltip_text_set(o, hl->url);
} }
} }