Index: irc_im.c
===================================================================
--- irc_im.c	(revision b95d03b74c1186a67f0a5e5ddf909b496505a3b5)
+++ irc_im.c	(revision 1522faf1c44fa65a3bd3e544561974f8b2b18b97)
@@ -576,9 +576,17 @@
 	ic->data = c;
 
-	topic = g_strdup_printf(
-	        "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!",
-	        c->title);
-	irc_channel_set_topic(ic, topic, irc->root);
-	g_free(topic);
+	if (ic->topic == NULL) {
+		/* New channel with no preset topic - make up a generic one */
+		topic = g_strdup_printf(
+		        "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!",
+		        c->title);
+		irc_channel_set_topic(ic, topic, irc->root);
+	} else {
+		/* Preset topic from the channel we picked */
+		topic = g_strdup(ic->topic);
+	}
+
+	g_free(c->topic);
+	c->topic = topic;         /* Let groupchat borrow this pointer */
 
 	return TRUE;
@@ -600,4 +608,25 @@
 	c->ui_data = NULL;
 	irc_channel_del_user(ic, ic->irc->user, IRC_CDU_KICK, "Chatroom closed by server");
+
+	return TRUE;
+}
+
+static gboolean bee_irc_chat_placeholder_new(bee_t *bee, struct im_connection *ic, const char *handle,
+                                             const char *name, const char *topic)
+{
+	irc_t *irc = bee->ui_data;
+	irc_channel_t *ircc;
+	char *full_name = irc_channel_name_gen(bee, name);
+
+	ircc = irc_channel_new(irc, full_name);
+
+	set_setstr(&ircc->set, "type", "chat");
+	set_setstr(&ircc->set, "chat_type", "placeholder");
+	set_setstr(&ircc->set, "account", ic->acc->tag);
+	set_setstr(&ircc->set, "room", (char *) handle);
+
+	irc_channel_set_topic(ircc, topic, NULL);
+
+	g_free(full_name);
 
 	return TRUE;
@@ -696,59 +725,5 @@
 static gboolean bee_irc_chat_name_hint(bee_t *bee, struct groupchat *c, const char *name)
 {
-	irc_t *irc = bee->ui_data;
-	irc_channel_t *ic = c->ui_data, *oic;
-	char *stripped, *full_name;
-	gsize bytes_written;
-
-	if (ic == NULL) {
-		return FALSE;
-	}
-
-	/* Don't rename a channel if the user's in it already. */
-	if (ic->flags & IRC_CHANNEL_JOINED) {
-		return FALSE;
-	}
-
-	stripped = g_convert_with_fallback(name, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL);
-	if (bytes_written > MAX_NICK_LENGTH) {
-		stripped[MAX_NICK_LENGTH] = '\0';
-	}
-
-	irc_channel_name_strip(stripped);
-	if (set_getbool(&bee->set, "lcnicks")) {
-		nick_lc(irc, stripped);
-	}
-
-	if (stripped[0] == '\0') {
-		g_free(stripped);
-		return FALSE;
-	}
-
-	full_name = g_strdup_printf("#%s", stripped);
-	g_free(stripped);
-	if ((oic = irc_channel_by_name(irc, full_name))) {
-		char *type, *chat_type;
-
-		type = set_getstr(&oic->set, "type");
-		chat_type = set_getstr(&oic->set, "chat_type");
-
-		if (type && chat_type && oic->data == FALSE &&
-		    strcmp(type, "chat") == 0 &&
-		    strcmp(chat_type, "groupchat") == 0) {
-			/* There's a channel with this name already, but it looks
-			   like it's not in use yet. Most likely the IRC client
-			   rejoined the channel after a reconnect. Remove it so
-			   we can reuse its name. */
-			irc_channel_free(oic);
-		} else {
-			g_free(full_name);
-			return FALSE;
-		}
-	}
-
-	g_free(ic->name);
-	ic->name = full_name;
-
-	return TRUE;
+	return irc_channel_name_hint(c->ui_data, name);
 }
 
@@ -878,8 +853,10 @@
 static gboolean bee_irc_channel_chat_join(irc_channel_t *ic)
 {
-	char *acc_s, *room;
+	char *acc_s, *room, *chat_type;
 	account_t *acc;
 
-	if (strcmp(set_getstr(&ic->set, "chat_type"), "room") != 0) {
+	chat_type = set_getstr(&ic->set, "chat_type");
+
+	if (strcmp(chat_type, "room") != 0 && strcmp(chat_type, "placeholder") != 0) {
 		return TRUE;
 	}
@@ -1037,8 +1014,12 @@
 	struct irc_channel *ic = set->data;
 
+	ic->flags &= ~(IRC_CHANNEL_TEMP | IRC_CHANNEL_KEEP_PLACEHOLDER);
+
 	if (strcmp(value, "groupchat") == 0) {
 		ic->flags |= IRC_CHANNEL_TEMP;
 	} else if (strcmp(value, "room") == 0) {
-		ic->flags &= ~IRC_CHANNEL_TEMP;
+		// beep boop
+	} else if (strcmp(value, "placeholder") == 0) {
+		ic->flags |= IRC_CHANNEL_TEMP | IRC_CHANNEL_KEEP_PLACEHOLDER;
 	} else {
 		return NULL;
@@ -1124,4 +1105,5 @@
 	bee_irc_chat_new,
 	bee_irc_chat_free,
+	bee_irc_chat_placeholder_new,
 	bee_irc_chat_log,
 	bee_irc_chat_msg,
