changeset 24277:0b6acb534f16

merge of '62e0eb23e1c2cd6ac1d8a7d96b6e598bd54ed0d2' and 'c8e0fdc8a85e96e382b7f826cfebfb1f54dcf12b'
author John Bailey <rekkanoryo@rekkanoryo.org>
date Thu, 30 Oct 2008 03:58:20 +0000
parents 06a4e268b9f5 (diff) eab7a02d87de (current diff)
children 03c73e917b1b ff6eba605ca3
files
diffstat 4 files changed, 34 insertions(+), 90 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/blist.c	Thu Oct 30 03:17:17 2008 +0000
+++ b/libpurple/blist.c	Thu Oct 30 03:58:20 2008 +0000
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  *
  */
+#define PURPLE_BLIST_STRUCTS
+
 #include "internal.h"
 #include "blist.h"
 #include "conversation.h"
@@ -41,60 +43,6 @@
 static guint          save_timer = 0;
 static gboolean       blist_loaded = FALSE;
 
-
-/******************************************************************************
- * Structs
- *****************************************************************************/
-#ifdef PURPLE_HIDE_STRUCTS
-struct _PurpleBlistNode {
-    PurpleBlistNodeType type;
-    PurpleBlistNode *prev;
-    PurpleBlistNode *next;
-    PurpleBlistNode *parent;
-    PurpleBlistNode *child;
-    GHashTable *settings;
-    void *ui_data;
-    PurpleBlistNodeFlags flags;
-};
-
-struct _PurpleBuddy {
-    PurpleBlistNode node;
-    char *name;
-    char *alias;
-    char *server_alias;
-    void *proto_data;
-    PurpleBuddyIcon *icon;
-    PurpleAccount *account;
-    PurplePresence *presence;
-};
-
-struct _PurpleContact {
-    PurpleBlistNode node;
-    char *alias;
-    int totalsize;
-    int currentsize;
-    int online;
-    PurpleBuddy *priority;
-    gboolean priority_valid;
-};
-
-struct _PurpleGroup {
-    PurpleBlistNode node;
-    char *name;
-    int totalsize;
-    int currentsize;
-    int online;
-};
-
-struct _PurpleChat {
-    PurpleBlistNode node;
-    char *alias;
-    GHashTable *components;
-    PurpleAccount *account;
-};
-
-#endif /* PURPLE_HIDE_STRUCTS */
-
 /*********************************************************************
  * Private utility functions                                         *
  *********************************************************************/
--- a/libpurple/blist.h	Thu Oct 30 03:17:17 2008 +0000
+++ b/libpurple/blist.h	Thu Oct 30 03:58:20 2008 +0000
@@ -89,7 +89,7 @@
 /* Data Structures                                                        */
 /**************************************************************************/
 
-#ifndef PURPLE_HIDE_STRUCTS
+#if !(defined PURPLE_HIDE_STRUCTS) || (defined PURPLE_BLIST_STRUCTS)
 
 /**
  * A Buddy list node.  This can represent a group, a buddy, or anything else.
@@ -156,7 +156,7 @@
 	PurpleAccount *account; /**< The account this chat is attached to */
 };
 
-#endif /* PURPLE_HIDE_STRUCTS */
+#endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */
 
 
 /**
--- a/libpurple/plugins/log_reader.c	Thu Oct 30 03:17:17 2008 +0000
+++ b/libpurple/plugins/log_reader.c	Thu Oct 30 03:58:20 2008 +0000
@@ -662,8 +662,8 @@
 	}
 
 	if (buddy) {
-		PurpleBlistNode *node = (PurpleBlistNode *)buddy;
-		savedfilename = purple_blist_node_get_string(node, "log_reader_msn_log_filename");
+		savedfilename = purple_blist_node_get_string((PurpleBlistNode *)buddy,
+		                                             "log_reader_msn_log_filename");
 	}
 
 	if (savedfilename) {
@@ -1022,12 +1022,9 @@
 					name_guessed = NAME_GUESS_THEM;
 				} else {
 					if (buddy) {
-						const gchar *a = NULL, *server_alias = NULL;
-						gchar *alias = NULL, *temp = NULL;
-						
-						a = purple_buddy_get_alias(buddy);
-						if(a)
-							alias = g_strdup(a);
+						const char *server_alias = NULL;
+						char *alias = g_strdup(purple_buddy_get_alias(buddy));
+						char *temp;
 
 						/* "Truncate" the string at the first non-alphanumeric
 						 * character. The idea is to relax the comparison.
@@ -1572,31 +1569,30 @@
 					g_string_append(formatted, "</b>");
 					footer = NULL;
 				} else if (strstr(line, " signed off ")) {
-					if (buddy != NULL) {
-						const gchar *alias = purple_buddy_get_alias(buddy);
-
-						if(alias != NULL)
-							g_string_append_printf(formatted,
-								_("%s has signed off."), alias);
-						else
-							g_string_append_printf(formatted,
-								_("%s has signed off."), log->name);
+					const char *alias = NULL;
+
+					if (buddy != NULL)
+						alias = purple_buddy_get_alias(buddy);
+
+					if (alias != NULL) {
+						g_string_append_printf(formatted,
+							_("%s has signed off."), alias);
 					} else {
 						g_string_append_printf(formatted,
 							_("%s has signed off."), log->name);
 					}
 					line = "";
 				} else if (strstr(line, " signed on ")) {
-					if (buddy != NULL) {
-						const gchar *alias = purple_buddy_get_alias(buddy);
-
-						if(alias)
-							g_string_append(formatted, alias);
-						else
-							g_string_append(formatted, log->name);
-					} else {
+					const char *alias = NULL;
+
+					if (buddy != NULL)
+						alias = purple_buddy_get_alias(buddy);
+					
+					if (alias != NULL)
+						g_string_append(formatted, alias);
+					else
 						g_string_append(formatted, log->name);
-					}
+
 					line = " logged in.";
 				} else if (purple_str_has_prefix(line,
 					"One or more messages may have been undeliverable.")) {
@@ -1652,9 +1648,9 @@
 				}
 			} else if (purple_str_has_prefix(line, data->their_nickname)) {
 				if (buddy != NULL) {
-					const gchar *alias = purple_buddy_get_alias(buddy);
-
-					if(alias != NULL) {
+					const char *alias = purple_buddy_get_alias(buddy);
+
+					if (alias != NULL) {
 						line += strlen(data->their_nickname) + 2;
 						g_string_append_printf(formatted,
 							"<span style=\"color: #A82F2F;\">"
@@ -2025,10 +2021,10 @@
 					g_string_append(formatted, "</font> ");
 
 					if (is_in_message) {
-						const gchar *alias = NULL;
+						const char *alias = NULL;
 
 						if (buddy_name != NULL && buddy != NULL &&
-							(alias = purple_buddy_get_alias(buddy)))
+						    (alias = purple_buddy_get_alias(buddy)))
 						{
 							g_string_append_printf(formatted,
 								"<span style=\"color: #A82F2F;\">"
--- a/pidgin/gtkprefs.c	Thu Oct 30 03:17:17 2008 +0000
+++ b/pidgin/gtkprefs.c	Thu Oct 30 03:58:20 2008 +0000
@@ -1836,14 +1836,14 @@
                 gpointer data)
 {
 	GtkToggleButton *button = data;
-	gboolean muted = val;
+	gboolean muted = GPOINTER_TO_INT(val);
 
 	g_return_if_fail(!strcmp (pref_name, PIDGIN_PREFS_ROOT "/sound/mute"));
 
 	/* Block the handler that re-sets the preference. */
-	g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, pref_name);
+	g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name);
 	gtk_toggle_button_set_active (button, muted);
-	g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, pref_name);
+	g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name);
 }