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
1=== modified file 'click/cnotificationsettings/cnotificationsettings.go'
2--- click/cnotificationsettings/cnotificationsettings.go 2016-07-08 17:05:38 +0000
3+++ click/cnotificationsettings/cnotificationsettings.go 2016-07-27 01:08:17 +0000
4@@ -33,7 +33,6 @@
5 #define USE_SOUNDS_NOTIFICATIONS_KEY "use-sounds-notifications"
6 #define USE_VIBRATIONS_NOTIFICATIONS_KEY "use-vibrations-notifications"
7 #define USE_BUBBLES_NOTIFICATIONS_KEY "use-bubbles-notifications"
8-#define USE_LIST_NOTIFICATIONS_KEY "use-list-notifications"
9
10 GSettings* get_settings() {
11 // Check if GSettings schema exists
12@@ -153,23 +152,6 @@
13 g_object_unref(notificationSettings);
14 return bubblesNotify;
15 }
16-
17-int can_use_list_notify(const char *pkgname, const char *appname) {
18- GSettings *notificationSettings = NULL;
19- int listNotify = 0;
20-
21- notificationSettings = get_settings_for_app(pkgname, appname);
22- if (!notificationSettings) {
23- return -1;
24- }
25-
26- if (g_settings_get_boolean(notificationSettings, USE_LIST_NOTIFICATIONS_KEY)) {
27- listNotify = 1;
28- }
29-
30- g_object_unref(notificationSettings);
31- return listNotify;
32-}
33 */
34 import "C"
35
36@@ -219,12 +201,3 @@
37 defer C.free(unsafe.Pointer(appname))
38 return C.can_use_bubbles_notify(pkgname, appname) != 0
39 }
40-
41-// CanUseListNotify returns true if the application is marked on gsettings to use list notificy
42-func CanUseListNotify(app *click.AppId) bool {
43- pkgname := C.CString(app.Package)
44- appname := C.CString(app.Application)
45- defer C.free(unsafe.Pointer(pkgname))
46- defer C.free(unsafe.Pointer(appname))
47- return C.can_use_list_notify(pkgname, appname) != 0
48-}
49
50=== modified file 'messaging/messaging.go'
51--- messaging/messaging.go 2016-07-08 17:05:38 +0000
52+++ messaging/messaging.go 2016-07-27 01:08:17 +0000
53@@ -25,7 +25,6 @@
54
55 "launchpad.net/ubuntu-push/bus/notifications"
56 "launchpad.net/ubuntu-push/click"
57- "launchpad.net/ubuntu-push/click/cnotificationsettings"
58 "launchpad.net/ubuntu-push/launch_helper"
59 "launchpad.net/ubuntu-push/logger"
60 "launchpad.net/ubuntu-push/messaging/cmessaging"
61@@ -144,18 +143,11 @@
62 return len(nids)
63 }
64
65-var canUseListNotify = cnotificationsettings.CanUseListNotify
66-
67 func (mmu *MessagingMenu) Present(app *click.AppId, nid string, notification *launch_helper.Notification) bool {
68 if notification == nil {
69 panic("please check notification is not nil before calling present")
70 }
71
72- if !canUseListNotify(app) {
73- mmu.Log.Debugf("[%s] list notify disabled by user for this app.", nid)
74- return false
75- }
76-
77 card := notification.Card
78
79 if card == nil || !card.Persist || card.Summary == "" {

Subscribers

People subscribed via source and target branches