static void room_sub_menu_activate_cb (GtkWidget *item, RoomSubMenuData *data) { EmpathyTpChat *chat; chat = empathy_chatroom_get_tp_chat (data->chatroom); if (chat == NULL) { /* channel was invalidated. Ignoring */ return; } /* send invitation */ empathy_contact_list_add (EMPATHY_CONTACT_LIST (chat), data->contact, _("Inviting you to this room")); }
static void contact_manager_add (EmpathyContactList *manager, EmpathyContact *contact, const gchar *message) { EmpathyContactManagerPriv *priv = GET_PRIV (manager); EmpathyContactList *list; TpConnection *connection; g_return_if_fail (EMPATHY_IS_CONTACT_MANAGER (manager)); connection = empathy_contact_get_connection (contact); list = g_hash_table_lookup (priv->lists, connection); if (list) { empathy_contact_list_add (list, contact, message); } }
static void new_contact_response_cb (GtkDialog *dialog, gint response, GtkWidget *contact_widget) { EmpathyContactManager *manager; EmpathyContact *contact; manager = empathy_contact_manager_dup_singleton (); contact = empathy_contact_widget_get_contact (contact_widget); if (contact && response == GTK_RESPONSE_OK) { empathy_contact_list_add (EMPATHY_CONTACT_LIST (manager), contact, ""); } new_contact_dialog = NULL; gtk_widget_destroy (GTK_WIDGET (dialog)); g_object_unref (manager); }
static void subscription_dialog_response_cb (GtkDialog *dialog, gint response, GtkWidget *contact_widget) { EmpathyContactManager *manager; EmpathyContact *contact; manager = empathy_contact_manager_dup_singleton (); contact = empathy_contact_widget_get_contact (contact_widget); if (response == GTK_RESPONSE_YES) { empathy_contact_list_add (EMPATHY_CONTACT_LIST (manager), contact, ""); } else if (response == GTK_RESPONSE_NO) { empathy_contact_list_remove (EMPATHY_CONTACT_LIST (manager), contact, ""); } subscription_dialogs = g_list_remove (subscription_dialogs, dialog); gtk_widget_destroy (GTK_WIDGET (dialog)); g_object_unref (manager); }