From 79774d694b7f9a7d5f844a063e67f4ae07227c5f Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 10:47:32 -0800 Subject: [PATCH 01/12] added support for notification sounds with Pushover API --- push.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/push.cpp b/push.cpp index 64015c0..77fc0db 100644 --- a/push.cpp +++ b/push.cpp @@ -109,6 +109,7 @@ class CPushMod : public CModule defaults["username"] = ""; defaults["secret"] = ""; defaults["target"] = ""; + defaults["sound"] = ""; // Condition strings defaults["channel_conditions"] = "all"; @@ -312,6 +313,11 @@ class CPushMod : public CModule { params["device"] = options["target"]; } + + if ( options["sound"] != "" ) + { + params["sound"] = options["sound"]; + } } else if (service == "prowl") { From 480ee7baa873ebcb38585f653b5810d550da915b Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 11:02:42 -0800 Subject: [PATCH 02/12] changed "sound" option name to the more specific "message_sound" name --- push.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/push.cpp b/push.cpp index 77fc0db..c9b008b 100644 --- a/push.cpp +++ b/push.cpp @@ -109,7 +109,7 @@ class CPushMod : public CModule defaults["username"] = ""; defaults["secret"] = ""; defaults["target"] = ""; - defaults["sound"] = ""; + defaults["message_sound"] = ""; // Condition strings defaults["channel_conditions"] = "all"; @@ -314,9 +314,9 @@ class CPushMod : public CModule params["device"] = options["target"]; } - if ( options["sound"] != "" ) + if ( options["message_sound"] != "" ) { - params["sound"] = options["sound"]; + params["sound"] = options["message_sound"]; } } else if (service == "prowl") From 9a3bb732c29eb79402c8818dd1b55c5b9a36172c Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 11:08:45 -0800 Subject: [PATCH 03/12] adding documentation for Pushover's sound support in README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7db1885..7d48bf0 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Copy the compiled module into your ZNC profile: Now, load the module in ZNC: - /msg *status loadmod push + /msg *status loadmod push Then select the push service you want to use, and set your username and secret as needed. The secret is not your password, and can be obtained by logging into the service's website @@ -76,6 +76,7 @@ At this point, it should start sending notifications every time you get a privat or someone says your name in a channel. If this is everything you wanted, congratulations, you're done! +* Sound option is only available for Pushover.net API Migrating From Notifo --------------------- @@ -322,6 +323,10 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or Message content that will be sent for the push notification. Keyword expansion is performed on this value. +* `message_sound = {sound}` + + If you're using the Pushover.net API, you can specify a specific sound for the notification: + https://pushover.net/api#sounds ### Advanced From c6b60892ef76d34b8463e784f177804952b2a58f Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 11:11:57 -0800 Subject: [PATCH 04/12] tweaked README for a more exclipit description of the loadmod function --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d48bf0..280d1f0 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Copy the compiled module into your ZNC profile: Now, load the module in ZNC: - /msg *status loadmod push + /msg *status loadmod push Then select the push service you want to use, and set your username and secret as needed. The secret is not your password, and can be obtained by logging into the service's website @@ -76,6 +76,11 @@ At this point, it should start sending notifications every time you get a privat or someone says your name in a channel. If this is everything you wanted, congratulations, you're done! + +You can also load the module with options: + + /msg *status loadmod push + * Sound option is only available for Pushover.net API Migrating From Notifo From e7443d63928408c3199776d6e91d64f6abcbf690 Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 11:14:54 -0800 Subject: [PATCH 05/12] updated wording for footnote --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 280d1f0..57c8e00 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,11 @@ you're done! You can also load the module with options: - /msg *status loadmod push + /msg *status loadmod push -* Sound option is only available for Pushover.net API +Note: Sound option is only available for Pushover.net API. Also, for some services, there is +no username, in that case you can replace with the secret and replace +with "null" minus the quotes. Migrating From Notifo --------------------- From a7f852f3da5544e5311e92d7b172445d8911c4c1 Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 11:16:52 -0800 Subject: [PATCH 06/12] tweaked format --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 57c8e00..57909b5 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,8 @@ You can also load the module with options: /msg *status loadmod push Note: Sound option is only available for Pushover.net API. Also, for some services, there is -no username, in that case you can replace with the secret and replace -with "null" minus the quotes. +no username, in that case you can replace <username> with the secret and replace <secret> +with null. Migrating From Notifo --------------------- From 287028336949305d062ccc2b9827ca1920f159f5 Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 11:18:52 -0800 Subject: [PATCH 07/12] added more formatting changes --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 57909b5..57ac3c0 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ You can also load the module with options: /msg *status loadmod push -Note: Sound option is only available for Pushover.net API. Also, for some services, there is +Note: The option is only available for Pushover.net API. Also, for some services, there is no username, in that case you can replace <username> with the secret and replace <secret> with null. @@ -332,8 +332,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or * `message_sound = {sound}` - If you're using the Pushover.net API, you can specify a specific sound for the notification: - https://pushover.net/api#sounds + If you're using the Pushover.net API, you can specify a specific sound for the notifications. ### Advanced From 28908b6eb6b8af26bff89fae0328545e6e034684 Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 11:19:49 -0800 Subject: [PATCH 08/12] more formatting tweaks --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57ac3c0..cd82709 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ You can also load the module with options: /msg *status loadmod push -Note: The option is only available for Pushover.net API. Also, for some services, there is +Note: The <sound> option is only available for Pushover.net API. Also, for some services, there is no username, in that case you can replace <username> with the secret and replace <secret> with null. From a021d5501081eb5bd8c42ccc5327d6c94df1d7dd Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 12:23:48 -0800 Subject: [PATCH 09/12] reordered notification settings for default options so that user's can set message_sound and message_uri on module load --- README.md | 4 ++-- push.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cd82709..15e2e36 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ you're done! You can also load the module with options: - /msg *status loadmod push + /msg *status loadmod push -Note: The <sound> option is only available for Pushover.net API. Also, for some services, there is +Note: The <message_sound> option is only available for Pushover.net API. Also, for some services, there is no username, in that case you can replace <username> with the secret and replace <secret> with null. diff --git a/push.cpp b/push.cpp index c9b008b..6176d6b 100644 --- a/push.cpp +++ b/push.cpp @@ -109,7 +109,13 @@ class CPushMod : public CModule defaults["username"] = ""; defaults["secret"] = ""; defaults["target"] = ""; + + // Notification settings defaults["message_sound"] = ""; + defaults["message_uri"] = ""; + defaults["message_length"] = "100"; + defaults["message_title"] = "{title}"; + defaults["message_content"] = "{message}"; // Condition strings defaults["channel_conditions"] = "all"; @@ -125,12 +131,6 @@ class CPushMod : public CModule defaults["nick_blacklist"] = ""; defaults["replied"] = "yes"; - // Notification settings - defaults["message_length"] = "100"; - defaults["message_uri"] = ""; - defaults["message_title"] = "{title}"; - defaults["message_content"] = "{message}"; - defaults["debug"] = "off"; } virtual ~CPushMod() {} From 98d422c8545bc1b8ed1057eb40afab8bb7cc8857 Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 12:25:57 -0800 Subject: [PATCH 10/12] re-ordered notifications settings doc --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 15e2e36..9ec9567 100644 --- a/README.md +++ b/README.md @@ -304,11 +304,9 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or ### Notifications -* `message_length = 100` +* `message_sound = {sound}` - 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. + If you're using the Pushover.net API, you can specify a specific sound for the notifications. * `message_uri = ""` @@ -316,6 +314,12 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or 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. @@ -330,10 +334,6 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or Message content that will be sent for the push notification. Keyword expansion is performed on this value. -* `message_sound = {sound}` - - If you're using the Pushover.net API, you can specify a specific sound for the notifications. - ### Advanced * `channel_conditions = "all"` From 9182bfdb968285db8a32cbc91f816ee596ba4d98 Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 12:30:28 -0800 Subject: [PATCH 11/12] reorganized configuration section of docs and default options of module. docs and default options should now be properly aligned. --- README.md | 65 ++++++++++++++++++++++++++++--------------------------- push.cpp | 7 +++--- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 9ec9567..b98d326 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,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 + +* `message_sound = ""` + + If you're using the Pushover.net API, you can specify a specific sound 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 * `away_only = "no"` @@ -302,38 +335,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. -### Notifications - -* `message_sound = {sound}` - - If you're using the Pushover.net API, you can specify a specific sound 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. - ### Advanced * `channel_conditions = "all"` diff --git a/push.cpp b/push.cpp index 6176d6b..79e71cf 100644 --- a/push.cpp +++ b/push.cpp @@ -117,10 +117,6 @@ class CPushMod : public CModule defaults["message_title"] = "{title}"; defaults["message_content"] = "{message}"; - // Condition strings - defaults["channel_conditions"] = "all"; - defaults["query_conditions"] = "all"; - // Notification conditions defaults["away_only"] = "no"; defaults["client_count_less_than"] = "0"; @@ -131,6 +127,9 @@ class CPushMod : public CModule defaults["nick_blacklist"] = ""; defaults["replied"] = "yes"; + // Advanced + defaults["channel_conditions"] = "all"; + defaults["query_conditions"] = "all"; defaults["debug"] = "off"; } virtual ~CPushMod() {} From 5f41d4a3d308261a81275a87414e666380f5ebb5 Mon Sep 17 00:00:00 2001 From: Ming Tang Date: Fri, 1 Mar 2013 13:06:45 -0800 Subject: [PATCH 12/12] Removed section about loadmodule defaults --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index b98d326..778302f 100644 --- a/README.md +++ b/README.md @@ -77,14 +77,6 @@ or someone says your name in a channel. If this is everything you wanted, congr you're done! -You can also load the module with options: - - /msg *status loadmod push - -Note: The <message_sound> option is only available for Pushover.net API. Also, for some services, there is -no username, in that case you can replace <username> with the secret and replace <secret> -with null. - Migrating From Notifo ---------------------