pidgin: ca6eb11f: Reduce work if there is no URL in the in...

sadrul at pidgin.im sadrul at pidgin.im
Mon May 25 13:15:29 EDT 2009


-----------------------------------------------------------------
Revision: ca6eb11f6084be37aeabcb2d99df789aaf8b4afd
Ancestor: b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005
Author: sadrul at pidgin.im
Date: 2009-05-25T17:18:26
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ca6eb11f6084be37aeabcb2d99df789aaf8b4afd

Modified files:
        finch/plugins/gnttinyurl.c

ChangeLog: 

Reduce work if there is no URL in the incoming message.

-------------- next part --------------
============================================================
--- finch/plugins/gnttinyurl.c	6186128d0e8f9faa5ac1791fdba6b22a548367d8
+++ finch/plugins/gnttinyurl.c	9eca68a9b4f860ed071d0bbb4ca4a34ffb57c296
@@ -228,12 +228,15 @@ static gboolean receiving_msg(PurpleAcco
 	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)) {


More information about the Commits mailing list