diff plugins/icq/gaim_icq.c @ 2046:5424784377f6

[gaim-migrate @ 2056] i'm bored committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 17 Jun 2001 04:17:24 +0000
parents 3a991ed8b45c
children 6778b4b91221
line wrap: on
line diff
--- a/plugins/icq/gaim_icq.c	Sun Jun 17 04:00:30 2001 +0000
+++ b/plugins/icq/gaim_icq.c	Sun Jun 17 04:17:24 2001 +0000
@@ -244,6 +244,36 @@
 	return;
 }
 
+struct icq_auth {
+	icq_Link *link;
+	unsigned long uin;
+};
+
+static void icq_den_auth(gpointer x, struct icq_auth *iq)
+{
+	g_free(iq);
+}
+
+static void icq_acc_auth(gpointer x, struct icq_auth *iq)
+{
+	icq_SendAuthMsg(iq->link, iq->uin);
+}
+
+static void icq_auth_req(icq_Link *link, unsigned long uin, unsigned char hour, unsigned char minute,
+		unsigned char day, unsigned char month, unsigned short year, const char *nick,
+		const char *first, const char *last, const char *email, const char *reason)
+{
+	char msg[8192];
+	struct icq_auth *iq = g_new0(struct icq_auth, 1);
+	iq->link = link;
+	iq->uin = uin;
+
+	g_snprintf(msg, sizeof(msg), "The user %s (%s%s%s%s%s) wants you to authorize them.",
+			nick, first ? first : "", first && last ? " " : "", last ? last : "",
+			(first || last) && email ? ", " : "", email ? email : "");
+	do_ask_dialog(msg, iq, icq_acc_auth, icq_den_auth);
+}
+
 static void icq_login(struct aim_user *user) {
 	struct gaim_connection *gc = new_gaim_conn(user);
 	struct icq_data *id = gc->proto_data = g_new0(struct icq_data, 1);
@@ -263,6 +293,7 @@
 	link->icq_RecvURL = icq_url_incoming;
 	link->icq_RecvWebPager = icq_web_pager;
 	link->icq_RecvMailExpress = icq_mail_express;
+	link->icq_RecvAuthReq = icq_auth_req;
 	link->icq_UserOnline = icq_user_online;
 	link->icq_UserOffline = icq_user_offline;
 	link->icq_UserStatusUpdate = icq_user_status;