/* Allow "test" and "freebusy" subcommands without logging in. */
- if (!strcmp(subcmd, "test")) {
+ if (!strcasecmp(subcmd, "test")) {
cprintf("%d This server supports calendaring\n", CIT_OK);
return;
}
- if (!strcmp(subcmd, "freebusy")) {
+ if (!strcasecmp(subcmd, "freebusy")) {
extract(who, argbuf, 1);
ical_freebusy(who);
return;
}
+ if (!strcasecmp(subcmd, "sgi")) {
+ CIT_ICAL->server_generated_invitations =
+ (extract_int(argbuf, 1) ? 1 : 0) ;
+ cprintf("%d %d\n",
+ CIT_OK, CIT_ICAL->server_generated_invitations);
+ return;
+ }
+
if (CtdlAccessCheck(ac_logged_in)) return;
- if (!strcmp(subcmd, "respond")) {
+ if (!strcasecmp(subcmd, "respond")) {
msgnum = extract_long(argbuf, 1);
extract(partnum, argbuf, 2);
extract(action, argbuf, 3);
return;
}
- if (!strcmp(subcmd, "handle_rsvp")) {
+ if (!strcasecmp(subcmd, "handle_rsvp")) {
msgnum = extract_long(argbuf, 1);
extract(partnum, argbuf, 2);
extract(action, argbuf, 3);
return;
}
- if (!strcmp(subcmd, "conflicts")) {
+ if (!strcasecmp(subcmd, "conflicts")) {
msgnum = extract_long(argbuf, 1);
extract(partnum, argbuf, 2);
ical_conflicts(msgnum, partnum);
strcpy(this_attendee, icalproperty_get_attendee(attendee) );
if (!strncasecmp(this_attendee, "MAILTO:", 7)) {
strcpy(this_attendee, &this_attendee[7]);
- snprintf(&attendees_string[strlen(attendees_string)],
- sizeof(attendees_string) - strlen(attendees_string),
- "%s, ",
- this_attendee
- );
- ++num_attendees;
+
+ if (!CtdlIsMe(this_attendee)) { /* don't send an invitation to myself! */
+ snprintf(&attendees_string[strlen(attendees_string)],
+ sizeof(attendees_string) - strlen(attendees_string),
+ "%s, ",
+ this_attendee
+ );
+ ++num_attendees;
+ }
}
}
}
icalproperty *organizer = NULL;
char organizer_string[SIZ];
+ /* Don't send out invitations unless the client wants us to. */
+ if (CIT_ICAL->server_generated_invitations == 0) {
+ return;
+ }
+
/* Don't send out invitations if we've been asked not to. */
- lprintf(9, "CIT_ICAL->avoid_sending_invitations = %d\n",
- CIT_ICAL->avoid_sending_invitations);
if (CIT_ICAL->avoid_sending_invitations > 0) {
return;
}
TRANSP). If there is no such user, or no calendar available, the usual
ERROR codes will be returned.
+ ICAL sgi|<bool>
+
Readers who are paying attention will notice that there is no subcommand to
-send out meeting invitations. This is because that task is handled
-automatically by the Citadel server. When an event is saved to the user's
-Calendar> room and it contains attendees, Citadel will automatically turn
-the event into vCalendar REQUEST messages and mail them out to all listed
-attendees.
+send out meeting invitations. This is because that task can be handled
+automatically by the Citadel server. Issue this command with <bool> set to 1
+to enable Server Generated Invitations. In this mode, when an event is saved
+to the user's Calendar> room and it contains attendees, Citadel will
+automatically turn the event into vCalendar REQUEST messages and mail them
+out to all listed attendees. If for some reason the client needs to disable
+Server Generated Invitations, the command may be sent again with <bool> = 0.