[polari] telepathyClient: Only identify with nickname when necessary



commit 03eef02681821875a9f55a2e3780d165e3b26c2f
Author: Justyn Temme <Justyntemme gmail com>
Date:   Wed May 10 06:37:58 2017 -0500

    telepathyClient: Only identify with nickname when necessary
    
    Many NickServ bots only take a password parameter, while we currently
    send the username along unconditionally to make sure that identification
    is still possible when connecting with a nickname that doesn't match
    the registered one.
    In order to work both with bots that support an optional username
    parameter and those that don't understand the parameter at all,
    omit the username when it already matches the currently used nick.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772915

 src/telepathyClient.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 7fe5686..d965a1d 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -309,6 +309,11 @@ const TelepathyClient = new Lang.Class({
                     return;
 
                 let room = this._roomManager.lookupRoomByChannel(channel);
+                let activeNick = room.channel.connection.self_contact.alias;
+                // Omit username parameter when it matches the default, to
+                // support NickServ bots that don't support the parameter at all
+                if (activeNick == username)
+                    username = null;
                 room.send_identify_message_async(command, username, password, (r, res) => {
                     try {
                         r.send_identify_message_finish(res);


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