Преглед изворни кода

Merge pull request #116 from ShaneMcC/master

Add numeric stuff to IRCDataInEvent
pull/118/head
Greg Holmes пре 8 година
родитељ
комит
d82ee6f47c

+ 15
- 0
irc/src/com/dmdirc/parser/irc/events/IRCDataInEvent.java Прегледај датотеку

41
     private final ReadLine line;
41
     private final ReadLine line;
42
     private final String[] tokenisedData;
42
     private final String[] tokenisedData;
43
     private final String action;
43
     private final String action;
44
+    private final int numeric;
45
+    private final boolean isNumeric;
44
 
46
 
45
     public IRCDataInEvent(final IRCParser parser, final LocalDateTime date, final ReadLine line) {
47
     public IRCDataInEvent(final IRCParser parser, final LocalDateTime date, final ReadLine line) {
46
         super(parser, date, checkNotNull(line).getLine());
48
         super(parser, date, checkNotNull(line).getLine());
63
         } else {
65
         } else {
64
             action = "";
66
             action = "";
65
         }
67
         }
68
+
69
+        int num = -1;
70
+        try { num = Integer.parseInt(action); } catch (final NumberFormatException e) { }
71
+        numeric = num;
72
+        isNumeric = (numeric != -1);
66
     }
73
     }
67
 
74
 
68
     public String[] getTokenisedData() {
75
     public String[] getTokenisedData() {
76
     public String getAction() {
83
     public String getAction() {
77
         return action;
84
         return action;
78
     }
85
     }
86
+
87
+    public boolean isNumeric() {
88
+        return isNumeric;
89
+    }
90
+
91
+    public int getNumeric() {
92
+        return numeric;
93
+    }
79
 }
94
 }

+ 4
- 2
irc/src/com/dmdirc/parser/irc/processors/ProcessJoin.java Прегледај датотеку

187
                 iChannel.setInternalPassword(pendingJoin.getKey());
187
                 iChannel.setInternalPassword(pendingJoin.getKey());
188
             } else {
188
             } else {
189
                 // Out of sync, clear
189
                 // Out of sync, clear
190
-                callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: pending join keys out of sync (Got: " + pendingJoin.getChannel() + ", Wanted: " + channelName + ") - Clearing.");
190
+                callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: pending join keys out of sync (Got: " + (pendingJoin == null ? pendingJoin : pendingJoin.getChannel()) + ", Wanted: " + channelName + ") - Clearing.");
191
                 pendingJoins.clear();
191
                 pendingJoins.clear();
192
             }
192
             }
193
 
193
 
220
             // don't have guesses for channels we are already in.
220
             // don't have guesses for channels we are already in.
221
             for (final String chan : newLine[1].split(",")) {
221
             for (final String chan : newLine[1].split(",")) {
222
                 final String key = keys.poll();
222
                 final String key = keys.poll();
223
-                if (getChannel(chan) == null) {
223
+                if (chan.equals("0")) {
224
+                    callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: Ignoring possible channel Key for part-all channel: " + chan + " -> " + key);
225
+                } else if (getChannel(chan) == null) {
224
                     callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: Intercepted possible channel Key: " + chan + " -> " + key);
226
                     callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: Intercepted possible channel Key: " + chan + " -> " + key);
225
                     pendingJoins.add(new PendingJoin(chan, key));
227
                     pendingJoins.add(new PendingJoin(chan, key));
226
                 } else {
228
                 } else {

Loading…
Откажи
Сачувај