static void new_call_handler_cb (EmpathyCallFactory *factory, EmpathyCallHandler *handler, gboolean outgoing, gpointer user_data) { EmpathyCallWindow *window; EmpathyContact *contact; DEBUG ("Show the call window"); contact = empathy_call_handler_get_contact (handler); window = g_hash_table_lookup (call_windows, contact); if (window != NULL) { empathy_call_window_present (window, handler); } else { window = empathy_call_window_new (handler); g_hash_table_insert (call_windows, g_object_ref (contact), window); g_application_hold (G_APPLICATION (app)); g_signal_connect (window, "destroy", G_CALLBACK (call_window_destroyed_cb), contact); gtk_widget_show (GTK_WIDGET (window)); } }
static void new_call_handler_cb (EmpathyCallFactory *factory, EmpathyCallHandler *handler, gboolean outgoing, gpointer user_data) { EmpathyCallWindow *window; window = empathy_call_window_new (handler); gtk_widget_show (GTK_WIDGET (window)); }
static void dispatch_channel_cb (EmpathyDispatcher *dispatcher, TpChannel *channel, gpointer user_data) { gchar *channel_type; g_object_get (channel, "channel-type", &channel_type, NULL); if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TEXT)) { EmpathyTpChat *tp_chat; EmpathyChat *chat = NULL; const gchar *id; tp_chat = empathy_tp_chat_new (channel); empathy_run_until_ready (tp_chat); id = empathy_tp_chat_get_id (tp_chat); if (!id) { EmpathyContact *contact; contact = empathy_tp_chat_get_remote_contact (tp_chat); if (contact) { id = empathy_contact_get_id (contact); } } if (id) { McAccount *account; account = empathy_tp_chat_get_account (tp_chat); chat = empathy_chat_window_find_chat (account, id); } if (chat) { empathy_chat_set_tp_chat (chat, tp_chat); } else { chat = empathy_chat_new (tp_chat); } empathy_chat_window_present_chat (chat); g_object_unref (tp_chat); } else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) { empathy_call_window_new (channel); } }