Skip to content

Commit

Permalink
gnome-extra/gnome-shell-extension-gsconnect: Fix some notifications (…
Browse files Browse the repository at this point in the history
…like WhatsApp ones)

Package-Manager: Portage-2.3.80, Repoman-2.3.19
Signed-off-by: Pacho Ramos <[email protected]>
  • Loading branch information
pacho2 committed Dec 14, 2019
1 parent ce0035d commit ae88f95
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 1811528ca72a2b83924bc717c424f1301bf17c30 Mon Sep 17 00:00:00 2001
From: Andy Holmes <[email protected]>
Date: Sun, 1 Dec 2019 16:39:41 -0800
Subject: [PATCH] Notification Plugin: ignore the `silent` flag entirely

Upstream kdeconnect-android is tagging many notifications as `silent`,
causing them to never be shown. Since we already handle duplicates in
the Shell, we ignore that flag for now.

closes #720
---
src/service/plugins/notification.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/service/plugins/notification.js b/src/service/plugins/notification.js
index b31a828ba..45ed2050c 100644
--- a/src/service/plugins/notification.js
+++ b/src/service/plugins/notification.js
@@ -135,16 +135,16 @@ var Plugin = GObject.registerClass({

/**
* Handle an incoming notification or closed report.
+ *
+ * FIXME: upstream kdeconnect-android is tagging many notifications as
+ * `silent`, causing them to never be shown. Since we already handle
+ * duplicates in the Shell, we ignore that flag for now.
*/
_handleNotification(packet) {
// A report that a remote notification has been dismissed
if (packet.body.hasOwnProperty('isCancel')) {
this.device.hideNotification(packet.body.id);

- // A silent notification; silence it by aborting the icon transfer
- } else if (packet.body.hasOwnProperty('silent') && packet.body.silent) {
- this.device.rejectTransfer(packet);
-
// A normal, remote notification
} else {
this.receiveNotification(packet);
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit gnome2-utils meson readme.gentoo-r1

DESCRIPTION="KDE Connect implementation for Gnome Shell"
HOMEPAGE="https://github.com/andyholmes/gnome-shell-extension-gsconnect"
SRC_URI="https://github.com/andyholmes/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="nautilus"

COMMON_DEPEND="dev-libs/glib:2"
RDEPEND="${COMMON_DEPEND}
app-eselect/eselect-gnome-shell-extensions
>=dev-libs/gjs-1.48
>=gnome-base/gnome-shell-3.28
gnome-base/gvfs
|| ( ( net-libs/gnome-online-accounts dev-libs/libgdata ) dev-libs/folks )
|| ( media-libs/libcanberra media-libs/gsound )
nautilus? (
dev-python/nautilus-python
gnome-base/nautilus[introspection] )
"
DEPEND="${COMMON_DEPEND}"
BDEPEND="
>=dev-util/meson-0.49.0
virtual/pkgconfig
"

DISABLE_AUTOFORMATTING="yes"
DOC_CONTENTS="For knowing more about how to do the setup, please visit:
https://github.com/andyholmes/gnome-shell-extension-gsconnect/wiki/Installation"

PATCHES=(
# Fix WhastApp notifications, https://github.com/andyholmes/gnome-shell-extension-gsconnect/issues/720
"${FILESDIR}/${P}-silent-flag.patch"
)

src_configure() {
# nemo support relies on nemo-python from https://github.com/linuxmint/nemo-extensions
# https://bugs.gentoo.org/694388
meson_src_configure \
-Dnemo=false \
$(meson_use nautilus)
}

src_install() {
meson_src_install
readme.gentoo_create_doc
}

pkg_preinst() {
gnome2_schemas_savelist
}

pkg_postinst() {
gnome2_schemas_update
ebegin "Updating list of installed extensions"
eselect gnome-shell-extensions update
eend $?
readme.gentoo_print_elog
}

pkg_postrm() {
gnome2_schemas_update
}

0 comments on commit ae88f95

Please sign in to comment.