diff src/protocols/yahoo/yahoochat.c @ 9376:3aa848ccf986

[gaim-migrate @ 10184] *** Danger Will Robinson!!! committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Thu, 24 Jun 2004 07:08:33 +0000
parents d42f3e4fd7ad
children 8b2451878e26
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoochat.c	Thu Jun 24 05:01:50 2004 +0000
+++ b/src/protocols/yahoo/yahoochat.c	Thu Jun 24 07:08:33 2004 +0000
@@ -41,6 +41,7 @@
 
 #include "yahoo.h"
 #include "yahoochat.h"
+#include "ycht.h"
 
 #define YAHOO_CHAT_ID (1)
 
@@ -53,6 +54,10 @@
 	struct yahoo_data *yd = gc->proto_data;
 	struct yahoo_packet *pkt;
 
+	if (yd->wm) {
+		ycht_connection_open(gc);
+		return;
+	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATONLINE, YAHOO_STATUS_AVAILABLE,0);
 	yahoo_packet_hash(pkt, 1, gaim_connection_get_display_name(gc));
@@ -70,7 +75,7 @@
 }
 
 /* this is slow, and different from the gaim_* version in that it (hopefully) won't add a user twice */
-static void yahoo_chat_add_users(GaimConvChat *chat, GList *newusers)
+void yahoo_chat_add_users(GaimConvChat *chat, GList *newusers)
 {
 	GList *users, *i, *j;
 
@@ -84,7 +89,7 @@
 	}
 }
 
-static void yahoo_chat_add_user(GaimConvChat *chat, const char *user, const char *reason)
+void yahoo_chat_add_user(GaimConvChat *chat, const char *user, const char *reason)
 {
 	GList *users;
 
@@ -714,6 +719,13 @@
 	char *eroom;
 	gboolean utf8 = 1;
 
+	if (yd->wm) {
+		g_return_if_fail(yd->ycht != NULL);
+
+		ycht_chat_leave(yd->ycht, room, logout);
+		return;
+	}
+
 	eroom = yahoo_string_encode(gc, room, &utf8);
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATEXIT, YAHOO_STATUS_AVAILABLE, 0);
@@ -796,6 +808,12 @@
 	char *msg1, *msg2, *room2;
 	gboolean utf8 = TRUE;
 
+	if (yd->wm) {
+		g_return_val_if_fail(yd->ycht != NULL, 1);
+
+		return ycht_chat_send(yd->ycht, room, what);
+	}
+
 	msg1 = g_strdup(what);
 
 	if (meify(msg1, -1))
@@ -835,6 +853,13 @@
 	char *room2;
 	gboolean utf8 = TRUE;
 
+	if (yd->wm) {
+		g_return_if_fail(yd->ycht != NULL);
+
+		ycht_chat_join(yd->ycht, room);
+		return;
+	}
+
 	/* apparently room names are always utf8, or else always not utf8,
 	 * so we don't have to actually pass the flag in the packet. Or something. */
 	room2 = yahoo_string_encode(gc, room, &utf8);
@@ -860,6 +885,13 @@
 	char *room2, *msg2 = NULL;
 	gboolean utf8 = TRUE;
 
+	if (yd->wm) {
+		g_return_if_fail(yd->ycht != NULL);
+
+		ycht_chat_send_invite(yd->ycht, room, buddy, msg);
+		return;
+	}
+
 	room2 = yahoo_string_encode(gc, room, &utf8);
 	if (msg)
 		msg2 = yahoo_string_encode(gc, msg, NULL);
@@ -886,6 +918,13 @@
 
 	yd = gc->proto_data;
 
+	if (yd->wm) {
+		g_return_if_fail(yd->ycht != NULL);
+
+		ycht_chat_goto_user(yd->ycht, name);
+		return;
+	}
+
 	if (!yd->chat_online)
 		yahoo_chat_online(gc);