From c6bcc746495a5807f1043cc40ab1b02b3259cf8b Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 26 Aug 2021 11:42:59 +0000 Subject: [PATCH] notificationDaemon: Remove rewriteRules It's not really Shell's business to fix bad app notification contents. Part-of: --- js/ui/notificationDaemon.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index f94edb65c..69137b1b2 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -25,17 +25,6 @@ var Urgency = { CRITICAL: 2, }; -const rewriteRules = { - 'XChat': [ - { pattern: /^XChat: Private message from: (\S*) \(.*\)$/, - replacement: '<$1>' }, - { pattern: /^XChat: New public message from: (\S*) \((.*)\)$/, - replacement: '$2 <$1>' }, - { pattern: /^XChat: Highlighted message from: (\S*) \((.*)\)$/, - replacement: '$2 <$1>' }, - ], -}; - var FdoNotificationDaemon = class FdoNotificationDaemon { constructor() { this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(FdoNotificationsIface, this); @@ -166,15 +155,6 @@ var FdoNotificationDaemon = class FdoNotificationDaemon { return invocation.return_value(GLib.Variant.new('(u)', [id])); } - let rewrites = rewriteRules[appName]; - if (rewrites) { - for (let i = 0; i < rewrites.length; i++) { - let rule = rewrites[i]; - if (summary.search(rule.pattern) != -1) - summary = summary.replace(rule.pattern, rule.replacement); - } - } - // Be compatible with the various hints for image data and image path // 'image-data' and 'image-path' are the latest name of these hints, introduced in 1.2