# HG changeset patch # User Sadrul Habib Chowdhury # Date 1243271906 0 # Node ID 0f1b41c2f835f3574e3a7d25e3663f08f0986d92 # Parent 7e6c8fed6ffa832d64c6d8fe404e7cb71230ab79 Reduce work if there is no URL in the incoming message. diff -r 7e6c8fed6ffa -r 0f1b41c2f835 finch/plugins/gnttinyurl.c --- a/finch/plugins/gnttinyurl.c Mon May 25 03:06:12 2009 +0000 +++ b/finch/plugins/gnttinyurl.c Mon May 25 17:18:26 2009 +0000 @@ -228,12 +228,15 @@ if (!(*flags & PURPLE_MESSAGE_RECV) || *flags & PURPLE_MESSAGE_INVISIBLE) return FALSE; - t = g_string_new(*message); urls = purple_conversation_get_data(conv, "TinyURLs"); if (urls != NULL) /* message was cancelled somewhere? Reset. */ g_list_foreach(urls, free_urls, NULL); g_list_free(urls); - urls = extract_urls(t->str); + urls = extract_urls(*message); + if (!urls) + return FALSE; + + t = g_string_new(*message); g_free(*message); for (iter = urls; iter; iter = iter->next) { if (g_utf8_strlen((char *)iter->data, -1) >= purple_prefs_get_int(PREF_LENGTH)) {