From e982a3d0983d9d18c6b147b6c80cbe80d12a4a50 Mon Sep 17 00:00:00 2001 From: dequis Date: Thu, 2 Jun 2016 21:40:06 -0300 Subject: fb_http_urlcmp: more loose comparison, to avoid showing urls twice Now it returns true if url1 is contained inside url2, or the other way around. This helps when a message body is compared with a url. --- facebook/facebook-http.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/facebook/facebook-http.c b/facebook/facebook-http.c index da1f631..6234d55 100644 --- a/facebook/facebook-http.c +++ b/facebook/facebook-http.c @@ -528,6 +528,10 @@ fb_http_urlcmp(const gchar *url1, const gchar *url2, gboolean protocol) return url1 == url2; } + if (strstr(url1, url2) != NULL || strstr(url2, url1) != NULL) { + return TRUE; + } + if (!url_set(&purl1, url1) || !url_set(&purl2, url2)) { return g_ascii_strcasecmp(url1, url2) == 0; } -- cgit v1.2.3