gotoroom() now returns nonzero on error
authorMichael Hampton <io_error@uncensored.citadel.org>
Thu, 18 Aug 2005 22:57:55 +0000 (22:57 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Thu, 18 Aug 2005 22:57:55 +0000 (22:57 +0000)
webcit/roomops.c
webcit/webcit.h

index c587381df3d28ea2697fc00d697c5f6b72d279fa..d01fdfebb93063ce1423d2467b598c36cb16aa61 100644 (file)
@@ -567,10 +567,11 @@ void embed_room_banner(char *got, int navbar_style) {
  * back end routine to take the session to a new room
  *
  */
-void gotoroom(char *gname)
+int gotoroom(char *gname)
 {
        char buf[SIZ];
        static long ls = (-1L);
+       int err = 0;
 
        /* store ungoto information */
        strcpy(WC->ugname, WC->wc_roomname);
@@ -580,11 +581,15 @@ void gotoroom(char *gname)
        serv_printf("GOTO %s", gname);
        serv_getln(buf, sizeof buf);
        if (buf[0] != '2') {
+               buf[3] = 0;
+               err = atoi(buf);
                serv_puts("GOTO _BASEROOM_");
                serv_getln(buf, sizeof buf);
        }
        if (buf[0] != '2') {
-               return;
+               buf[3] = 0;
+               err = atoi(buf);
+               return err;
        }
        extract_token(WC->wc_roomname, &buf[4], 0, '|', sizeof WC->wc_roomname);
        WC->room_flags = extract_int(&buf[4], 4);
@@ -604,6 +609,8 @@ void gotoroom(char *gname)
        remove_march(WC->wc_roomname);
        if (!strcasecmp(gname, "_BASEROOM_"))
                remove_march(gname);
+
+       return err;
 }
 
 
index e507adc41a07176c0bb6bd3b7357a67266351c69..b8986d98eefec043c68b4f637e22caa2d19476b5 100644 (file)
@@ -92,7 +92,7 @@
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
 #define CLIENT_VERSION         621             /* This version of WebCit */
-#define MINIMUM_CIT_VERSION    655             /* min required Citadel vers */
+#define MINIMUM_CIT_VERSION    654             /* min required Citadel vers */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
 #define LB                     (1)             /* Internal escape chars */
@@ -416,7 +416,7 @@ void server_to_text(void);
 void save_edit(char *description, char *enter_cmd, int regoto);
 void display_edit(char *description, char *check_cmd,
                  char *read_cmd, char *save_cmd, int with_room_banner);
-void gotoroom(char *gname);
+int gotoroom(char *gname);
 void confirm_delete_room(void);
 void delete_room(void);
 void validate(void);
@@ -553,6 +553,7 @@ void display_customize_iconbar(void);
 void commit_iconbar(void);
 int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen);
 void spawn_another_worker_thread(void);
+void display_rss(const char *roomname);
 
 void embed_room_banner(char *, int);
 /* navbar types that can be passed to embed_room_banner */