* merge from dav_rework:
[citadel.git] / webcit / marchlist.c
index 8838cd35126d5fd741a9feb7e0fd04955d7a5e68..63cd84cc4fe098ef62ab191e6d2235371768aa90 100644 (file)
@@ -1,7 +1,6 @@
 #include "webcit.h"
 #include "webserver.h"
 
-
 /*
  * Free a session's march list
  */
@@ -114,8 +113,8 @@ void gotonext(void)
         * If it is, pop the first room off the list and go there.
         */
        if (havebstr("startmsg")) {
-                readloop(readnew);
-                return;
+               readloop(readnew, eUseDefault);
+               return;
        }
 
        if (WC->march == NULL) {
@@ -132,7 +131,7 @@ void gotonext(void)
                                        continue;                                       
                                }
                                extract_token(room_name, buf, 0, '|', sizeof room_name);
-                               if (strcasecmp(room_name, ChrPtr(WC->wc_roomname))) {
+                               if (strcasecmp(room_name, ChrPtr(WC->CurRoom.name))) {
                                        mptr = (struct march *) malloc(sizeof(struct march));
                                        mptr->next = NULL;
                                        safestrncpy(mptr->march_name, room_name, sizeof mptr->march_name);
@@ -167,7 +166,7 @@ void gotonext(void)
                 * ...and remove the room we're currently in, so a <G>oto doesn't make us
                 * walk around in circles
                 */
-               remove_march(WC->wc_roomname);
+               remove_march(WC->CurRoom.name);
        }
        if (WC->march != NULL) {
                next_room = NewStrBufPlain(pop_march(-1), -1);/*TODO: migrate march to strbuf */
@@ -188,19 +187,19 @@ void ungoto(void)
        StrBuf *Buf;
 
        if (havebstr("startmsg")) {
-               readloop(readnew);
+               readloop(readnew, eUseDefault);
                return;
        }
 
        if (!strcmp(WC->ugname, "")) {
-               smart_goto(WC->wc_roomname);
+               smart_goto(WC->CurRoom.name);
                return;
        }
        serv_printf("GOTO %s", WC->ugname);
        Buf = NewStrBuf();
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) != 2) {
-               smart_goto(WC->wc_roomname);
+               smart_goto(WC->CurRoom.name);
                FreeStrBuf(&Buf);
                return;
        }
@@ -235,7 +234,7 @@ InitModule_MARCHLIST
 (void)
 {
 
-       WebcitAddUrlHandler(HKEY("gotonext"), _gotonext, NEED_URL);
-       WebcitAddUrlHandler(HKEY("skip"), gotonext, NEED_URL);
-       WebcitAddUrlHandler(HKEY("ungoto"), ungoto, NEED_URL);
+       WebcitAddUrlHandler(HKEY("gotonext"), "", 0, _gotonext, NEED_URL);
+       WebcitAddUrlHandler(HKEY("skip"), "", 0, gotonext, NEED_URL);
+       WebcitAddUrlHandler(HKEY("ungoto"), "", 0, ungoto, NEED_URL);
 }