Fix bug 1034971 - Regression: IRC topic not always settable on freshly-joined channels. r=aleth,a=Standard8
authorPatrick Cloke <clokep@gmail.com>
Tue, 23 Dec 2014 15:50:57 +0100
changeset 25628 0e47678128e65ff5346067b45fb71a1e511ed23f
parent 25627 610891f677330790236e193bb0e68e28648da2d4
child 25629 a9f68b06d1b4f6c30de9542a404f20ba6565d7e1
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleth, Standard8
bugs1034971
Fix bug 1034971 - Regression: IRC topic not always settable on freshly-joined channels. r=aleth,a=Standard8
chat/protocols/irc/irc.js
--- a/chat/protocols/irc/irc.js
+++ b/chat/protocols/irc/irc.js
@@ -489,32 +489,34 @@ ircChannel.prototype = {
 
     if (aModeParams.length)
       this.WARN("Unused mode parameters: " + aModeParams.join(", "));
 
     // Update the mode of each participant.
     for (let [nick, mode] of userModes.entries())
       this.getParticipant(nick).setMode(addNewMode, mode, aSetter);
 
+    // If the topic can now be set (and it couldn't previously) or vice versa,
+    // notify the UI. Note that this status can change by either a channel mode
+    // or a user mode changing.
+    if (this.topicSettable != previousTopicSettable)
+      this.notifyObservers(this, "chat-update-topic");
+
+    // If no channel modes were being set, don't display a message for it.
     if (!channelModes.length)
       return;
 
     // Store the channel modes.
     _setMode.call(this, addNewMode, channelModes);
 
     // Notify the UI of changes.
     msg = _("message.channelmode", aNewMode[0] + channelModes.join(""),
             aSetter);
     this.writeMessage(aSetter, msg, {system: true});
 
-    // If the topic can now be set (and it couldn't previously) or vice versa,
-    // notify the UI.
-    if (this.topicSettable != previousTopicSettable)
-      this.notifyObservers(this, "chat-update-topic");
-
     this._receivedInitialMode = true;
   },
 
   setModesFromRestriction: function(aRestriction) {
     // First remove all types from the list of modes.
     for each (let mode in this._account.channelRestrictionToModeMap)
       this._modes.delete(mode);