+ char buf[SIZ];
+
+ /* First, check to make sure we're still allowed in this room. */
+ serv_printf("GOTO %s", WC->wc_roomname);
+ serv_gets(buf);
+ if (buf[0] != '2') {
+ smart_goto("_BASEROOM_");
+ return;
+ }
+
+ /* If the chat socket is still open from a previous chat,
+ * close it -- because it might be stale or in the wrong room.
+ */
+ if (WC->chat_sock < 0) {
+ close(WC->chat_sock);
+ WC->chat_sock = (-1);
+ }