diff --git a/lib/naughty/notification.lua b/lib/naughty/notification.lua index 4e602a523..860eec08c 100644 --- a/lib/naughty/notification.lua +++ b/lib/naughty/notification.lua @@ -570,6 +570,27 @@ function notification:set_timeout(timeout) self:emit_signal("property::timeout", timeout) end +function notification:get_message() + -- This property was called "text" in older versions. + -- Some modules like `lain` abused of the presets (they + -- had little choice at the time) to set the message on + -- an existing popup. + local p = rawget(self, "preset") or {} + local message = self._private.message or p.message or "" + + if message == "" and p.text and p.text ~= "" then + gdebug.deprecate( + "Using the preset configuration to set the notification ".. + "message is not supported. Please use `n.message = 'text'`.", + {deprecated_in=5} + ) + + return p.text + end + + return message +end + function notification:set_text(txt) gdebug.deprecate( "The `text` attribute is deprecated, use `message`",