| 374 find_conversation_with_buddy(PurpleBuddy *buddy) |
374 find_conversation_with_buddy(PurpleBuddy *buddy) |
| 375 { |
375 { |
| 376 PidginBlistNode *ui = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
376 PidginBlistNode *ui = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
| 377 if (ui) |
377 if (ui) |
| 378 return ui->conv.conv; |
378 return ui->conv.conv; |
| 379 return purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, |
379 return purple_conversations_find_with_account(PURPLE_CONV_TYPE_IM, |
| 380 purple_buddy_get_name(buddy), |
380 purple_buddy_get_name(buddy), |
| 381 purple_buddy_get_account(buddy)); |
381 purple_buddy_get_account(buddy)); |
| 382 } |
382 } |
| 383 |
383 |
| 384 static void gtk_blist_join_chat(PurpleChat *chat) |
384 static void gtk_blist_join_chat(PurpleChat *chat) |
| 403 if (chat_name) |
403 if (chat_name) |
| 404 name = chat_name; |
404 name = chat_name; |
| 405 else |
405 else |
| 406 name = purple_chat_get_name(chat); |
406 name = purple_chat_get_name(chat); |
| 407 |
407 |
| 408 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, name, |
408 conv = purple_conversations_find_with_account(PURPLE_CONV_TYPE_CHAT, name, |
| 409 account); |
409 account); |
| 410 |
410 |
| 411 if (conv != NULL) { |
411 if (conv != NULL) { |
| 412 pidgin_conv_attach_to_conversation(conv); |
412 pidgin_conv_attach_to_conversation(conv); |
| 413 purple_conversation_present(conv); |
413 purple_conversation_present(conv); |
| 3858 if (prpl_info && prpl_info->get_chat_name) |
3858 if (prpl_info && prpl_info->get_chat_name) |
| 3859 chat_name = prpl_info->get_chat_name(purple_chat_get_components(chat)); |
3859 chat_name = prpl_info->get_chat_name(purple_chat_get_components(chat)); |
| 3860 else |
3860 else |
| 3861 chat_name = g_strdup(purple_chat_get_name(chat)); |
3861 chat_name = g_strdup(purple_chat_get_name(chat)); |
| 3862 |
3862 |
| 3863 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, chat_name, |
3863 conv = purple_conversations_find_with_account(PURPLE_CONV_TYPE_CHAT, chat_name, |
| 3864 purple_chat_get_account(chat)); |
3864 purple_chat_get_account(chat)); |
| 3865 g_free(chat_name); |
3865 g_free(chat_name); |
| 3866 } |
3866 } |
| 3867 |
3867 |
| 3868 if (conv && !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) { |
3868 if (conv && !purple_chat_conversation_has_left(PURPLE_CONV_CHAT(conv))) { |
| 3869 g_string_append_printf(str, _("\n<b>Occupants:</b> %d"), |
3869 g_string_append_printf(str, _("\n<b>Occupants:</b> %d"), |
| 3870 g_list_length(purple_conv_chat_get_users(PURPLE_CONV_CHAT(conv)))); |
3870 g_list_length(purple_chat_conversation_get_users(PURPLE_CONV_CHAT(conv)))); |
| 3871 |
3871 |
| 3872 if (prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC)) { |
3872 if (prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC)) { |
| 3873 const char *chattopic = purple_conv_chat_get_topic(PURPLE_CONV_CHAT(conv)); |
3873 const char *chattopic = purple_chat_conversation_get_topic(PURPLE_CONV_CHAT(conv)); |
| 3874 char *topic = chattopic ? g_markup_escape_text(chattopic, -1) : NULL; |
3874 char *topic = chattopic ? g_markup_escape_text(chattopic, -1) : NULL; |
| 3875 g_string_append_printf(str, _("\n<b>Topic:</b> %s"), topic ? topic : _("(no topic set)")); |
3875 g_string_append_printf(str, _("\n<b>Topic:</b> %s"), topic ? topic : _("(no topic set)")); |
| 3876 g_free(topic); |
3876 g_free(topic); |
| 3877 } |
3877 } |
| 3878 } |
3878 } |
| 4747 } |
4747 } |
| 4748 return TRUE; |
4748 return TRUE; |
| 4749 } |
4749 } |
| 4750 |
4750 |
| 4751 static void |
4751 static void |
| 4752 conversation_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type, |
4752 conversation_updated_cb(PurpleConversation *conv, PurpleConversationUpdateType type, |
| 4753 PidginBuddyList *gtkblist) |
4753 PidginBuddyList *gtkblist) |
| 4754 { |
4754 { |
| 4755 PurpleAccount *account = purple_conversation_get_account(conv); |
4755 PurpleAccount *account = purple_conversation_get_account(conv); |
| 4756 GList *convs = NULL; |
4756 GList *convs = NULL; |
| 4757 GList *ims, *chats; |
4757 GList *ims, *chats; |
| 4758 GList *l = NULL; |
4758 GList *l = NULL; |
| 4759 |
4759 |
| 4760 if (type != PURPLE_CONV_UPDATE_UNSEEN) |
4760 if (type != PURPLE_CONVERSATION_UPDATE_UNSEEN) |
| 4761 return; |
4761 return; |
| 4762 |
4762 |
| 4763 if(account != NULL && purple_conversation_get_name(conv) != NULL) { |
4763 if(account != NULL && purple_conversation_get_name(conv) != NULL) { |
| 4764 PurpleBuddy *buddy = purple_find_buddy(account, purple_conversation_get_name(conv)); |
4764 PurpleBuddy *buddy = purple_find_buddy(account, purple_conversation_get_name(conv)); |
| 4765 if(buddy != NULL) |
4765 if(buddy != NULL) |
| 4824 } |
4824 } |
| 4825 |
4825 |
| 4826 static void |
4826 static void |
| 4827 conversation_deleting_cb(PurpleConversation *conv, PidginBuddyList *gtkblist) |
4827 conversation_deleting_cb(PurpleConversation *conv, PidginBuddyList *gtkblist) |
| 4828 { |
4828 { |
| 4829 conversation_updated_cb(conv, PURPLE_CONV_UPDATE_UNSEEN, gtkblist); |
4829 conversation_updated_cb(conv, PURPLE_CONVERSATION_UPDATE_UNSEEN, gtkblist); |
| 4830 } |
4830 } |
| 4831 |
4831 |
| 4832 static void |
4832 static void |
| 4833 conversation_deleted_update_ui_cb(PurpleConversation *conv, struct _pidgin_blist_node *ui) |
4833 conversation_deleted_update_ui_cb(PurpleConversation *conv, struct _pidgin_blist_node *ui) |
| 4834 { |
4834 { |
| 7296 * local list. We need a new, non-gtk file that calls both |
7296 * local list. We need a new, non-gtk file that calls both |
| 7297 * purple_account_add_buddy and purple_blist_add_buddy(). |
7297 * purple_account_add_buddy and purple_blist_add_buddy(). |
| 7298 * Or something. --Mark |
7298 * Or something. --Mark |
| 7299 */ |
7299 */ |
| 7300 |
7300 |
| 7301 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, data->rq_data.account); |
7301 c = purple_conversations_find_with_account(PURPLE_CONV_TYPE_IM, who, data->rq_data.account); |
| 7302 if (c != NULL) { |
7302 if (c != NULL) { |
| 7303 icon = purple_conv_im_get_icon(PURPLE_CONV_IM(c)); |
7303 icon = purple_im_conversation_get_icon(PURPLE_CONV_IM(c)); |
| 7304 if (icon != NULL) |
7304 if (icon != NULL) |
| 7305 purple_buddy_icon_update(icon); |
7305 purple_buddy_icon_update(icon); |
| 7306 } |
7306 } |
| 7307 } |
7307 } |
| 7308 |
7308 |