Merge lp:~jonas-drange/account-polld/lp1570415 into lp:~ubuntu-push-hackers/account-polld/trunk

Proposed by Jonas G. Drange
Status: Merged
Approved by: Bill Filler
Approved revision: 162
Merged at revision: 158
Proposed branch: lp:~jonas-drange/account-polld/lp1570415
Merge into: lp:~ubuntu-push-hackers/account-polld/trunk
Diff against target: 25 lines (+8/-1)
1 file modified
cmd/account-polld/main.go (+8/-1)
To merge this branch: bzr merge lp:~jonas-drange/account-polld/lp1570415
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+292274@code.launchpad.net

Commit message

Emit haptic and audible feedback only on the first notification in a batch of notifications.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested, works for case if # rec messages < batch limit. But think there is a related condition that is not covered. If we recv > batchlimit # of messages, the notification shows "20 new messages" but seems we get two sets of vibrations. Guessing first one is for the message 0 and the next one is for the batch notification? In this case we should only vibrate once on the batch notification

review: Needs Fixing
160. By Jonas G. Drange

fix case #2 and lower notf limit

161. By Jonas G. Drange

tweak params for vibrate

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
162. By Jonas G. Drange

revert limit

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested, works in both cases now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmd/account-polld/main.go'
2--- cmd/account-polld/main.go 2015-12-19 19:54:01 +0000
3+++ cmd/account-polld/main.go 2016-04-20 11:10:28 +0000
4@@ -175,7 +175,13 @@
5 notifs := batch.Messages
6 overflowing := len(notifs) > batch.Limit
7
8- for _, n := range notifs {
9+ for i, n := range notifs {
10+ // Play sound and vibrate on first notif only.
11+ if i > 0 {
12+ n.Notification.Vibrate = false
13+ n.Notification.Sound = ""
14+ }
15+
16 // We're overflowing, so no popups.
17 // See LP: #1527171
18 if overflowing {
19@@ -186,6 +192,7 @@
20 if overflowing {
21 n := batch.OverflowHandler(notifs)
22 n.Notification.Card.Persist = false
23+ n.Notification.Vibrate = false
24 notifs = append(notifs, n)
25 }
26

Subscribers

People subscribed via source and target branches