Index: chat.c
===================================================================
--- chat.c	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ chat.c	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -170,5 +170,5 @@
 }
 
-int chat_join( irc_t *irc, struct chat *c )
+int chat_join( irc_t *irc, struct chat *c, const char *password )
 {
 	struct groupchat *gc;
@@ -178,5 +178,5 @@
 		nick = irc->nick;
 	
-	if( ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, NULL ) ) )
+	if( ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, password ) ) )
 	{
 		g_free( gc->channel );
Index: chat.h
===================================================================
--- chat.h	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ chat.h	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -44,3 +44,3 @@
 int chat_chanok( char *a );
 
-int chat_join( irc_t *irc, struct chat *c );
+int chat_join( irc_t *irc, struct chat *c, const char *password );
Index: irc_commands.c
===================================================================
--- irc_commands.c	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ irc_commands.c	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -194,10 +194,9 @@
 	{
 		struct chat *c;
-		user_t *u;
 		
 		if( strchr( CTYPES, cmd[1][0] ) == NULL || cmd[1][1] == 0 )
 			irc_reply( irc, 479, "%s :Invalid channel name", cmd[1] );
 		else if( ( c = chat_bychannel( irc, cmd[1] ) ) && c->acc && c->acc->ic )
-			chat_join( irc, c );
+			chat_join( irc, c, cmd[2] );
 		else
 			irc_reply( irc, 403, "%s :No such channel", cmd[1] );
Index: lib/xmltree.c
===================================================================
--- lib/xmltree.c	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ lib/xmltree.c	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -472,5 +472,5 @@
 }
 
-struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children )
+struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children )
 {
 	struct xt_node *node, *c;
Index: lib/xmltree.h
===================================================================
--- lib/xmltree.h	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ lib/xmltree.h	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -90,5 +90,5 @@
 char *xt_find_attr( struct xt_node *node, const char *key );
 
-struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children );
+struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children );
 void xt_add_child( struct xt_node *parent, struct xt_node *child );
 void xt_add_attr( struct xt_node *node, const char *key, const char *value );
Index: protocols/jabber/conference.c
===================================================================
--- protocols/jabber/conference.c	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ protocols/jabber/conference.c	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -26,5 +26,5 @@
 static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
 
-struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password )
+struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password )
 {
 	struct jabber_chat *jc;
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ protocols/jabber/jabber.c	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -425,5 +425,5 @@
 }
 
-static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password )
+static struct groupchat *jabber_chat_join_( struct im_connection *ic, const char *room, const char *nick, const char *password )
 {
 	if( strchr( room, '@' ) == NULL )
Index: protocols/jabber/jabber.h
===================================================================
--- protocols/jabber/jabber.h	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ protocols/jabber/jabber.h	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -240,5 +240,5 @@
 
 /* conference.c */
-struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password );
+struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password );
 struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name );
 void jabber_chat_free( struct groupchat *c );
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ protocols/nogaim.c	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -280,5 +280,5 @@
 		
 		if( set_getbool( &c->set, "auto_join" ) )
-			chat_join( irc, c );
+			chat_join( irc, c, NULL );
 	}
 }
@@ -710,5 +710,5 @@
 }
 
-struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
+struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle )
 {
 	struct groupchat *c;
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ protocols/nogaim.h	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -209,5 +209,5 @@
 	 * not implement this. */
 	struct groupchat *
-	     (* chat_join)	(struct im_connection *, char *room, char *nick, char *password);
+	     (* chat_join)	(struct im_connection *, const char *room, const char *nick, const char *password);
 	/* Change the topic, if supported. Note that BitlBee expects the IM
 	   server to confirm the topic change with a regular topic change
@@ -290,5 +290,5 @@
  *   the user her/himself. At that point the group chat will be visible to the
  *   user, too. */
-G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle );
+G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle );
 G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle );
 /* To remove a handle from a group chat. Reason can be NULL. */
Index: protocols/oscar/oscar.c
===================================================================
--- protocols/oscar/oscar.c	(revision e180c59a7796bb651b96ffaa5757e4688f1d3cc6)
+++ protocols/oscar/oscar.c	(revision 94acdd0d7beaa659a5f6b26673c5dea5dbcc4496)
@@ -2581,5 +2581,5 @@
 }
 
-struct groupchat *oscar_chat_join(struct im_connection * ic, char * room, char * nick, char * password )
+struct groupchat *oscar_chat_join(struct im_connection * ic, const char * room, const char * nick, const char * password )
 {
 	struct oscar_data * od = (struct oscar_data *)ic->proto_data;
