| 199 static gboolean infopane_entry_activate(PidginConversation *gtkconv); |
199 static gboolean infopane_entry_activate(PidginConversation *gtkconv); |
| 200 #if 0 |
200 #if 0 |
| 201 static void got_typing_keypress(PidginConversation *gtkconv, gboolean first); |
201 static void got_typing_keypress(PidginConversation *gtkconv, gboolean first); |
| 202 #endif |
202 #endif |
| 203 static void gray_stuff_out(PidginConversation *gtkconv); |
203 static void gray_stuff_out(PidginConversation *gtkconv); |
| 204 static void add_chat_buddy_common(PurpleChatConversation *chat, PurpleChatConversationBuddy *cb, const char *old_name); |
204 static void add_chat_user_common(PurpleChatConversation *chat, PurpleChatUser *cb, const char *old_name); |
| 205 static gboolean tab_complete(PurpleConversation *conv); |
205 static gboolean tab_complete(PurpleConversation *conv); |
| 206 static void pidgin_conv_updated(PurpleConversation *conv, PurpleConversationUpdateType type); |
206 static void pidgin_conv_updated(PurpleConversation *conv, PurpleConversationUpdateType type); |
| 207 static void conv_set_unseen(PurpleConversation *gtkconv, PidginUnseenState state); |
207 static void conv_set_unseen(PurpleConversation *gtkconv, PidginUnseenState state); |
| 208 static void gtkconv_set_unseen(PidginConversation *gtkconv, PidginUnseenState state); |
208 static void gtkconv_set_unseen(PidginConversation *gtkconv, PidginUnseenState state); |
| 209 static void update_typing_icon(PidginConversation *gtkconv); |
209 static void update_typing_icon(PidginConversation *gtkconv); |
| 2438 /* We deleted all the text, so turn off typing. */ |
2438 /* We deleted all the text, so turn off typing. */ |
| 2439 purple_im_conversation_stop_send_typed_timeout(im); |
2439 purple_im_conversation_stop_send_typed_timeout(im); |
| 2440 |
2440 |
| 2441 serv_send_typing(purple_conversation_get_connection(conv), |
2441 serv_send_typing(purple_conversation_get_connection(conv), |
| 2442 purple_conversation_get_name(conv), |
2442 purple_conversation_get_name(conv), |
| 2443 PURPLE_IM_CONVERSATION_NOT_TYPING); |
2443 PURPLE_IM_NOT_TYPING); |
| 2444 } |
2444 } |
| 2445 else { |
2445 else { |
| 2446 /* We're deleting, but not all of it, so it counts as typing. */ |
2446 /* We're deleting, but not all of it, so it counts as typing. */ |
| 2447 got_typing_keypress(gtkconv, FALSE); |
2447 got_typing_keypress(gtkconv, FALSE); |
| 2448 } |
2448 } |
| 3723 PurpleConversation *conv = gtkconv->active_conv; |
3723 PurpleConversation *conv = gtkconv->active_conv; |
| 3724 PurpleIMConversation *im; |
3724 PurpleIMConversation *im; |
| 3725 |
3725 |
| 3726 /* |
3726 /* |
| 3727 * We know we got something, so we at least have to make sure we don't |
3727 * We know we got something, so we at least have to make sure we don't |
| 3728 * send PURPLE_IM_CONVERSATION_TYPED any time soon. |
3728 * send PURPLE_IM_TYPED any time soon. |
| 3729 */ |
3729 */ |
| 3730 |
3730 |
| 3731 im = PURPLE_CONV_IM(conv); |
3731 im = PURPLE_CONV_IM(conv); |
| 3732 |
3732 |
| 3733 purple_im_conversation_stop_send_typed_timeout(im); |
3733 purple_im_conversation_stop_send_typed_timeout(im); |
| 3734 purple_im_conversation_start_send_typed_timeout(im); |
3734 purple_im_conversation_start_send_typed_timeout(im); |
| 3735 |
3735 |
| 3736 /* Check if we need to send another PURPLE_IM_CONVERSATION_TYPING message */ |
3736 /* Check if we need to send another PURPLE_IM_TYPING message */ |
| 3737 if (first || (purple_im_conversation_get_type_again(im) != 0 && |
3737 if (first || (purple_im_conversation_get_type_again(im) != 0 && |
| 3738 time(NULL) > purple_im_conversation_get_type_again(im))) |
3738 time(NULL) > purple_im_conversation_get_type_again(im))) |
| 3739 { |
3739 { |
| 3740 unsigned int timeout; |
3740 unsigned int timeout; |
| 3741 timeout = serv_send_typing(purple_conversation_get_connection(conv), |
3741 timeout = serv_send_typing(purple_conversation_get_connection(conv), |
| 3742 purple_conversation_get_name(conv), |
3742 purple_conversation_get_name(conv), |
| 3743 PURPLE_IM_CONVERSATION_TYPING); |
3743 PURPLE_IM_TYPING); |
| 3744 purple_im_conversation_set_type_again(im, timeout); |
3744 purple_im_conversation_set_type_again(im, timeout); |
| 3745 } |
3745 } |
| 3746 } |
3746 } |
| 3747 |
3747 |
| 3748 static gboolean |
3748 static gboolean |
| 3832 char *message = NULL; |
3832 char *message = NULL; |
| 3833 |
3833 |
| 3834 if (im == NULL) |
3834 if (im == NULL) |
| 3835 return; |
3835 return; |
| 3836 |
3836 |
| 3837 if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_CONVERSATION_NOT_TYPING) { |
3837 if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_NOT_TYPING) { |
| 3838 #ifdef RESERVE_LINE |
3838 #ifdef RESERVE_LINE |
| 3839 update_typing_message(gtkconv, NULL); |
3839 update_typing_message(gtkconv, NULL); |
| 3840 #else |
3840 #else |
| 3841 update_typing_message(gtkconv, "\n "); |
3841 update_typing_message(gtkconv, "\n "); |
| 3842 #endif |
3842 #endif |
| 3843 return; |
3843 return; |
| 3844 } |
3844 } |
| 3845 |
3845 |
| 3846 if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_CONVERSATION_TYPING) { |
3846 if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_TYPING) { |
| 3847 message = g_strdup_printf(_("\n%s is typing..."), purple_conversation_get_title(PURPLE_CONVERSATION(im))); |
3847 message = g_strdup_printf(_("\n%s is typing..."), purple_conversation_get_title(PURPLE_CONVERSATION(im))); |
| 3848 } else { |
3848 } else { |
| 3849 message = g_strdup_printf(_("\n%s has stopped typing"), purple_conversation_get_title(PURPLE_CONVERSATION(im))); |
3849 message = g_strdup_printf(_("\n%s has stopped typing"), purple_conversation_get_title(PURPLE_CONVERSATION(im))); |
| 3850 } |
3850 } |
| 3851 |
3851 |
| 4094 gtk_widget_set_sensitive(win->menu.send_to, FALSE); |
4094 gtk_widget_set_sensitive(win->menu.send_to, FALSE); |
| 4095 update_send_to_selection(win); |
4095 update_send_to_selection(win); |
| 4096 } |
4096 } |
| 4097 |
4097 |
| 4098 static const char * |
4098 static const char * |
| 4099 get_chat_buddy_status_icon(PurpleChatConversation *chat, const char *name, PurpleChatConversationBuddyFlags flags) |
4099 get_chat_user_status_icon(PurpleChatConversation *chat, const char *name, PurpleChatUserFlags flags) |
| 4100 { |
4100 { |
| 4101 const char *image = NULL; |
4101 const char *image = NULL; |
| 4102 |
4102 |
| 4103 if (flags & PURPLE_CHAT_CONVERSATION_BUDDY_FOUNDER) { |
4103 if (flags & PURPLE_CHAT_USER_FOUNDER) { |
| 4104 image = PIDGIN_STOCK_STATUS_FOUNDER; |
4104 image = PIDGIN_STOCK_STATUS_FOUNDER; |
| 4105 } else if (flags & PURPLE_CHAT_CONVERSATION_BUDDY_OP) { |
4105 } else if (flags & PURPLE_CHAT_USER_OP) { |
| 4106 image = PIDGIN_STOCK_STATUS_OPERATOR; |
4106 image = PIDGIN_STOCK_STATUS_OPERATOR; |
| 4107 } else if (flags & PURPLE_CHAT_CONVERSATION_BUDDY_HALFOP) { |
4107 } else if (flags & PURPLE_CHAT_USER_HALFOP) { |
| 4108 image = PIDGIN_STOCK_STATUS_HALFOP; |
4108 image = PIDGIN_STOCK_STATUS_HALFOP; |
| 4109 } else if (flags & PURPLE_CHAT_CONVERSATION_BUDDY_VOICE) { |
4109 } else if (flags & PURPLE_CHAT_USER_VOICE) { |
| 4110 image = PIDGIN_STOCK_STATUS_VOICE; |
4110 image = PIDGIN_STOCK_STATUS_VOICE; |
| 4111 } else if ((!flags) && purple_chat_conversation_is_ignored_user(chat, name)) { |
4111 } else if ((!flags) && purple_chat_conversation_is_ignored_user(chat, name)) { |
| 4112 image = PIDGIN_STOCK_STATUS_IGNORED; |
4112 image = PIDGIN_STOCK_STATUS_IGNORED; |
| 4113 } else { |
4113 } else { |
| 4114 return NULL; |
4114 return NULL; |
| 4115 } |
4115 } |
| 4116 return image; |
4116 return image; |
| 4117 } |
4117 } |
| 4118 |
4118 |
| 4119 static void |
4119 static void |
| 4120 deleting_chat_buddy_cb(PurpleChatConversationBuddy *cb) |
4120 deleting_chat_user_cb(PurpleChatUser *cb) |
| 4121 { |
4121 { |
| 4122 GtkTreeRowReference *ref = purple_chat_conversation_buddy_get_ui_data(cb); |
4122 GtkTreeRowReference *ref = purple_chat_user_get_ui_data(cb); |
| 4123 |
4123 |
| 4124 if (ref) { |
4124 if (ref) { |
| 4125 gtk_tree_row_reference_free(ref); |
4125 gtk_tree_row_reference_free(ref); |
| 4126 purple_chat_conversation_buddy_set_ui_data(cb, NULL); |
4126 purple_chat_user_set_ui_data(cb, NULL); |
| 4127 } |
4127 } |
| 4128 } |
4128 } |
| 4129 |
4129 |
| 4130 static void |
4130 static void |
| 4131 add_chat_buddy_common(PurpleChatConversation *chat, PurpleChatConversationBuddy *cb, const char *old_name) |
4131 add_chat_user_common(PurpleChatConversation *chat, PurpleChatUser *cb, const char *old_name) |
| 4132 { |
4132 { |
| 4133 PidginConversation *gtkconv; |
4133 PidginConversation *gtkconv; |
| 4134 PurpleConversation *conv; |
4134 PurpleConversation *conv; |
| 4135 PidginChatPane *gtkchat; |
4135 PidginChatPane *gtkchat; |
| 4136 PurpleConnection *gc; |
4136 PurpleConnection *gc; |
| 4142 GtkTreeIter iter; |
4142 GtkTreeIter iter; |
| 4143 gboolean is_me = FALSE; |
4143 gboolean is_me = FALSE; |
| 4144 gboolean is_buddy; |
4144 gboolean is_buddy; |
| 4145 const gchar *name, *alias; |
4145 const gchar *name, *alias; |
| 4146 gchar *tmp, *alias_key; |
4146 gchar *tmp, *alias_key; |
| 4147 PurpleChatConversationBuddyFlags flags; |
4147 PurpleChatUserFlags flags; |
| 4148 GdkColor *color = NULL; |
4148 GdkColor *color = NULL; |
| 4149 |
4149 |
| 4150 alias = purple_chat_conversation_buddy_get_alias(cb); |
4150 alias = purple_chat_user_get_alias(cb); |
| 4151 name = purple_chat_conversation_buddy_get_name(cb); |
4151 name = purple_chat_user_get_name(cb); |
| 4152 flags = purple_chat_conversation_buddy_get_flags(cb); |
4152 flags = purple_chat_user_get_flags(cb); |
| 4153 |
4153 |
| 4154 conv = PURPLE_CONVERSATION(chat); |
4154 conv = PURPLE_CONVERSATION(chat); |
| 4155 gtkconv = PIDGIN_CONVERSATION(conv); |
4155 gtkconv = PIDGIN_CONVERSATION(conv); |
| 4156 gtkchat = gtkconv->u.chat; |
4156 gtkchat = gtkconv->u.chat; |
| 4157 gc = purple_conversation_get_connection(conv); |
4157 gc = purple_conversation_get_connection(conv); |
| 4160 return; |
4160 return; |
| 4161 |
4161 |
| 4162 tm = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); |
4162 tm = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); |
| 4163 ls = GTK_LIST_STORE(tm); |
4163 ls = GTK_LIST_STORE(tm); |
| 4164 |
4164 |
| 4165 stock = get_chat_buddy_status_icon(chat, name, flags); |
4165 stock = get_chat_user_status_icon(chat, name, flags); |
| 4166 |
4166 |
| 4167 if (!strcmp(purple_chat_conversation_get_nick(chat), purple_normalize(purple_conversation_get_account(conv), old_name != NULL ? old_name : name))) |
4167 if (!strcmp(purple_chat_conversation_get_nick(chat), purple_normalize(purple_conversation_get_account(conv), old_name != NULL ? old_name : name))) |
| 4168 is_me = TRUE; |
4168 is_me = TRUE; |
| 4169 |
4169 |
| 4170 is_buddy = purple_chat_conversation_buddy_is_buddy(cb); |
4170 is_buddy = purple_chat_user_is_buddy(cb); |
| 4171 |
4171 |
| 4172 tmp = g_utf8_casefold(alias, -1); |
4172 tmp = g_utf8_casefold(alias, -1); |
| 4173 alias_key = g_utf8_collate_key(tmp, -1); |
4173 alias_key = g_utf8_collate_key(tmp, -1); |
| 4174 g_free(tmp); |
4174 g_free(tmp); |
| 4175 |
4175 |
| 4206 CHAT_USERS_FLAGS_COLUMN, flags, |
4206 CHAT_USERS_FLAGS_COLUMN, flags, |
| 4207 CHAT_USERS_COLOR_COLUMN, color, |
4207 CHAT_USERS_COLOR_COLUMN, color, |
| 4208 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, |
4208 CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, |
| 4209 -1); |
4209 -1); |
| 4210 |
4210 |
| 4211 if (purple_chat_conversation_buddy_get_ui_data(cb)) { |
4211 if (purple_chat_user_get_ui_data(cb)) { |
| 4212 GtkTreeRowReference *ref = purple_chat_conversation_buddy_get_ui_data(cb); |
4212 GtkTreeRowReference *ref = purple_chat_user_get_ui_data(cb); |
| 4213 gtk_tree_row_reference_free(ref); |
4213 gtk_tree_row_reference_free(ref); |
| 4214 } |
4214 } |
| 4215 |
4215 |
| 4216 newpath = gtk_tree_model_get_path(tm, &iter); |
4216 newpath = gtk_tree_model_get_path(tm, &iter); |
| 4217 purple_chat_conversation_buddy_set_ui_data(cb, gtk_tree_row_reference_new(tm, newpath)); |
4217 purple_chat_user_set_ui_data(cb, gtk_tree_row_reference_new(tm, newpath)); |
| 4218 gtk_tree_path_free(newpath); |
4218 gtk_tree_path_free(newpath); |
| 4219 |
4219 |
| 4220 if (is_me && color) |
4220 if (is_me && color) |
| 4221 gdk_color_free(color); |
4221 gdk_color_free(color); |
| 4222 g_free(alias_key); |
4222 g_free(alias_key); |
| 4368 int f; |
4368 int f; |
| 4369 |
4369 |
| 4370 /* Users */ |
4370 /* Users */ |
| 4371 for (; l != NULL; l = l->next) { |
4371 for (; l != NULL; l = l->next) { |
| 4372 tab_complete_process_item(&most_matched, entered, entered_bytes, &partial, nick_partial, |
4372 tab_complete_process_item(&most_matched, entered, entered_bytes, &partial, nick_partial, |
| 4373 &matches, purple_chat_conversation_buddy_get_name((PurpleChatConversationBuddy *)l->data)); |
4373 &matches, purple_chat_user_get_name((PurpleChatUser *)l->data)); |
| 4374 } |
4374 } |
| 4375 |
4375 |
| 4376 |
4376 |
| 4377 /* Aliases */ |
4377 /* Aliases */ |
| 4378 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) |
4378 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) |
| 4498 } |
4498 } |
| 4499 |
4499 |
| 4500 static gint |
4500 static gint |
| 4501 sort_chat_users(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer userdata) |
4501 sort_chat_users(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer userdata) |
| 4502 { |
4502 { |
| 4503 PurpleChatConversationBuddyFlags f1 = 0, f2 = 0; |
4503 PurpleChatUserFlags f1 = 0, f2 = 0; |
| 4504 char *user1 = NULL, *user2 = NULL; |
4504 char *user1 = NULL, *user2 = NULL; |
| 4505 gboolean buddy1 = FALSE, buddy2 = FALSE; |
4505 gboolean buddy1 = FALSE, buddy2 = FALSE; |
| 4506 gint ret = 0; |
4506 gint ret = 0; |
| 4507 |
4507 |
| 4508 gtk_tree_model_get(model, a, |
4508 gtk_tree_model_get(model, a, |
| 4515 CHAT_USERS_FLAGS_COLUMN, &f2, |
4515 CHAT_USERS_FLAGS_COLUMN, &f2, |
| 4516 CHAT_USERS_WEIGHT_COLUMN, &buddy2, |
4516 CHAT_USERS_WEIGHT_COLUMN, &buddy2, |
| 4517 -1); |
4517 -1); |
| 4518 |
4518 |
| 4519 /* Only sort by membership levels */ |
4519 /* Only sort by membership levels */ |
| 4520 f1 &= PURPLE_CHAT_CONVERSATION_BUDDY_VOICE | PURPLE_CHAT_CONVERSATION_BUDDY_HALFOP | PURPLE_CHAT_CONVERSATION_BUDDY_OP | |
4520 f1 &= PURPLE_CHAT_USER_VOICE | PURPLE_CHAT_USER_HALFOP | PURPLE_CHAT_USER_OP | |
| 4521 PURPLE_CHAT_CONVERSATION_BUDDY_FOUNDER; |
4521 PURPLE_CHAT_USER_FOUNDER; |
| 4522 f2 &= PURPLE_CHAT_CONVERSATION_BUDDY_VOICE | PURPLE_CHAT_CONVERSATION_BUDDY_HALFOP | PURPLE_CHAT_CONVERSATION_BUDDY_OP | |
4522 f2 &= PURPLE_CHAT_USER_VOICE | PURPLE_CHAT_USER_HALFOP | PURPLE_CHAT_USER_OP | |
| 4523 PURPLE_CHAT_CONVERSATION_BUDDY_FOUNDER; |
4523 PURPLE_CHAT_USER_FOUNDER; |
| 4524 |
4524 |
| 4525 if (user1 == NULL || user2 == NULL) { |
4525 if (user1 == NULL || user2 == NULL) { |
| 4526 if (!(user1 == NULL && user2 == NULL)) |
4526 if (!(user1 == NULL && user2 == NULL)) |
| 4527 ret = (user1 == NULL) ? -1: 1; |
4527 ret = (user1 == NULL) ? -1: 1; |
| 4528 } else if (f1 != f2) { |
4528 } else if (f1 != f2) { |
| 6753 account, name, displaying, conv, flags); |
6753 account, name, displaying, conv, flags); |
| 6754 g_free(displaying); |
6754 g_free(displaying); |
| 6755 update_typing_message(gtkconv, NULL); |
6755 update_typing_message(gtkconv, NULL); |
| 6756 } |
6756 } |
| 6757 |
6757 |
| 6758 static gboolean get_iter_from_chatbuddy(PurpleChatConversationBuddy *cb, GtkTreeIter *iter) |
6758 static gboolean get_iter_from_chatuser(PurpleChatUser *cb, GtkTreeIter *iter) |
| 6759 { |
6759 { |
| 6760 GtkTreeRowReference *ref; |
6760 GtkTreeRowReference *ref; |
| 6761 GtkTreePath *path; |
6761 GtkTreePath *path; |
| 6762 GtkTreeModel *model; |
6762 GtkTreeModel *model; |
| 6763 |
6763 |
| 6764 g_return_val_if_fail(cb != NULL, FALSE); |
6764 g_return_val_if_fail(cb != NULL, FALSE); |
| 6765 |
6765 |
| 6766 ref = purple_chat_conversation_buddy_get_ui_data(cb); |
6766 ref = purple_chat_user_get_ui_data(cb); |
| 6767 if (!ref) |
6767 if (!ref) |
| 6768 return FALSE; |
6768 return FALSE; |
| 6769 |
6769 |
| 6770 if ((path = gtk_tree_row_reference_get_path(ref)) == NULL) |
6770 if ((path = gtk_tree_row_reference_get_path(ref)) == NULL) |
| 6771 return FALSE; |
6771 return FALSE; |
| 6808 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, |
6808 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, |
| 6809 GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID); |
6809 GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID); |
| 6810 |
6810 |
| 6811 l = cbuddies; |
6811 l = cbuddies; |
| 6812 while (l != NULL) { |
6812 while (l != NULL) { |
| 6813 add_chat_buddy_common(chat, (PurpleChatConversationBuddy *)l->data, NULL); |
6813 add_chat_user_common(chat, (PurpleChatUser *)l->data, NULL); |
| 6814 l = l->next; |
6814 l = l->next; |
| 6815 } |
6815 } |
| 6816 |
6816 |
| 6817 /* Currently GTK+ maintains our sorted list after it's in the tree. |
6817 /* Currently GTK+ maintains our sorted list after it's in the tree. |
| 6818 * This may change if it turns out we can manage it faster ourselves. |
6818 * This may change if it turns out we can manage it faster ourselves. |
| 6825 pidgin_conv_chat_rename_user(PurpleChatConversation *chat, const char *old_name, |
6825 pidgin_conv_chat_rename_user(PurpleChatConversation *chat, const char *old_name, |
| 6826 const char *new_name, const char *new_alias) |
6826 const char *new_name, const char *new_alias) |
| 6827 { |
6827 { |
| 6828 PidginConversation *gtkconv; |
6828 PidginConversation *gtkconv; |
| 6829 PidginChatPane *gtkchat; |
6829 PidginChatPane *gtkchat; |
| 6830 PurpleChatConversationBuddy *old_cbuddy, *new_cbuddy; |
6830 PurpleChatUser *old_chatuser, *new_chatuser; |
| 6831 GtkTreeIter iter; |
6831 GtkTreeIter iter; |
| 6832 GtkTreeModel *model; |
6832 GtkTreeModel *model; |
| 6833 GtkTextTag *tag; |
6833 GtkTextTag *tag; |
| 6834 |
6834 |
| 6835 gtkconv = PIDGIN_CONVERSATION(PURPLE_CONVERSATION(chat)); |
6835 gtkconv = PIDGIN_CONVERSATION(PURPLE_CONVERSATION(chat)); |
| 6843 if ((tag = get_buddy_tag(chat, old_name, 0, FALSE))) |
6843 if ((tag = get_buddy_tag(chat, old_name, 0, FALSE))) |
| 6844 g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL); |
6844 g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL); |
| 6845 if ((tag = get_buddy_tag(chat, old_name, PURPLE_MESSAGE_NICK, FALSE))) |
6845 if ((tag = get_buddy_tag(chat, old_name, PURPLE_MESSAGE_NICK, FALSE))) |
| 6846 g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL); |
6846 g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL); |
| 6847 |
6847 |
| 6848 old_cbuddy = purple_chat_conversation_find_buddy(chat, old_name); |
6848 old_chatuser = purple_chat_conversation_find_buddy(chat, old_name); |
| 6849 if (!old_cbuddy) |
6849 if (!old_chatuser) |
| 6850 return; |
6850 return; |
| 6851 |
6851 |
| 6852 if (get_iter_from_chatbuddy(old_cbuddy, &iter)) { |
6852 if (get_iter_from_chatuser(old_chatuser, &iter)) { |
| 6853 GtkTreeRowReference *ref = purple_chat_conversation_buddy_get_ui_data(old_cbuddy); |
6853 GtkTreeRowReference *ref = purple_chat_user_get_ui_data(old_chatuser); |
| 6854 |
6854 |
| 6855 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
6855 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
| 6856 gtk_tree_row_reference_free(ref); |
6856 gtk_tree_row_reference_free(ref); |
| 6857 purple_chat_conversation_buddy_set_ui_data(old_cbuddy, NULL); |
6857 purple_chat_user_set_ui_data(old_chatuser, NULL); |
| 6858 } |
6858 } |
| 6859 |
6859 |
| 6860 g_return_if_fail(new_alias != NULL); |
6860 g_return_if_fail(new_alias != NULL); |
| 6861 |
6861 |
| 6862 new_cbuddy = purple_chat_conversation_find_buddy(chat, new_name); |
6862 new_chatuser = purple_chat_conversation_find_buddy(chat, new_name); |
| 6863 |
6863 |
| 6864 add_chat_buddy_common(chat, new_cbuddy, old_name); |
6864 add_chat_user_common(chat, new_chatuser, old_name); |
| 6865 } |
6865 } |
| 6866 |
6866 |
| 6867 static void |
6867 static void |
| 6868 pidgin_conv_chat_remove_users(PurpleChatConversation *chat, GList *users) |
6868 pidgin_conv_chat_remove_users(PurpleChatConversation *chat, GList *users) |
| 6869 { |
6869 { |
| 6916 |
6916 |
| 6917 gtk_label_set_text(GTK_LABEL(gtkchat->count), tmp); |
6917 gtk_label_set_text(GTK_LABEL(gtkchat->count), tmp); |
| 6918 } |
6918 } |
| 6919 |
6919 |
| 6920 static void |
6920 static void |
| 6921 pidgin_conv_chat_update_user(PurpleChatConversationBuddy *cbuddy) |
6921 pidgin_conv_chat_update_user(PurpleChatUser *chatuser) |
| 6922 { |
6922 { |
| 6923 PurpleChatConversation *chat; |
6923 PurpleChatConversation *chat; |
| 6924 PidginConversation *gtkconv; |
6924 PidginConversation *gtkconv; |
| 6925 PidginChatPane *gtkchat; |
6925 PidginChatPane *gtkchat; |
| 6926 GtkTreeIter iter; |
6926 GtkTreeIter iter; |
| 6927 GtkTreeModel *model; |
6927 GtkTreeModel *model; |
| 6928 |
6928 |
| 6929 if (!cbuddy) |
6929 if (!chatuser) |
| 6930 return; |
6930 return; |
| 6931 |
6931 |
| 6932 chat = purple_chat_conversation_buddy_get_chat(cbuddy); |
6932 chat = purple_chat_user_get_chat(chatuser); |
| 6933 gtkconv = PIDGIN_CONVERSATION(PURPLE_CONVERSATION(chat)); |
6933 gtkconv = PIDGIN_CONVERSATION(PURPLE_CONVERSATION(chat)); |
| 6934 gtkchat = gtkconv->u.chat; |
6934 gtkchat = gtkconv->u.chat; |
| 6935 |
6935 |
| 6936 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); |
6936 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); |
| 6937 |
6937 |
| 6938 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) |
6938 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) |
| 6939 return; |
6939 return; |
| 6940 |
6940 |
| 6941 if (get_iter_from_chatbuddy(cbuddy, &iter)) { |
6941 if (get_iter_from_chatuser(chatuser, &iter)) { |
| 6942 GtkTreeRowReference *ref = purple_chat_conversation_buddy_get_ui_data(cbuddy); |
6942 GtkTreeRowReference *ref = purple_chat_user_get_ui_data(chatuser); |
| 6943 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
6943 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
| 6944 gtk_tree_row_reference_free(ref); |
6944 gtk_tree_row_reference_free(ref); |
| 6945 purple_chat_conversation_buddy_set_ui_data(cbuddy, NULL); |
6945 purple_chat_user_set_ui_data(chatuser, NULL); |
| 6946 } |
6946 } |
| 6947 |
6947 |
| 6948 if (cbuddy) |
6948 if (chatuser) |
| 6949 add_chat_buddy_common(chat, cbuddy, NULL); |
6949 add_chat_user_common(chat, chatuser, NULL); |
| 6950 } |
6950 } |
| 6951 |
6951 |
| 6952 gboolean |
6952 gboolean |
| 6953 pidgin_conv_has_focus(PurpleConversation *conv) |
6953 pidgin_conv_has_focus(PurpleConversation *conv) |
| 6954 { |
6954 { |
| 7461 if (!gtk_widget_get_realized(gtkconv->tab_label)) |
7461 if (!gtk_widget_get_realized(gtkconv->tab_label)) |
| 7462 gtk_widget_realize(gtkconv->tab_label); |
7462 gtk_widget_realize(gtkconv->tab_label); |
| 7463 |
7463 |
| 7464 accessibility_obj = gtk_widget_get_accessible(gtkconv->tab_cont); |
7464 accessibility_obj = gtk_widget_get_accessible(gtkconv->tab_cont); |
| 7465 if (im != NULL && |
7465 if (im != NULL && |
| 7466 purple_im_conversation_get_typing_state(im) == PURPLE_IM_CONVERSATION_TYPING) { |
7466 purple_im_conversation_get_typing_state(im) == PURPLE_IM_TYPING) { |
| 7467 atk_object_set_description(accessibility_obj, _("Typing")); |
7467 atk_object_set_description(accessibility_obj, _("Typing")); |
| 7468 style = "tab-label-typing"; |
7468 style = "tab-label-typing"; |
| 7469 } else if (im != NULL && |
7469 } else if (im != NULL && |
| 7470 purple_im_conversation_get_typing_state(im) == PURPLE_IM_CONVERSATION_TYPED) { |
7470 purple_im_conversation_get_typing_state(im) == PURPLE_IM_TYPED) { |
| 7471 atk_object_set_description(accessibility_obj, _("Stopped Typing")); |
7471 atk_object_set_description(accessibility_obj, _("Stopped Typing")); |
| 7472 style = "tab-label-typed"; |
7472 style = "tab-label-typed"; |
| 7473 } else if (gtkconv->unseen_state == PIDGIN_UNSEEN_NICK) { |
7473 } else if (gtkconv->unseen_state == PIDGIN_UNSEEN_NICK) { |
| 7474 atk_object_set_description(accessibility_obj, _("Nick Said")); |
7474 atk_object_set_description(accessibility_obj, _("Nick Said")); |
| 7475 style = "tab-label-attention"; |
7475 style = "tab-label-attention"; |
| 8747 purple_signal_connect(purple_conversations_get_handle(), "received-im-msg", |
8747 purple_signal_connect(purple_conversations_get_handle(), "received-im-msg", |
| 8748 handle, G_CALLBACK(received_im_msg_cb), NULL); |
8748 handle, G_CALLBACK(received_im_msg_cb), NULL); |
| 8749 purple_signal_connect(purple_conversations_get_handle(), "cleared-message-history", |
8749 purple_signal_connect(purple_conversations_get_handle(), "cleared-message-history", |
| 8750 handle, G_CALLBACK(clear_conversation_scrollback_cb), NULL); |
8750 handle, G_CALLBACK(clear_conversation_scrollback_cb), NULL); |
| 8751 |
8751 |
| 8752 purple_signal_connect(purple_conversations_get_handle(), "deleting-chat-buddy", |
8752 purple_signal_connect(purple_conversations_get_handle(), "deleting-chat-user", |
| 8753 handle, G_CALLBACK(deleting_chat_buddy_cb), NULL); |
8753 handle, G_CALLBACK(deleting_chat_user_cb), NULL); |
| 8754 |
8754 |
| 8755 purple_conversations_set_ui_ops(&conversation_ui_ops); |
8755 purple_conversations_set_ui_ops(&conversation_ui_ops); |
| 8756 |
8756 |
| 8757 hidden_convwin = pidgin_conv_window_new(); |
8757 hidden_convwin = pidgin_conv_window_new(); |
| 8758 window_list = g_list_remove(window_list, hidden_convwin); |
8758 window_list = g_list_remove(window_list, hidden_convwin); |