Commit Graph
100 Commits
Author SHA1 Message Date
Lukas Fleischer 35eaa4a737 Release 4.5.1
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-10-18 17:18:01 -04:00
Lukas Fleischer 1b43893c4c test/Makefile.am: Add apts-dst to EXTRA_DIST
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-10-18 17:18:01 -04:00
Lukas Fleischer 65e2a71b76 Release 4.5.0
Helped-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-06-17 08:42:03 -04:00
Lukas Fleischer 130221dd0e po/: Translation updates from Transifex
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-06-16 15:29:05 -04:00
Lukas Fleischer 3216814be1 Use current value as default for periodic save
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-06-07 21:06:18 -04:00
Lukas Fleischer 4fb5eb4ce3 Disable view item/note bindings for dummy items
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-06-06 22:38:46 -04:00
Lukas Fleischer d659a8e2ee Use empty end date instead of 0 when editing repetitions
Since commit 987fa9d (Allow to omit end date in repetitions,
2019-06-03), one can provide an empty date instead of using the value 0
to omit the end date of a repetition. Use this as default value when
editing repetitions without an end date.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-06-06 20:57:48 -04:00
Lukas Fleischer 16b346a1f4 Add GitHub gimmicks
Add a bug report template and a sponsor button to the GitHub interface.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-06-06 20:57:48 -04:00
Lukas Fleischer 987fa9d3e5 Allow to omit end date in repetitions
Addresses GitHub issue #213.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-06-03 18:43:42 -04:00
Lukas Fleischer 2f348a9292 README.md: move demo to top of document
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-05-31 20:35:49 -04:00
Lukas Fleischer d280a5a55a Update message catalog
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-05-30 07:53:14 -04:00
Lukas Fleischer 31b02513aa calcurse-caldav: replace readfp() by read_file()
Addresses GitHub issue #209.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-05-26 10:04:28 -04:00
Lukas Fleischer 90b91d92db Fix note on -P in the 4.4.0 release notes
Reported-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-02-24 12:50:11 +01:00
Lukas Fleischer e72d984906 Release 4.4.0
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-02-21 07:50:08 +01:00
Lukas Fleischer 61ca7cf864 Update po files
This is just automated updates from `make update-po` and does not
include any new translations from Transifex.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-02-21 07:20:24 +01:00
Lukas Fleischer 6cd67311e3 Check for KEY_ENTER in getstring()
In some cases (e.g., TERM=pccon0) wgetch(3) can return KEY_ENTER instead
of '\n' when the return key is pressed, causing getstring() to fail.

Suggested-by: Mikolaj Kucharski <mikolaj@kucharski.name>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-02-10 21:40:11 +01:00
Lukas Fleischer 0bbe802002 Use portable default day heading format
The %-d format string is not standards-compliant. Use %e instead.

Reported-by: Mikolaj Kucharski <mikolaj@kucharski.name>
Suggested-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-02-10 21:36:39 +01:00
Lukas Fleischer 1f74ad3357 calcurse-caldav: fix -x argument
The optional argument to -x must be given as "-xical" (without a space).

Partly addresses GitHub issue #177.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-02-10 21:33:35 +01:00
Lukas Fleischer 5657e19e17 Invalidate calendar cache when adding an exception
Removing an occurrence of a recurrent item can turn a busy day into a
free day.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-02-02 18:21:08 +01:00
Lukas Fleischer 4eda8f6937 calcurse-caldav: drop misplaced filter argument
We cannot use the filter options when importing events.

This was noticed because the new calcurse argument parser catches
invalid input flag combinations and bails out.

Partly addresses GitHub issue #177.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-02-02 18:13:49 +01:00
Lukas Fleischer 0169ba0934 doc/flag.txt: fix typo
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-01-24 08:23:22 +01:00
Lukas Fleischer b0984e71b0 Refactor keys_format_label()
Simplify the key formatting function and enforce display width properly
using the UTF8 chopping function.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-01-19 15:07:42 +01:00
Lukas Fleischer bffa517250 Bind RETURN to view-item by default
Also, use the modern key name instead of the backwards compatibility
name.

Addresses GitHub issue #168.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-01-19 10:41:05 +01:00
Lukas Fleischer 03340db72e Use time_t for system time values
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2019-01-14 06:21:34 +01:00
Lukas Fleischer 51f17fb9c6 Update message catalog 2019-01-12 18:09:58 +01:00
Lukas Fleischer e3ca60eefe Fix default paths for configuration files
Addresses a copy-paste typo introduced in commit 65064ce (Check if the
configuration folder exists, 2018-08-25).

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-11-10 12:34:47 +01:00
Lukas Fleischer efdff01da8 Ignore resize and error keys in getstring()
Partly addresses GitHub issue #145.

Suggested-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-10-21 20:04:38 +02:00
Lukas Fleischer 37d8725e78 contrib/caldav/Makefile.am: add config.sample
Fixes GitHub issue #144.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-10-21 20:01:34 +02:00
Lukas Fleischer c4960aaf93 calcurse-caldav: fix auth method check
Fixes a regression introduced in 6a6c711 (calcurse-caldav: fix basic
authentication, 2018-07-20).

Addresses GitHub issue #149.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-09-27 07:33:47 +02:00
Lukas Fleischer ea0a33645a README.md: add demo
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-08-30 07:25:25 +02:00
Lukas Fleischer 9f8622905c Update README.md
* Add more details on the project directory structure.
* Add information on contributions and donations.
* Move contributors to the manual but keep a reference.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-08-30 07:25:25 +02:00
Lukas Fleischer 5efc334c1b Fix memory leak in run_hook()
Fixes GitHub issue #139.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-08-25 10:22:29 +02:00
Lukas Fleischer a5febe2e22 Make editing of punctual appointments more intuitive
When editing the start time, move the item instead of keeping the
previous start time as end time. When editing the end time, start with
an empty end time instead of the previous start time.

Fixes GitHub issue #89.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-08-25 09:28:56 +02:00
Lukas Fleischer 8466717f06 calcurse-caldav: print executed commands in debug mode
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-08-25 08:54:03 +02:00
Lukas Fleischer 41f4a92fa9 Only stop threads when exiting from interactive mode
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-08-25 08:47:18 +02:00
Lukas Fleischer dd4d444c0c calcurse-caldav: print HTTP status codes in debug mode
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-08-21 05:51:35 +02:00
Lukas Fleischer 30f411257a Do not stop already cancelled notification thread
Add a static state variable to indicate whether the notification thread
is already running or not. Only start the thread if the notification
thread is paused. Only stop the thread if the notification thread is
actually running.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-06-03 10:28:28 +02:00
Lukas Fleischer e55aead126 Only lock save mutex as short as possible
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-06-03 10:28:28 +02:00
Lukas Fleischer 574156be7c Always NUL-terminate buffer in note_gc()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-26 12:05:50 +02:00
Lukas Fleischer 68cac7345c Always NUL-terminate buffer in keys_fill_missing()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-26 12:05:41 +02:00
Lukas Fleischer 7efe03cf05 Fix buffer overflow in keys_action_allkeys()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-26 12:03:03 +02:00
Lukas Fleischer 2cd60c78cf Always NUL-terminate buffer in io_load_keys()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-26 11:52:41 +02:00
Lukas Fleischer 65c2b6d9b8 notify.c: fix several buffer overflows
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-26 11:51:38 +02:00
Lukas Fleischer 8abb1a93ad Properly NUL-terminate the day heading after editing
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-26 11:47:01 +02:00
Lukas Fleischer 7e5f8ed7bc Avoid buffer overrun in config_parse_str()
The previous implementation only read a prefix from the configuration
file if the configuration value was too long and forgot to terminate the
string with a NUL character.

Return 0 if the string is too long instead.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-26 11:44:30 +02:00
Lukas Fleischer fda8c1a7e2 calcurse-caldav: remove authorization data from logs
The Authorization header contains the Base64-encoded user name and
password. Remove this information from debug logs, unless the user
explicitly requests to keep them by using the --debug-raw flag.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-23 17:59:50 +02:00
Lukas Fleischer 912124bcdc Run pre-load hook before testing for modifications
The pre-load hook is often used to manipulate the data files before
loading, such as by synchronizing with a remote calendar. Make sure we
always execute the pre-load hook upon reloads, even if the data files
have not been modified.

Fixes GitHub issue #98.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-23 17:52:05 +02:00
Lukas Fleischer 2d19605ba8 Unlock the save mutex as early as possible
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-19 10:34:19 +02:00
Lukas Fleischer 1418e40793 Use dummy variables to ignore return values of pair_content()
This prevents from segmentation faults with recent ncurses
implementations. See commit 5722d2e (Fix segmentation fault when
changing colors, 2017-07-28) for details.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2018-05-10 14:05:43 +02:00
Lukas Fleischer b82a3b9276 Allow for passing negative arguments to -d
When specifying date ranges using -d, allow for passing negative values
to indicate that the date range should start a certain number of days
ago.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-12-13 09:06:32 +01:00
Lukas Fleischer edc44d613b calcurse-caldav: Avoid corrupting the sync DB
When importing an iCal event via calcurse fails (i.e. does not return a
single object hash), do not write anything to the synchronization
database instead of blindly appending the entry, thereby potentially
corrupting the database.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-11-23 08:57:45 +01:00
Lukas Fleischer 16e7aecd29 Do not prompt when non-interactive import fails
When running calcurse in non-interactive mode, we should not expect any
user input. This is even more important in the case of iCal imports
which are used by calcurse-caldav to import events from CalDAV servers.

Partly fixes GitHub issue #73.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-11-23 08:57:45 +01:00
Lukas Fleischer 5b94be2246 Revert "calcurse-caldav: Add --password command line argument"
This reverts commit efd76a0d99.

Passing passwords as command line arguments is not a good idea, since
they may appear in process listings which are potentially visible to
other users logged into the system.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-11-08 21:54:53 +01:00
Lukas Fleischer 8b92fde3a3 Release 4.3.0
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-11-02 08:42:52 +01:00
Lukas Fleischer 2fc161f4d2 po/: Translation updates from Transifex
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-11-02 08:42:52 +01:00
Lukas Fleischer 4dbb00c595 test/Makefile.am: Add missing data file to EXTRA_DIST
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-11-02 08:37:47 +01:00
Lukas Fleischer bf6ca4405a .travis.yml: Test under both Linux and OS X
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-10-29 08:42:03 +01:00
Lukas Fleischer e9bddf38e8 Parse time before date in parse_datetime()
Make sure that in cases when the date and time formats conflict, such as
is the case with "0030", the input is interpreted as a time value, not a
date.

Suggested-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-10-27 08:40:10 +02:00
Lukas Fleischer 301f240881 Make parsing of date-time more strict
In parse_datetime() it was possible to enter any number of dates and
times in any order. Allow just date or time or date followed by time.

Time must be looked for before date because of conflicting time and date
formats.

Suggested-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-10-26 20:49:30 +02:00
Lukas Fleischer 760c297027 Add parse_date_interactive()
Add a wrapper around parse_date() which picks the current input date
format as well as the currently selected day and passes both values to
parse_date(), alongside with the parameters passed to
parse_date_interactive() itself.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-10-26 20:49:30 +02:00
Lukas Fleischer eddee590ec Replace NEWS by CHANGES.md
Use Markdown syntax for the release notes and rename the release notes
file from NEWS to CHANGES.md.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-10-26 16:02:08 +02:00
Lukas Fleischer 8ee78c14af Add calcurse-dateutil
Add a script to iterate over a certain date range, performing operations
on each of the dates and printing the result. An additional string can
be appended to each of the printed lines.

The script can be used to create "extended recurrent events". For
example

    ./calcurse-dateutil.py --date 2017-01-01 --range 365 --unique \
        --append ' [1] Test event' bom next-weekday 3 skip-days 14

can be used to print an event for each third Thursday of each month in
2017.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 22:35:36 +02:00
Lukas Fleischer 8ab3106f6b git-version-gen: Add default version
Instead of bailing out early in the build process when neither a version
file nor a valid Git repository is detected, use a hardcoded default
version string. This fixes building from shallow clones or Git
snapshots.

Also fixes GitHub issue #22.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 22:35:36 +02:00
Lukas Fleischer 2fe9c7efce Reload data after resolving save conflict
After resolving a save conflict with the merge tool, we need to reload
the data files to import the result of the conflict resolution.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:23:25 +02:00
Lukas Fleischer e943a8a4db Unset modification flag after merging
Turn off the local modification flag to avoid a bogus warning when
reloading the data files immediately after the merge process.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:22:22 +02:00
Lukas Fleischer f69698569f Recompute hashes after saving
After saving the data files, we need to recompute and store the hashes
to make sure the updated contents is reflected.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:21:45 +02:00
Lukas Fleischer 380124c7a2 Factor out hash computation
Move code to compute the hash of a data file to a separate function.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:21:11 +02:00
Lukas Fleischer 7a0134204e Use a shared input/output mutex
Replace the save mutex with a common mutex, which is locked whenever
read or write operations on the data files are performed. Also, since
this mutex is an implementation detail, mark the locking functions
static and remove them from the header file.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:08:54 +02:00
Lukas Fleischer 0f3d1988bf Interrupt periodic save when launching process
To avoid interactions between the periodic save thread and external
processes, stop the periodic save thread before launching an external
program and restart the thread as soon as the program is terminated.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:08:54 +02:00
Lukas Fleischer 57dd3d6b66 Only reload if data files were changed
Instead of blindly reloading data in io_reload_data(), compare the
stored hashes of the data files with hashes of the current file contents
and only reload if any of the hashes differs.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:08:54 +02:00
Lukas Fleischer ba85d9b6f5 Factor out check for external modifications
Move the check to compare the stored hashes of the data files with the
current hash to a separate function. This makes the code easier to read
and reusable.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:08:54 +02:00
Lukas Fleischer 9137590e7a Do not blindly overwrite files when saving
When reading the data files, compute a cryptographic hash of the file
contents and store it. When saving the files later, ensure that the hash
still matches the current file contents. If it does not, show a warning
to the user and ask whether she wants to execute the merge tool.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:08:53 +02:00
Lukas Fleischer fb1524b4e2 Use .new as file extension when merging
Using the file name extension .sav and naming the variables "backup" is
slightly misleading, since the affected files actually contain the
updated content and not some old snapshot. Use the term "new" instead.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:08:53 +02:00
Lukas Fleischer e5a824e576 Factor out merge routine
Move the code, which runs the merge tool with current and updated data
files, to a separate function to make it reusable.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:08:53 +02:00
Lukas Fleischer 74d90e7cbc Add CALCURSE_{EDITOR,PAGER,MERGETOOL} environment variables
Support environment variables specific to calcurse to override $EDITOR,
$PAGER and $MERGETOOL.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-08 21:08:53 +02:00
Lukas Fleischer 2e584f03e6 Replace remaining uses of wgetch() by keys_wgetch()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-03 16:37:35 +02:00
Lukas Fleischer 53f0f1d2e3 Add a function to wait for any key press
Introduce a new function keys_wait_for_any_key() and use it instead of
wgetch() whenever the return value is discarded.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-03 16:37:35 +02:00
Lukas Fleischer 8373ecfe51 Improve default selection when editing key bindings
When adding a new key binding, automatically select the new binding.
When removing a key binding, keep the selection index (unless the last
binding of a row is removed).

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-03 15:51:01 +02:00
Lukas Fleischer 6521d8cc0a Use strncpy() properly in general_option_edit()
Always use strncpy() to copy strings between fixed-size buffers and pass
the buffer size as maximal length parameter.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-09-03 09:31:33 +02:00
Lukas Fleischer 578091f051 Add support for UTF-8 key bindings
A new function keys_wgetch() reads full UTF-8 characters instead of
single ASCII characters only.

Key bindings for regular ASCII characters are stored in a hash map while
the actions of keys with higher code points are stored in a linked list
for space efficiency.

The key serialization methods are updated to handle UTF-8 characters as
well; extended UTF-8 characters (characters not in the ASCII range) are
serialized by using the hexadecimal representation of the corresponding
code points (e.g. "U+00E4").

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-30 16:39:23 +02:00
Lukas Fleischer 8544e4a570 Rename keys_getch() to keys_get()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-30 16:26:10 +02:00
Lukas Fleischer 273e32d43d Factor out UTF-8 code point decoding
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-30 16:17:28 +02:00
Lukas Fleischer 6cb26c2f27 Relocate HANDLE_KEY macros
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-30 16:15:39 +02:00
Lukas Fleischer fad4a5f4e0 Add basic Travis CI support
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-28 07:30:38 +02:00
Lukas Fleischer bebc46fb63 Rename README to README.md
Make sure that the Markdown syntax already used in the README file is
recognized by repository browsers such as cgit or GitHub.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-28 07:30:38 +02:00
Lukas Fleischer 550a2e9379 Extend strings API for formatted dates
Add two new functions string_catftime(), resp. string_strftime(), which
can be used to append, resp. print, a formatted date to a dynamic
string.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-28 07:30:38 +02:00
Lukas Fleischer 8d85a58a26 ical-002: Fix broken test
In the expected output, the punctual appointment (lasting one second in
the iCal data) was missing. The test was not failing because calcurse
did not print the missing item due to a bug. This bug was fixed by
7924315 (Fix support for punctual appointments at 00:00, 2017-08-28),
making the test case fail. Fix the test case as well such that
everything behaves as expected again.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-28 07:30:15 +02:00
Lukas Fleischer 7924315bfb Fix support for punctual appointments at 00:00
When checking whether an appointment belongs to a given day in
apoint_inday(), the return value was 0 if the end time of the
appointment matched 00:00 on that day (because we do not want to include
appointments starting on the day before and lasting until midnight).
However, this means that punctual appointments at 00:00 were not
included in any day. Fix the apoint_inday() logic to take this into
consideration.

Fixes GitHub issue #39.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-28 07:06:06 +02:00
Lukas Fleischer e76b96c9ff calcurse-caldav: Specify depth in the initial request
For the initial calendar-query request, set the Depth header to 1. This
is required because according to RFC 4791, the depth value defaults to 0
if no header is specified.

Fixes GitHub issue #38.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-08-28 06:42:53 +02:00
Lukas Fleischer 43cd40e8ce Include stdarg.h when using variable argument lists
Fixes GitHub issue #36.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-07-28 16:09:43 +02:00
Lukas Fleischer 5722d2ea4c Fix segmentation fault when changing colors
The pair_content() function can be used to retrieve a color pair. The
foreground and the background color numbers are written to addresses
specified by the second and third parameters. While both parameters were
optional in older ncurses implementations (making it possible to pass
NULL pointers if the one does not care about either foreground or
background color), recent implementations seem to assume that both
parameters are valid pointers. Thus, instead of passing NULL, we need to
pass a pointer to a dummy variable when we do not care about the
background color.

Partly fixes GitHub issue #31.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-07-28 16:02:46 +02:00
Lukas Fleischer 5aa7a0962a Fix another error in the notification code
In addition to checking whether a recurrent item predates the current
next appointment, we need to check that the actual occurrence of the
item predates the current appointment as well.

Fixes GitHub issue #26.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-02-11 11:50:51 +01:00
Lukas Fleischer 2084f353e3 Fix notification of recurrent appointments
The recur_apoint_starts_before() filter function expected the second
parameter to be passed by value, whereas its only caller passed the
value by reference. For consistency with apoint_starts_after(), change
the signature and the implementation of recur_apoint_starts_before()
such that the parameter is passed by reference.

Also, add a comment to the only caller of recur_apoint_starts_before()
to clarify on why recur_apoint_starts_before() is used.

Fixes GitHub issue #25.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-02-09 08:43:32 +01:00
Lukas Fleischer ed6035afb1 Do not read past NUL character in ical_get_value()
Make sure we never read beyond the end of the buffer, even if the
terminating quote of a quoted string is missing.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-02-08 07:32:35 +01:00
Lukas Fleischer e4e2e0eb20 Gracefully parse iCal parameters with colons
According to RFC 5545, iCalendar content lines can have optional
parameters, which can be quoted strings containing colons (":"). Make
sure that such colons are not interpreted as delimiters marking the
start of the value string.

Also, add a test case that covers this corner case.

Reported-by: Håkan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-02-07 21:54:05 +01:00
Lukas Fleischer 3375fddb4e Release 4.2.2
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-01-14 14:09:46 +01:00
Lukas Fleischer 9f6678bc49 Update copyright ranges
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2017-01-12 08:40:30 +01:00
Lukas Fleischer e2086c426c calcurse-caldav: Use right diffs when synchronizing
Some parameters where swapped accidentally when reworking the diff
computation in c8d3d87 (calcurse-caldav: Compute diffs before
synchronizing, 2016-12-13) such that the synchronization functions were
working with incorrect diffs since that commit. Exchange the parameters
again to fix this.

Reported-by: Guillaume Laurès <guillaume@lauresfamily.fr>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-15 18:41:24 +01:00
Lukas Fleischer 6a80e156dd calcurse-caldav: Fix scrambled comment
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-13 18:47:38 +01:00
Lukas Fleischer c8d3d87c84 calcurse-caldav: Compute diffs before synchronizing
Instead of computing the objects to push/pull on-demand, use a snapshot
of the synchronization database taken before the synchronization process
starts.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-13 18:32:12 +01:00