From 8e47d0fa0bd533e5883048cf7c6bf7b472bbd7f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 3 Sep 2009 21:41:07 +0000 Subject: [PATCH] * fix NULL conditions in room sorters * connect the server side virtual "my folders" floor to the js representation --- webcit/roomlist.c | 12 ++++++++++ webcit/static/roomops.js | 2 +- webcit/static/wclib.js | 49 ++++++++++++++++++++++------------------ 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/webcit/roomlist.c b/webcit/roomlist.c index e915616a4..c58e43c41 100644 --- a/webcit/roomlist.c +++ b/webcit/roomlist.c @@ -240,6 +240,10 @@ int CompareRoomListByFloorRoomPrivFirst(const void *room1, const void *room2) folder *r1 = (folder*) GetSearchPayload(room1); folder *r2 = (folder*) GetSearchPayload(room2); + if ((r1->Floor == NULL) || + (r2->Floor == NULL)) + return 0; + /** * are we on the same floor? else sort by floor. */ @@ -304,6 +308,10 @@ int CompareRoomListByFloorRoomPrivFirstRev(const void *room1, const void *room2) folder *r1 = (folder*) GetSearchPayload(room1); folder *r2 = (folder*) GetSearchPayload(room2); + if ((r1->Floor == NULL) || + (r2->Floor == NULL)) + return 0; + /** * are we on the same floor? else sort by floor. */ @@ -376,6 +384,10 @@ int GroupchangeRoomListByFloorRoomPrivFirst(const void *room1, const void *room2 folder *r2 = (folder*) room2; + if ((r1->Floor == NULL) || + (r2->Floor == NULL)) + return 0; + if (r1->Floor == r2->Floor) return 0; else diff --git a/webcit/static/roomops.js b/webcit/static/roomops.js index 0f43dbdc8..449057f84 100644 --- a/webcit/static/roomops.js +++ b/webcit/static/roomops.js @@ -68,7 +68,7 @@ function GetMailboxRooms() { var room = rooms[i]; var floornum = room[RN_FLOOR_NUM]; var flag = room[RN_ROOM_FLAG]; - if ((flag & QR_MAILBOX) == QR_MAILBOX) { + if (floornum == -1) { roomsForFloor[x] = room; x++; } diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 77b07f5f8..66df5b699 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -234,32 +234,37 @@ function IconBarRoomList() { mailboxLI.appendChild(mailboxUL); var mailboxRooms = GetMailboxRooms(); for(var i=0; i