Index: protocols/jabber/conference.c
===================================================================
--- protocols/jabber/conference.c	(revision 2d317bbe8def887fb796b2daaa958c59d8f4c070)
+++ protocols/jabber/conference.c	(revision 6286f80d6dc1dc4cb8106b4e209a8578d7cebe56)
@@ -137,26 +137,29 @@
 				{
 					/* Yay, found what we need. :-) */
-					bud->orig_jid = g_strdup( s );
+					bud->ext_jid = g_strdup( s );
 					break;
 				}
 			}
 		
-		/* Won't handle this for now. */
-		if( bud->orig_jid == NULL )
-			return;
-		
-		s = strchr( bud->orig_jid, '/' );
+		/* Make up some other handle, if necessary. */
+		if( bud->ext_jid == NULL )
+		{
+			/* Don't want the nick to be at the end, so let's
+			   think of some slightly different notation to use
+			   for anonymous groupchat participants in BitlBee. */
+			bud->ext_jid = g_strdup_printf( "%s=%s", bud->resource, bud->bare_jid );
+			bud->flags |= JBFLAG_IS_ANONYMOUS;
+		}
+		
+		s = strchr( bud->ext_jid, '/' );
 		if( s ) *s = 0; /* Should NEVER be NULL, but who knows... */
-		imcb_chat_add_buddy( chat, bud->orig_jid );
+		imcb_chat_add_buddy( chat, bud->ext_jid );
 		if( s ) *s = '/';
 	}
 	else if( type ) /* This only gets called if type is NULL or "unavailable" */
 	{
-		/* Won't handle this for now. */
-		if( bud->orig_jid == NULL )
-			return;
-		s = strchr( bud->orig_jid, '/' );
-		if( s ) *s = 0; /* Should NEVER be NULL, but who knows... */
-		imcb_chat_remove_buddy( chat, bud->orig_jid, NULL );
+		s = strchr( bud->ext_jid, '/' );
+		if( s ) *s = 0;
+		imcb_chat_remove_buddy( chat, bud->ext_jid, NULL );
 		if( s ) *s = '/';
 		
@@ -199,7 +202,7 @@
 	if( body && body->text_len > 0 )
 	{
-		s = strchr( bud->orig_jid, '/' );
+		s = strchr( bud->ext_jid, '/' );
 		if( s ) *s = 0;
-		imcb_chat_msg( chat, bud->orig_jid, body->text, 0, jabber_get_timestamp( node ) );
+		imcb_chat_msg( chat, bud->ext_jid, body->text, 0, jabber_get_timestamp( node ) );
 		if( s ) *s = '/';
 	}
Index: protocols/jabber/jabber.h
===================================================================
--- protocols/jabber/jabber.h	(revision 2d317bbe8def887fb796b2daaa958c59d8f4c070)
+++ protocols/jabber/jabber.h	(revision 6286f80d6dc1dc4cb8106b4e209a8578d7cebe56)
@@ -52,4 +52,6 @@
 	JBFLAG_IS_CHATROOM = 4,		/* It's convenient to use this JID thingy for
 	                                   groupchat state info too. */
+	JBFLAG_IS_ANONYMOUS = 8,	/* For anonymous chatrooms, when we don't have
+	                                   have a real JID. */
 } jabber_buddy_flags_t;
 
@@ -103,6 +105,6 @@
 	char *resource;
 	
-	/* Groupchat-only */
-	char *orig_jid;
+	char *ext_jid; /* The JID to use in BitlBee. The real JID if possible, */
+	               /* otherwise something similar to the conference JID. */
 	
 	int priority;
Index: protocols/jabber/jabber_util.c
===================================================================
--- protocols/jabber/jabber_util.c	(revision 2d317bbe8def887fb796b2daaa958c59d8f4c070)
+++ protocols/jabber/jabber_util.c	(revision 6286f80d6dc1dc4cb8106b4e209a8578d7cebe56)
@@ -451,4 +451,5 @@
 			g_hash_table_remove( jd->buddies, bud->bare_jid );
 			g_free( bud->bare_jid );
+			g_free( bud->ext_jid );
 			g_free( bud->full_jid );
 			g_free( bud->away_message );
@@ -483,4 +484,5 @@
 					g_hash_table_replace( jd->buddies, bi->bare_jid, bi->next );
 				
+				g_free( bi->ext_jid );
 				g_free( bi->full_jid );
 				g_free( bi->away_message );
@@ -526,4 +528,5 @@
 		{
 			next = bud->next;
+			g_free( bud->ext_jid );
 			g_free( bud->full_jid );
 			g_free( bud->away_message );
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision 2d317bbe8def887fb796b2daaa958c59d8f4c070)
+++ protocols/nogaim.h	(revision 6286f80d6dc1dc4cb8106b4e209a8578d7cebe56)
@@ -61,4 +61,5 @@
 #define OPT_AWAY        0x00000004
 #define OPT_DOES_HTML   0x00000010
+#define OPT_LOCALBUDDY  0x00000020 /* For nicks local to one groupchat */
 #define OPT_TYPING      0x00000100 /* Some pieces of code make assumptions */
 #define OPT_THINKING    0x00000200 /* about these values... Stupid me! */
