changeset 2113:9f83b7ef1fdc

[gaim-migrate @ 2123] Make warning errors work right. Now shows name that failed instead of "(null)". committer: Tailor Script <tailor@pidgin.im>
author Adam Fritzler <mid@auk.cx>
date Fri, 03 Aug 2001 00:39:48 +0000
parents 0ad5f2cf6728
children c582116e8463
files src/protocols/oscar/CHANGES src/protocols/oscar/aim.h src/protocols/oscar/misc.c src/protocols/oscar/oscar.c
diffstat 4 files changed, 37 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/CHANGES	Thu Aug 02 20:52:04 2001 +0000
+++ b/src/protocols/oscar/CHANGES	Fri Aug 03 00:39:48 2001 +0000
@@ -1,6 +1,14 @@
 
 No release numbers
 ------------------
+ - Thu Aug  2 13:28:37 EDT 2001
+  - Uhm. Why does arcanejill think its in EDT?
+  - Cache the username on warnings so errors work right.
+  - Someday, I'm going to convert all of libfaim to that formatting style, too.
+
+ -  Wed Jun 27 00:13:20 EDT 2001
+  - Some comments about UNICODE in faimtest.
+
  - Fri Jun 15 17:51:27 EDT 2001
   - Make faimtest compile on RH7.1 (new gcc).
   - Add aim_conn_getsess()
--- a/src/protocols/oscar/aim.h	Thu Aug 02 20:52:04 2001 +0000
+++ b/src/protocols/oscar/aim.h	Fri Aug 03 00:39:48 2001 +0000
@@ -546,7 +546,7 @@
 
 #define AIM_WARN_ANON                     0x01
 
-faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon);
+faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, const char *destsn, unsigned long flags);
 faim_export unsigned long aim_bos_nop(struct aim_session_t *, struct aim_conn_t *);
 faim_export unsigned long aim_flap_nop(struct aim_session_t *sess, struct aim_conn_t *conn);
 faim_export unsigned long aim_bos_setidle(struct aim_session_t *, struct aim_conn_t *, u_long);
--- a/src/protocols/oscar/misc.c	Thu Aug 02 20:52:04 2001 +0000
+++ b/src/protocols/oscar/misc.c	Fri Aug 03 00:39:48 2001 +0000
@@ -495,41 +495,45 @@
 }
 
 /*
- * aim_send_warning(struct aim_session_t *sess, 
- *                  struct aim_conn_t *conn, char *destsn, int anon)
- * send a warning to destsn.
- * anon is anonymous or not;
- *  AIM_WARN_ANON anonymous
+ * Send a warning to destsn.
+ * 
+ * Flags:
+ *  AIM_WARN_ANON  Send as an anonymous (doesn't count as much)
  *
- * returns -1 on error (couldn't alloc packet), next snacid on success.
+ * returns -1 on error (couldn't alloc packet), 0 on success. 
  *
  */
-faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon)
+faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, const char *destsn, unsigned long flags)
 {
-  struct command_tx_struct *newpacket;
-  int curbyte;
+	struct command_tx_struct *newpacket;
+	int curbyte;
+	unsigned short outflags = 0x0000;
 
-  if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, strlen(destsn)+13)))
-    return -1;
+	if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 
+					strlen(destsn)+13)))
+		return -1;
 
-  newpacket->lock = 1;
+	newpacket->lock = 1;
+
+	curbyte  = 0;
+	curbyte += aim_putsnac(newpacket->data+curbyte,
+			0x0004, 0x0008, 0x0000, sess->snac_nextid);
 
-  curbyte  = 0;
-  curbyte += aim_putsnac(newpacket->data+curbyte,
-                        0x0004, 0x0008, 0x0000, sess->snac_nextid);
+	if (flags & AIM_WARN_ANON)
+		outflags |= 0x0001;
 
-  curbyte += aimutil_put16(newpacket->data+curbyte, (anon & AIM_WARN_ANON)?1:0);
-
-  curbyte += aimutil_put8(newpacket->data+curbyte, strlen(destsn));
+	curbyte += aimutil_put16(newpacket->data+curbyte, outflags); 
+	curbyte += aimutil_put8(newpacket->data+curbyte, strlen(destsn));
+	curbyte += aimutil_putstr(newpacket->data+curbyte, destsn, strlen(destsn));
 
-  curbyte += aimutil_putstr(newpacket->data+curbyte, destsn, strlen(destsn));
+	newpacket->commandlen = curbyte;
+	newpacket->lock = 0;
 
-  newpacket->commandlen = curbyte;
-  newpacket->lock = 0;
+	aim_tx_enqueue(sess, newpacket);
 
-  aim_tx_enqueue(sess, newpacket);
+	aim_cachesnac(sess, 0x0004, 0x0008, 0x0000, destsn, strlen(destsn)+1);
 
-  return (sess->snac_nextid++);
+	return 0;
 }
 
 /*
--- a/src/protocols/oscar/oscar.c	Thu Aug 02 20:52:04 2001 +0000
+++ b/src/protocols/oscar/oscar.c	Fri Aug 03 00:39:48 2001 +0000
@@ -2529,7 +2529,7 @@
 
 static void oscar_warn(struct gaim_connection *g, char *name, int anon) {
 	struct oscar_data *odata = (struct oscar_data *)g->proto_data;
-	aim_send_warning(odata->sess, odata->conn, name, anon);
+	aim_send_warning(odata->sess, odata->conn, name, anon ? AIM_WARN_ANON : 0);
 }
 
 static void oscar_dir_search(struct gaim_connection *g, char *first, char *middle, char *last,