The inner condition will never be true. I don't think the function should be interpreting "fuzzy" URIs anyhow--if we want it to accept "fuzzy" uris, I think we should reuse "stronger" existing functions for the purpose. Most likely though all the logic can simply be removed--we can put full URIs in the dialogs.
Mostly looks good, except:
403 + if (g_str_has_prefix (uri, "mailto:"))
404 + {
405 + gchar* newuri = NULL;
406 + if (!g_str_has_prefix (uri, "mailto:"))
The inner condition will never be true. I don't think the function should be interpreting "fuzzy" URIs anyhow--if we want it to accept "fuzzy" uris, I think we should reuse "stronger" existing functions for the purpose. Most likely though all the logic can simply be removed--we can put full URIs in the dialogs.