~ci-train-bot/account-polld/account-polld-ubuntu-yakkety-landing-054

« back to all changes in this revision

Viewing changes to cmd/account-polld/main.go

  • Committer: CI Train Bot
  • Author(s): jonas-drange
  • Date: 2016-04-20 11:25:32 UTC
  • mfrom: (157.1.5 lp1570415)
  • Revision ID: ci-train-bot@canonical.com-20160420112532-6s1825hwnciiq004
Emit haptic and audible feedback only on the first notification in a batch of notifications. Fixes: #1570415
Approved by: PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
                        notifs := batch.Messages
176
176
                        overflowing := len(notifs) > batch.Limit
177
177
 
178
 
                        for _, n := range notifs {
 
178
                        for i, n := range notifs {
 
179
                                // Play sound and vibrate on first notif only.
 
180
                                if i > 0 {
 
181
                                        n.Notification.Vibrate = false
 
182
                                        n.Notification.Sound = ""
 
183
                                }
 
184
 
179
185
                                // We're overflowing, so no popups.
180
186
                                // See LP: #1527171
181
187
                                if overflowing {
186
192
                        if overflowing {
187
193
                                n := batch.OverflowHandler(notifs)
188
194
                                n.Notification.Card.Persist = false
 
195
                                n.Notification.Vibrate = false
189
196
                                notifs = append(notifs, n)
190
197
                        }
191
198