From ae5876a55ce54d005261cbb451aa9901ec22b7c2 Mon Sep 17 00:00:00 2001 From: Michael Hampton Date: Thu, 18 Aug 2005 22:57:55 +0000 Subject: [PATCH] gotoroom() now returns nonzero on error --- webcit/roomops.c | 11 +++++++++-- webcit/webcit.h | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/webcit/roomops.c b/webcit/roomops.c index c587381df..d01fdfebb 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -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; } diff --git a/webcit/webcit.h b/webcit/webcit.h index e507adc41..b8986d98e 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -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 */ -- 2.39.2