| 78 |
78 |
| 79 gc = g->gc; |
79 gc = g->gc; |
| 80 uid = g->uid; |
80 uid = g->uid; |
| 81 g_return_if_fail(gc != 0 && uid != 0); |
81 g_return_if_fail(gc != 0 && uid != 0); |
| 82 |
82 |
| 83 qq_send_packet_get_info(gc, uid, TRUE); /* we wanna see window */ |
83 qq_send_packet_get_info(gc, uid, TRUE); /* we want to see window */ |
| 84 |
84 |
| 85 nombre = uid_to_purple_name(uid); |
85 nombre = uid_to_purple_name(uid); |
| 86 /* TODO: 'wanna' is not an appropriate word for this string. Fix after string freeze. */ |
|
| 87 purple_request_action |
86 purple_request_action |
| 88 (gc, NULL, _("Do you wanna approve the request?"), "", 2, |
87 (gc, NULL, _("Do you want to approve the request?"), "", 2, |
| 89 purple_connection_get_account(gc), nombre, NULL, |
88 purple_connection_get_account(gc), nombre, NULL, |
| 90 g, 2, |
89 g, 2, |
| 91 _("Reject"), G_CALLBACK(qq_reject_add_request_with_gc_and_uid), |
90 _("Reject"), G_CALLBACK(qq_reject_add_request_with_gc_and_uid), |
| 92 _("Approve"), G_CALLBACK(qq_approve_add_request_with_gc_and_uid)); |
91 _("Approve"), G_CALLBACK(qq_approve_add_request_with_gc_and_uid)); |
| 93 g_free(nombre); |
92 g_free(nombre); |
| 103 |
102 |
| 104 gc = g->gc; |
103 gc = g->gc; |
| 105 uid = g->uid; |
104 uid = g->uid; |
| 106 g_return_if_fail(gc != 0 && uid != 0); |
105 g_return_if_fail(gc != 0 && uid != 0); |
| 107 |
106 |
| 108 qq_send_packet_get_info(gc, uid, TRUE); /* we wanna see window */ |
107 qq_send_packet_get_info(gc, uid, TRUE); /* we want to see window */ |
| 109 /* TODO: 'wanna' is not an appropriate word for this string. Fix after string freeze. */ |
|
| 110 nombre = uid_to_purple_name(uid); |
108 nombre = uid_to_purple_name(uid); |
| 111 purple_request_action |
109 purple_request_action |
| 112 (gc, NULL, _("Do you wanna add this buddy?"), "", 2, |
110 (gc, NULL, _("Do you want to add this buddy?"), "", 2, |
| 113 purple_connection_get_account(gc), nombre, NULL, |
111 purple_connection_get_account(gc), nombre, NULL, |
| 114 g, 2, |
112 g, 2, |
| 115 _("Cancel"), NULL, |
113 _("Cancel"), NULL, |
| 116 _("Add"), G_CALLBACK(qq_add_buddy_with_gc_and_uid)); |
114 _("Add"), G_CALLBACK(qq_add_buddy_with_gc_and_uid)); |
| 117 g_free(nombre); |
115 g_free(nombre); |
| 173 g, 3, |
171 g, 3, |
| 174 _("Cancel"), NULL, |
172 _("Cancel"), NULL, |
| 175 _("Add"), G_CALLBACK(qq_add_buddy_with_gc_and_uid), |
173 _("Add"), G_CALLBACK(qq_add_buddy_with_gc_and_uid), |
| 176 _("Search"), G_CALLBACK(_qq_search_before_add_with_gc_and_uid)); |
174 _("Search"), G_CALLBACK(_qq_search_before_add_with_gc_and_uid)); |
| 177 } else { |
175 } else { |
| 178 message = g_strdup_printf(_("%s has added you [%s]"), from, to); |
176 message = g_strdup_printf(_("%s has added you [%s] to his or her buddy list"), from, to); |
| 179 _qq_sys_msg_log_write(gc, message, from); |
177 _qq_sys_msg_log_write(gc, message, from); |
| 180 purple_notify_info(gc, NULL, message, NULL); |
178 purple_notify_info(gc, NULL, message, NULL); |
| 181 } |
179 } |
| 182 |
180 |
| 183 g_free(name); |
181 g_free(name); |
| 209 g_return_if_fail(from != NULL && to != NULL); |
207 g_return_if_fail(from != NULL && to != NULL); |
| 210 |
208 |
| 211 qd = (qq_data *) gc->proto_data; |
209 qd = (qq_data *) gc->proto_data; |
| 212 qq_add_buddy_by_recv_packet(gc, strtol(from, NULL, 10), TRUE, TRUE); |
210 qq_add_buddy_by_recv_packet(gc, strtol(from, NULL, 10), TRUE, TRUE); |
| 213 |
211 |
| 214 message = g_strdup_printf(_("User %s has approved your request"), from); |
212 message = g_strdup_printf(_("User %s approved your request"), from); |
| 215 _qq_sys_msg_log_write(gc, message, from); |
213 _qq_sys_msg_log_write(gc, message, from); |
| 216 purple_notify_info(gc, NULL, message, NULL); |
214 purple_notify_info(gc, NULL, message, NULL); |
| 217 |
215 |
| 218 g_free(message); |
216 g_free(message); |
| 219 } |
217 } |
| 234 g->gc = gc; |
232 g->gc = gc; |
| 235 g->uid = uid; |
233 g->uid = uid; |
| 236 |
234 |
| 237 name = uid_to_purple_name(uid); |
235 name = uid_to_purple_name(uid); |
| 238 |
236 |
| 239 /* TODO: 'wanna' is not an appropriate word for this string. Fix after string freeze */ |
|
| 240 /* TODO: this should go through purple_account_request_authorization() */ |
237 /* TODO: this should go through purple_account_request_authorization() */ |
| 241 message = g_strdup_printf(_("%s wanna add you [%s] as friends"), from, to); |
238 message = g_strdup_printf(_("%s wants to add you [%s] as a friend"), from, to); |
| 242 reason = g_strdup_printf(_("Message: %s"), msg_utf8); |
239 reason = g_strdup_printf(_("Message: %s"), msg_utf8); |
| 243 _qq_sys_msg_log_write(gc, message, from); |
240 _qq_sys_msg_log_write(gc, message, from); |
| 244 |
241 |
| 245 purple_request_action |
242 purple_request_action |
| 246 (gc, NULL, message, reason, 2, |
243 (gc, NULL, message, reason, 2, |