| 3776 GaimConversation *conv) |
3776 GaimConversation *conv) |
| 3777 { |
3777 { |
| 3778 GaimConvWindow *win = conv->window; |
3778 GaimConvWindow *win = conv->window; |
| 3779 GaimConversation *c; |
3779 GaimConversation *c; |
| 3780 |
3780 |
| 3781 if (sd->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE)) { |
3781 if (sd->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE)) |
| |
3782 { |
| 3782 GaimBlistNode *n = NULL; |
3783 GaimBlistNode *n = NULL; |
| 3783 GaimBuddy *b; |
3784 GaimBuddy *b; |
| 3784 memcpy(&n, sd->data, sizeof(n)); |
3785 memcpy(&n, sd->data, sizeof(n)); |
| 3785 |
3786 |
| 3786 if (GAIM_BLIST_NODE_IS_CONTACT(n)) |
3787 if (GAIM_BLIST_NODE_IS_CONTACT(n)) |
| 3791 return; |
3792 return; |
| 3792 |
3793 |
| 3793 c = gaim_conversation_new(GAIM_CONV_IM, b->account, b->name); |
3794 c = gaim_conversation_new(GAIM_CONV_IM, b->account, b->name); |
| 3794 |
3795 |
| 3795 gaim_conv_window_add_conversation(win, c); |
3796 gaim_conv_window_add_conversation(win, c); |
| |
3797 } |
| |
3798 else if (sd->target == gdk_atom_intern("application/x-im-contact", FALSE)) |
| |
3799 { |
| |
3800 char *protocol = NULL; |
| |
3801 char *username = NULL; |
| |
3802 GaimAccount *account; |
| |
3803 |
| |
3804 if (gaim_gtk_parse_x_im_contact(sd->data, FALSE, &account, |
| |
3805 &protocol, &username, NULL)) |
| |
3806 { |
| |
3807 if (account == NULL) |
| |
3808 { |
| |
3809 gaim_notify_error(NULL, NULL, |
| |
3810 _("You are not currently signed on with an account that " |
| |
3811 "can add that buddy."), NULL); |
| |
3812 } |
| |
3813 else |
| |
3814 { |
| |
3815 gaim_conversation_new(GAIM_CONV_IM, account, username); |
| |
3816 } |
| |
3817 } |
| |
3818 |
| |
3819 if (username != NULL) g_free(username); |
| |
3820 if (protocol != NULL) g_free(protocol); |
| |
3821 |
| |
3822 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); |
| 3796 } |
3823 } |
| 3797 } |
3824 } |
| 3798 |
3825 |
| 3799 /************************************************************************** |
3826 /************************************************************************** |
| 3800 * GTK+ window ops |
3827 * GTK+ window ops |
| 3942 |
3969 |
| 3943 static const GtkTargetEntry te[] = |
3970 static const GtkTargetEntry te[] = |
| 3944 { |
3971 { |
| 3945 {"text/plain", 0, 0}, |
3972 {"text/plain", 0, 0}, |
| 3946 {"text/uri-list", 0, 1}, |
3973 {"text/uri-list", 0, 1}, |
| 3947 {"GAIM_BLIST_NODE", 0, 2}, |
3974 {"GAIM_BLIST_NODE", GTK_TARGET_SAME_APP, 2}, |
| 3948 {"STRING", 0, 3} |
3975 {"STRING", 0, 3}, |
| |
3976 {"application/x-im-contact", 0, 4} |
| 3949 }; |
3977 }; |
| 3950 |
3978 |
| 3951 static void |
3979 static void |
| 3952 gaim_gtk_add_conversation(GaimConvWindow *win, GaimConversation *conv) |
3980 gaim_gtk_add_conversation(GaimConvWindow *win, GaimConversation *conv) |
| 3953 { |
3981 { |