| 244 char *nick; |
244 char *nick; |
| 245 unsigned long uin; |
245 unsigned long uin; |
| 246 struct gaim_connection *gc; |
246 struct gaim_connection *gc; |
| 247 }; |
247 }; |
| 248 |
248 |
| 249 static void icq_den_auth(gpointer x, struct icq_auth *iq) |
249 static void icq_den_auth(struct icq_auth *iq) |
| 250 { |
250 { |
| 251 g_free(iq->nick); |
251 g_free(iq->nick); |
| 252 g_free(iq); |
252 g_free(iq); |
| 253 } |
253 } |
| 254 |
254 |
| 255 static void icq_add_after_auth(gpointer x, struct icq_auth *iq) |
255 static void icq_add_after_auth(struct icq_auth *iq) |
| 256 { |
256 { |
| 257 char uin[16]; |
257 char uin[16]; |
| 258 g_snprintf(uin, sizeof(uin), "%ld", iq->uin); |
258 g_snprintf(uin, sizeof(uin), "%ld", iq->uin); |
| 259 show_add_buddy(iq->gc, uin, NULL, iq->nick); |
259 show_add_buddy(iq->gc, uin, NULL, iq->nick); |
| 260 } |
260 icq_den_auth(iq); |
| 261 |
261 } |
| 262 static void icq_acc_auth(gpointer x, struct icq_auth *iq) |
262 |
| |
263 static void icq_acc_auth(struct icq_auth *iq) |
| 263 { |
264 { |
| 264 char msg[1024]; |
265 char msg[1024]; |
| 265 char uin[16]; |
266 char uin[16]; |
| 266 struct icq_auth *iqnew; |
267 struct icq_auth *iqnew; |
| 267 |
268 |
| 273 |
274 |
| 274 iqnew = g_memdup(iq, sizeof(struct icq_auth)); |
275 iqnew = g_memdup(iq, sizeof(struct icq_auth)); |
| 275 iqnew->nick = g_strdup(iq->nick); |
276 iqnew->nick = g_strdup(iq->nick); |
| 276 |
277 |
| 277 g_snprintf(msg, sizeof(msg), "Add %ld to your buddy list?", iq->uin); |
278 g_snprintf(msg, sizeof(msg), "Add %ld to your buddy list?", iq->uin); |
| 278 do_ask_dialog(msg, iqnew, icq_add_after_auth, icq_den_auth); |
279 do_ask_dialog(msg, NULL, iqnew, _("Add"), icq_add_after_auth, _("Cancel"), icq_den_auth); |
| |
280 icq_den_auth(iq); |
| 279 } |
281 } |
| 280 |
282 |
| 281 static void icq_auth_req(icq_Link *link, unsigned long uin, unsigned char hour, unsigned char minute, |
283 static void icq_auth_req(icq_Link *link, unsigned long uin, unsigned char hour, unsigned char minute, |
| 282 unsigned char day, unsigned char month, unsigned short year, const char *nick, |
284 unsigned char day, unsigned char month, unsigned short year, const char *nick, |
| 283 const char *first, const char *last, const char *email, const char *reason) |
285 const char *first, const char *last, const char *email, const char *reason) |
| 290 iq->gc = link->icq_UserData; |
292 iq->gc = link->icq_UserData; |
| 291 |
293 |
| 292 g_snprintf(msg, sizeof(msg), "The user %s (%s%s%s%s%s) wants you to authorize them.", |
294 g_snprintf(msg, sizeof(msg), "The user %s (%s%s%s%s%s) wants you to authorize them.", |
| 293 nick, first ? first : "", first && last ? " " : "", last ? last : "", |
295 nick, first ? first : "", first && last ? " " : "", last ? last : "", |
| 294 (first || last) && email ? ", " : "", email ? email : ""); |
296 (first || last) && email ? ", " : "", email ? email : ""); |
| 295 do_ask_dialog(msg, iq, icq_acc_auth, icq_den_auth); |
297 do_ask_dialog(msg, NULL, iq, _("Authorize"), icq_acc_auth, _("Deny"), icq_den_auth); |
| 296 } |
298 } |
| 297 |
299 |
| 298 static void icq_login(struct aim_user *user) { |
300 static void icq_login(struct aim_user *user) { |
| 299 struct gaim_connection *gc = new_gaim_conn(user); |
301 struct gaim_connection *gc = new_gaim_conn(user); |
| 300 struct icq_data *id = gc->proto_data = g_new0(struct icq_data, 1); |
302 struct icq_data *id = gc->proto_data = g_new0(struct icq_data, 1); |