changeset 22607:c7742b830585

Updated patch from Justin 'Jaywalker' Williams to discard messages from spambots in msim. Closes #5143.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 01 Apr 2008 22:24:18 +0000
parents 40c93093a555
children dcfe7a855d7e
files ChangeLog libpurple/protocols/myspace/myspace.c
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Mar 31 17:19:02 2008 +0000
+++ b/ChangeLog	Tue Apr 01 22:24:18 2008 +0000
@@ -1,5 +1,9 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
+version 2.x.x:
+	libpurple:
+	* In MySpaceIM, messages from spambots are discarded (Justin Williams)
+
 version 2.4.1 (03/31/2008):
 	http://developer.pidgin.im/query?status=closed&milestone=2.4.1
 
--- a/libpurple/protocols/myspace/myspace.c	Mon Mar 31 17:19:02 2008 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Tue Apr 01 22:24:18 2008 +0000
@@ -688,6 +688,13 @@
 	username = msim_msg_get_string(msg, "_username");
 	g_return_val_if_fail(username != NULL, FALSE);
 
+	if (msim_is_userid(username)) {
+		purple_debug_info("msim", "Ignoring message from spambot (%s) on account %s\n",
+				username, purple_account_get_username(session->account));
+		g_free(username);
+		return FALSE;
+	}
+
 	msg_msim_markup = msim_msg_get_string(msg, "msg");
 	g_return_val_if_fail(msg_msim_markup != NULL, FALSE);