From 02e69c92e439605f55b1d9234be44003ed51ef83 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 24 Jan 2006 03:22:59 +0000 Subject: [PATCH] In WIKI rooms, clients can supply a message EUID --- citadel/ChangeLog | 3 +++ citadel/msgbase.c | 18 +++++++++++++++++- citadel/msgbase.h | 1 + citadel/serv_calendar.c | 3 +++ citadel/techdoc/protocol.txt | 6 ++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 8949c10e2..29142d9f1 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 next message" function, submitted by matt diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 3aa7c34e6..8bc08b201 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -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. diff --git a/citadel/msgbase.h b/citadel/msgbase.h index 64feab384..a4f43002e 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -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); diff --git a/citadel/serv_calendar.c b/citadel/serv_calendar.c index 527982072..8d1dff601 100644 --- a/citadel/serv_calendar.c +++ b/citadel/serv_calendar.c @@ -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) { diff --git a/citadel/techdoc/protocol.txt b/citadel/techdoc/protocol.txt index 516a6158e..f9a200698 100644 --- a/citadel/techdoc/protocol.txt +++ b/citadel/techdoc/protocol.txt @@ -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 -- 2.39.2