瀏覽代碼

Add server events.

Change-Id: Id53eb0fba852cf19e80dbd51d6b45fc9fc3dbee6
Reviewed-on: http://gerrit.dmdirc.com/3486
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
pull/1/head
Greg Holmes 10 年之前
父節點
當前提交
6afb56b917
共有 26 個文件被更改,包括 1393 次插入89 次删除
  1. 2
    5
      src/com/dmdirc/Server.java
  2. 107
    84
      src/com/dmdirc/ServerEventHandler.java
  3. 23
    0
      src/com/dmdirc/actions/CoreActionType.java
  4. 49
    0
      src/com/dmdirc/events/ServerAuthnoticeEvent.java
  5. 48
    0
      src/com/dmdirc/events/ServerAwayEvent.java
  6. 40
    0
      src/com/dmdirc/events/ServerBackEvent.java
  7. 74
    0
      src/com/dmdirc/events/ServerCtcpEvent.java
  8. 64
    0
      src/com/dmdirc/events/ServerCtcprEvent.java
  9. 48
    0
      src/com/dmdirc/events/ServerErrorEvent.java
  10. 48
    0
      src/com/dmdirc/events/ServerGotpingEvent.java
  11. 58
    0
      src/com/dmdirc/events/ServerInvitereceivedEvent.java
  12. 49
    0
      src/com/dmdirc/events/ServerMotdendEvent.java
  13. 49
    0
      src/com/dmdirc/events/ServerMotdlineEvent.java
  14. 49
    0
      src/com/dmdirc/events/ServerMotdstartEvent.java
  15. 57
    0
      src/com/dmdirc/events/ServerNickchangeEvent.java
  16. 48
    0
      src/com/dmdirc/events/ServerNopingEvent.java
  17. 58
    0
      src/com/dmdirc/events/ServerNoticeEvent.java
  18. 40
    0
      src/com/dmdirc/events/ServerPingsentEvent.java
  19. 58
    0
      src/com/dmdirc/events/ServerServernoticeEvent.java
  20. 64
    0
      src/com/dmdirc/events/ServerUnknownactionEvent.java
  21. 64
    0
      src/com/dmdirc/events/ServerUnknownmessageEvent.java
  22. 64
    0
      src/com/dmdirc/events/ServerUnknownnoticeEvent.java
  23. 58
    0
      src/com/dmdirc/events/ServerUsermodesEvent.java
  24. 58
    0
      src/com/dmdirc/events/ServerWalldesyncEvent.java
  25. 58
    0
      src/com/dmdirc/events/ServerWallopsEvent.java
  26. 58
    0
      src/com/dmdirc/events/ServerWallusersEvent.java

+ 2
- 5
src/com/dmdirc/Server.java 查看文件

@@ -23,8 +23,6 @@
23 23
 package com.dmdirc;
24 24
 
25 25
 import com.dmdirc.ClientModule.UserConfig;
26
-import com.dmdirc.actions.ActionManager;
27
-import com.dmdirc.actions.CoreActionType;
28 26
 import com.dmdirc.commandparser.CommandType;
29 27
 import com.dmdirc.commandparser.parsers.CommandParser;
30 28
 import com.dmdirc.events.ChannelOpenedEvent;
@@ -34,6 +32,7 @@ import com.dmdirc.events.ServerConnectErrorEvent;
34 32
 import com.dmdirc.events.ServerConnectedEvent;
35 33
 import com.dmdirc.events.ServerConnectingEvent;
36 34
 import com.dmdirc.events.ServerDisconnectedEvent;
35
+import com.dmdirc.events.ServerNopingEvent;
37 36
 import com.dmdirc.events.ServerNumericEvent;
38 37
 import com.dmdirc.interfaces.AwayStateListener;
39 38
 import com.dmdirc.interfaces.Connection;
@@ -1353,9 +1352,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
1353 1352
                 + ((int) (Math.floor(parser.getPingTime() / 1000.0)))
1354 1353
                 + " seconds.", getConfigManager()));
1355 1354
 
1356
-        ActionManager.getActionManager().triggerEvent(
1357
-                CoreActionType.SERVER_NOPING, null, this,
1358
-                parser.getPingTime());
1355
+        getEventBus().post(new ServerNopingEvent(this, parser.getPingTime()));
1359 1356
 
1360 1357
         if (parser.getPingTime()
1361 1358
                 >= getConfigManager().getOptionInt(DOMAIN_SERVER, "pingtimeout")) {

+ 107
- 84
src/com/dmdirc/ServerEventHandler.java 查看文件

@@ -22,13 +22,33 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
-import com.dmdirc.actions.ActionManager;
26
-import com.dmdirc.actions.CoreActionType;
27 25
 import com.dmdirc.events.DisplayableEvent;
26
+import com.dmdirc.events.EventUtils;
28 27
 import com.dmdirc.events.QuerySelfActionEvent;
29 28
 import com.dmdirc.events.QuerySelfMessageEvent;
29
+import com.dmdirc.events.ServerAuthnoticeEvent;
30
+import com.dmdirc.events.ServerAwayEvent;
31
+import com.dmdirc.events.ServerBackEvent;
32
+import com.dmdirc.events.ServerCtcpEvent;
33
+import com.dmdirc.events.ServerCtcprEvent;
34
+import com.dmdirc.events.ServerErrorEvent;
35
+import com.dmdirc.events.ServerGotpingEvent;
36
+import com.dmdirc.events.ServerInvitereceivedEvent;
37
+import com.dmdirc.events.ServerMotdendEvent;
38
+import com.dmdirc.events.ServerMotdlineEvent;
39
+import com.dmdirc.events.ServerMotdstartEvent;
40
+import com.dmdirc.events.ServerNickchangeEvent;
41
+import com.dmdirc.events.ServerNoticeEvent;
42
+import com.dmdirc.events.ServerPingsentEvent;
43
+import com.dmdirc.events.ServerServernoticeEvent;
44
+import com.dmdirc.events.ServerUnknownactionEvent;
45
+import com.dmdirc.events.ServerUnknownmessageEvent;
46
+import com.dmdirc.events.ServerUnknownnoticeEvent;
47
+import com.dmdirc.events.ServerUsermodesEvent;
48
+import com.dmdirc.events.ServerWalldesyncEvent;
49
+import com.dmdirc.events.ServerWallopsEvent;
50
+import com.dmdirc.events.ServerWallusersEvent;
30 51
 import com.dmdirc.interfaces.Connection;
31
-import com.dmdirc.interfaces.actions.ActionType;
32 52
 import com.dmdirc.logger.ErrorLevel;
33 53
 import com.dmdirc.logger.Logger;
34 54
 import com.dmdirc.parser.common.AwayState;
@@ -73,10 +93,8 @@ import com.dmdirc.parser.interfaces.callbacks.WalluserListener;
73 93
 
74 94
 import com.google.common.eventbus.EventBus;
75 95
 
76
-import java.util.ArrayList;
77
-import java.util.Arrays;
78 96
 import java.util.Date;
79
-import java.util.List;
97
+
80 98
 
81 99
 /**
82 100
  * Handles parser events for a Server object.
@@ -181,9 +199,11 @@ public class ServerEventHandler extends EventHandler implements
181 199
             final String message, final String host) {
182 200
         checkParser(parser);
183 201
 
184
-        owner.doNotification("privateCTCP", owner.getParser().getClient(host), type, message);
185
-        if (triggerAction("privateCTCP", CoreActionType.SERVER_CTCP, owner.getParser().getClient(
186
-                host), type, message)) {
202
+        final ServerCtcpEvent event = new ServerCtcpEvent(owner, owner.getParser().getClient(host),
203
+                type, message);
204
+        final String format = EventUtils.postDisplayable(eventBus, event, "privateCTCP");
205
+        owner.doNotification(format, owner.getParser().getClient(host), type, message);
206
+        if (event.isHandled()) {
187 207
             owner.sendCTCPReply(owner.parseHostmask(host)[0], type, message);
188 208
         }
189 209
     }
@@ -193,9 +213,10 @@ public class ServerEventHandler extends EventHandler implements
193 213
             final String message, final String host) {
194 214
         checkParser(parser);
195 215
 
196
-        owner.doNotification("privateCTCPreply", owner.getParser().getClient(host), type, message);
197
-        triggerAction("privateCTCPreply", CoreActionType.SERVER_CTCPR, owner.getParser().getClient(
198
-                host), type, message);
216
+        final DisplayableEvent event
217
+                = new ServerCtcprEvent(owner, owner.getParser().getClient(host), type, message);
218
+        final String format = EventUtils.postDisplayable(eventBus, event, "privateCTCPreply");
219
+        owner.doNotification(format, owner.getParser().getClient(host), type, message);
199 220
     }
200 221
 
201 222
     @Override
@@ -210,9 +231,10 @@ public class ServerEventHandler extends EventHandler implements
210 231
             final String message, final String host) {
211 232
         checkParser(parser);
212 233
 
213
-        owner.doNotification("privateNotice", owner.getParser().getClient(host), message);
214
-        triggerAction("privateNotice", CoreActionType.SERVER_NOTICE, owner.getParser().getClient(
215
-                host), message);
234
+        final DisplayableEvent event = new ServerNoticeEvent(owner, owner.getParser().
235
+                getClient(host), message);
236
+        final String format = EventUtils.postDisplayable(eventBus, event, "privateNotice");
237
+        owner.doNotification(format, owner.getParser().getClient(host), message);
216 238
     }
217 239
 
218 240
     @Override
@@ -220,25 +242,28 @@ public class ServerEventHandler extends EventHandler implements
220 242
             final String message, final String host) {
221 243
         checkParser(parser);
222 244
 
223
-        owner.doNotification("serverNotice", owner.getParser().getClient(host), message);
224
-        triggerAction("serverNotice", CoreActionType.SERVER_SERVERNOTICE, owner.getParser().
245
+        final DisplayableEvent event = new ServerServernoticeEvent(owner, owner.getParser().
225 246
                 getClient(host), message);
247
+        final String format = EventUtils.postDisplayable(eventBus, event, "serverNotice");
248
+        owner.doNotification(format, owner.getParser().getClient(host), message);
226 249
     }
227 250
 
228 251
     @Override
229 252
     public void onMOTDStart(final Parser parser, final Date date, final String data) {
230 253
         checkParser(parser);
231 254
 
232
-        owner.doNotification("motdStart", data);
233
-        triggerAction("motdStart", CoreActionType.SERVER_MOTDSTART, data);
255
+        final DisplayableEvent event = new ServerMotdstartEvent(owner, data);
256
+        final String format = EventUtils.postDisplayable(eventBus, event, "motdStart");
257
+        owner.doNotification(format, data);
234 258
     }
235 259
 
236 260
     @Override
237 261
     public void onMOTDLine(final Parser parser, final Date date, final String data) {
238 262
         checkParser(parser);
239 263
 
240
-        owner.doNotification("motdLine", data);
241
-        triggerAction("motdLine", CoreActionType.SERVER_MOTDLINE, data);
264
+        final DisplayableEvent event = new ServerMotdlineEvent(owner, data);
265
+        final String format = EventUtils.postDisplayable(eventBus, event, "motdLine");
266
+        owner.doNotification(format, data);
242 267
     }
243 268
 
244 269
     @Override
@@ -246,8 +271,9 @@ public class ServerEventHandler extends EventHandler implements
246 271
             final boolean noMOTD, final String data) {
247 272
         checkParser(parser);
248 273
 
249
-        owner.doNotification("motdEnd", data);
250
-        triggerAction("motdEnd", CoreActionType.SERVER_MOTDEND, data);
274
+        final DisplayableEvent event = new ServerMotdendEvent(owner, data);
275
+        final String format = EventUtils.postDisplayable(eventBus, event, "motdEnd");
276
+        owner.doNotification(format, data);
251 277
     }
252 278
 
253 279
     @Override
@@ -267,17 +293,14 @@ public class ServerEventHandler extends EventHandler implements
267 293
     public void onPingSent(final Parser parser, final Date date) {
268 294
         checkParser(parser);
269 295
 
270
-        ActionManager.getActionManager().triggerEvent(
271
-                CoreActionType.SERVER_PINGSENT, null, owner);
296
+        eventBus.post(new ServerPingsentEvent(owner));
272 297
     }
273 298
 
274 299
     @Override
275 300
     public void onPingSuccess(final Parser parser, final Date date) {
276 301
         checkParser(parser);
277 302
 
278
-        ActionManager.getActionManager().triggerEvent(
279
-                CoreActionType.SERVER_GOTPING, null, owner,
280
-                Long.valueOf(owner.getParser().getServerLatency()));
303
+        eventBus.post(new ServerGotpingEvent(owner, owner.getParser().getServerLatency()));
281 304
     }
282 305
 
283 306
     @Override
@@ -293,11 +316,13 @@ public class ServerEventHandler extends EventHandler implements
293 316
         }
294 317
 
295 318
         if (currentState == AwayState.AWAY) {
296
-            owner.doNotification("away", reason);
297
-            triggerAction("away", CoreActionType.SERVER_AWAY, reason);
319
+            final DisplayableEvent event = new ServerAwayEvent(owner, reason);
320
+            final String format = EventUtils.postDisplayable(eventBus, event, "away");
321
+            owner.doNotification(format, reason);
298 322
         } else {
299
-            owner.doNotification("back");
300
-            triggerAction("back", CoreActionType.SERVER_BACK);
323
+            final DisplayableEvent event = new ServerBackEvent(owner);
324
+            final String format = EventUtils.postDisplayable(eventBus, event, "back");
325
+            owner.doNotification(format);
301 326
         }
302 327
     }
303 328
 
@@ -323,8 +348,9 @@ public class ServerEventHandler extends EventHandler implements
323 348
     public void onNoticeAuth(final Parser parser, final Date date, final String data) {
324 349
         checkParser(parser);
325 350
 
326
-        owner.doNotification("authNotice", data);
327
-        triggerAction("authNotice", CoreActionType.SERVER_AUTHNOTICE, data);
351
+        final DisplayableEvent event = new ServerAuthnoticeEvent(owner, data);
352
+        final String format = EventUtils.postDisplayable(eventBus, event, "authNotice");
353
+        owner.doNotification(format, data);
328 354
     }
329 355
 
330 356
     @Override
@@ -332,8 +358,9 @@ public class ServerEventHandler extends EventHandler implements
332 358
             final String target, final String host) {
333 359
         checkParser(parser);
334 360
 
335
-        owner.doNotification("unknownNotice", host, target, message);
336
-        triggerAction("unknownNotice", CoreActionType.SERVER_UNKNOWNNOTICE, host, target, message);
361
+        final DisplayableEvent event = new ServerUnknownnoticeEvent(owner, host, target, message);
362
+        final String format = EventUtils.postDisplayable(eventBus, event, "unknownNotice");
363
+        owner.doNotification(format, host, target, message);
337 364
     }
338 365
 
339 366
     @Override
@@ -343,16 +370,16 @@ public class ServerEventHandler extends EventHandler implements
343 370
 
344 371
         if (parser.getLocalClient().equals(parser.getClient(host))) {
345 372
             // Local client
346
-            owner.getQuery(target).doNotification("querySelfExternalMessage",
347
-                    parser.getLocalClient(), message);
348 373
             final DisplayableEvent event = new QuerySelfMessageEvent(owner.getQuery(target),
349 374
                     parser.getLocalClient(), message);
350
-            event.setDisplayFormat("querySelfExternalMessage");
351
-            eventBus.post(event);
375
+            final String format = EventUtils.postDisplayable(eventBus, event,
376
+                    "querySelfExternalMessage");
377
+            owner.getQuery(target).doNotification(format, parser.getLocalClient(), message);
352 378
         } else {
353
-            owner.doNotification("unknownMessage", host, target, message);
354
-            triggerAction("unknownMessage", CoreActionType.SERVER_UNKNOWNNOTICE, host, target,
355
-                    message);
379
+            final DisplayableEvent event
380
+                    = new ServerUnknownmessageEvent(owner, host, target, message);
381
+            final String format = EventUtils.postDisplayable(eventBus, event, "unknownMessage");
382
+            owner.doNotification(format, host, target, message);
356 383
         }
357 384
     }
358 385
 
@@ -363,16 +390,16 @@ public class ServerEventHandler extends EventHandler implements
363 390
 
364 391
         if (parser.getLocalClient().equals(parser.getClient(host))) {
365 392
             // Local client
366
-            owner.getQuery(target).doNotification("querySelfExternalAction",
367
-                    parser.getLocalClient(), message);
368 393
             final DisplayableEvent event = new QuerySelfActionEvent(owner.getQuery(target),
369 394
                     parser.getLocalClient(), message);
370
-            event.setDisplayFormat("querySelfExternalAction");
371
-            eventBus.post(event);
395
+            final String format = EventUtils.postDisplayable(eventBus, event,
396
+                    "querySelfExternalAction");
397
+            owner.getQuery(target).doNotification(format, parser.getLocalClient(), message);
372 398
         } else {
373
-            owner.doNotification("unknownAction", host, target, message);
374
-            triggerAction("unknownAction", CoreActionType.SERVER_UNKNOWNACTION, host, target,
375
-                    message);
399
+            final DisplayableEvent event
400
+                    = new ServerUnknownactionEvent(owner, host, target, message);
401
+            final String format = EventUtils.postDisplayable(eventBus, event, "unknownAction");
402
+            owner.doNotification(format, host, target, message);
376 403
         }
377 404
     }
378 405
 
@@ -381,9 +408,10 @@ public class ServerEventHandler extends EventHandler implements
381 408
             final ClientInfo client, final String host, final String modes) {
382 409
         checkParser(parser);
383 410
 
384
-        owner.doNotification("userModeChanged", owner.getParser().getClient(host), modes);
385
-        triggerAction("userModeChanged", CoreActionType.SERVER_USERMODES, owner.getParser().
386
-                getClient(host), modes);
411
+        final DisplayableEvent event = new ServerUsermodesEvent(owner,
412
+                owner.getParser().getClient(host), modes);
413
+        final String format = EventUtils.postDisplayable(eventBus, event, "userModeChanged");
414
+        owner.doNotification(format, owner.getParser().getClient(host), modes);
387 415
     }
388 416
 
389 417
     @Override
@@ -391,10 +419,10 @@ public class ServerEventHandler extends EventHandler implements
391 419
             final ClientInfo client, final String modes) {
392 420
         checkParser(parser);
393 421
 
394
-        owner.doNotification(modes.isEmpty() || "+".equals(modes)
395
-                ? "userNoModes" : "userModeDiscovered", client, modes);
396
-        triggerAction(modes.isEmpty() || "+".equals(modes) ? "userNoModes" : "userModeDiscovered",
397
-                CoreActionType.SERVER_USERMODES, client, modes);
422
+        final DisplayableEvent event = new ServerUsermodesEvent(owner, client, modes);
423
+        final String format = EventUtils.postDisplayable(eventBus, event, modes.isEmpty()
424
+                || "+".equals(modes) ? "userNoModes" : "userModeDiscovered");
425
+        owner.doNotification(format, client, modes);
398 426
     }
399 427
 
400 428
     @Override
@@ -403,10 +431,10 @@ public class ServerEventHandler extends EventHandler implements
403 431
         checkParser(parser);
404 432
 
405 433
         owner.addInvite(new Invite(owner, channel, userHost));
406
-        owner.doNotification("inviteReceived",
407
-                owner.getParser().getClient(userHost), channel);
408
-        triggerAction("inviteReceived", CoreActionType.SERVER_INVITERECEIVED, owner.getParser().
434
+        final DisplayableEvent event = new ServerInvitereceivedEvent(owner, owner.getParser().
409 435
                 getClient(userHost), channel);
436
+        final String format = EventUtils.postDisplayable(eventBus, event, "inviteReceived");
437
+        owner.doNotification(format, owner.getParser().getClient(userHost), channel);
410 438
     }
411 439
 
412 440
     @Override
@@ -414,9 +442,10 @@ public class ServerEventHandler extends EventHandler implements
414 442
             final String host) {
415 443
         checkParser(parser);
416 444
 
417
-        owner.doNotification("wallop", owner.getParser().getClient(host), message);
418
-        triggerAction("wallop", CoreActionType.SERVER_WALLOPS, owner.getParser().getClient(host),
419
-                message);
445
+        final DisplayableEvent event = new ServerWallopsEvent(owner,
446
+                owner.getParser().getClient(host), message);
447
+        final String format = EventUtils.postDisplayable(eventBus, event, "wallop");
448
+        owner.doNotification(format, owner.getParser().getClient(host), message);
420 449
 
421 450
     }
422 451
 
@@ -425,9 +454,10 @@ public class ServerEventHandler extends EventHandler implements
425 454
             final String host) {
426 455
         checkParser(parser);
427 456
 
428
-        owner.doNotification("walluser", owner.getParser().getClient(host), message);
429
-        triggerAction("walluser", CoreActionType.SERVER_WALLUSERS, owner.getParser().getClient(host),
430
-                message);
457
+        final DisplayableEvent event = new ServerWallusersEvent(owner,
458
+                owner.getParser().getClient(host), message);
459
+        final String format = EventUtils.postDisplayable(eventBus, event, "walluser");
460
+        owner.doNotification(format, owner.getParser().getClient(host), message);
431 461
     }
432 462
 
433 463
     @Override
@@ -435,9 +465,10 @@ public class ServerEventHandler extends EventHandler implements
435 465
             final String host) {
436 466
         checkParser(parser);
437 467
 
438
-        owner.doNotification("walldesync", owner.getParser().getClient(host), message);
439
-        triggerAction("walldesync", CoreActionType.SERVER_WALLDESYNC, owner.getParser().getClient(
440
-                host), message);
468
+        final DisplayableEvent event = new ServerWalldesyncEvent(owner,
469
+                owner.getParser().getClient(host), message);
470
+        final String format = EventUtils.postDisplayable(eventBus, event, "walldesync");
471
+        owner.doNotification(format, owner.getParser().getClient(host), message);
441 472
     }
442 473
 
443 474
     @Override
@@ -446,9 +477,10 @@ public class ServerEventHandler extends EventHandler implements
446 477
         checkParser(parser);
447 478
 
448 479
         if (client.equals(owner.getParser().getLocalClient())) {
449
-            owner.doNotification("selfNickChange", oldNick, client.getNickname());
450
-            triggerAction("selfNickChange", CoreActionType.SERVER_NICKCHANGE, oldNick, client.
451
-                    getNickname());
480
+            final DisplayableEvent event = new ServerNickchangeEvent(owner, oldNick,
481
+                    client.getNickname());
482
+            final String format = EventUtils.postDisplayable(eventBus, event, "selfNickChange");
483
+            owner.doNotification(format, oldNick, client.getNickname());
452 484
             owner.updateTitle();
453 485
         }
454 486
     }
@@ -457,8 +489,9 @@ public class ServerEventHandler extends EventHandler implements
457 489
     public void onServerError(final Parser parser, final Date date, final String message) {
458 490
         checkParser(parser);
459 491
 
460
-        owner.doNotification("serverError", message);
461
-        triggerAction("serverError", CoreActionType.SERVER_ERROR, message);
492
+        final DisplayableEvent event = new ServerErrorEvent(owner, message);
493
+        final String format = EventUtils.postDisplayable(eventBus, event, "serverError");
494
+        owner.doNotification(format, message);
462 495
     }
463 496
 
464 497
     @Override
@@ -475,14 +508,4 @@ public class ServerEventHandler extends EventHandler implements
475 508
         }
476 509
     }
477 510
 
478
-    private boolean triggerAction(final String messageType, final ActionType actionType,
479
-            final Object... args) {
480
-        final StringBuffer buffer = new StringBuffer(messageType);
481
-        final List<Object> actionArgs = new ArrayList<>();
482
-        actionArgs.add(owner);
483
-        actionArgs.addAll(Arrays.asList(args));
484
-        return ActionManager.getActionManager().triggerEvent(actionType, buffer, actionArgs.
485
-                toArray());
486
-    }
487
-
488 511
 }

+ 23
- 0
src/com/dmdirc/actions/CoreActionType.java 查看文件

@@ -101,50 +101,73 @@ public enum CoreActionType implements ActionType {
101 101
     @Deprecated
102 102
     SERVER_DISCONNECTED(ServerEvents.SERVER_EVENT, "Server disconnected"),
103 103
     /** Marked as away. */
104
+    @Deprecated
104 105
     SERVER_BACK(ServerEvents.SERVER_EVENT, "Marked as 'back'"),
105 106
     /** Marked as back. */
107
+    @Deprecated
106 108
     SERVER_AWAY(ServerEvents.SERVER_EVENT_WITH_ARG, "Marked as 'away'"),
107 109
     /** Error. */
110
+    @Deprecated
108 111
     SERVER_ERROR(ServerEvents.SERVER_EVENT_WITH_ARG, "Server error"),
109 112
     /** Auth notice received. */
113
+    @Deprecated
110 114
     SERVER_AUTHNOTICE(ServerEvents.SERVER_EVENT_WITH_ARG, "Received auth notice"),
111 115
     /** Unknown action received. */
116
+    @Deprecated
112 117
     SERVER_UNKNOWNACTION(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown action"),
113 118
     /** Unknown notice received. */
119
+    @Deprecated
114 120
     SERVER_UNKNOWNNOTICE(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown notice"),
115 121
     /** Unknown message received. */
122
+    @Deprecated
116 123
     SERVER_UNKNOWNMESSAGE(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown message"),
117 124
     /** User modes changed. */
125
+    @Deprecated
118 126
     SERVER_USERMODES(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "User modes changed"),
119 127
     /** Private CTCP received. */
128
+    @Deprecated
120 129
     SERVER_CTCP(ServerEvents.SERVER_CTCP_EVENT, "CTCP received"),
121 130
     /** Private CTCPR received. */
131
+    @Deprecated
122 132
     SERVER_CTCPR(ServerEvents.SERVER_CTCP_EVENT, "CTCP reply received"),
123 133
     /** Private notice received. */
134
+    @Deprecated
124 135
     SERVER_NOTICE(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Notice received"),
125 136
     /** Private server notice received. */
137
+    @Deprecated
126 138
     SERVER_SERVERNOTICE(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Server notice received"),
127 139
     /** MOTD starting. */
140
+    @Deprecated
128 141
     SERVER_MOTDSTART(ServerEvents.SERVER_EVENT_WITH_ARG, "Start of MOTD received"),
129 142
     /** MOTD ended. */
143
+    @Deprecated
130 144
     SERVER_MOTDEND(ServerEvents.SERVER_EVENT_WITH_ARG, "End of MOTD received"),
131 145
     /** MOTD line. */
146
+    @Deprecated
132 147
     SERVER_MOTDLINE(ServerEvents.SERVER_EVENT_WITH_ARG, "MOTD line received"),
133 148
     /** Ping reply received. */
149
+    @Deprecated
134 150
     SERVER_GOTPING(ServerEvents.SERVER_PING, "Received server ping reply"),
135 151
     /** Missed server ping reply. */
152
+    @Deprecated
136 153
     SERVER_NOPING(ServerEvents.SERVER_PING, "Missed server ping reply"),
137 154
     /** Ping sent. */
155
+    @Deprecated
138 156
     SERVER_PINGSENT(ServerEvents.SERVER_EVENT, "Ping request sent"),
139 157
     /** Invite received. */
158
+    @Deprecated
140 159
     SERVER_INVITERECEIVED(ServerEvents.SERVER_INVITE, "Invite received"),
141 160
     /** Wallops. */
161
+    @Deprecated
142 162
     SERVER_WALLOPS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Wallop received"),
143 163
     /** Wallusers. */
164
+    @Deprecated
144 165
     SERVER_WALLUSERS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walluser received"),
145 166
     /** Walldesync. */
167
+    @Deprecated
146 168
     SERVER_WALLDESYNC(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walldesync received"),
147 169
     /** Nick change. */
170
+    @Deprecated
148 171
     SERVER_NICKCHANGE(ServerEvents.SERVER_NICKCHANGE, "My nickname changed"),
149 172
     /** Names reply received. */
150 173
     @Deprecated

+ 49
- 0
src/com/dmdirc/events/ServerAuthnoticeEvent.java 查看文件

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired on receiving an auth notice.
29
+ */
30
+public class ServerAuthnoticeEvent extends ServerDisplayableEvent {
31
+
32
+    private final String notice;
33
+
34
+    public ServerAuthnoticeEvent(final long timestamp, final Connection connection,
35
+            final String notice) {
36
+        super(timestamp, connection);
37
+        this.notice = notice;
38
+    }
39
+
40
+    public ServerAuthnoticeEvent(final Connection connection, final String notice) {
41
+        super(connection);
42
+        this.notice = notice;
43
+    }
44
+
45
+    public String getNotice() {
46
+        return notice;
47
+    }
48
+
49
+}

+ 48
- 0
src/com/dmdirc/events/ServerAwayEvent.java 查看文件

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when you set away.
29
+ */
30
+public class ServerAwayEvent extends ServerDisplayableEvent {
31
+
32
+    private final String reason;
33
+
34
+    public ServerAwayEvent(final long timestamp, final Connection connection, final String reason) {
35
+        super(timestamp, connection);
36
+        this.reason = reason;
37
+    }
38
+
39
+    public ServerAwayEvent(final Connection connection, final String reason) {
40
+        super(connection);
41
+        this.reason = reason;
42
+    }
43
+
44
+    public String getReason() {
45
+        return reason;
46
+    }
47
+
48
+}

+ 40
- 0
src/com/dmdirc/events/ServerBackEvent.java 查看文件

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when you set back from being away.
29
+ */
30
+public class ServerBackEvent extends ServerDisplayableEvent {
31
+
32
+    public ServerBackEvent(final long timestamp, final Connection connection) {
33
+        super(timestamp, connection);
34
+    }
35
+
36
+    public ServerBackEvent(final Connection connection) {
37
+        super(connection);
38
+    }
39
+
40
+}

+ 74
- 0
src/com/dmdirc/events/ServerCtcpEvent.java 查看文件

@@ -0,0 +1,74 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired when receiving a CTCP event.
30
+ */
31
+public class ServerCtcpEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String type;
35
+    private final String content;
36
+    private boolean handled;
37
+
38
+    public ServerCtcpEvent(final long timestamp, final Connection connection,
39
+            final ClientInfo client, final String type, final String content) {
40
+        super(timestamp, connection);
41
+        this.client = client;
42
+        this.type = type;
43
+        this.content = content;
44
+    }
45
+
46
+    public ServerCtcpEvent(final Connection connection, final ClientInfo client, final String type,
47
+            final String content) {
48
+        super(connection);
49
+        this.client = client;
50
+        this.type = type;
51
+        this.content = content;
52
+    }
53
+
54
+    public ClientInfo getClient() {
55
+        return client;
56
+    }
57
+
58
+    public String getType() {
59
+        return type;
60
+    }
61
+
62
+    public String getContent() {
63
+        return content;
64
+    }
65
+
66
+    public boolean isHandled() {
67
+        return handled;
68
+    }
69
+
70
+    public void setHandled(final boolean handled) {
71
+        this.handled = handled;
72
+    }
73
+
74
+}

+ 64
- 0
src/com/dmdirc/events/ServerCtcprEvent.java 查看文件

@@ -0,0 +1,64 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired when sending a CTCP reply.
30
+ */
31
+public class ServerCtcprEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String type;
35
+    private final String content;
36
+
37
+    public ServerCtcprEvent(final long timestamp, final Connection connection,
38
+            final ClientInfo client, final String type, final String content) {
39
+        super(timestamp, connection);
40
+        this.client = client;
41
+        this.type = type;
42
+        this.content = content;
43
+    }
44
+
45
+    public ServerCtcprEvent(final Connection connection, final ClientInfo client, final String type,
46
+            final String content) {
47
+        super(connection);
48
+        this.client = client;
49
+        this.type = type;
50
+        this.content = content;
51
+    }
52
+
53
+    public ClientInfo getClient() {
54
+        return client;
55
+    }
56
+
57
+    public String getType() {
58
+        return type;
59
+    }
60
+
61
+    public String getContent() {
62
+        return content;
63
+    }
64
+}

+ 48
- 0
src/com/dmdirc/events/ServerErrorEvent.java 查看文件

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired on receipt of a server error.
29
+ */
30
+public class ServerErrorEvent extends ServerDisplayableEvent {
31
+
32
+    private final String reason;
33
+
34
+    public ServerErrorEvent(final long timestamp, final Connection connection, final String reason) {
35
+        super(timestamp, connection);
36
+        this.reason = reason;
37
+    }
38
+
39
+    public ServerErrorEvent(final Connection connection, final String reason) {
40
+        super(connection);
41
+        this.reason = reason;
42
+    }
43
+
44
+    public String getReason() {
45
+        return reason;
46
+    }
47
+
48
+}

+ 48
- 0
src/com/dmdirc/events/ServerGotpingEvent.java 查看文件

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when we receive a server ping reply.
29
+ */
30
+public class ServerGotpingEvent extends ServerEvent {
31
+
32
+    private final long ping;
33
+
34
+    public ServerGotpingEvent(final long timestamp, final Connection connection, final long ping) {
35
+        super(timestamp, connection);
36
+        this.ping = ping;
37
+    }
38
+
39
+    public ServerGotpingEvent(final Connection connection, final long ping) {
40
+        super(connection);
41
+        this.ping = ping;
42
+    }
43
+
44
+    public long getPing() {
45
+        return ping;
46
+    }
47
+
48
+}

+ 58
- 0
src/com/dmdirc/events/ServerInvitereceivedEvent.java 查看文件

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired when an invite is received.
30
+ */
31
+public class ServerInvitereceivedEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String channel;
35
+
36
+    public ServerInvitereceivedEvent(final long timestamp, final Connection connection,
37
+            final ClientInfo client, final String channel) {
38
+        super(timestamp, connection);
39
+        this.client = client;
40
+        this.channel = channel;
41
+    }
42
+
43
+    public ServerInvitereceivedEvent(final Connection connection, final ClientInfo client,
44
+            final String channel) {
45
+        super(connection);
46
+        this.client = client;
47
+        this.channel = channel;
48
+    }
49
+
50
+    public ClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getChannel() {
55
+        return channel;
56
+    }
57
+
58
+}

+ 49
- 0
src/com/dmdirc/events/ServerMotdendEvent.java 查看文件

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when the MOTD ends.
29
+ */
30
+public class ServerMotdendEvent extends ServerDisplayableEvent {
31
+
32
+    private final String message;
33
+
34
+    public ServerMotdendEvent(final long timestamp, final Connection connection,
35
+            final String message) {
36
+        super(timestamp, connection);
37
+        this.message = message;
38
+    }
39
+
40
+    public ServerMotdendEvent(final Connection connection, final String message) {
41
+        super(connection);
42
+        this.message = message;
43
+    }
44
+
45
+    public String getMessage() {
46
+        return message;
47
+    }
48
+
49
+}

+ 49
- 0
src/com/dmdirc/events/ServerMotdlineEvent.java 查看文件

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when the MOTD line is received.
29
+ */
30
+public class ServerMotdlineEvent extends ServerDisplayableEvent {
31
+
32
+    private final String message;
33
+
34
+    public ServerMotdlineEvent(final long timestamp, final Connection connection,
35
+            final String message) {
36
+        super(timestamp, connection);
37
+        this.message = message;
38
+    }
39
+
40
+    public ServerMotdlineEvent(final Connection connection, final String message) {
41
+        super(connection);
42
+        this.message = message;
43
+    }
44
+
45
+    public String getMessage() {
46
+        return message;
47
+    }
48
+
49
+}

+ 49
- 0
src/com/dmdirc/events/ServerMotdstartEvent.java 查看文件

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when the MOTD starts.
29
+ */
30
+public class ServerMotdstartEvent extends ServerDisplayableEvent {
31
+
32
+    private final String message;
33
+
34
+    public ServerMotdstartEvent(final long timestamp, final Connection connection,
35
+            final String message) {
36
+        super(timestamp, connection);
37
+        this.message = message;
38
+    }
39
+
40
+    public ServerMotdstartEvent(final Connection connection, final String message) {
41
+        super(connection);
42
+        this.message = message;
43
+    }
44
+
45
+    public String getMessage() {
46
+        return message;
47
+    }
48
+
49
+}

+ 57
- 0
src/com/dmdirc/events/ServerNickchangeEvent.java 查看文件

@@ -0,0 +1,57 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired on a change of a nickname.
29
+ */
30
+public class ServerNickchangeEvent extends ServerDisplayableEvent {
31
+
32
+    private final String oldNick;
33
+    private final String newNick;
34
+
35
+    public ServerNickchangeEvent(final long timestamp, final Connection connection,
36
+            final String oldNick, final String newNick) {
37
+        super(timestamp, connection);
38
+        this.oldNick = oldNick;
39
+        this.newNick = newNick;
40
+    }
41
+
42
+    public ServerNickchangeEvent(final Connection connection, final String oldNick,
43
+            final String newNick) {
44
+        super(connection);
45
+        this.oldNick = oldNick;
46
+        this.newNick = newNick;
47
+    }
48
+
49
+    public String getOldNick() {
50
+        return oldNick;
51
+    }
52
+
53
+    public String getNewNick() {
54
+        return newNick;
55
+    }
56
+
57
+}

+ 48
- 0
src/com/dmdirc/events/ServerNopingEvent.java 查看文件

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when we miss a server ping reply.
29
+ */
30
+public class ServerNopingEvent extends ServerEvent {
31
+
32
+    private final long ping;
33
+
34
+    public ServerNopingEvent(final long timestamp, final Connection connection, final long ping) {
35
+        super(timestamp, connection);
36
+        this.ping = ping;
37
+    }
38
+
39
+    public ServerNopingEvent(final Connection connection, final long ping) {
40
+        super(connection);
41
+        this.ping = ping;
42
+    }
43
+
44
+    public long getPing() {
45
+        return ping;
46
+    }
47
+
48
+}

+ 58
- 0
src/com/dmdirc/events/ServerNoticeEvent.java 查看文件

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired when receiving a notice.
30
+ */
31
+public class ServerNoticeEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String message;
35
+
36
+    public ServerNoticeEvent(final long timestamp, final Connection connection,
37
+            final ClientInfo client, final String message) {
38
+        super(timestamp, connection);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public ServerNoticeEvent(final Connection connection, final ClientInfo client,
44
+            final String message) {
45
+        super(connection);
46
+        this.client = client;
47
+        this.message = message;
48
+    }
49
+
50
+    public ClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getMessage() {
55
+        return message;
56
+    }
57
+
58
+}

+ 40
- 0
src/com/dmdirc/events/ServerPingsentEvent.java 查看文件

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when sending a server ping request.
29
+ */
30
+public class ServerPingsentEvent extends ServerEvent {
31
+
32
+    public ServerPingsentEvent(final long timestamp, final Connection connection) {
33
+        super(timestamp, connection);
34
+    }
35
+
36
+    public ServerPingsentEvent(final Connection connection) {
37
+        super(connection);
38
+    }
39
+
40
+}

+ 58
- 0
src/com/dmdirc/events/ServerServernoticeEvent.java 查看文件

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired when receiving a server notice.
30
+ */
31
+public class ServerServernoticeEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String message;
35
+
36
+    public ServerServernoticeEvent(final long timestamp, final Connection connection,
37
+            final ClientInfo client, final String message) {
38
+        super(timestamp, connection);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public ServerServernoticeEvent(final Connection connection, final ClientInfo client,
44
+            final String message) {
45
+        super(connection);
46
+        this.client = client;
47
+        this.message = message;
48
+    }
49
+
50
+    public ClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getMessage() {
55
+        return message;
56
+    }
57
+
58
+}

+ 64
- 0
src/com/dmdirc/events/ServerUnknownactionEvent.java 查看文件

@@ -0,0 +1,64 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when an unknown action is received.
29
+ */
30
+public class ServerUnknownactionEvent extends ServerDisplayableEvent {
31
+
32
+    private final String source;
33
+    private final String target;
34
+    private final String message;
35
+
36
+    public ServerUnknownactionEvent(final long timestamp, final Connection connection,
37
+            final String source, final String target, final String message) {
38
+        super(timestamp, connection);
39
+        this.source = source;
40
+        this.target = target;
41
+        this.message = message;
42
+    }
43
+
44
+    public ServerUnknownactionEvent(final Connection connection, final String source,
45
+            final String target, final String message) {
46
+        super(connection);
47
+        this.source = source;
48
+        this.target = target;
49
+        this.message = message;
50
+    }
51
+
52
+    public String getSource() {
53
+        return source;
54
+    }
55
+
56
+    public String getTarget() {
57
+        return target;
58
+    }
59
+
60
+    public String getMessage() {
61
+        return message;
62
+    }
63
+
64
+}

+ 64
- 0
src/com/dmdirc/events/ServerUnknownmessageEvent.java 查看文件

@@ -0,0 +1,64 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when an unknown message is received.
29
+ */
30
+public class ServerUnknownmessageEvent extends ServerDisplayableEvent {
31
+
32
+    private final String source;
33
+    private final String target;
34
+    private final String message;
35
+
36
+    public ServerUnknownmessageEvent(final long timestamp, final Connection connection,
37
+            final String source, final String target, final String message) {
38
+        super(timestamp, connection);
39
+        this.source = source;
40
+        this.target = target;
41
+        this.message = message;
42
+    }
43
+
44
+    public ServerUnknownmessageEvent(final Connection connection, final String source,
45
+            final String target, final String message) {
46
+        super(connection);
47
+        this.source = source;
48
+        this.target = target;
49
+        this.message = message;
50
+    }
51
+
52
+    public String getSource() {
53
+        return source;
54
+    }
55
+
56
+    public String getTarget() {
57
+        return target;
58
+    }
59
+
60
+    public String getMessage() {
61
+        return message;
62
+    }
63
+
64
+}

+ 64
- 0
src/com/dmdirc/events/ServerUnknownnoticeEvent.java 查看文件

@@ -0,0 +1,64 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Fired when an unknown notice is received.
29
+ */
30
+public class ServerUnknownnoticeEvent extends ServerDisplayableEvent {
31
+
32
+    private final String source;
33
+    private final String target;
34
+    private final String message;
35
+
36
+    public ServerUnknownnoticeEvent(final long timestamp, final Connection connection,
37
+            final String source, final String target, final String message) {
38
+        super(timestamp, connection);
39
+        this.source = source;
40
+        this.target = target;
41
+        this.message = message;
42
+    }
43
+
44
+    public ServerUnknownnoticeEvent(final Connection connection, final String source,
45
+            final String target, final String message) {
46
+        super(connection);
47
+        this.source = source;
48
+        this.target = target;
49
+        this.message = message;
50
+    }
51
+
52
+    public String getSource() {
53
+        return source;
54
+    }
55
+
56
+    public String getTarget() {
57
+        return target;
58
+    }
59
+
60
+    public String getMessage() {
61
+        return message;
62
+    }
63
+
64
+}

+ 58
- 0
src/com/dmdirc/events/ServerUsermodesEvent.java 查看文件

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired in on receipt of user modes.
30
+ */
31
+public class ServerUsermodesEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String message;
35
+
36
+    public ServerUsermodesEvent(final long timestamp, final Connection connection,
37
+            final ClientInfo client, final String message) {
38
+        super(timestamp, connection);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public ServerUsermodesEvent(final Connection connection, final ClientInfo client,
44
+            final String message) {
45
+        super(connection);
46
+        this.client = client;
47
+        this.message = message;
48
+    }
49
+
50
+    public ClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getMessage() {
55
+        return message;
56
+    }
57
+
58
+}

+ 58
- 0
src/com/dmdirc/events/ServerWalldesyncEvent.java 查看文件

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired when receiving a server walldesync.
30
+ */
31
+public class ServerWalldesyncEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String message;
35
+
36
+    public ServerWalldesyncEvent(final long timestamp, final Connection connection,
37
+            final ClientInfo client, final String message) {
38
+        super(timestamp, connection);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public ServerWalldesyncEvent(final Connection connection, final ClientInfo client,
44
+            final String message) {
45
+        super(connection);
46
+        this.client = client;
47
+        this.message = message;
48
+    }
49
+
50
+    public ClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getMessage() {
55
+        return message;
56
+    }
57
+
58
+}

+ 58
- 0
src/com/dmdirc/events/ServerWallopsEvent.java 查看文件

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired when receiving a server wallops.
30
+ */
31
+public class ServerWallopsEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String message;
35
+
36
+    public ServerWallopsEvent(final long timestamp, final Connection connection,
37
+            final ClientInfo client, final String message) {
38
+        super(timestamp, connection);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public ServerWallopsEvent(final Connection connection, final ClientInfo client,
44
+            final String message) {
45
+        super(connection);
46
+        this.client = client;
47
+        this.message = message;
48
+    }
49
+
50
+    public ClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getMessage() {
55
+        return message;
56
+    }
57
+
58
+}

+ 58
- 0
src/com/dmdirc/events/ServerWallusersEvent.java 查看文件

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Fired when receiving a server wallusers.
30
+ */
31
+public class ServerWallusersEvent extends ServerDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String message;
35
+
36
+    public ServerWallusersEvent(final long timestamp, final Connection connection,
37
+            final ClientInfo client, final String message) {
38
+        super(timestamp, connection);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public ServerWallusersEvent(final Connection connection, final ClientInfo client,
44
+            final String message) {
45
+        super(connection);
46
+        this.client = client;
47
+        this.message = message;
48
+    }
49
+
50
+    public ClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getMessage() {
55
+        return message;
56
+    }
57
+
58
+}

Loading…
取消
儲存