/soc/2015/jgeboski/facebook: 2a5decfdeb7b: facebook: use proper ...

James Geboski jgeboski at gmail.com
Sun Jul 5 15:59:50 EDT 2015


Changeset: 2a5decfdeb7ba71e452fc4b9a280b2039285dd42
Author:	 James Geboski <jgeboski at gmail.com>
Date:	 2015-07-05 15:58 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/2a5decfdeb7b

Description:

facebook: use proper type checks

diffstat:

 libpurple/protocols/facebook/api.c  |  2 +-
 libpurple/protocols/facebook/mqtt.c |  6 +++---
 libpurple/protocols/facebook/util.c |  2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diffs (54 lines):

diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -1448,7 +1448,7 @@ fb_api_thread_remove(FbApi *api, FbId ti
 		"DELETE"
 	};
 
-	g_return_if_fail(api != NULL);
+	g_return_if_fail(FB_IS_API(api));
 	priv = api->priv;
 
 	prms = fb_http_params_new();
diff --git a/libpurple/protocols/facebook/mqtt.c b/libpurple/protocols/facebook/mqtt.c
--- a/libpurple/protocols/facebook/mqtt.c
+++ b/libpurple/protocols/facebook/mqtt.c
@@ -646,7 +646,7 @@ fb_mqtt_publish(FbMqtt *mqtt, const gcha
 	FbMqttMessage *msg;
 	FbMqttPrivate *priv;
 
-	g_return_if_fail(mqtt != NULL);
+	g_return_if_fail(FB_IS_MQTT(mqtt));
 	g_return_if_fail(fb_mqtt_connected(mqtt, FALSE));
 	priv = mqtt->priv;
 
@@ -674,7 +674,7 @@ fb_mqtt_subscribe(FbMqtt *mqtt, const gc
 	guint16 qos;
 	va_list ap;
 
-	g_return_if_fail(mqtt != NULL);
+	g_return_if_fail(FB_IS_MQTT(mqtt));
 	g_return_if_fail(fb_mqtt_connected(mqtt, FALSE));
 	priv = mqtt->priv;
 
@@ -708,7 +708,7 @@ fb_mqtt_unsubscribe(FbMqtt *mqtt, const 
 	FbMqttPrivate *priv;
 	va_list ap;
 
-	g_return_if_fail(mqtt != NULL);
+	g_return_if_fail(FB_IS_MQTT(mqtt));
 	g_return_if_fail(fb_mqtt_connected(mqtt, FALSE));
 	priv = mqtt->priv;
 
diff --git a/libpurple/protocols/facebook/util.c b/libpurple/protocols/facebook/util.c
--- a/libpurple/protocols/facebook/util.c
+++ b/libpurple/protocols/facebook/util.c
@@ -50,7 +50,7 @@ fb_util_account_find_buddy(PurpleAccount
 	guint retc;
 	PurpleBuddy *ret = NULL;
 
-	g_return_val_if_fail(acct != NULL, NULL);
+	g_return_val_if_fail(PURPLE_IS_ACCOUNT(acct), NULL);
 	g_return_val_if_fail(search != NULL, NULL);
 
 	buddies = purple_blist_find_buddies(acct, NULL);



More information about the Commits mailing list