To maintain compatibility with ZNC < 0.090 (such as 0.078 used by
Ubuntu), we need to conditionally disable the away_only condition when
compiled against versions that don't support CUser->IsIRCAway().
Time in seconds since the last activity by the user on any channel or query
window, including joins, parts, messages, and actions. Notifications will
only be sent if the elapsed time is greater than this value. A value of
0 (zero) will disable this condition.
Time in seconds since the last message sent by the user on that channel or
query window. Notifications will only be sent if the elapsed time is greater
than this value. A value of 0 (zero) will disable this condition.
Note that this condition keeps track of the last message sent to each channel
and query window separately, so a recent PM to Joe will not affect a
notification sent from channel #foo.
Space-separated list of nicks. Applies to both channel mentions and
query windows. Notifications will only be sent for messages from nicks
that are not present in this list, using a case-insensitive comparison.
Note that wildcard patterns can be used to match multiple nicks with
a single blacklist entry. For example, `set nick_blacklist *bot` will
not send notifications from nicks like "channelbot", "FooBot", or
"Robot". Care must be used to not accidentally blacklist legitimate
nicks with wildcards.
In preparation for nick_blacklist, which needs to allow input of a
space-separated list of nicks to ignore, the SET command shouldn't be
requirement an exact number of tokens. Any tokens past the first three
should be included in the option's new value, such that a command like
"set nick_blacklist nick1 nick2 nick3" will be accepted.
Time in seconds since the last notification sent from that channel or query
window. Notifications will only be sent if the elapsed time is greater than
this value. A value of 0 (zero) will disable this condition.
Note that this condition keeps track of the last notification sent from each
channel and query window separately, so a recent PM from Joe will not affect a
notification sent from channel #foo.
Config option client_count_less_than (uint) determines if notifications
will be sent based on how many IRC clients are connected to ZNC. A
value of zero disables this condition (always met), otherwise only sends
notifications if the number of connected clients is less than the
configured threshold.
Personal use case is client_count_less_than = 2, in that I always have
Irssi connected from my server, but if also connected from my phone, I
don't want duplicate notifications.
In order to better abstract and handle the difference between messages
and actions, notify_pm() is changed to only determine whether a private
message or action should send a notification to the user, and leave
sending the notification to the calling method. This allows PM's and
PA's to have different notification text formats, while still
centralizing the logic to decide when to send them.
TODO: Make notify_pm() actually use logic instead of blindly saying yes.
Rather than re-encoding the auth string for every message, factored it into a
separate method that only gets called when the username or password is changed,
or the plugin is loaded/reloaded.
User can set and retrieve config values for their Notifo account name
and API secret. The SEND command allows the user to send an arbitrary
notification to their account.
Fixed issue with encoding credentials in request headers.
Tested against official API and notification succeeded.
Currently the plugin waits for any command to be sent to *notifo, at
which point it triggers a canned HTTP request to a test URL. This
canned request will be replaced soon with a proper, authenticated
request to the official Notifo service URL.