diff options
author | dequis <dx@dxzone.com.ar> | 2016-06-02 21:40:06 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2016-06-02 21:40:06 -0300 |
commit | e982a3d0983d9d18c6b147b6c80cbe80d12a4a50 (patch) | |
tree | 65514778e1f3f5bfeba286f7984b2f788ebe6bc7 /facebook | |
parent | d60efe03daf2f79a14e09ae915d3e476afda63b8 (diff) | |
download | bitlbee-facebook-e982a3d0983d9d18c6b147b6c80cbe80d12a4a50.tar.gz bitlbee-facebook-e982a3d0983d9d18c6b147b6c80cbe80d12a4a50.tar.bz2 bitlbee-facebook-e982a3d0983d9d18c6b147b6c80cbe80d12a4a50.tar.xz |
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.
Diffstat (limited to 'facebook')
-rw-r--r-- | facebook/facebook-http.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; } |