/soc/2015/jgeboski/facebook: cebf09840cbc: facebook: inform the ...

James Geboski jgeboski at gmail.com
Sat Aug 15 18:26:07 EDT 2015


Changeset: cebf09840cbc47119dcec7cf5305f236323398ab
Author:	 James Geboski <jgeboski at gmail.com>
Date:	 2015-08-15 18:25 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/cebf09840cbc

Description:

facebook: inform the user of invalid group chat names

diffstat:

 libpurple/protocols/facebook/facebook.c |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (25 lines):

diff --git a/libpurple/protocols/facebook/facebook.c b/libpurple/protocols/facebook/facebook.c
--- a/libpurple/protocols/facebook/facebook.c
+++ b/libpurple/protocols/facebook/facebook.c
@@ -1039,10 +1039,21 @@ fb_chat_join(PurpleConnection *gc, GHash
 	FbId tid;
 	gint id;
 	PurpleChatConversation *chat;
+	PurpleRequestCommonParameters *cpar;
 
 	name = g_hash_table_lookup(data, "name");
 	g_return_if_fail(name != NULL);
 
+	if (!FB_ID_IS_STR(name)) {
+		cpar = purple_request_cpar_from_connection(gc);
+		purple_notify_error(gc,
+		                    _("Join a Chat"),
+		                    _("Failed to Join Chat"),
+		                    _("Invalid Facebook identifier."),
+				    cpar);
+		return;
+	}
+
 	tid = FB_ID_FROM_STR(name);
 	id = fb_id_hash(&tid);
 	chat = purple_conversations_find_chat(gc, id);



More information about the Commits mailing list