Index: protocols/jabber/conference.c
===================================================================
--- protocols/jabber/conference.c	(revision 50e1776cb0c76b3328d458dd8a1bfb379b6b0e43)
+++ protocols/jabber/conference.c	(revision 7df5a087131d3b1bbe7add0907cd72217692ffd0)
@@ -85,4 +85,23 @@
 	
 	node = xt_new_node( "body", message, NULL );
+	node = jabber_make_packet( "message", "groupchat", jc->name, node );
+	
+	if( !jabber_write_packet( ic, node ) )
+	{
+		xt_free_node( node );
+		return 0;
+	}
+	xt_free_node( node );
+	
+	return 1;
+}
+
+int jabber_chat_topic( struct groupchat *c, char *topic )
+{
+	struct im_connection *ic = c->ic;
+	struct jabber_chat *jc = c->data;
+	struct xt_node *node;
+	
+	node = xt_new_node( "subject", topic, NULL );
 	node = jabber_make_packet( "message", "groupchat", jc->name, node );
 	
@@ -214,4 +233,5 @@
 void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node )
 {
+	struct xt_node *subject = xt_find_node( node->children, "subject" );
 	struct xt_node *body = xt_find_node( node->children, "body" );
 	struct groupchat *chat;
@@ -237,4 +257,12 @@
 	}
 	
+	if( subject )
+	{
+		s = strchr( bud->ext_jid, '/' );
+		if( s ) *s = 0;
+		imcb_chat_topic( chat, bud->ext_jid, subject->text_len > 0 ?
+		                 subject->text : NULL, jabber_get_timestamp( node ) );
+		if( s ) *s = '/';
+	}
 	if( body && body->text_len > 0 )
 	{
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision 50e1776cb0c76b3328d458dd8a1bfb379b6b0e43)
+++ protocols/jabber/jabber.c	(revision 7df5a087131d3b1bbe7add0907cd72217692ffd0)
@@ -385,4 +385,10 @@
 }
 
+static void jabber_chat_topic_( struct groupchat *c, char *topic )
+{
+	if( c && topic )
+		jabber_chat_topic( c, topic );
+}
+
 static void jabber_chat_leave_( struct groupchat *c )
 {
@@ -461,4 +467,5 @@
 	ret->remove_buddy = jabber_remove_buddy;
 	ret->chat_msg = jabber_chat_msg_;
+	ret->chat_topic = jabber_chat_topic_;
 //	ret->chat_invite = jabber_chat_invite;
 	ret->chat_leave = jabber_chat_leave_;
Index: protocols/jabber/jabber.h
===================================================================
--- protocols/jabber/jabber.h	(revision 50e1776cb0c76b3328d458dd8a1bfb379b6b0e43)
+++ protocols/jabber/jabber.h	(revision 7df5a087131d3b1bbe7add0907cd72217692ffd0)
@@ -229,4 +229,5 @@
 void jabber_chat_free( struct groupchat *c );
 int jabber_chat_msg( struct groupchat *ic, char *message, int flags );
+int jabber_chat_topic( struct groupchat *c, char *topic );
 int jabber_chat_leave( struct groupchat *c, const char *reason );
 void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
Index: protocols/jabber/sasl.c
===================================================================
--- protocols/jabber/sasl.c	(revision 50e1776cb0c76b3328d458dd8a1bfb379b6b0e43)
+++ protocols/jabber/sasl.c	(revision 7df5a087131d3b1bbe7add0907cd72217692ffd0)
@@ -332,4 +332,4 @@
 	struct jabber_data *jd = ic->proto_data;
 	
-	return ( (void*) ( jd->xt && jd->xt->root && xt_find_attr( jd->xt->root, "version" ) ) ) != NULL;
-}
+	return ( jd->xt && jd->xt->root && xt_find_attr( jd->xt->root, "version" ) ) != 0;
+}
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision 50e1776cb0c76b3328d458dd8a1bfb379b6b0e43)
+++ protocols/nogaim.c	(revision 7df5a087131d3b1bbe7add0907cd72217692ffd0)
@@ -760,5 +760,5 @@
 }
 
-void imcb_chat_topic( struct groupchat *c, char *who, char *topic )
+void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at )
 {
 	struct im_connection *ic = c->ic;
@@ -766,7 +766,7 @@
 	
 	if( who == NULL)
-		u = user_find( ic, ic->irc->mynick );
+		u = user_find( ic->irc, ic->irc->mynick );
 	else if( g_strcasecmp( who, ic->acc->user ) == 0 )
-		u = user_find( ic, ic->irc->nick );
+		u = user_find( ic->irc, ic->irc->nick );
 	else
 		u = user_findhandle( ic, who );
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision 50e1776cb0c76b3328d458dd8a1bfb379b6b0e43)
+++ protocols/nogaim.h	(revision 7df5a087131d3b1bbe7add0907cd72217692ffd0)
@@ -219,5 +219,5 @@
 	   event. If it doesn't do that, you have to fake it to make it
 	   visible to the user. */
-	void (* chat_topic)	(struct groupchat *, char *message);
+	void (* chat_topic)	(struct groupchat *, char *topic);
 	
 	/* You can tell what away states your protocol supports, so that
@@ -302,5 +302,5 @@
 G_MODULE_EXPORT void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags, time_t sent_at );
 /* To tell BitlBee 'who' changed the topic of 'c' to 'topic'. */
-G_MODULE_EXPORT void imcb_chat_topic( struct groupchat *c, char *who, char *topic );
+G_MODULE_EXPORT void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at );
 G_MODULE_EXPORT void imcb_chat_free( struct groupchat *c );
 
