]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
'go' and 'gotofirst' are both accepted
[citadel.git] / webcit / webcit.c
index 3c094cd1e0c1fd1490640f4314a9e48419b1d5c4..9762311cc934152787d698f960bf5da20a0ebae0 100644 (file)
@@ -511,7 +511,7 @@ void push_destination(void) {
 void pop_destination(void) {
        wcsession *WCC = WC;
 
-       if (!WCC) {
+       if ( (!WCC) || (WCC->PushedDestination == NULL) || (StrLength(WCC->PushedDestination) == 0) ) {
                do_welcome();
                return;
        }
@@ -654,7 +654,6 @@ void session_loop(void)
        WCC= WC;
        WCC->upload_length = 0;
        WCC->upload = NULL;
-       WCC->is_mobile = 0;
        WCC->Hdr->nWildfireHeaders = 0;
        if (WCC->Hdr->HR.Handler != NULL)
                Flags = WCC->Hdr->HR.Handler->Flags; /* so we can temporarily add our own... */
@@ -751,7 +750,7 @@ void session_loop(void)
                (WCC->Hdr->HR.eReqType != eHEAD);
 
        /*
-        * If a 'go' parameter has been specified, attempt to goto that room
+        * If a 'go' (or 'gotofirst') parameter has been specified, attempt to goto that room
         * prior to doing anything else.
         */
        if (havebstr("go")) {
@@ -759,8 +758,15 @@ void session_loop(void)
                lprintf(9, "Explicit room selection: %s\n", bstr("go"));
                ret = gotoroom(sbstr("go"));    /* do quietly to avoid session output! */
                if ((ret/100) != 2) {
-                       lprintf(1, "GOTOFIRST: Unable to change to [%s]; Reason: %d\n",
-                               bstr("go"), ret);
+                       lprintf(1, "Unable to change to [%s]; Reason: %d\n", bstr("go"), ret);
+               }
+       }
+       else if (havebstr("gotofirst")) {
+               int ret;
+               lprintf(9, "Explicit room selection: %s\n", bstr("gotofirst"));
+               ret = gotoroom(sbstr("gotofirst"));     /* do quietly to avoid session output! */
+               if ((ret/100) != 2) {
+                       lprintf(1, "Unable to change to [%s]; Reason: %d\n", bstr("gotofirst"), ret);
                }
        }