soc.2009.telepathy: 64d822bd: TpChannel creation and caching should be...
sttwister at soc.pidgin.im
sttwister at soc.pidgin.im
Mon Jun 1 11:20:39 EDT 2009
-----------------------------------------------------------------
Revision: 64d822bde2f2d325a15a35632dda56adc4c2cfdd
Ancestor: ef9a9a6a83b54a41fc97b194f25d9e629c4b0fdf
Author: sttwister at soc.pidgin.im
Date: 2009-06-01T15:12:31
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/64d822bde2f2d325a15a35632dda56adc4c2cfdd
Modified files:
libpurple/protocols/telepathy/telepathy.c
ChangeLog:
TpChannel creation and caching should be done when NewChannels fires
-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy.c df9ad808c58bbb1ddb26ca0093c64cb0fb4aba8c
+++ libpurple/protocols/telepathy/telepathy.c bfac58c8ae6098bcb550aca424b2ca4e161fb768
@@ -248,7 +248,14 @@ handle_text_channel (TpChannel *channel,
handle_text_channel (TpChannel *channel,
PurplePlugin *plugin)
{
-
+ telepathy_data *data = plugin->extra;
+
+ GHashTable *properties = tp_channel_borrow_immutable_properties(channel);
+ gchar *who = (gchar *)tp_asv_get_string(properties, TP_IFACE_CHANNEL ".TargetID");
+
+ purple_debug_info("telepathy", "Saving TpChannel proxy for %s\n", who);
+
+ g_hash_table_insert(data->text_Channels, g_strdup(who), channel);
}
static void
@@ -341,12 +348,12 @@ get_channels_cb (TpProxy *proxy,
PurplePlugin *plugin = user_data;
telepathy_data *data = plugin->extra;
- data->listing_channels = FALSE;
-
/* unpack the a(oa{sv}) struct */
const GPtrArray *channels = g_value_get_boxed(out_Value);
int i;
+ data->listing_channels = FALSE;
+
for (i = 0; i < channels->len; i++)
{
const GValueArray *channel = g_ptr_array_index(channels, i);
@@ -682,26 +689,6 @@ ensure_channel_cb (TpConnection *proxy,
{
purple_debug_error("telepathy", "EnsureChannel error: %s\n", error->message);
}
- else
- {
- PurplePlugin *plugin = user_data;
- telepathy_data *data = plugin->extra;
- GError *error = NULL;
- TpChannel *channel;
- gchar *who = (gchar *)tp_asv_get_string(out_Properties, TP_IFACE_CHANNEL ".TargetID");
-
- channel = tp_channel_new(proxy, out_Channel, NULL, TP_HANDLE_TYPE_NONE, 0, &error);
-
- if (error != NULL)
- {
- purple_debug_error("telepathy", "Error creating channel proxy: %s\n", error->message);
- return;
- }
-
- purple_debug_info("telepathy", "Saving TpChannel proxy for %s\n", who);
-
- g_hash_table_insert(data->text_Channels, g_strdup(who), channel);
- }
}
static void
More information about the Commits
mailing list