Mercurial > pidgin.yaz
comparison finch/gntconv.c @ 32827:4a34689eeb33 default tip
merged from im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 19 Nov 2011 14:42:54 +0900 |
parents | 3e7a7e14af62 |
children |
comparison
equal
deleted
inserted
replaced
32692:0f94ec89f0bc | 32827:4a34689eeb33 |
---|---|
121 purple_conv_im_stop_send_typed_timeout(im); | 121 purple_conv_im_stop_send_typed_timeout(im); |
122 purple_conv_im_start_send_typed_timeout(im); | 122 purple_conv_im_start_send_typed_timeout(im); |
123 if (send || (purple_conv_im_get_type_again(im) != 0 && | 123 if (send || (purple_conv_im_get_type_again(im) != 0 && |
124 time(NULL) > purple_conv_im_get_type_again(im))) { | 124 time(NULL) > purple_conv_im_get_type_again(im))) { |
125 unsigned int timeout; | 125 unsigned int timeout; |
126 timeout = serv_send_typing(purple_conversation_get_gc(conv), | 126 timeout = serv_send_typing(purple_conversation_get_connection(conv), |
127 purple_conversation_get_name(conv), | 127 purple_conversation_get_name(conv), |
128 PURPLE_TYPING); | 128 PURPLE_TYPING); |
129 purple_conv_im_set_type_again(im, timeout); | 129 purple_conv_im_set_type_again(im, timeout); |
130 } | 130 } |
131 } else { | 131 } else { |
132 purple_conv_im_stop_send_typed_timeout(im); | 132 purple_conv_im_stop_send_typed_timeout(im); |
133 | 133 |
134 serv_send_typing(purple_conversation_get_gc(conv), | 134 serv_send_typing(purple_conversation_get_connection(conv), |
135 purple_conversation_get_name(conv), | 135 purple_conversation_get_name(conv), |
136 PURPLE_NOT_TYPING); | 136 PURPLE_NOT_TYPING); |
137 } | 137 } |
138 } | 138 } |
139 } | 139 } |
412 | 412 |
413 static void | 413 static void |
414 send_file_cb(GntMenuItem *item, gpointer ggconv) | 414 send_file_cb(GntMenuItem *item, gpointer ggconv) |
415 { | 415 { |
416 FinchConv *ggc = ggconv; | 416 FinchConv *ggc = ggconv; |
417 serv_send_file(purple_conversation_get_gc(ggc->active_conv), | 417 serv_send_file(purple_conversation_get_connection(ggc->active_conv), |
418 purple_conversation_get_name(ggc->active_conv), NULL); | 418 purple_conversation_get_name(ggc->active_conv), NULL); |
419 } | 419 } |
420 | 420 |
421 static void | 421 static void |
422 add_pounce_cb(GntMenuItem *item, gpointer ggconv) | 422 add_pounce_cb(GntMenuItem *item, gpointer ggconv) |
429 | 429 |
430 static void | 430 static void |
431 get_info_cb(GntMenuItem *item, gpointer ggconv) | 431 get_info_cb(GntMenuItem *item, gpointer ggconv) |
432 { | 432 { |
433 FinchConv *ggc = ggconv; | 433 FinchConv *ggc = ggconv; |
434 finch_retrieve_user_info(purple_conversation_get_gc(ggc->active_conv), | 434 finch_retrieve_user_info(purple_conversation_get_connection(ggc->active_conv), |
435 purple_conversation_get_name(ggc->active_conv)); | 435 purple_conversation_get_name(ggc->active_conv)); |
436 } | 436 } |
437 | 437 |
438 static void | 438 static void |
439 toggle_timestamps_cb(GntMenuItem *item, gpointer ggconv) | 439 toggle_timestamps_cb(GntMenuItem *item, gpointer ggconv) |
681 return; | 681 return; |
682 } | 682 } |
683 | 683 |
684 name = gnt_tree_get_selection_data(GNT_TREE(widget)); | 684 name = gnt_tree_get_selection_data(GNT_TREE(widget)); |
685 | 685 |
686 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); | 686 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
687 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_cb_real_name)) | 687 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_cb_real_name)) |
688 realname = prpl_info->get_cb_real_name(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(fc->active_conv)), name); | 688 realname = prpl_info->get_cb_real_name(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(fc->active_conv)), name); |
689 else | 689 else |
690 realname = NULL; | 690 realname = NULL; |
691 purple_conversation_new(PURPLE_CONV_TYPE_IM, account, realname ? realname : name); | 691 purple_conversation_new(PURPLE_CONV_TYPE_IM, account, realname ? realname : name); |
1082 g_string_printf(string, | 1082 g_string_printf(string, |
1083 ngettext("List of %d user:\n", "List of %d users:\n", count), count); | 1083 ngettext("List of %d user:\n", "List of %d users:\n", count), count); |
1084 for (iter = users; iter; iter = iter->next) | 1084 for (iter = users; iter; iter = iter->next) |
1085 { | 1085 { |
1086 PurpleConvChatBuddy *cbuddy = iter->data; | 1086 PurpleConvChatBuddy *cbuddy = iter->data; |
1087 char *str; | 1087 const char *str; |
1088 | 1088 |
1089 if ((str = cbuddy->alias) == NULL) | 1089 if ((str = purple_conv_chat_cb_get_alias(cbuddy)) == NULL) |
1090 str = cbuddy->name; | 1090 str = purple_conv_chat_cb_get_name(cbuddy); |
1091 g_string_append_printf(string, "[ %s ]", str); | 1091 g_string_append_printf(string, "[ %s ]", str); |
1092 } | 1092 } |
1093 | 1093 |
1094 purple_conversation_write(conv, NULL, string->str, | 1094 purple_conversation_write(conv, NULL, string->str, |
1095 PURPLE_MESSAGE_SYSTEM, time(NULL)); | 1095 PURPLE_MESSAGE_SYSTEM, time(NULL)); |
1098 | 1098 |
1099 for (; users; users = users->next) | 1099 for (; users; users = users->next) |
1100 { | 1100 { |
1101 PurpleConvChatBuddy *cbuddy = users->data; | 1101 PurpleConvChatBuddy *cbuddy = users->data; |
1102 GntTree *tree = GNT_TREE(ggc->u.chat->userlist); | 1102 GntTree *tree = GNT_TREE(ggc->u.chat->userlist); |
1103 gnt_entry_add_suggest(entry, cbuddy->name); | 1103 gnt_entry_add_suggest(entry, purple_conv_chat_cb_get_name(cbuddy)); |
1104 gnt_entry_add_suggest(entry, cbuddy->alias); | 1104 gnt_entry_add_suggest(entry, purple_conv_chat_cb_get_alias(cbuddy)); |
1105 gnt_tree_add_row_after(tree, g_strdup(cbuddy->name), | 1105 gnt_tree_add_row_after(tree, g_strdup(purple_conv_chat_cb_get_name(cbuddy)), |
1106 gnt_tree_create_row(tree, chat_flag_text(cbuddy->flags), cbuddy->alias), NULL, NULL); | 1106 gnt_tree_create_row(tree, chat_flag_text(purple_conv_chat_cb_get_flags(cbuddy)), purple_conv_chat_cb_get_alias(cbuddy)), NULL, NULL); |
1107 } | 1107 } |
1108 } | 1108 } |
1109 | 1109 |
1110 static void | 1110 static void |
1111 finch_chat_rename_user(PurpleConversation *conv, const char *old, const char *new_n, const char *new_a) | 1111 finch_chat_rename_user(PurpleConversation *conv, const char *old, const char *new_n, const char *new_a) |
1120 gnt_tree_remove(tree, (gpointer)old); | 1120 gnt_tree_remove(tree, (gpointer)old); |
1121 | 1121 |
1122 gnt_entry_add_suggest(entry, new_n); | 1122 gnt_entry_add_suggest(entry, new_n); |
1123 gnt_entry_add_suggest(entry, new_a); | 1123 gnt_entry_add_suggest(entry, new_a); |
1124 gnt_tree_add_row_after(tree, g_strdup(new_n), | 1124 gnt_tree_add_row_after(tree, g_strdup(new_n), |
1125 gnt_tree_create_row(tree, chat_flag_text(cb->flags), new_a), NULL, NULL); | 1125 gnt_tree_create_row(tree, chat_flag_text(purple_conv_chat_cb_get_flags(cb)), new_a), NULL, NULL); |
1126 } | 1126 } |
1127 | 1127 |
1128 static void | 1128 static void |
1129 finch_chat_remove_users(PurpleConversation *conv, GList *list) | 1129 finch_chat_remove_users(PurpleConversation *conv, GList *list) |
1130 { | 1130 { |
1141 static void | 1141 static void |
1142 finch_chat_update_user(PurpleConversation *conv, const char *user) | 1142 finch_chat_update_user(PurpleConversation *conv, const char *user) |
1143 { | 1143 { |
1144 PurpleConvChatBuddy *cb = purple_conv_chat_cb_find(PURPLE_CONV_CHAT(conv), user); | 1144 PurpleConvChatBuddy *cb = purple_conv_chat_cb_find(PURPLE_CONV_CHAT(conv), user); |
1145 FinchConv *ggc = FINCH_CONV(conv); | 1145 FinchConv *ggc = FINCH_CONV(conv); |
1146 gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist), (gpointer)user, 0, chat_flag_text(cb->flags)); | 1146 gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist), (gpointer)user, 0, chat_flag_text(purple_conv_chat_cb_get_flags(cb))); |
1147 } | 1147 } |
1148 | 1148 |
1149 static void | 1149 static void |
1150 finch_conv_present(PurpleConversation *conv) | 1150 finch_conv_present(PurpleConversation *conv) |
1151 { | 1151 { |