X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Froomops.c;h=b93a4910dae0f249182604160dc92974e39cc5bf;hb=7cab38e6faabd64d969eb3836c52869cae1bfd22;hp=3d1e3a12c27bbfbbe4e86461b74b70606eeeca0f;hpb=4578d24050e4a00b0a903a568d6ef775e1bac848;p=citadel.git diff --git a/webcit/roomops.c b/webcit/roomops.c index 3d1e3a12c..b93a4910d 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -186,18 +186,30 @@ long gotoroom(const StrBuf *gname) StrBuf *Buf; static long ls = (-1L); long err = 0; + int room_name_supplied = 0; + int is_baseroom = 0; /* store ungoto information */ - if (StrLength(gname) > 0) + if (StrLength(gname) > 0) { + room_name_supplied = 1; + } + if (room_name_supplied) { strcpy(WCC->ugname, ChrPtr(WCC->CurRoom.name)); + if (!strcasecmp(ChrPtr(gname), "_BASEROOM_")) { + is_baseroom = 1; + } + } WCC->uglsn = ls; Buf = NewStrBuf(); /* move to the new room */ - if (StrLength(gname) > 0) + if (room_name_supplied) { serv_printf("GOTO %s", ChrPtr(gname)); - else /* or just refresh the current state... */ + } + else { + /* or just refresh the current state... */ serv_printf("GOTO 00000000000000000000"); + } StrBuf_ServGetln(Buf); if (GetServerStatus(Buf, &err) != 2) { serv_puts("GOTO _BASEROOM_"); @@ -215,11 +227,11 @@ long gotoroom(const StrBuf *gname) FlushFolder(&WCC->CurRoom); ParseGoto(&WCC->CurRoom, Buf); - if (StrLength(gname) > 0) - { + if (room_name_supplied) { remove_march(WCC->CurRoom.name); - if (!strcasecmp(ChrPtr(gname), "_BASEROOM_")) + if (is_baseroom) { remove_march(gname); + } } FreeStrBuf(&Buf);