changeset 15088:337dfc40a538

[gaim-migrate @ 17873] Update our current rate information stuff when the server slaps us on the wrist for sending SNACs too rapidly committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 02 Dec 2006 08:56:35 +0000
parents eed75cc6cb88
children 25c3a33c6485
files libgaim/protocols/oscar/family_oservice.c
diffstat 1 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/oscar/family_oservice.c	Sat Dec 02 08:37:24 2006 +0000
+++ b/libgaim/protocols/oscar/family_oservice.c	Sat Dec 02 08:56:35 2006 +0000
@@ -430,22 +430,27 @@
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
-	guint16 code, rateclass;
-	guint32 currentavg, maxavg, windowsize, clear, alert, limit, disconnect;
+	guint16 code, classid;
+	struct rateclass *rateclass;
 
 	code = byte_stream_get16(bs);
-	rateclass = byte_stream_get16(bs);
+	classid = byte_stream_get16(bs);
+
+	rateclass = rateclass_find(conn->rateclasses, classid);
+	if (rateclass == NULL)
+		/* This should never really happen */
+		return 0;
 
-	windowsize = byte_stream_get32(bs);
-	clear = byte_stream_get32(bs);
-	alert = byte_stream_get32(bs);
-	limit = byte_stream_get32(bs);
-	disconnect = byte_stream_get32(bs);
-	currentavg = byte_stream_get32(bs);
-	maxavg = byte_stream_get32(bs);
+	rateclass->windowsize = byte_stream_get32(bs);
+	rateclass->clear = byte_stream_get32(bs);
+	rateclass->alert = byte_stream_get32(bs);
+	rateclass->limit = byte_stream_get32(bs);
+	rateclass->disconnect = byte_stream_get32(bs);
+	rateclass->current = byte_stream_get32(bs);
+	rateclass->max = byte_stream_get32(bs);
 
 	if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
-		ret = userfunc(od, conn, frame, code, rateclass, windowsize, clear, alert, limit, disconnect, currentavg, maxavg);
+		ret = userfunc(od, conn, frame, code, classid, rateclass->windowsize, rateclass->clear, rateclass->alert, rateclass->limit, rateclass->disconnect, rateclass->current, rateclass->max);
 
 	return ret;
 }