changeset 6069:5ca86172352a

[gaim-migrate @ 6519] Tim Ringenbach (marv_sf) writes: "This fixes offline messages in yahoo. Now you should get all of them." normally i run yahoo patches by sean. but i know he won't look at it. and i am sick of yahoo offline messages being buggy as all get out. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 09 Jul 2003 04:25:12 +0000
parents ba3847f74387
children 8469f83b6cae
files src/protocols/yahoo/yahoo.c
diffstat 1 files changed, 29 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Wed Jul 09 03:37:36 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Wed Jul 09 04:25:12 2003 +0000
@@ -553,35 +553,39 @@
 	char *from = NULL;
 	time_t tm = time(NULL);
 	GSList *l = pkt->hash;
-	
-	while (l) {
-		struct yahoo_pair *pair = l->data;
-		if (pair->key == 4)
-			from = pair->value;
-		if (pair->key == 14)
-			msg = pair->value;
-		if (pair->key == 15)
-			tm = strtol(pair->value, NULL, 10);
-		l = l->next;
-	}
 
 	if (pkt->status <= 1 || pkt->status == 5) {
-		char *m;
-		int i, j;
-		strip_linefeed(msg);
-		m = msg;
-		for (i = 0, j = 0; m[i]; i++) {
-			if (m[i] == 033) {
-				while (m[i] && (m[i] != 'm'))
-					i++;
-				if (!m[i])
-					i--;
-				continue;
+		while (l) {
+			struct yahoo_pair *pair = l->data;
+			if (pair->key == 4)
+				from = pair->value;
+			if (pair->key == 15)
+				tm = strtol(pair->value, NULL, 10);
+			if (pair->key == 14) {
+				char *m;
+				int i, j;
+
+				msg = pair->value;
+
+				strip_linefeed(msg);
+				m = msg;
+				for (i = 0, j = 0; m[i]; i++) {
+					if (m[i] == 033) {
+						while (m[i] && (m[i] != 'm'))
+							i++;
+						if (!m[i])
+							i--;
+						continue;
+					}
+					msg[j++] = m[i];
+				}
+				msg[j] = 0;
+				serv_got_im(gc, from, msg, 0, tm, -1);
+
+				tm = time(NULL);
 			}
-			msg[j++] = m[i];
+			l = l->next;
 		}
-		msg[j] = 0;
-		serv_got_im(gc, from, msg, 0, tm, -1);
 	} else if (pkt->status == 2) {
 		gaim_notify_error(gc, NULL,
 						  _("Your Yahoo! message did not get sent."), NULL);