]> code.citadel.org Git - citadel.git/commitdiff
When loading the march list, don't insert the current room.
authorArt Cancro <ajc@citadel.org>
Mon, 22 Jan 2007 17:42:58 +0000 (17:42 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 22 Jan 2007 17:42:58 +0000 (17:42 +0000)
webcit/calendar.c
webcit/roomops.c

index d705046d2e30a877e26761fc339fe1b15052fe25..2dd94b2f071407ce63c1a2e063e5b635d8816c84 100644 (file)
@@ -738,7 +738,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
                 * can't encapsulate something that may already be encapsulated
                 * somewhere else.
                 */
-               lprintf(9, "Encapsulating into full VCALENDAR component\n");
+               lprintf(9, "Encapsulating into full VCALENDAR component\n");
                encaps = ical_encapsulate_subcomponent(icalcomponent_new_clone(vtodo));
 
                /* Serialize it and save it to the message base */
index bcb4b9562881b78fcf8e3a296a8f5405ac7dcd3b..84bdf656eed3180ed2d771e8b8a15ce168e9d9ab 100644 (file)
@@ -784,6 +784,7 @@ void gotonext(void)
 {
        char buf[256];
        struct march *mptr, *mptr2;
+       char room_name[128];
        char next_room[128];
 
        /**
@@ -796,18 +797,21 @@ void gotonext(void)
                serv_getln(buf, sizeof buf);
                if (buf[0] == '1')
                        while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
-                               mptr = (struct march *) malloc(sizeof(struct march));
-                               mptr->next = NULL;
-                               extract_token(mptr->march_name, buf, 0, '|', sizeof mptr->march_name);
-                               mptr->march_floor = extract_int(buf, 2);
-                               mptr->march_order = extract_int(buf, 3);
-                               if (WC->march == NULL) {
-                                       WC->march = mptr;
-                               } else {
-                                       mptr2 = WC->march;
-                                       while (mptr2->next != NULL)
-                                               mptr2 = mptr2->next;
-                                       mptr2->next = mptr;
+                               extract_token(room_name, buf, 0, '|', sizeof room_name);
+                               if (strcasecmp(room_name, WC->wc_roomname)) {
+                                       mptr = (struct march *) malloc(sizeof(struct march));
+                                       mptr->next = NULL;
+                                       safestrncpy(mptr->march_name, room_name, sizeof mptr->march_name);
+                                       mptr->march_floor = extract_int(buf, 2);
+                                       mptr->march_order = extract_int(buf, 3);
+                                       if (WC->march == NULL) {
+                                               WC->march = mptr;
+                                       } else {
+                                               mptr2 = WC->march;
+                                               while (mptr2->next != NULL)
+                                                       mptr2 = mptr2->next;
+                                               mptr2->next = mptr;
+                                       }
                                }
                        }
                /**