| 3476 } |
3476 } |
| 3477 return image; |
3477 return image; |
| 3478 } |
3478 } |
| 3479 |
3479 |
| 3480 static void |
3480 static void |
| 3481 deleting_chat_user_cb(PurpleChatUser *cb) |
|
| 3482 { |
|
| 3483 GtkTreeRowReference *ref = purple_chat_user_get_ui_data(cb); |
|
| 3484 |
|
| 3485 if (ref) { |
|
| 3486 gtk_tree_row_reference_free(ref); |
|
| 3487 purple_chat_user_set_ui_data(cb, NULL); |
|
| 3488 } |
|
| 3489 } |
|
| 3490 |
|
| 3491 static void |
|
| 3492 add_chat_user_common(PurpleChatConversation *chat, PurpleChatUser *cb, const char *old_name) |
3481 add_chat_user_common(PurpleChatConversation *chat, PurpleChatUser *cb, const char *old_name) |
| 3493 { |
3482 { |
| 3494 PidginConversation *gtkconv; |
3483 PidginConversation *gtkconv; |
| 3495 PurpleConversation *conv; |
3484 PurpleConversation *conv; |
| 3496 PidginChatPane *gtkchat; |
3485 PidginChatPane *gtkchat; |
| 3567 CHAT_USERS_FLAGS_COLUMN, flags, |
3556 CHAT_USERS_FLAGS_COLUMN, flags, |
| 3568 CHAT_USERS_COLOR_COLUMN, color, |
3557 CHAT_USERS_COLOR_COLUMN, color, |
| 3569 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, |
3558 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, |
| 3570 -1); |
3559 -1); |
| 3571 |
3560 |
| 3572 if (purple_chat_user_get_ui_data(cb)) { |
|
| 3573 GtkTreeRowReference *ref = purple_chat_user_get_ui_data(cb); |
|
| 3574 gtk_tree_row_reference_free(ref); |
|
| 3575 } |
|
| 3576 |
|
| 3577 newpath = gtk_tree_model_get_path(tm, &iter); |
3561 newpath = gtk_tree_model_get_path(tm, &iter); |
| 3578 purple_chat_user_set_ui_data(cb, gtk_tree_row_reference_new(tm, newpath)); |
3562 g_object_set_data_full(G_OBJECT(cb), "pidgin-tree-row", |
| |
3563 gtk_tree_row_reference_new(tm, newpath), |
| |
3564 (GDestroyNotify)gtk_tree_row_reference_free); |
| 3579 gtk_tree_path_free(newpath); |
3565 gtk_tree_path_free(newpath); |
| 3580 |
3566 |
| 3581 #if 0 |
3567 #if 0 |
| 3582 if (is_me && color) |
3568 if (is_me && color) |
| 3583 gdk_rgba_free(color); |
3569 gdk_rgba_free(color); |
| 4848 old_chatuser = purple_chat_conversation_find_user(chat, old_name); |
4834 old_chatuser = purple_chat_conversation_find_user(chat, old_name); |
| 4849 if (!old_chatuser) |
4835 if (!old_chatuser) |
| 4850 return; |
4836 return; |
| 4851 |
4837 |
| 4852 if (get_iter_from_chatuser(old_chatuser, &iter)) { |
4838 if (get_iter_from_chatuser(old_chatuser, &iter)) { |
| 4853 GtkTreeRowReference *ref = purple_chat_user_get_ui_data(old_chatuser); |
|
| 4854 |
|
| 4855 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
4839 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
| 4856 gtk_tree_row_reference_free(ref); |
4840 g_object_set_data(G_OBJECT(old_chatuser), "pidgin-tree-row", NULL); |
| 4857 purple_chat_user_set_ui_data(old_chatuser, NULL); |
|
| 4858 } |
4841 } |
| 4859 |
4842 |
| 4860 g_return_if_fail(new_alias != NULL); |
4843 g_return_if_fail(new_alias != NULL); |
| 4861 |
4844 |
| 4862 new_chatuser = purple_chat_conversation_find_user(chat, new_name); |
4845 new_chatuser = purple_chat_conversation_find_user(chat, new_name); |
| 4937 |
4920 |
| 4938 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) |
4921 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) |
| 4939 return; |
4922 return; |
| 4940 |
4923 |
| 4941 if (get_iter_from_chatuser(chatuser, &iter)) { |
4924 if (get_iter_from_chatuser(chatuser, &iter)) { |
| 4942 GtkTreeRowReference *ref = purple_chat_user_get_ui_data(chatuser); |
|
| 4943 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
4925 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
| 4944 gtk_tree_row_reference_free(ref); |
4926 g_object_set_data(G_OBJECT(chatuser), "pidgin-tree-row", NULL); |
| 4945 purple_chat_user_set_ui_data(chatuser, NULL); |
|
| 4946 } |
4927 } |
| 4947 |
4928 |
| 4948 add_chat_user_common(chat, chatuser, NULL); |
4929 add_chat_user_common(chat, chatuser, NULL); |
| 4949 } |
4930 } |
| 4950 |
4931 |
| 6495 handle, G_CALLBACK(writing_msg), NULL); |
6476 handle, G_CALLBACK(writing_msg), NULL); |
| 6496 purple_signal_connect(purple_conversations_get_handle(), "received-im-msg", |
6477 purple_signal_connect(purple_conversations_get_handle(), "received-im-msg", |
| 6497 handle, G_CALLBACK(received_im_msg_cb), NULL); |
6478 handle, G_CALLBACK(received_im_msg_cb), NULL); |
| 6498 purple_signal_connect(purple_conversations_get_handle(), "cleared-message-history", |
6479 purple_signal_connect(purple_conversations_get_handle(), "cleared-message-history", |
| 6499 handle, G_CALLBACK(clear_conversation_scrollback_cb), NULL); |
6480 handle, G_CALLBACK(clear_conversation_scrollback_cb), NULL); |
| 6500 |
|
| 6501 purple_signal_connect(purple_conversations_get_handle(), "deleting-chat-user", |
|
| 6502 handle, G_CALLBACK(deleting_chat_user_cb), NULL); |
|
| 6503 |
6481 |
| 6504 purple_conversations_set_ui_ops(&conversation_ui_ops); |
6482 purple_conversations_set_ui_ops(&conversation_ui_ops); |
| 6505 |
6483 |
| 6506 hidden_convwin = pidgin_conv_window_new(); |
6484 hidden_convwin = pidgin_conv_window_new(); |
| 6507 window_list = g_list_remove(window_list, hidden_convwin); |
6485 window_list = g_list_remove(window_list, hidden_convwin); |