]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_calendar.c
* Began framing up a command to view other users' free/busy times
[citadel.git] / citadel / serv_calendar.c
index 6db1f958a91d05cd10d3ed312111889751c18883..a1726b658699a904a3a90b6015501ba1e9d38d11 100644 (file)
@@ -946,6 +946,43 @@ void ical_conflicts(long msgnum, char *partnum) {
 
 
 
+/*
+ * Grab another user's free/busy times
+ */
+void ical_freebusy(char *who) {
+       struct usersupp usbuf;
+       char calendar_room_name[ROOMNAMELEN];
+       char hold_rm[ROOMNAMELEN];
+
+       if (getuser(&usbuf, who) != 0) {
+               cprintf("%d No such user.\n", ERROR + NO_SUCH_USER);
+               return;
+       }
+
+       MailboxName(calendar_room_name, sizeof calendar_room_name,
+               &usbuf, USERCALENDARROOM);
+
+       strcpy(hold_rm, CC->quickroom.QRname);  /* save current room */
+
+       if (getroom(&CC->quickroom, USERCALENDARROOM) != 0) {
+               cprintf("%d Cannot open calendar\n", ERROR+ROOM_NOT_FOUND);
+               getroom(&CC->quickroom, hold_rm);
+               return;
+       }
+
+/*
+       CtdlForEachMessage(MSGS_ALL, 0, "text/calendar",
+               template, the_FIXME_function, NULL);
+ */
+
+       /* Go back to the room from which we came... */
+       getroom(&CC->quickroom, hold_rm);
+
+       cprintf("%d not implemented yet\n", ERROR);
+}
+
+
+
 
 /*
  * All Citadel calendar commands from the client come through here.
@@ -956,6 +993,7 @@ void cmd_ical(char *argbuf)
        long msgnum;
        char partnum[SIZ];
        char action[SIZ];
+       char who[SIZ];
 
        if (CtdlAccessCheck(ac_logged_in)) return;
 
@@ -986,6 +1024,11 @@ void cmd_ical(char *argbuf)
                ical_conflicts(msgnum, partnum);
        }
 
+       else if (!strcmp(subcmd, "freebusy")) {
+               extract(who, argbuf, 1);
+               ical_freebusy(who);
+       }
+
        else {
                cprintf("%d Invalid subcommand\n", ERROR+CMD_NOT_SUPPORTED);
                return;