Index: irc_im.c
===================================================================
--- irc_im.c	(revision f1a089067fcc4fcae05cdbfa0f51a8a3cc8f6783)
+++ irc_im.c	(revision 27e2c66f28bc196d766ac179aa5eae0d190565d5)
@@ -245,10 +245,25 @@
 }
 
-gboolean bee_irc_chat_log( bee_t *bee, struct groupchat *c, const char *format, ... )
-{
-}
-
-gboolean bee_irc_chat_msg( bee_t *bee, struct groupchat *c, const char *who, const char *msg, time_t sent_at )
-{
+gboolean bee_irc_chat_log( bee_t *bee, struct groupchat *c, const char *text )
+{
+	irc_channel_t *ic = c->ui_data;
+	
+	irc_channel_printf( ic, "%s", text );
+}
+
+gboolean bee_irc_chat_msg( bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at )
+{
+	irc_t *irc = bee->ui_data;
+	irc_user_t *iu = bu->ui_data;
+	irc_channel_t *ic = c->ui_data;
+	char *ts = NULL;
+	
+	if( sent_at > 0 && set_getbool( &bee->set, "display_timestamps" ) )
+		ts = irc_format_timestamp( irc, sent_at );
+	
+	irc_send_msg( iu, "PRIVMSG", ic->name, msg, ts );
+	g_free( ts );
+	
+	return TRUE;
 }
 
@@ -301,6 +316,6 @@
 	bee_irc_chat_new,
 	bee_irc_chat_free,
-	NULL,
-	NULL,
+	bee_irc_chat_log,
+	bee_irc_chat_msg,
 	bee_irc_chat_add_user,
 	NULL,
Index: protocols/bee.h
===================================================================
--- protocols/bee.h	(revision f1a089067fcc4fcae05cdbfa0f51a8a3cc8f6783)
+++ protocols/bee.h	(revision 27e2c66f28bc196d766ac179aa5eae0d190565d5)
@@ -81,6 +81,6 @@
 	gboolean (*chat_new)( bee_t *bee, struct groupchat *c );
 	gboolean (*chat_free)( bee_t *bee, struct groupchat *c );
-	gboolean (*chat_log)( bee_t *bee, struct groupchat *c, const char *format, ... );
-	gboolean (*chat_msg)( bee_t *bee, struct groupchat *c, const char *who, const char *msg, time_t sent_at );
+	gboolean (*chat_log)( bee_t *bee, struct groupchat *c, const char *text );
+	gboolean (*chat_msg)( bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at );
 	gboolean (*chat_add_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu );
 	gboolean (*chat_remove_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu );
Index: protocols/bee_chat.c
===================================================================
--- protocols/bee_chat.c	(revision f1a089067fcc4fcae05cdbfa0f51a8a3cc8f6783)
+++ protocols/bee_chat.c	(revision 27e2c66f28bc196d766ac179aa5eae0d190565d5)
@@ -105,8 +105,8 @@
 void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t flags, time_t sent_at )
 {
-#if 0
-	struct im_connection *ic = c->ic;
-	char *wrapped;
-	user_t *u;
+	struct im_connection *ic = c->ic;
+	bee_t *bee = ic->bee;
+	bee_user_t *bu;
+	char *s;
 	
 	/* Gaim sends own messages through this too. IRC doesn't want this, so kill them */
@@ -114,34 +114,26 @@
 		return;
 	
-	u = user_findhandle( ic, who );
-	
-	if( ( g_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) ||
-	    ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->bee->set, "strip_html" ) ) )
+	bu = bee_user_by_handle( bee, ic, who );
+	
+	s = set_getstr( &ic->bee->set, "strip_html" );
+	if( ( g_strcasecmp( s, "always" ) == 0 ) ||
+	    ( ( ic->flags & OPT_DOES_HTML ) && s ) )
 		strip_html( msg );
 	
-	wrapped = word_wrap( msg, 425 );
-	if( c && u )
-	{
-		char *ts = NULL;
-		if( set_getbool( &ic->irc->set, "display_timestamps" ) )
-			ts = format_timestamp( ic->irc, sent_at );
-		irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, ts ? : "", wrapped );
-		g_free( ts );
-	}
+	if( bu && bee->ui->chat_msg )
+		bee->ui->chat_msg( bee, c, bu, msg, sent_at );
 	else
-	{
-		imcb_log( ic, "Message from/to conversation %s@%p (unknown conv/user): %s", who, c, wrapped );
-	}
-	g_free( wrapped );
-#endif
+		imcb_chat_log( c, "Message from unknown participant %s: %s", who, msg );
 }
 
 void imcb_chat_log( struct groupchat *c, char *format, ... )
 {
-#if 0
-	irc_t *irc = c->ic->irc;
+	struct im_connection *ic = c->ic;
+	bee_t *bee = ic->bee;
 	va_list params;
 	char *text;
-	user_t *u;
+	
+	if( !bee->ui->chat_log )
+		return;
 	
 	va_start( params, format );
@@ -149,10 +141,6 @@
 	va_end( params );
 	
-	u = user_find( irc, irc->mynick );
-	
-	irc_privmsg( irc, u, "PRIVMSG", c->channel, "System message: ", text );
-	
+	bee->ui->chat_log( bee, c, text );
 	g_free( text );
-#endif
 }
 
