changeset 96:987607b5ba32

made is_*_conv(conv) return FALSE if conv is NULL.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 10 Jul 2008 17:31:19 +0900
parents ab612180e7d0
children 24ad534e438e
files pidgin-twitter.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-twitter.c	Thu Jul 10 00:12:03 2008 +0900
+++ b/pidgin-twitter.c	Thu Jul 10 17:31:19 2008 +0900
@@ -972,6 +972,8 @@
 static gboolean
 is_twitter_conv(PurpleConversation *conv)
 {
+    g_return_val_if_fail(conv != NULL, FALSE);
+
     const char *name = purple_conversation_get_name(conv);
     PurpleAccount *account = purple_conversation_get_account(conv);
 
@@ -996,6 +998,8 @@
 static gboolean
 is_wassr_conv(PurpleConversation *conv)
 {
+    g_return_val_if_fail(conv != NULL, FALSE);
+
     const char *name = purple_conversation_get_name(conv);
     PurpleAccount *account = purple_conversation_get_account(conv);
 
@@ -1020,6 +1024,8 @@
 static gboolean
 is_identica_conv(PurpleConversation *conv)
 {
+    g_return_val_if_fail(conv != NULL, FALSE);
+
     const char *name = purple_conversation_get_name(conv);
     PurpleAccount *account = purple_conversation_get_account(conv);
 
@@ -1100,12 +1106,8 @@
     twitter_debug("called\n");
     twitter_debug("buffer = %s suppress_oops = %d\n", *buffer, suppress_oops);
 
-    /* Check if the conv is not NULL to avoid a clash.
-     * conv is null when the conversation window has not opened yet.
-     * And if check is a twitter conv. */
-
     /* quick hack to suppress annoying completion message from wassr */
-    if(conv && is_wassr_conv(conv)) {
+    if(is_wassr_conv(conv)) {
         if(strstr(*buffer, "<body>投稿完了:") ||
            strstr(*buffer, "<body>チャンネル投稿完了:")) {
             twitter_debug("clearing sender and buffer\n");
@@ -1120,7 +1122,7 @@
         }
     }
 
-    if(!(conv && is_twitter_conv(conv))) {
+    if(!is_twitter_conv(conv)) {
         return FALSE;
     }