In WIKI rooms, clients can supply a message EUID
authorArt Cancro <ajc@citadel.org>
Tue, 24 Jan 2006 03:22:59 +0000 (03:22 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 24 Jan 2006 03:22:59 +0000 (03:22 +0000)
citadel/ChangeLog
citadel/msgbase.c
citadel/msgbase.h
citadel/serv_calendar.c
citadel/techdoc/protocol.txt

index 8949c10e2649329942d21c3a56da0240c7c4980a..29142d9f16b8b3c6fc390b25444864adc84c3ce9 100644 (file)
@@ -1,5 +1,8 @@
 $Id$
 
+Mon Jan 23 22:22:18 EST 2006 ajc
+* In WIKI rooms, clients can supply a message EUID
+
 Sat Jan 21 16:22:51 EST 2006 ajc
 * Patch to the "m<Y> next message" function, submitted by matt
 
index 3aa7c34e6eab478fcc4d2821f95d76db826bb574..8bc08b20113dc964fcff224c0d0ec659cc407469 100644 (file)
@@ -2640,6 +2640,7 @@ struct CtdlMessage *CtdlMakeMessage(
        int format_type,                /* variformat, plain text, MIME... */
        char *fake_name,                /* who we're masquerading as */
        char *subject,                  /* Subject (optional) */
+       char *supplied_euid,            /* ...or NULL if this is irrelevant */
        char *preformatted_text         /* ...or NULL to read text from client */
 ) {
        char dest_node[SIZ];
@@ -2700,6 +2701,10 @@ struct CtdlMessage *CtdlMakeMessage(
                }
        }
 
+       if (supplied_euid != NULL) {
+               msg->cm_fields['E'] = strdup(supplied_euid);
+       }
+
        if (preformatted_text != NULL) {
                msg->cm_fields['M'] = preformatted_text;
        }
@@ -2975,6 +2980,7 @@ void cmd_ent0(char *entargs)
        char recp[SIZ];
        char cc[SIZ];
        char bcc[SIZ];
+       char supplied_euid[128];
        char masquerade_as[SIZ];
        int anon_flag = 0;
        int format_type = 0;
@@ -3001,6 +3007,14 @@ void cmd_ent0(char *entargs)
        do_confirm = extract_int(entargs, 6);
        extract_token(cc, entargs, 7, '|', sizeof cc);
        extract_token(bcc, entargs, 8, '|', sizeof bcc);
+       switch(CC->room.QRdefaultview) {
+               case VIEW_WIKI:
+                       extract_token(supplied_euid, entargs, 9, '|', sizeof supplied_euid);
+                       break;
+               default:
+                       supplied_euid[0] = 0;
+                       break;
+       }
 
        /* first check to make sure the request is valid. */
 
@@ -3161,7 +3175,9 @@ void cmd_ent0(char *entargs)
 
        msg = CtdlMakeMessage(&CC->user, recp, cc,
                CC->room.QRname, anonymous, format_type,
-               masquerade_as, subject, NULL);
+               masquerade_as, subject,
+               ((strlen(supplied_euid) > 0) ? supplied_euid : NULL),
+               NULL);
 
        /* Put together one big recipients struct containing to/cc/bcc all in
         * one.  This is for the envelope.
index 64feab384fee73f046e59b9072cf753ed53eed98..a4f43002e4337e1f9d0f41ed06bc440cf7db26ca 100644 (file)
@@ -153,6 +153,7 @@ struct CtdlMessage *CtdlMakeMessage(
         int format_type,                /* variformat, plain text, MIME... */
         char *fake_name,                /* who we're masquerading as */
         char *subject,                  /* Subject (optional) */
+       char *supplied_euid,            /* ...or NULL if this is irrelevant */
         char *preformatted_text         /* ...or NULL to read text from client */
 );
 int CtdlCheckInternetMailPermission(struct ctdluser *who);
index 527982072e37512c1ec92b9ff5cff0ca378fd5fa..8d1dff6016b00a7b62a28e2d878cfa30c465f810 100644 (file)
@@ -321,6 +321,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                        CC->room.QRname, 0, FMT_RFC822,
                        "",
                        summary_string,         /* Use summary for subject */
+                       NULL,
                        reply_message_text);
        
                if (msg != NULL) {
@@ -697,6 +698,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
                        0, FMT_RFC822,
                        "",
                        "",             /* no subject */
+                       NULL,
                        message_text);
        
                if (msg != NULL) {
@@ -1589,6 +1591,7 @@ void ical_send_out_invitations(icalcomponent *cal) {
                        CC->room.QRname, 0, FMT_RFC822,
                        "",
                        summary_string,         /* Use summary for subject */
+                       NULL,
                        request_message_text);
        
                if (msg != NULL) {
index 516a6158e80879746965cfd99313360111038608..f9a200698c0c787c8e1cebe389a995cbd3e5a1f9 100644 (file)
@@ -824,6 +824,12 @@ of the recipient(s) of the message.
   8  -  Recipient (Bcc: field).  This argument is utilized only for private
 mail.  It is ignored for public messages.  It contains, of course, the name
 of the recipient(s) of the message.
+  9  -  Exclusive message ID.  When a message is submitted with an Exclusive
+message ID, any existing messages with the same ID will automatically be
+deleted.  This is only applicable for Wiki rooms; other types of rooms either
+ignore the supplied ID (such as message boards and mailboxes) or derive the
+ID from a UUID native to the objects stored in them (such as calendars and
+address books).
 
  Possible result codes:
   OK  -  The request is valid.  (Client did not set the "post" flag, so the