Merge lp:~artmello/ubuntu-push/ubuntu-push-remove_notification_list_check into lp:ubuntu-push

Proposed by Arthur Mello
Status: Needs review
Proposed branch: lp:~artmello/ubuntu-push/ubuntu-push-remove_notification_list_check
Merge into: lp:ubuntu-push
Diff against target: 79 lines (+0/-35)
2 files modified
click/cnotificationsettings/cnotificationsettings.go (+0/-27)
messaging/messaging.go (+0/-8)
To merge this branch: bzr merge lp:~artmello/ubuntu-push/ubuntu-push-remove_notification_list_check
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
Ubuntu Push Hackers Pending
Review via email: mp+301225@code.launchpad.net

Commit message

Do not check if application can use Notification list
Always display application notification to Notification List if notifications are enabled for that app

Description of the change

Do not check if application can use Notification list
Always display application notification to Notification List if notifications are enabled for that app

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
170. By Arthur Mello

Remove unused include

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

170. By Arthur Mello

Remove unused include

169. By Arthur Mello

Do not check if application can use Notification list
Always display application notification to Notification List if notifications are enabled for that app

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'click/cnotificationsettings/cnotificationsettings.go'
--- click/cnotificationsettings/cnotificationsettings.go 2016-07-08 17:05:38 +0000
+++ click/cnotificationsettings/cnotificationsettings.go 2016-07-27 01:08:17 +0000
@@ -33,7 +33,6 @@
33#define USE_SOUNDS_NOTIFICATIONS_KEY "use-sounds-notifications"33#define USE_SOUNDS_NOTIFICATIONS_KEY "use-sounds-notifications"
34#define USE_VIBRATIONS_NOTIFICATIONS_KEY "use-vibrations-notifications"34#define USE_VIBRATIONS_NOTIFICATIONS_KEY "use-vibrations-notifications"
35#define USE_BUBBLES_NOTIFICATIONS_KEY "use-bubbles-notifications"35#define USE_BUBBLES_NOTIFICATIONS_KEY "use-bubbles-notifications"
36#define USE_LIST_NOTIFICATIONS_KEY "use-list-notifications"
3736
38GSettings* get_settings() {37GSettings* get_settings() {
39 // Check if GSettings schema exists38 // Check if GSettings schema exists
@@ -153,23 +152,6 @@
153 g_object_unref(notificationSettings);152 g_object_unref(notificationSettings);
154 return bubblesNotify;153 return bubblesNotify;
155}154}
156
157int can_use_list_notify(const char *pkgname, const char *appname) {
158 GSettings *notificationSettings = NULL;
159 int listNotify = 0;
160
161 notificationSettings = get_settings_for_app(pkgname, appname);
162 if (!notificationSettings) {
163 return -1;
164 }
165
166 if (g_settings_get_boolean(notificationSettings, USE_LIST_NOTIFICATIONS_KEY)) {
167 listNotify = 1;
168 }
169
170 g_object_unref(notificationSettings);
171 return listNotify;
172}
173*/155*/
174import "C"156import "C"
175157
@@ -219,12 +201,3 @@
219 defer C.free(unsafe.Pointer(appname))201 defer C.free(unsafe.Pointer(appname))
220 return C.can_use_bubbles_notify(pkgname, appname) != 0202 return C.can_use_bubbles_notify(pkgname, appname) != 0
221}203}
222
223// CanUseListNotify returns true if the application is marked on gsettings to use list notificy
224func CanUseListNotify(app *click.AppId) bool {
225 pkgname := C.CString(app.Package)
226 appname := C.CString(app.Application)
227 defer C.free(unsafe.Pointer(pkgname))
228 defer C.free(unsafe.Pointer(appname))
229 return C.can_use_list_notify(pkgname, appname) != 0
230}
231204
=== modified file 'messaging/messaging.go'
--- messaging/messaging.go 2016-07-08 17:05:38 +0000
+++ messaging/messaging.go 2016-07-27 01:08:17 +0000
@@ -25,7 +25,6 @@
2525
26 "launchpad.net/ubuntu-push/bus/notifications"26 "launchpad.net/ubuntu-push/bus/notifications"
27 "launchpad.net/ubuntu-push/click"27 "launchpad.net/ubuntu-push/click"
28 "launchpad.net/ubuntu-push/click/cnotificationsettings"
29 "launchpad.net/ubuntu-push/launch_helper"28 "launchpad.net/ubuntu-push/launch_helper"
30 "launchpad.net/ubuntu-push/logger"29 "launchpad.net/ubuntu-push/logger"
31 "launchpad.net/ubuntu-push/messaging/cmessaging"30 "launchpad.net/ubuntu-push/messaging/cmessaging"
@@ -144,18 +143,11 @@
144 return len(nids)143 return len(nids)
145}144}
146145
147var canUseListNotify = cnotificationsettings.CanUseListNotify
148
149func (mmu *MessagingMenu) Present(app *click.AppId, nid string, notification *launch_helper.Notification) bool {146func (mmu *MessagingMenu) Present(app *click.AppId, nid string, notification *launch_helper.Notification) bool {
150 if notification == nil {147 if notification == nil {
151 panic("please check notification is not nil before calling present")148 panic("please check notification is not nil before calling present")
152 }149 }
153150
154 if !canUseListNotify(app) {
155 mmu.Log.Debugf("[%s] list notify disabled by user for this app.", nid)
156 return false
157 }
158
159 card := notification.Card151 card := notification.Card
160152
161 if card == nil || !card.Persist || card.Summary == "" {153 if card == nil || !card.Persist || card.Summary == "" {

Subscribers

People subscribed via source and target branches