Hello,
I was testing the FreeBusy feature using the openchangeclient tool,
and I found some entries missing from the results displayed. Browsing
through the dump I noticed we fetch all the entries, but we did not
display the calendar items which were created at half hours, example an
event at 0430 hours.
I made a few changes and the resulting string looked very long and
wordy. So I have modified the print statements to display it in the
following format,
7th June 2010 0430 hrs and lasts 1 hr 30 mins.
Even better would be the following format,
7th June 2010 0430 hrs Duration: 1 hr 30 mins.
Let me know if I need to change anything else.
Regards,
Bharath
Index: libmapi/mapidump.c
===================================================================
--- libmapi/mapidump.c (revision 1845)
+++ libmapi/mapidump.c (working copy)
@@ -927,7 +927,7 @@
uint32_t day;
const char *month_name;
uint32_t last;
- uint32_t minutes;
+ uint32_t minutes = 0;
if (!bin) return;
/* bin.cb must be a multiple of 4 */
@@ -942,23 +942,24 @@
event_end = (bin->lpb[i + 3] << 8) | bin->lpb[i + 2];
for (hour = 0; hour < 24; hour++) {
- if (!((event_start - (60 * hour)) % 1440)) {
+ if (!(((event_start - (60 * hour)) % 1440) && (((event_start - (60 * hour)) % 1440) - 30))) {
day = ((event_start - (60 * hour)) / 1440) + 1;
+ minutes = (event_start - (60 * hour)) % 1440;
last = event_end - event_start;
#if defined (__FreeBSD__)
- DEBUG(0, ("%s %u %s %u at %u hours and lasts ", sep ? sep : "", day, month_name, year, hour));
+ DEBUG(0, ("%s %u %s %u at %.2u%.2u hrs and lasts ", sep ? sep : "", day, month_name, year, hour, minutes));
#else
- DEBUG(0, ("%s %u %s %u at %u hours and lasts ", sep ? sep : "", day, month_name, year, hour + daylight));
+ DEBUG(0, ("%s %u %s %u at %.2u%.2u hrs and lasts ", sep ? sep : "", day, month_name, year, hour + daylight, minutes));
#endif
if (last < 60) {
- DEBUG(0, ("%u minutes\n", last));
+ DEBUG(0, ("%u mins\n", last));
} else {
hours = last / 60;
minutes = last - hours * 60;
if (minutes > 0) {
- DEBUG(0, ("%u hours and %u minutes\n", hours, minutes));
+ DEBUG(0, ("%u hrs %u mins\n", hours, minutes));
} else {
- DEBUG(0, ("%u hours\n", hours));
+ DEBUG(0, ("%u hrs\n", hours));
}
}
}
_______________________________________________
devel mailing list
[email protected]
http://mailman.openchange.org/listinfo/devel