[polari] telepathyClient: Hook up room errors



commit 04ac0a024e5f01c9dd22f2caa96644042ff65527
Author: Daronion <stefanosdimos 98 gmail com>
Date:   Tue May 14 16:45:56 2019 +0300

    telepathyClient: Hook up room errors
    
    Upon getting a connection error when trying to join a room,
    save the error code in that room's channel_error property.
    The property was added in the previous commit.
    
    https://gitlab.gnome.org/GNOME/polari/issues/17

 src/telepathyClient.js | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 44acfb7..494ade7 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -321,10 +321,15 @@ class TelepathyClient extends Tp.BaseClient {
         req.ensure_and_observe_channel_async(preferredHandler, cancellable,
             (o, res) => {
                 let channel = null;
+                let room = this._roomManager.lookupRoom(roomId);
                 try {
                     channel = req.ensure_and_observe_channel_finish(res);
+                    room.channel_error = '';
                 } catch (e) {
                     debug(`Failed to ensure channel: ${e.message}`);
+
+                    if (room)
+                        room.channel_error = Tp.error_get_dbus_name(e.code);
                 }
 
                 if (callback)


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