Benedikt Heine
cb16fe9d96
Fix DoS in notification_format_message
...
When using a format with a trailing % character, dunst ends in an
endless loop, searching for a % char, while pointing exactly with the
haystack on the % character.
Increasing the substring pointer will shift the pointer forwards onto
the actual NULL character and stop the loop.
2018-11-24 15:22:18 +01:00
Jordan Galby
d879d70da0
Implement stack_tag, implementing x-canonical-private-synchronous
...
Implements "x-dunst-stack-tag", "x-canonical-private-synchronous",
"private-synchronous", and "synchronous" hints via the "stack_tag" feature.
2018-11-10 14:59:32 +01:00
Nikos Tsipinakis
f12f1094ed
Merge pull request #550 from bebehei/misc
...
Misc patches
2018-10-10 17:59:30 +03:00
Benedikt Heine
c0e2a2a7e3
Move all strcmp operations to STR*EQ macros
2018-10-09 10:08:17 +02:00
Benedikt Heine
52c47524f2
Test notification referencing
2018-10-08 18:27:11 +02:00
Benedikt Heine
1f4cd4bd15
Use STR_(EMPTY|FULL) for string emptyness checks
2018-10-08 17:38:00 +02:00
Benedikt Heine
da846d8442
Do not count longer than necessary
...
And also use g_strndup. This makes allocation easier and also ensures a
null-byte at the end of the string.
2018-10-08 17:38:00 +02:00
Benedikt Heine
974bcb776e
Remember if the notification is living on a valid connection
...
The notification spec says, that a notification gets invalidated when
closed. So the client won't listen anymore to ActionInvoked signals and
won't listen to NotificationClosed signals.
Remembering the actual status of the notification helps the standard and
makes the behavior clearer.
2018-10-06 13:44:01 +02:00
Benedikt Heine
837b4fe125
Implement refcounting for notifications
2018-10-06 13:43:49 +02:00
Benedikt Heine
c5d552856f
Reformat icon_position enum
2018-09-16 02:58:35 +02:00
Benedikt Heine
bbbddad3a7
Use structs for notifications
2018-09-16 02:58:31 +02:00
Benedikt Heine
de0f0bf3d9
Pack type RawImage into raw_image struct
2018-09-16 02:58:26 +02:00
Benedikt Heine
8010f83286
Pack Actions type into struct actions
2018-09-16 02:58:23 +02:00
Benedikt Heine
c692d222d7
Save the notification's scriptrun in script_run field
2018-09-13 11:14:33 +02:00
Benedikt Heine
646d037b15
Make NULL a valid input for notification_free
2018-07-10 13:23:12 +02:00
Benedikt Heine
54ce81ccca
Convert notification.[ch] into docstrings
2018-07-10 13:23:12 +02:00
Benedikt Heine
f4fb95c827
Do not make explicit NULL checks on elements
...
Most of the NULL checks are actually doubly false logic. Turning the
logic around and removing the NULL check makes the program easier to
read.
2018-07-10 13:23:12 +02:00
Benedikt Heine
7187290536
Turn read only fields into const
2018-07-10 13:23:05 +02:00
Benedikt Heine
b5fbfd0e65
Print progress in notification_print
2018-07-07 11:55:06 +02:00
Benedikt Heine
e091dd4d15
Notification comparison done right
2018-07-07 11:51:14 +02:00
Benedikt Heine
1d58d2ec87
Canonify invalid enum values handling
2018-05-14 09:31:53 +03:00
Nikos Tsipinakis
8547be20d7
Merge pull request #503 from bebehei/escape-summary
...
Escape the summary
2018-03-20 15:32:18 +02:00
Benedikt Heine
ac4a0becd2
Count monotonic time with Linux specific clocks
...
On Linux, CLOCK_MONOTONIC has got a bug. It does not count
onwards during sleep, albeit required by POSIX. This behavior
is reasoned with the requirement for poll().
Also the GLib people are sticking to this behavior in their
g_get_monotonic_time() function.
So we have to use a drop in replacement, which respects CLOCK_BOOTTIME
on Linux, as this is the clock, what would be CLOCK_MONOTONIC on POSIX
systems.
2018-03-20 14:17:03 +01:00
Benedikt Heine
80d8c40791
Escape the summary
...
According to the notification spec, only the body shall contain markup.
Therefore HTML symbols should get escaped in the summary, too.
2018-03-20 01:51:18 +01:00
Benedikt Heine
aa5cc977cc
Add pushback mode
2018-02-25 20:18:40 +01:00
Benedikt Heine
0f46564e97
Print fullscreen value of notification
2018-02-25 20:18:40 +01:00
Benedikt Heine
bda8c1dbb2
Add rule to show notification on fullscreen
2018-02-25 20:18:40 +01:00
Benedikt Heine
58dc09b415
Replace PERR macro with appropriate logging macro
2018-02-02 17:29:04 +01:00
Benedikt Heine
19b364d67c
Translate fprintf statements into log messages
2018-02-02 17:29:04 +01:00
Nikos Tsipinakis
337d0a9cd1
Raise the maximum value of the progress hint
...
The progress hint is mostly used for progress bars but as discussed in
#437 there are cases where values > 100 make sense.
Fixes #437
2018-01-05 21:55:15 +02:00
Benedikt Heine
35dbd00611
Merge pull request #428 from bebehei/refactor-notification_init
...
Refactor notification init
2017-12-18 00:55:59 +01:00
Benedikt Heine
aae73d888e
Show multiple URLs pretty with print
2017-12-15 00:16:31 +01:00
Benedikt Heine
b97a49c09b
Fix memory leak colors given via hints
...
The hints given via DBus are not constants. Therefore the color fields
have to get freed during notification cleanup. As it's not possible to
disinguish, which field is constant, we have to duplicate the settings
on assignment.
2017-12-15 00:16:31 +01:00
Benedikt Heine
acd8be51ab
Remove a and img tags from msg
...
While the notification spec allows tags like <a href="...">...</a> and
<img src="..." alt="...">, pango cannot parse these tags and therefore
these tags should be removed before passed to pango.
Also the method notification_extract_markup_urls is not needed anymore,
as markup_strip_a can return URLs optionally.
This implies, that URL replacement is now indicated via show_indicators
for URLs and the dmenu string is in the format of
'[text between a tags] URL\n'. This is similarly handled for images,
too.
2017-12-15 00:16:31 +01:00
Nikos Tsipinakis
ff6f3e496c
Prefix signal functions with signal_
...
Make dbus function that emit a signal easier to distinguish by prefixing
them with 'signal_'.
2017-12-09 17:03:56 +02:00
Benedikt Heine
4bfae81f18
Split and refactor notification_init
...
Unboil the spaghetti code and split it into separate methods.
2017-12-04 20:27:33 +01:00
Benedikt Heine
eae071f330
Rename color_strings to colors
...
This is an antipattern and makes linelength increase for nothing
2017-11-25 10:58:25 +01:00
Benedikt Heine
0ad63d2c2c
Don't indent switch labels
2017-11-25 02:16:45 +01:00
Benedikt Heine
5b2a6e57b7
curly braces style
...
Curly braces should start on a new line, after a method declaration, but
should continue on the same line after a control structure.
2017-11-25 02:15:30 +01:00
Benedikt Heine
bd8fd8b1d2
Improve whitespace handling
2017-11-25 01:38:28 +01:00
Benedikt Heine
fc4f0a4238
Refactor arguments into one line
...
Parameters should not cover an area. All arguments should be on a single
line (either horizontally or vertically).
2017-11-25 01:32:06 +01:00
Benedikt Heine
caa63d6275
Sort includes alphabetically
2017-11-25 01:28:03 +01:00
Benedikt Heine
823665a3bd
Sanitize negative urgency correctly
2017-11-21 16:19:40 +01:00
Benedikt Heine
5f51147263
Prefix urgency enum with URG_
2017-11-16 17:12:30 +01:00
Benedikt Heine
d91053c85e
Use enum for urgency
2017-11-16 17:10:28 +01:00
Nikos Tsipinakis
76857b6e7c
Merge pull request #423 from bebehei/optimize_icons
...
Optimize icons
2017-11-02 07:54:41 +02:00
Benedikt Heine
11af7402fa
Use '-1' for undefined progress
2017-10-31 15:58:41 +01:00
Benedikt Heine
b571698f52
Free Actions in separate method
...
Also free the memory of the actual Action.
2017-10-31 12:49:19 +01:00
Benedikt Heine
13ed6301d8
Add separate function to free RawImage
2017-10-31 12:49:07 +01:00
Benedikt Heine
b57483416e
Remove command handling from notification_init
2017-10-29 20:38:40 +01:00