Browse Source

Fixes issue 3904, removes deprecated method usage

Dont fire link events for thigns without servers

Change-Id: Iea21de87ec2f295b7f3a5de079bfad6d9736b69d
Reviewed-on: http://gerrit.dmdirc.com/1005
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.6.4
Greboid 14 years ago
parent
commit
093439d2fd

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

@@ -300,7 +300,7 @@ public class TopicBar extends JComponent implements ActionListener,
300 300
             } else if (url.contains("://")) {
301 301
                 URLHandler.getURLHander().launchApp(e.getDescription());
302 302
             } else {
303
-                channel.getServer().addQuery(url).activateFrame();
303
+                channel.getServer().getQuery(url).activateFrame();
304 304
             }
305 305
         }
306 306
     }

+ 11
- 7
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java View File

@@ -1,4 +1,4 @@
1
-    /*
1
+/*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3 3
  *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -906,8 +906,10 @@ public abstract class TextFrame extends JInternalFrame implements Window,
906 906
                 if (type == MouseClickType.CLICKED) {
907 907
                     switch (clickType) {
908 908
                         case CHANNEL:
909
-                            if (ActionManager.processEvent(CoreActionType.
910
-                                    LINK_CHANNEL_CLICKED, null, this, attribute)) {
909
+                            if (frameParent.getServer() != null &&
910
+                                    ActionManager.processEvent(CoreActionType.
911
+                                    LINK_CHANNEL_CLICKED, null, this,
912
+                                    attribute)) {
911 913
                                 frameParent.getServer().join(
912 914
                                         new ChannelJoinRequest(attribute));
913 915
                             }
@@ -919,10 +921,12 @@ public abstract class TextFrame extends JInternalFrame implements Window,
919 921
                             }
920 922
                             break;
921 923
                         case NICKNAME:
922
-                            if (ActionManager.processEvent(CoreActionType.
923
-                                    LINK_NICKNAME_CLICKED, null, this, attribute)) {
924
-                                getContainer().getServer().addQuery(attribute).
925
-                                        activateFrame();
924
+                            if (frameParent.getServer() != null &&
925
+                                    ActionManager.processEvent(CoreActionType.
926
+                                    LINK_NICKNAME_CLICKED, null, this,
927
+                                    attribute)) {
928
+                                getContainer().getServer().getQuery(
929
+                                        attribute).activateFrame();
926 930
                             }
927 931
                             break;
928 932
                         default:

Loading…
Cancel
Save