changeset 1845:e739d3dddf4c

[gaim-migrate @ 1855] this is probably bad, huh. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 12 May 2001 09:49:21 +0000
parents 9845deede1e9
children f173a3e14266
files plugins/yay/internal.h plugins/yay/outgoing.c plugins/yay/rxhandlers.c
diffstat 3 files changed, 30 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/yay/internal.h	Sat May 12 08:48:06 2001 +0000
+++ b/plugins/yay/internal.h	Sat May 12 09:49:21 2001 +0000
@@ -70,6 +70,8 @@
 
 #define YAHOO_MESSAGE_NORMAL  1
 #define YAHOO_MESSAGE_BOUNCE  2
+#define YAHOO_MESSAGE_OFFLINE 5
+#define YAHOO_MESSAGE_SEND    1515563606
 
 void yahoo_storeint(guchar *, guint);
 int yahoo_makeint(guchar *);
--- a/plugins/yay/outgoing.c	Sat May 12 08:48:06 2001 +0000
+++ b/plugins/yay/outgoing.c	Sat May 12 09:49:21 2001 +0000
@@ -115,7 +115,7 @@
 		return 0;
 
 	ret = yahoo_write_cmd(session, conn, YAHOO_SERVICE_MESSAGE,
-			active_id ? active_id : session->name, buf, 0);
+			active_id ? active_id : session->name, buf, YAHOO_MESSAGE_SEND);
 	g_free(buf);
 
 	return ret;
--- a/plugins/yay/rxhandlers.c	Sat May 12 08:48:06 2001 +0000
+++ b/plugins/yay/rxhandlers.c	Sat May 12 09:49:21 2001 +0000
@@ -208,7 +208,7 @@
 {
 	char buf[256];
 	int type = yahoo_makeint(pkt->msgtype);
-	char *str_array[3];
+	char *str_array[4];
 	char *tmp;
 
 	switch(type) {
@@ -232,6 +232,32 @@
 		if (sess->callbacks[YAHOO_HANDLE_BOUNCE].function)
 			(*sess->callbacks[YAHOO_HANDLE_BOUNCE].function)(sess);
 		break;
+	case YAHOO_MESSAGE_OFFLINE:
+		tmp = pkt->content;
+		if ((tmp = strchr(tmp, ',')) == NULL)
+			break;
+		++tmp;
+		if ((tmp = strchr(tmp, ',')) == NULL)
+			break;
+		str_array[0] = ++tmp;
+		if ((tmp = strchr(tmp, ',')) == NULL)
+			break;
+		*tmp++ = '\0';
+		str_array[1] = tmp;
+		if ((tmp = strchr(tmp, ',')) == NULL)
+			break;
+		*tmp++ = '\0';
+		str_array[2] = tmp;
+		if ((tmp = strchr(tmp, ',')) == NULL)
+			break;
+		*tmp++ = '\0';
+		str_array[3] = tmp;
+		if (sess->callbacks[YAHOO_HANDLE_MESSAGE].function)
+			(*sess->callbacks[YAHOO_HANDLE_MESSAGE].function)(sess, str_array[0],
+									  str_array[1],
+									  atol(str_array[2]),
+									  str_array[3]);
+		break;
 	default:
 		g_snprintf(buf, sizeof(buf), "unhandled message type %d", type);
 		YAHOO_PRINT(sess, YAHOO_LOG_WARNING, buf);