]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.h
* Corrected overly-escaped reply-to addresses in "reply" button
[citadel.git] / webcit / webcit.h
index afb3c9d7b406bfe2c203642de0b2556166e869ca..f3a1e1a850696bca3dcf1dae0b02e0c6280e481a 100644 (file)
@@ -4,7 +4,6 @@
 #include <zlib.h>
 #endif
 
-
 #ifdef HAVE_ICAL_H
 #ifdef HAVE_LIBICAL
 #define WEBCIT_WITH_CALENDAR_SERVICE 1
 #define SLEEPING               180             /* TCP connection timeout */
 #define WEBCIT_TIMEOUT         900             /* WebCit session timeout */
 #define PORT_NUM               2000            /* port number to listen on */
-#define SERVER                 "WebCit v5.06"  /* who's in da house */
+#define SERVER                 "WebCit v5.28"  /* who's in da house */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         506             /* This version of WebCit */
-#define MINIMUM_CIT_VERSION    611             /* min required Citadel vers */
+#define CLIENT_VERSION         528             /* This version of WebCit */
+#define MINIMUM_CIT_VERSION    626             /* min required Citadel vers */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
 #define LB                     (1)             /* Internal escape chars */
@@ -50,6 +49,7 @@
 #define LISTEN_QUEUE_LENGTH    100             /* listen() backlog queue */
 
 #define USERCONFIGROOM         "My Citadel Config"
+#define DEFAULT_MAXMSGS                20
 
 
 /*
@@ -192,6 +192,7 @@ struct wcsession {
        unsigned room_flags;
        int wc_view;
        int wc_default_view;
+       int wc_floor;
        char ugname[128];
        long uglsn;
        int upload_length;
@@ -218,8 +219,10 @@ struct wcsession {
        char http_host[SIZ];            /* HTTP Host: header */
        char *preferences;
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
-       icalcomponent **disp_cal;       /* store calendar items for display */
-       long *cal_msgnum;               /* store calendar msgids for display */
+       struct disp_cal {
+               icalcomponent *cal;             /* cal items for display */
+               long cal_msgnum;                /* cal msgids for display */
+       } *disp_cal;
        int num_cal;
 #endif
        struct wc_attachment *first_attachment;
@@ -227,17 +230,22 @@ struct wcsession {
        int outside_frameset_allowed;   /* nonzero if current req is allowed
                                         * outside of the main frameset */
        char last_chat_user[SIZ];
-#ifdef HAVE_OPENSSL
-       SSL *ssl;
-#endif
+       int ctdl_pid;                   /* Session ID on the Citadel server */
 };
 
 #define extract(dest,source,parmnum)   extract_token(dest,source,parmnum,'|')
 #define num_parms(source)              num_tokens(source, '|')
 
+/* Per-session data */
 #define WC ((struct wcsession *)pthread_getspecific(MyConKey))
 extern pthread_key_t MyConKey;
 
+/* Per-thread SSL context */
+#ifdef HAVE_OPENSSL
+#define THREADSSL ((SSL *)pthread_getspecific(ThreadSSL))
+extern pthread_key_t ThreadSSL;
+#endif
+
 struct serv_info serv_info;
 extern char floorlist[128][SIZ];
 extern char *axdefs[];
@@ -245,8 +253,6 @@ extern char *ctdlhost, *ctdlport;
 extern char *server_cookie;
 extern int is_https;
 
-extern struct wcsubst *global_subst;
-
 
 void stuff_to_cookie(char *cookie, int session,
                        char *user, char *pass, char *room);
@@ -280,10 +286,12 @@ void jsescputs(char *);
 void output_headers(int);
 void wprintf(const char *format,...);
 void output_static(char *what);
-void stresc(char *target, char *strbuf, int nbsp);
+void stresc(char *target, char *strbuf, int nbsp, int nolinebreaks);
 void escputs(char *strbuf);
 void url(char *buf);
-void escputs1(char *strbuf, int nbsp);
+void escputs1(char *strbuf, int nbsp, int nolinebreaks);
+void msgesc(char *target, char *strbuf);
+void msgescputs(char *strbuf);
 long extract_long(char *source, long int parmnum);
 int extract_int(char *source, int parmnum);
 void stripout(char *str, char leftboundary, char rightboundary);
@@ -297,6 +305,7 @@ void display_enter(void);
 void post_message(void);
 void confirm_delete_msg(void);
 void delete_msg(void);
+void do_stuff_to_one_msg(void);
 void confirm_move_msg(void);
 void move_msg(void);
 void userlist(void);
@@ -320,7 +329,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 headers_type);
-void gotoroom(char *gname, int display_name);
+void gotoroom(char *gname);
 void confirm_delete_room(void);
 void delete_room(void);
 void validate(void);
@@ -406,13 +415,19 @@ ssize_t write(int fd, const void *buf, size_t count);
 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum);
 void display_calendar(long msgnum);
 void display_task(long msgnum);
+void display_note(long msgnum);
 void do_calendar_view(void);
+void do_tasks_view(void);
 void free_calendar_buffer(void);
 void calendar_summary_view(void);
 int load_msg_ptrs(char *servcmd);
 void CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen);
 int CtdlDecodeBase64(char *dest, const char *source, size_t length);
 void free_attachments(struct wcsession *sess);
+void set_room_policy(void);
+void display_inetconf(void);
+void save_inetconf(void);
+void generate_uuid(char *);
 
 
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
@@ -424,7 +439,6 @@ void display_icaltimetype_as_webform(struct icaltimetype *, char *);
 struct icaltimetype icaltime_from_webform(char *prefix);
 void display_edit_individual_event(icalcomponent *supplied_vtodo, long msgnum);
 void save_individual_event(icalcomponent *supplied_vtodo, long msgnum);
-void generate_new_uid(char *);
 void respond_to_request(void);
 void handle_rsvp(void);
 void ical_dezonify(icalcomponent *cal);
@@ -456,7 +470,18 @@ void spawn_another_worker_thread(void);
 void init_ssl(void);
 void endtls(void);
 void ssl_lock(int mode, int n, const char *file, int line);
-int starttls(void);
+int starttls(int sock);
 extern SSL_CTX *ssl_ctx;  
+int client_read_ssl(char *buf, int bytes, int timeout);
+void client_write_ssl(char *buf, int nbytes);
 #endif
 
+
+
+/* Views (from citadel.h) */
+#define        VIEW_BBS                0       /* Traditional Citadel BBS view */
+#define VIEW_MAILBOX           1       /* Mailbox summary */
+#define VIEW_ADDRESSBOOK       2       /* Address book view */
+#define VIEW_CALENDAR          3       /* Calendar view */
+#define VIEW_TASKS             4       /* Tasks view */
+#define VIEW_NOTES             5       /* Notes view */