if (error != NULL)
{
dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s",
error->message ? error->message : "No error message");
gtk_dialog_run (GTK_DIALOG (dialog));
EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (data);
EmpathyContact *contact;
- contact = empathy_contact_selector_get_selected (selector);
+ contact = empathy_contact_selector_dup_selected (selector);
if (!contact)
return;
- /* This is required otherwise the dispatcher isn't ref'd, and so it
- * disappears by the time the callback gets called. It's deliberately not
- * freed otherwise it segfaults... sigh */
- empathy_dispatcher_dup_singleton ();
empathy_dispatcher_chat_with_contact (contact, chat_cb, NULL);
+
+ g_object_unref (contact);
}
int main (int argc,
manager = empathy_contact_manager_dup_singleton ();
selector = empathy_contact_selector_new (EMPATHY_CONTACT_LIST (manager));
+ empathy_contact_selector_set_visible (EMPATHY_CONTACT_SELECTOR (selector),
+ (EmpathyContactSelectorFilterFunc) empathy_contact_can_send_files, NULL);
+
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), selector, FALSE, FALSE, 5);