Merge pull request #32 from mingtang/master

Pushover Sound Support
This commit is contained in:
John Reese 2013-03-01 13:16:41 -08:00
commit dae170524c
2 changed files with 47 additions and 38 deletions

View File

@ -212,6 +212,39 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
notifications to; if blank or unset, notifications will be sent to all devices. notifications to; if blank or unset, notifications will be sent to all devices.
### Notifications
* `message_sound = ""`
If you're using the Pushover.net API, you can specify a <a href="https://pushover.net/api#sounds">specific sound</a> for the notifications.
* `message_uri = ""`
URI that will be sent with the push notification. This could be a web address or a
local scheme to access a mobile application. Keyword expansion is performed on this
value.
* `message_length = 100`
Maximum length of the notification message to be sent. The message will be nicely
truncated and ellipsized at or before this length is reached. A value of 0 (zero) will
disable this option.
When using the custom URL service, this options allows you to specify the URL to send
a GET request to, and has keyword expansion performed on portions of it, including the
path and any query parameter values.
* `message_title = "{title}"`
Title that will be provided for the push notification. Keyword expansion is performed
on this value.
* `message_content = "{message}"`
Message content that will be sent for the push notification. Keyword expansion is
performed on this value.
### Conditions ### Conditions
* `away_only = "no"` * `away_only = "no"`
@ -294,35 +327,6 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
query window more recently than the last time a notification was sent for that context. query window more recently than the last time a notification was sent for that context.
### Notifications
* `message_length = 100`
Maximum length of the notification message to be sent. The message will be nicely
truncated and ellipsized at or before this length is reached. A value of 0 (zero) will
disable this option.
* `message_uri = ""`
URI that will be sent with the push notification. This could be a web address or a
local scheme to access a mobile application. Keyword expansion is performed on this
value.
When using the custom URL service, this options allows you to specify the URL to send
a GET request to, and has keyword expansion performed on portions of it, including the
path and any query parameter values.
* `message_title = "{title}"`
Title that will be provided for the push notification. Keyword expansion is performed
on this value.
* `message_content = "{message}"`
Message content that will be sent for the push notification. Keyword expansion is
performed on this value.
### Advanced ### Advanced
* `channel_conditions = "all"` * `channel_conditions = "all"`

View File

@ -110,9 +110,12 @@ class CPushMod : public CModule
defaults["secret"] = ""; defaults["secret"] = "";
defaults["target"] = ""; defaults["target"] = "";
// Condition strings // Notification settings
defaults["channel_conditions"] = "all"; defaults["message_sound"] = "";
defaults["query_conditions"] = "all"; defaults["message_uri"] = "";
defaults["message_length"] = "100";
defaults["message_title"] = "{title}";
defaults["message_content"] = "{message}";
// Notification conditions // Notification conditions
defaults["away_only"] = "no"; defaults["away_only"] = "no";
@ -124,12 +127,9 @@ class CPushMod : public CModule
defaults["nick_blacklist"] = ""; defaults["nick_blacklist"] = "";
defaults["replied"] = "yes"; defaults["replied"] = "yes";
// Notification settings // Advanced
defaults["message_length"] = "100"; defaults["channel_conditions"] = "all";
defaults["message_uri"] = ""; defaults["query_conditions"] = "all";
defaults["message_title"] = "{title}";
defaults["message_content"] = "{message}";
defaults["debug"] = "off"; defaults["debug"] = "off";
} }
virtual ~CPushMod() {} virtual ~CPushMod() {}
@ -312,6 +312,11 @@ class CPushMod : public CModule
{ {
params["device"] = options["target"]; params["device"] = options["target"];
} }
if ( options["message_sound"] != "" )
{
params["sound"] = options["message_sound"];
}
} }
else if (service == "prowl") else if (service == "prowl")
{ {