[polari/wip/fmuellner/3-24-1-candidates: 8/10] app: Reset nick on startup



commit 3f8dfe72c02d83f6fe83e96aea126db7b4d33321
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Mar 24 11:33:14 2017 +0100

    app: Reset nick on startup

 src/application.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 9eb4c62..c722f95 100644
--- a/src/application.js
+++ b/src/application.js
@@ -235,6 +235,13 @@ const Application = new Lang.Class({
 
         this._accountsMonitor.connect('account-status-changed',
                                       Lang.bind(this, this._onAccountStatusChanged));
+        this._accountsMonitor.connect('account-added', (am, account) => {
+            // Reset nickname at startup
+            let params = Connections.getAccountParams(account);
+            account.set_nickname_async(params.username, (a, res) => {
+                a.set_nickname_finish(res);
+            });
+        });
 
         this.pasteManager = new PasteManager.PasteManager();
         this.notificationQueue = new AppNotifications.NotificationQueue();


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