changeset 26059:18b71033ea6e

Remove connection attribute from PurpleMedia.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Tue, 16 Dec 2008 01:27:51 +0000
parents 0ad1b8e950d7
children 0829a08038c6
files finch/gntmedia.c libpurple/marshallers.list libpurple/media.c libpurple/media.h libpurple/mediamanager.c pidgin/gtkconv.c
diffstat 6 files changed, 11 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntmedia.c	Tue Dec 16 00:53:59 2008 +0000
+++ b/finch/gntmedia.c	Tue Dec 16 01:27:51 2008 +0000
@@ -371,14 +371,14 @@
 }
 
 static gboolean
-finch_new_media(PurpleMediaManager *manager, PurpleMedia *media, gpointer null)
+finch_new_media(PurpleMediaManager *manager, PurpleMedia *media,
+		PurpleConnection *gc, gchar *name, gpointer null)
 {
 	GntWidget *gntmedia;
 	PurpleConversation *conv;
 
 	conv = purple_conversation_new(PURPLE_CONV_TYPE_IM,
-			purple_connection_get_account(purple_media_get_connection(media)),
-			purple_media_get_screenname(media));
+			purple_connection_get_account(gc), name);
 
 	gntmedia = finch_media_new(media);
 	g_signal_connect(G_OBJECT(gntmedia), "message", G_CALLBACK(gntmedia_message_cb), conv);
--- a/libpurple/marshallers.list	Tue Dec 16 00:53:59 2008 +0000
+++ b/libpurple/marshallers.list	Tue Dec 16 01:27:51 2008 +0000
@@ -1,4 +1,4 @@
 VOID:BOXED,BOXED
 VOID:POINTER,POINTER,OBJECT
-BOOLEAN:OBJECT
+BOOLEAN:OBJECT,POINTER,STRING
 VOID:STRING,STRING
--- a/libpurple/media.c	Tue Dec 16 00:53:59 2008 +0000
+++ b/libpurple/media.c	Tue Dec 16 01:27:51 2008 +0000
@@ -75,7 +75,6 @@
 	FsConference *conference;
 
 	char *name;
-	PurpleConnection *connection;
 
 	GHashTable *sessions;	/* PurpleMediaSession table */
 	GHashTable *participants; /* FsParticipant table */
@@ -128,7 +127,6 @@
 	PROP_0,
 	PROP_FS_CONFERENCE,
 	PROP_NAME,
-	PROP_CONNECTION,
 };
 
 GType
@@ -178,12 +176,6 @@
 			NULL,
 			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 
-	g_object_class_install_property(gobject_class, PROP_CONNECTION,
-			g_param_spec_pointer("connection",
-			"Connection",
-			"The PurpleConnection associated with this session",
-			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
-
 	purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 g_cclosure_marshal_VOID__STRING,
@@ -335,9 +327,6 @@
 			g_free(media->priv->name);
 			media->priv->name = g_value_dup_string(value);
 			break;
-		case PROP_CONNECTION:
-			media->priv->connection = g_value_get_pointer(value);
-			break;
 		default:	
 			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 			break;
@@ -359,9 +348,6 @@
 		case PROP_NAME:
 			g_value_set_string(value, media->priv->name);
 			break;
-		case PROP_CONNECTION:
-			g_value_set_pointer(value, media->priv->connection);
-			break;
 		default:	
 			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);	
 			break;
@@ -753,14 +739,6 @@
 	return media->priv->pipeline;
 }
 
-PurpleConnection *
-purple_media_get_connection(PurpleMedia *media)
-{
-	PurpleConnection *gc;
-	g_object_get(G_OBJECT(media), "connection", &gc, NULL);
-	return gc;
-}
-
 char *
 purple_media_get_screenname(PurpleMedia *media)
 {
--- a/libpurple/media.h	Tue Dec 16 00:53:59 2008 +0000
+++ b/libpurple/media.h	Tue Dec 16 01:27:51 2008 +0000
@@ -214,15 +214,6 @@
 GstElement *purple_media_get_pipeline(PurpleMedia *media);
 
 /**
- * Gets the connection the media session is associated with.
- *
- * @param media The media object to retrieve the connection from.
- *
- * @return The retreived connection.
- */
-PurpleConnection *purple_media_get_connection(PurpleMedia *media);
-
-/**
  * Gets the screenname of the remote user.
  *
  * @param media The media object to retrieve the remote user from.
--- a/libpurple/mediamanager.c	Tue Dec 16 00:53:59 2008 +0000
+++ b/libpurple/mediamanager.c	Tue Dec 16 01:27:51 2008 +0000
@@ -102,8 +102,9 @@
 		G_TYPE_FROM_CLASS (klass),
 		G_SIGNAL_RUN_LAST,
 		0, NULL, NULL,
-		purple_smarshal_BOOLEAN__OBJECT,
-		G_TYPE_BOOLEAN, 1, PURPLE_TYPE_MEDIA);
+		purple_smarshal_BOOLEAN__OBJECT_POINTER_STRING,
+		G_TYPE_BOOLEAN, 3, PURPLE_TYPE_MEDIA,
+		G_TYPE_POINTER, G_TYPE_STRING);
 	g_type_class_add_private(klass, sizeof(PurpleMediaManagerPrivate));
 }
 
@@ -156,7 +157,6 @@
 
 	media = PURPLE_MEDIA(g_object_new(purple_media_get_type(),
 			     "screenname", remote_user,
-			     "connection", gc, 
 			     "farsight-conference", conference,
 			     NULL));
 
@@ -172,7 +172,7 @@
 	}
 
 	g_signal_emit(manager, purple_media_manager_signals[INIT_MEDIA], 0,
-			media, &signal_ret);
+			media, gc, remote_user, &signal_ret);
 
 	if (signal_ret == FALSE) {
 		g_object_unref(media);
--- a/pidgin/gtkconv.c	Tue Dec 16 00:53:59 2008 +0000
+++ b/pidgin/gtkconv.c	Tue Dec 16 01:27:51 2008 +0000
@@ -7814,17 +7814,15 @@
 }
 
 static gboolean
-pidgin_conv_new_media_cb(PurpleMediaManager *manager, PurpleMedia *media, gpointer nul)
+pidgin_conv_new_media_cb(PurpleMediaManager *manager, PurpleMedia *media,
+		PurpleConnection *gc, gchar *screenname, gpointer nul)
 {
 	GtkWidget *gtkmedia;
 	PurpleConversation *conv;
 	PidginConversation *gtkconv;
-	gchar *name = purple_media_get_screenname(media);
 
 	conv = purple_conversation_new(PURPLE_CONV_TYPE_IM,
-			purple_connection_get_account(
-			purple_media_get_connection(media)), name);
-	g_free(name);
+			purple_connection_get_account(gc), screenname);
 
 	gtkconv = PIDGIN_CONVERSATION(conv);