Browse Source

Prevents topic bar from trying to set an unchanged topic

fixes issue 3601

Change-Id: I8b9d9f0c21b3c1078a77100334dff0020c0bc81c
Reviewed-on: http://gerrit.dmdirc.com/584
Automatic-Compile: Gregory Holmes <greboid@dmdirc.com>
Reviewed-by: Gregory Holmes <greboid@dmdirc.com>
tags/0.6.3
Simon Mott 14 years ago
parent
commit
a5907bcd9f
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      src/com/dmdirc/addons/ui_swing/components/TopicBar.java

+ 5
- 1
src/com/dmdirc/addons/ui_swing/components/TopicBar.java View File

@@ -247,7 +247,11 @@ public class TopicBar extends JComponent implements ActionListener,
247 247
     public void actionPerformed(final ActionEvent e) {
248 248
         if (e.getSource() == topicEdit || e.getSource() == topicText) {
249 249
             if (topicText.isEditable()) {
250
-                channel.setTopic(topicText.getText());
250
+                if ((channel.getCurrentTopic() == null && !topicText.getText().isEmpty())
251
+                        || (channel.getCurrentTopic() != null &&
252
+                        !channel.getCurrentTopic().getTopic().equals(topicText.getText()))) {
253
+                    channel.setTopic(topicText.getText());
254
+                }
251 255
                 ((ChannelFrame) channel.getFrame()).getInputField().
252 256
                         requestFocusInWindow();
253 257
                 topicChanged();

Loading…
Cancel
Save