# HG changeset patch # User Sean Egan # Date 1188957316 0 # Node ID 2fda7113380058a0d8430bfbf1fac45e74e0e3c0 # Parent 5150d8b576be25ba61cf2e533427827e4e728f33 Some UI ;) diff -r 5150d8b576be -r 2fda71133800 libpurple/mediamanager.c --- a/libpurple/mediamanager.c Wed Sep 05 00:48:34 2007 +0000 +++ b/libpurple/mediamanager.c Wed Sep 05 01:55:16 2007 +0000 @@ -98,12 +98,14 @@ 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, PURPLE_TYPE_MEDIA); + g_type_class_add_private(klass, sizeof(PurpleMediaManagerPrivate)); } static void purple_media_manager_init (PurpleMediaManager *media) { media->priv = PURPLE_MEDIA_MANAGER_GET_PRIVATE(media); + media->priv->medias = NULL; } static void @@ -128,10 +130,10 @@ const char *screenname) { PurpleMedia *media = PURPLE_MEDIA(g_object_new(purple_media_get_type(), - PROP_NAME, screenname, - PROP_CONNECTION, gc, NULL)); + "screenname", screenname, + "connection", gc, NULL)); manager->priv->medias = g_list_append(manager->priv->medias, media); - g_signal_emit(manager, purple_media_manager_signals[NEW_MEDIA], 1, media); + g_signal_emit(manager, purple_media_manager_signals[NEW_MEDIA], 0, media); return media; } diff -r 5150d8b576be -r 2fda71133800 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Wed Sep 05 00:48:34 2007 +0000 +++ b/pidgin/gtkconv.c Wed Sep 05 01:55:16 2007 +0000 @@ -45,6 +45,7 @@ #include "idle.h" #include "imgstore.h" #include "log.h" +#include "mediamanager.h" #include "notify.h" #include "prpl.h" #include "request.h" @@ -7161,6 +7162,12 @@ pidgin_conv_update_fields(conv, PIDGIN_CONV_TOPIC); } +static void +pidgin_conv_new_media_cb(PurpleMedia *media, gpointer nul) +{ + purple_notify_info(pidgin_conversations_get_handle(), "Media!", "New Media!", "You got new media!\n"); +} + void * pidgin_conversations_get_handle(void) { @@ -7257,6 +7264,8 @@ purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/im/hide_new", hide_new_pref_cb, NULL); + g_signal_connect(G_OBJECT(purple_media_manager_get()), "new-media", + G_CALLBACK(pidgin_conv_new_media_cb), NULL); /**********************************************************************