]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/server/webcit.h
calendar_functions.c: added skeleton
[citadel.git] / webcit-ng / server / webcit.h
index 9e6d069ba9752310db2bd03905105b809e0a81cd..11681a5969f6056f0e100412cded5c6383cfce19 100644 (file)
@@ -1,6 +1,6 @@
 // webcit.h - "header of headers"
 //
-// Copyright (c) 1996-2022 by the citadel.org team
+// Copyright (c) 1996-2023 by the citadel.org team
 //
 // This program is open source software.  You can redistribute it and/or
 // modify it under the terms of the GNU General Public License, version 3.
@@ -22,6 +22,7 @@
 #include <netdb.h>
 #include <sys/un.h>
 #include <sys/poll.h>
+#include <time.h>
 #include <sys/time.h>
 #include <string.h>
 #include <pwd.h>
@@ -63,7 +64,8 @@ struct http_transaction {                     // The lifetime of an HTTP request goes through this
        char *http_version;                     // stack and sent back down to the web server, which transmits it to
        char *site_prefix;                      // the client.
        Array *request_headers;
-       char *request_body;
+       char *request_body_with_synth_headers;  // This is the request body with some synthetic headers prepended into it.
+       char *request_body;                     // this is just going to be a pointer into request_body_with_synth_headers
        long request_body_length;
        Array *request_parms;                   // anything after the "?" in the URL
        int response_code;
@@ -83,15 +85,23 @@ struct ctdlsession {
        char room[128];                         // What room we are currently in
        int room_current_view;
        int room_default_view;
+       int is_trash_folder;                    // nonzero if this room is the user's Trash folder
        int is_room_aide;                       // nonzero if the user has aide rights to THIS room
-       int can_delete_messages;                // nonzeri if the user is permitted to delete messages in THIS room
+       int can_delete_messages;                // nonzero if the user is permitted to delete messages in THIS room
        long last_seen;
        int new_messages;
        int total_messages;
        time_t last_access;                     // Timestamp of last request that used this session
        time_t num_requests_handled;
        time_t room_mtime;                      // Timestampt of the most recent write activity in this room
-       int new_mail;                           // number of new messages in the user's INBOX
+};
+
+struct uploaded_file {                         // things that have been uploaded to the server (such as email attachments)
+       char id[10];
+       char filename[256];
+       char content_type[256];
+       long length;
+       FILE *fp;
 };
 
 extern char *ssl_cipher_list;
@@ -119,6 +129,9 @@ enum {
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
 #define TARGET                 "webcit02"      /* Window target for inline URL's */
+#define ROOMNAMELEN            128             // The size of a roomname string
+#define        DAV_MOVE                0               // MOVE=0 COPY=1 don't change these!
+#define DAV_COPY               1               // they are the values used in the Citadel Server MOVE command
 
 void worker_entry(int *);
 void perform_one_http_transaction(struct client_handle *ch);
@@ -126,6 +139,7 @@ void add_response_header(struct http_transaction *h, char *key, char *val);
 void perform_request(struct http_transaction *);
 void do_204(struct http_transaction *);
 void do_404(struct http_transaction *);
+void do_405(struct http_transaction *);
 void do_412(struct http_transaction *);
 void do_502(struct http_transaction *);
 void output_static(struct http_transaction *);
@@ -134,6 +148,7 @@ void ctdl_a(struct http_transaction *, struct ctdlsession *);
 void ctdl_f(struct http_transaction *, struct ctdlsession *);
 void ctdl_r(struct http_transaction *, struct ctdlsession *);
 void ctdl_u(struct http_transaction *, struct ctdlsession *);
+void ctdl_p(struct http_transaction *, struct ctdlsession *);
 struct ctdlsession *connect_to_citadel(struct http_transaction *);
 void disconnect_from_citadel(struct ctdlsession *);
 char *header_val(struct http_transaction *h, char *requested_header);
@@ -141,13 +156,13 @@ char *get_url_param(struct http_transaction *h, char *requested_param);
 int unescape_input(char *);
 void http_redirect(struct http_transaction *h, char *to_where);
 char *http_datestring(time_t xtime);
-long *get_msglist(struct ctdlsession *c, char *which_msgs);
 void caldav_report(struct http_transaction *h, struct ctdlsession *c);
 long locate_message_by_uid(struct ctdlsession *c, char *uid);
 void ctdl_delete_msgs(struct ctdlsession *c, long *msgnums, int num_msgs);
 void dav_delete_message(struct http_transaction *h, struct ctdlsession *c, long msgnum);
 void dav_get_message(struct http_transaction *h, struct ctdlsession *c, long msgnum);
 void dav_put_message(struct http_transaction *h, struct ctdlsession *c, char *euid, long old_msgnum);
+void dav_move_or_copy_message(struct http_transaction *h, struct ctdlsession *c, long msgnum, int move_or_copy);
 ssize_t ctdl_write(struct ctdlsession *ctdl, const void *buf, size_t count);
 int login_to_citadel(struct ctdlsession *c, char *auth, char *resultbuf);
 StrBuf *ctdl_readtextmsg(struct ctdlsession *ctdl);
@@ -163,3 +178,6 @@ void ctdl_printf(struct ctdlsession *ctdl, const char *format,...);
 int webcit_tcp_server(const char *ip_addr, int port_number, int queue_len);
 void UrlizeText(StrBuf* Target, StrBuf *Source, StrBuf *WrkBuf);
 void json_render_one_message(struct http_transaction *h, struct ctdlsession *c, long msgnum);
+void upload_files(struct http_transaction *h, struct ctdlsession *c);
+struct uploaded_file pop_upload(char *id);
+void json_msglist(struct http_transaction *h, struct ctdlsession *c, char *range);