[polari] telepathyClient: Mute identify bots on update



commit 4203c8b9af8796f08402ec4f1ce313e984afcef3
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Apr 21 22:00:23 2019 +0200

    telepathyClient: Mute identify bots on update
    
    As we now mute newly added identify bots, it makes sense to apply
    the same to existing bots, so add a corresponding one-time action.
    
    https://gitlab.gnome.org/GNOME/polari/-/merge_requests/153

 src/telepathyClient.js | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index d1ff05e6..3f75251a 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -240,6 +240,17 @@ class TelepathyClient extends Tp.BaseClient {
         });
         this.register();
 
+        if (Utils.needsOnetimeAction('mute-bots')) {
+            this._accountsMonitor.visibleAccounts.forEach(a => {
+                if (a.settings.get_string('identify-username') === null)
+                    return;
+
+                const tracker =
+                    this._userStatusMonitor.getUserTrackerForAccount(a);
+                tracker.muteNick(a.settings.get_string('identify-botname'));
+            });
+        }
+
         this._accountsMonitor.connect('account-status-changed',
             this._onAccountStatusChanged.bind(this));
         this._accountsMonitor.connect('account-reachable-changed',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]