| 656 } |
656 } |
| 657 purple_blist_add_chat(chat, grp, NULL); |
657 purple_blist_add_chat(chat, grp, NULL); |
| 658 purple_blist_alias_chat(chat, alias); |
658 purple_blist_alias_chat(chat, alias); |
| 659 purple_blist_node_set_bool((PurpleBlistNode*)chat, "gnt-autojoin", autojoin); |
659 purple_blist_node_set_bool((PurpleBlistNode*)chat, "gnt-autojoin", autojoin); |
| 660 if (autojoin) |
660 if (autojoin) |
| 661 serv_join_chat(chat->account->gc, chat->components); |
661 serv_join_chat(purple_account_get_connection(chat->account), chat->components); |
| 662 } |
662 } |
| 663 } |
663 } |
| 664 |
664 |
| 665 static void |
665 static void |
| 666 finch_request_add_chat(PurpleAccount *account, PurpleGroup *grp, const char *alias, const char *name) |
666 finch_request_add_chat(PurpleAccount *account, PurpleGroup *grp, const char *alias, const char *name) |
| 941 finch_conversation_set_active(conv); |
941 finch_conversation_set_active(conv); |
| 942 } |
942 } |
| 943 else if (PURPLE_BLIST_NODE_IS_CHAT(node)) |
943 else if (PURPLE_BLIST_NODE_IS_CHAT(node)) |
| 944 { |
944 { |
| 945 PurpleChat *chat = (PurpleChat*)node; |
945 PurpleChat *chat = (PurpleChat*)node; |
| 946 serv_join_chat(chat->account->gc, chat->components); |
946 serv_join_chat(purple_account_get_connection(chat->account), chat->components); |
| 947 } |
947 } |
| 948 } |
948 } |
| 949 |
949 |
| 950 static void |
950 static void |
| 951 context_menu_callback(GntMenuItem *item, gpointer data) |
951 context_menu_callback(GntMenuItem *item, gpointer data) |
| 1041 PurpleRequestFields *fields = purple_request_fields_new(); |
1041 PurpleRequestFields *fields = purple_request_fields_new(); |
| 1042 PurpleRequestFieldGroup *group = purple_request_field_group_new(NULL); |
1042 PurpleRequestFieldGroup *group = purple_request_field_group_new(NULL); |
| 1043 PurpleRequestField *field; |
1043 PurpleRequestField *field; |
| 1044 GList *parts, *iter; |
1044 GList *parts, *iter; |
| 1045 struct proto_chat_entry *pce; |
1045 struct proto_chat_entry *pce; |
| |
1046 PurpleConnection *gc; |
| 1046 |
1047 |
| 1047 purple_request_fields_add_group(fields, group); |
1048 purple_request_fields_add_group(fields, group); |
| 1048 |
1049 |
| 1049 parts = PURPLE_PLUGIN_PROTOCOL_INFO(chat->account->gc->prpl)->chat_info(chat->account->gc); |
1050 gc = purple_account_get_connection(chat->account); |
| |
1051 parts = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info(gc); |
| 1050 |
1052 |
| 1051 for (iter = parts; iter; iter = iter->next) { |
1053 for (iter = parts; iter; iter = iter->next) { |
| 1052 pce = iter->data; |
1054 pce = iter->data; |
| 1053 if (pce->is_int) { |
1055 if (pce->is_int) { |
| 1054 int val; |
1056 int val; |
| 1138 } |
1140 } |
| 1139 |
1141 |
| 1140 static void |
1142 static void |
| 1141 finch_blist_get_buddy_info_cb(PurpleBlistNode *selected, PurpleBuddy *buddy) |
1143 finch_blist_get_buddy_info_cb(PurpleBlistNode *selected, PurpleBuddy *buddy) |
| 1142 { |
1144 { |
| 1143 finch_retrieve_user_info(buddy->account->gc, purple_buddy_get_name(buddy)); |
1145 finch_retrieve_user_info(purple_account_get_connection(buddy->account), purple_buddy_get_name(buddy)); |
| 1144 } |
1146 } |
| 1145 |
1147 |
| 1146 static void |
1148 static void |
| 1147 finch_blist_menu_send_file_cb(PurpleBlistNode *selected, PurpleBuddy *buddy) |
1149 finch_blist_menu_send_file_cb(PurpleBlistNode *selected, PurpleBuddy *buddy) |
| 1148 { |
1150 { |
| 1149 serv_send_file(buddy->account->gc, buddy->name, NULL); |
1151 serv_send_file(purple_account_get_connection(buddy->account), buddy->name, NULL); |
| 1150 } |
1152 } |
| 1151 |
1153 |
| 1152 static void |
1154 static void |
| 1153 finch_blist_pounce_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node) |
1155 finch_blist_pounce_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node) |
| 1154 { |
1156 { |
| 1163 |
1165 |
| 1164 static void |
1166 static void |
| 1165 create_buddy_menu(GntMenu *menu, PurpleBuddy *buddy) |
1167 create_buddy_menu(GntMenu *menu, PurpleBuddy *buddy) |
| 1166 { |
1168 { |
| 1167 PurplePluginProtocolInfo *prpl_info; |
1169 PurplePluginProtocolInfo *prpl_info; |
| 1168 |
1170 PurpleConnection *gc = purple_account_get_connection(buddy->account); |
| 1169 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(buddy->account->gc->prpl); |
1171 |
| |
1172 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); |
| 1170 if (prpl_info && prpl_info->get_info) |
1173 if (prpl_info && prpl_info->get_info) |
| 1171 { |
1174 { |
| 1172 add_custom_action(menu, _("Get Info"), |
1175 add_custom_action(menu, _("Get Info"), |
| 1173 PURPLE_CALLBACK(finch_blist_get_buddy_info_cb), buddy); |
1176 PURPLE_CALLBACK(finch_blist_get_buddy_info_cb), buddy); |
| 1174 } |
1177 } |
| 1177 PURPLE_CALLBACK(finch_blist_pounce_node_cb), buddy); |
1180 PURPLE_CALLBACK(finch_blist_pounce_node_cb), buddy); |
| 1178 |
1181 |
| 1179 if (prpl_info && prpl_info->send_file) |
1182 if (prpl_info && prpl_info->send_file) |
| 1180 { |
1183 { |
| 1181 if (!prpl_info->can_receive_file || |
1184 if (!prpl_info->can_receive_file || |
| 1182 prpl_info->can_receive_file(buddy->account->gc, buddy->name)) |
1185 prpl_info->can_receive_file(gc, buddy->name)) |
| 1183 add_custom_action(menu, _("Send File"), |
1186 add_custom_action(menu, _("Send File"), |
| 1184 PURPLE_CALLBACK(finch_blist_menu_send_file_cb), buddy); |
1187 PURPLE_CALLBACK(finch_blist_menu_send_file_cb), buddy); |
| 1185 } |
1188 } |
| 1186 #if 0 |
1189 #if 0 |
| 1187 add_custom_action(tree, _("View Log"), |
1190 add_custom_action(tree, _("View Log"), |