#ifdef USE_PTHREAD
#include <pthread.h>
#endif
-#include <ical.h>
+#include <libical/ical.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <curl/curl.h>
debug_print("DST change offset to apply to time %d\n", dst_offset);
t += dst_offset;
debug_print("%s\n", ctime(&t));
- return g_strdup(icaltime_as_ical_string(icaltime_from_timet(t, FALSE)));
+ return g_strdup(icaltime_as_ical_string(icaltime_from_timet_with_zone(t, FALSE, NULL)));
}
static gchar *get_location(VCalMeeting *meet)
found = FALSE;
while (!found && offset >= -3600*6) {
gboolean ok = TRUE;
- struct icaltimetype new_start = icaltime_from_timet(icaltime_as_timet(start)+offset, FALSE);
- struct icaltimetype new_end = icaltime_from_timet(icaltime_as_timet(end)+offset, FALSE);
+ struct icaltimetype new_start = icaltime_from_timet_with_zone(icaltime_as_timet(start)+offset, FALSE, NULL);
+ struct icaltimetype new_end = icaltime_from_timet_with_zone(icaltime_as_timet(end)+offset, FALSE, NULL);
for (cur = attendees; cur; cur = cur->next) {
VCalAttendee *attendee = (VCalAttendee *)cur->data;
debug_print("trying %s - %s (offset %d)\n",
offset = 1800;
while (!found && offset <= 3600*6) {
gboolean ok = TRUE;
- struct icaltimetype new_start = icaltime_from_timet(icaltime_as_timet(start)+offset, FALSE);
- struct icaltimetype new_end = icaltime_from_timet(icaltime_as_timet(end)+offset, FALSE);
+ struct icaltimetype new_start = icaltime_from_timet_with_zone(icaltime_as_timet(start)+offset, FALSE, NULL);
+ struct icaltimetype new_end = icaltime_from_timet_with_zone(icaltime_as_timet(end)+offset, FALSE, NULL);
for (cur = attendees; cur; cur = cur->next) {
VCalAttendee *attendee = (VCalAttendee *)cur->data;
debug_print("trying %s - %s (offset %d)\n",
gchar *summary = NULL;
gchar *description = NULL;
VCalEvent *event = NULL;
- gchar buf[256];
GSList *cur;
PrefsAccount *account = NULL;
gboolean res = FALSE;
gboolean found_att = FALSE;
- Folder *folder = folder_find_from_name ("vCalendar", vcal_folder_get_class());
+ Folder *folder = folder_find_from_name (PLUGIN_NAME, vcal_folder_get_class());
gboolean redisp = FALSE;
if (meet->uid == NULL && meet->visible &&
organizer_name = get_organizer_name(meet);
- if (account->set_domain && account->domain) {
- g_snprintf(buf, sizeof(buf), "%s", account->domain);
- } else if (!strncmp(get_domain_name(), "localhost", strlen("localhost"))) {
- g_snprintf(buf, sizeof(buf), "%s",
- strchr(account->address, '@') ?
- strchr(account->address, '@')+1 :
- account->address);
- } else {
- g_snprintf(buf, sizeof(buf), "%s", "");
- }
- generate_msgid(buf, 255, account->address);
-
if (meet->uid) {
uid = g_strdup(meet->uid);
} else {
- uid = g_strdup(buf);
+ uid = prefs_account_generate_msgid(account);
}
dtstart = get_date(meet, TRUE);
icalproperty_new_prodid(
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
- 0
+ (void*)0
);
vcal_manager_event_dump(event, FALSE, FALSE, calendar, FALSE);
tmp = g_strconcat(path, G_DIR_SEPARATOR_S, file, NULL);
for (cur = files; cur; cur = cur->next) {
file = (char *)cur->data;
if (fprintf(fp, "1 1 %s\n", file) < 0)
- perror(file);
+ FILE_OP_ERROR(file, "fprintf");
g_free(file);
}
if (fclose(fp) == EOF)
- perror(file);
+ FILE_OP_ERROR(file, "fclose");
} else {
- perror(file);
+ FILE_OP_ERROR(file, "fopen");
}
g_free(path);
g_slist_free(files);
icalproperty_new_prodid(
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
- 0
+ (void*)0
);
for (cur = list; cur; cur = cur->next) {
icalproperty_new_prodid(
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
- 0
+ (void*)0
);
timezone = icalcomponent_new(ICAL_VTIMEZONE_COMPONENT);
icalcomponent_add_component(calendar, timezone);
- itt_start = icaltime_from_timet(whole_start, FALSE);
- itt_end = icaltime_from_timet(whole_end, FALSE);
+ itt_start = icaltime_from_timet_with_zone(whole_start, FALSE, NULL);
+ itt_end = icaltime_from_timet_with_zone(whole_end, FALSE, NULL);
itt_start.second = itt_start.minute = itt_start.hour = 0;
itt_end.second = 59; itt_end.minute = 59; itt_end.hour = 23;
ICAL_VFREEBUSY_COMPONENT,
icalproperty_vanew_dtstart(itt_start, 0),
icalproperty_vanew_dtend(itt_end, 0),
- 0
+ (void*)0
);
debug_print("DTSTART:%s\nDTEND:%s\n",