dav_move_or_copy_message() skeleton
authorArt Cancro <ajc@citadel.org>
Sat, 11 Mar 2023 23:01:01 +0000 (18:01 -0500)
committerArt Cancro <ajc@citadel.org>
Sat, 11 Mar 2023 23:01:01 +0000 (18:01 -0500)
webcit-ng/server/messages.c
webcit-ng/server/room_functions.c
webcit-ng/server/webcit.h

index a45337b897910b19d364f85118ac1ebb4a73ddec..7250fe87c1ba9614a3133c23ae4dd3eafda47045 100644 (file)
@@ -46,6 +46,12 @@ void dav_delete_message(struct http_transaction *h, struct ctdlsession *c, long
 }
 
 
+// DAV move or copy an object in a room.
+void dav_move_or_copy_message(struct http_transaction *h, struct ctdlsession *c, long msgnum, int move_or_copy) {
+       do_404(h);
+}
+
+
 // GET method directly on a message in a room
 void dav_get_message(struct http_transaction *h, struct ctdlsession *c, long msgnum) {
        char buf[1024];
index 9e7896c5edaf7c15c09dd78fee3dac643a62becb..1840c6cbf465512d34ba07ddd83f872df35240a9 100644 (file)
@@ -300,10 +300,10 @@ void object_in_room(struct http_transaction *h, struct ctdlsession *c) {
                dav_put_message(h, c, unescaped_euid, msgnum);
        }
        else if (!strcasecmp(h->method, "MOVE")) {
-               do_404(h);      // FIXME write this
+               dav_move_or_copy_message(h, c, msgnum, DAV_MOVE);
        }
        else if (!strcasecmp(h->method, "COPY")) {
-               do_404(h);      // FIXME write this
+               dav_move_or_copy_message(h, c, msgnum, DAV_COPY);
        }
        else {
                do_404(h);      // Got this far but the method made no sense?  Bummer.
index d8321b49f0586d673d54dc2c6ad6a76ed3930bc6..e5a4f8e1f4e3602c27f6c5ce9f25678d78a5e8ad 100644 (file)
@@ -108,6 +108,11 @@ enum {
        WEBSERVER_UDS
 };
 
+enum {
+       DAV_MOVE,
+       DAV_COPY
+};
+
 #define TRACE syslog(LOG_DEBUG, "\033[3%dmCHECKPOINT: %s:%d\033[0m", ((__LINE__%6)+1), __FILE__, __LINE__)
 #define SLEEPING               180             // TCP connection timeout
 #define MAX_WORKER_THREADS     32              // Maximum number of worker threads permitted to exist
@@ -147,6 +152,7 @@ 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);