+void ParseGoto(folder *room, StrBuf *Line)
+{
+ wcsession *WCC = WC;
+ const char *Pos;
+ int flag;
+ void *vFloor = NULL;
+ StrBuf *pBuf;
+
+ if (StrLength(Line) < 4) {
+ return;
+ }
+
+ /* ignore the commandstate... */
+ Pos = ChrPtr(Line) + 4;
+
+ if (room->RoomNameParts != NULL)
+ {
+ int i;
+ for (i=0; i < room->nRoomNameParts; i++)
+ FreeStrBuf(&room->RoomNameParts[i]);
+ free(room->RoomNameParts);
+ room->RoomNameParts = NULL;
+ }
+
+ pBuf = room->name;
+ if (pBuf == NULL)
+ pBuf = NewStrBufPlain(NULL, StrLength(Line));
+ else
+ FlushStrBuf(pBuf);
+ memset(room, 0, sizeof(folder));
+ room->name = pBuf;
+
+ StrBufExtract_NextToken(room->name, Line, &Pos, '|'); // WC->CurRoom->name
+
+ room->nNewMessages = StrBufExtractNext_long(Line, &Pos, '|');
+ if (room->nNewMessages > 0)
+ room->RAFlags |= UA_HASNEWMSGS;
+
+ room->nTotalMessages = StrBufExtractNext_long(Line, &Pos, '|');
+
+ room->ShowInfo = StrBufExtractNext_long(Line, &Pos, '|');
+
+ room->QRFlags = StrBufExtractNext_long(Line, &Pos, '|'); //CurRoom->QRFlags
+
+ room->HighestRead = StrBufExtractNext_long(Line, &Pos, '|');
+ room->LastMessageRead = StrBufExtractNext_long(Line, &Pos, '|');
+
+ room->is_inbox = StrBufExtractNext_long(Line, &Pos, '|'); // is_mailbox
+
+ flag = StrBufExtractNext_long(Line, &Pos, '|');
+ if (WCC->is_aide || flag)
+ room->RAFlags |= UA_ADMINALLOWED;
+
+ room->UsersNewMAilboxMessages = StrBufExtractNext_long(Line, &Pos, '|');
+
+ room->floorid = StrBufExtractNext_int(Line, &Pos, '|'); // wc_floor
+
+ room->view = StrBufExtractNext_long(Line, &Pos, '|'); // CurRoom->view
+
+ room->defview = StrBufExtractNext_long(Line, &Pos, '|'); // CurRoom->defview
+
+ flag = StrBufExtractNext_long(Line, &Pos, '|');
+ if (flag)
+ room->RAFlags |= UA_ISTRASH; // wc_is_trash
+
+ room->QRFlags2 = StrBufExtractNext_long(Line, &Pos, '|'); // CurRoom->QRFlags2
+
+ /* find out, whether we are in a sub-room */
+ room->nRoomNameParts = StrBufNum_tokens(room->name, '\\');
+ if (room->nRoomNameParts > 1)
+ {
+ int i;
+
+ Pos = NULL;
+ room->RoomNameParts = malloc(sizeof(StrBuf*) * (room->nRoomNameParts + 1));
+ memset(room->RoomNameParts, 0, sizeof(StrBuf*) * (room->nRoomNameParts + 1));
+ for (i=0; i < room->nRoomNameParts; i++)
+ {
+ room->RoomNameParts[i] = NewStrBuf();
+ StrBufExtract_NextToken(room->RoomNameParts[i],
+ room->name, &Pos, '\\');
+ }
+ }
+
+ /* Private mailboxes on the main floor get remapped to the personal folder */
+ if ((room->QRFlags & QR_MAILBOX) &&
+ (room->floorid == 0))
+ {
+ room->floorid = VIRTUAL_MY_FLOOR;
+ if ((room->nRoomNameParts == 1) &&
+ (StrLength(room->name) == 4) &&
+ (strcmp(ChrPtr(room->name), "Mail") == 0))
+ {
+ room->is_inbox = 1;
+ }
+
+ }
+ /* get a pointer to the floor we're on: */
+ GetHash(WCC->Floors, IKEY(room->floorid), &vFloor);
+ room->Floor = (const floor*) vFloor;
+}
+
+