Переглянути джерело

Use all the new channel events.

Change-Id: Iccd094635493e5379cdb1e4771edbbca68a61ed6
Reviewed-on: http://gerrit.dmdirc.com/3481
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
pull/1/head
Greg Holmes 10 роки тому
джерело
коміт
9632b3fcce

+ 12
- 17
src/com/dmdirc/Channel.java Переглянути файл

@@ -22,11 +22,12 @@
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.commandparser.CommandType;
28 26
 import com.dmdirc.commandparser.parsers.ChannelCommandParser;
27
+import com.dmdirc.events.ChannelActionEvent;
29 28
 import com.dmdirc.events.ChannelClosedEvent;
29
+import com.dmdirc.events.DisplayableEvent;
30
+import com.dmdirc.events.EventUtils;
30 31
 import com.dmdirc.interfaces.CommandController;
31 32
 import com.dmdirc.interfaces.Connection;
32 33
 import com.dmdirc.interfaces.GroupChat;
@@ -141,7 +142,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener, Grou
141 142
         showModePrefix = getConfigManager().getOptionBool("channel", "showmodeprefix");
142 143
         showColours = getConfigManager().getOptionBool("ui", "shownickcoloursintext");
143 144
 
144
-        eventHandler = new ChannelEventHandler(this, eventBus);
145
+        eventHandler = new ChannelEventHandler(this, getEventBus());
145 146
 
146 147
         registerCallbacks();
147 148
 
@@ -180,14 +181,11 @@ public class Channel extends MessageTarget implements ConfigChangeListener, Grou
180 181
 
181 182
         for (String part : splitLine(line)) {
182 183
             if (!part.isEmpty()) {
183
-                final StringBuffer buff = new StringBuffer("channelSelfMessage");
184
-
185
-                ActionManager.getActionManager().triggerEvent(
186
-                        CoreActionType.CHANNEL_SELF_MESSAGE, buff, this,
184
+                final DisplayableEvent event = new ChannelActionEvent(this,
187 185
                         channelInfo.getChannelClient(me), part);
188
-
189
-                addLine(buff, details[0], details[1], details[2], details[3],
190
-                        part, channelInfo);
186
+                final String format = EventUtils.postDisplayable(getEventBus(), event,
187
+                        "channelSelfMessage");
188
+                addLine(format, details[0], details[1], details[2], details[3], part, channelInfo);
191 189
 
192 190
                 channelInfo.sendMessage(part);
193 191
             }
@@ -216,14 +214,11 @@ public class Channel extends MessageTarget implements ConfigChangeListener, Grou
216 214
                 <= action.length()) {
217 215
             addLine("actionTooLong", action.length());
218 216
         } else {
219
-            final StringBuffer buff = new StringBuffer("channelSelfAction");
220
-
221
-            ActionManager.getActionManager().triggerEvent(
222
-                    CoreActionType.CHANNEL_SELF_ACTION, buff, this,
217
+            final DisplayableEvent event = new ChannelActionEvent(this,
223 218
                     channelInfo.getChannelClient(me), action);
224
-
225
-            addLine(buff, details[0], details[1], details[2], details[3],
226
-                    action, channelInfo);
219
+            final String format = EventUtils.postDisplayable(getEventBus(), event,
220
+                    "channelSelfAction");
221
+            addLine(format, details[0], details[1], details[2], details[3], action, channelInfo);
227 222
 
228 223
             channelInfo.sendAction(action);
229 224
         }

+ 75
- 96
src/com/dmdirc/ChannelEventHandler.java Переглянути файл

@@ -22,12 +22,22 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
-import com.dmdirc.actions.ActionManager;
26
-import com.dmdirc.actions.CoreActionType;
25
+import com.dmdirc.events.ChannelActionEvent;
26
+import com.dmdirc.events.ChannelCtcpEvent;
27
+import com.dmdirc.events.ChannelGotnamesEvent;
28
+import com.dmdirc.events.ChannelGottopicEvent;
29
+import com.dmdirc.events.ChannelJoinEvent;
30
+import com.dmdirc.events.ChannelKickEvent;
27 31
 import com.dmdirc.events.ChannelListmodesretrievedEvent;
32
+import com.dmdirc.events.ChannelMessageEvent;
33
+import com.dmdirc.events.ChannelModeNoticeEvent;
28 34
 import com.dmdirc.events.ChannelModechangeEvent;
29 35
 import com.dmdirc.events.ChannelModesdiscoveredEvent;
30 36
 import com.dmdirc.events.ChannelNickchangeEvent;
37
+import com.dmdirc.events.ChannelNoticeEvent;
38
+import com.dmdirc.events.ChannelNotopicEvent;
39
+import com.dmdirc.events.ChannelPartEvent;
40
+import com.dmdirc.events.ChannelQuitEvent;
31 41
 import com.dmdirc.events.ChannelTopicChangeEvent;
32 42
 import com.dmdirc.events.ChannelUserAwayEvent;
33 43
 import com.dmdirc.events.ChannelUserBackEvent;
@@ -35,7 +45,6 @@ import com.dmdirc.events.ChannelUsermodechangeEvent;
35 45
 import com.dmdirc.events.DisplayableEvent;
36 46
 import com.dmdirc.events.EventUtils;
37 47
 import com.dmdirc.interfaces.Connection;
38
-import com.dmdirc.interfaces.actions.ActionType;
39 48
 import com.dmdirc.parser.common.AwayState;
40 49
 import com.dmdirc.parser.common.CallbackManager;
41 50
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
@@ -65,10 +74,7 @@ import com.google.common.base.Optional;
65 74
 import com.google.common.base.Strings;
66 75
 import com.google.common.eventbus.EventBus;
67 76
 
68
-import java.util.ArrayList;
69
-import java.util.Arrays;
70 77
 import java.util.Date;
71
-import java.util.List;
72 78
 
73 79
 /**
74 80
  * Handles events for channel objects.
@@ -125,10 +131,10 @@ public class ChannelEventHandler extends EventHandler implements
125 131
             final String message, final String host) {
126 132
         checkParser(parser);
127 133
 
128
-        final StringBuffer messageType = new StringBuffer(
134
+        final DisplayableEvent event = new ChannelMessageEvent(owner, client, message);
135
+        final String format = EventUtils.postDisplayable(eventBus, event,
129 136
                 isMyself(client) ? "channelSelfExternalMessage" : "channelMessage");
130
-        triggerAction(messageType, CoreActionType.CHANNEL_MESSAGE, client, message);
131
-        owner.doNotification(date, messageType.toString(), client, message);
137
+        owner.doNotification(date, format, client, message);
132 138
     }
133 139
 
134 140
     @Override
@@ -136,7 +142,7 @@ public class ChannelEventHandler extends EventHandler implements
136 142
         checkParser(parser);
137 143
 
138 144
         owner.setClients(channel.getChannelClients());
139
-        ActionManager.getActionManager().triggerEvent(CoreActionType.CHANNEL_GOTNAMES, null, owner);
145
+        eventBus.post(new ChannelGotnamesEvent(owner));
140 146
     }
141 147
 
142 148
     @Override
@@ -146,27 +152,27 @@ public class ChannelEventHandler extends EventHandler implements
146 152
 
147 153
         if (isJoinTopic) {
148 154
             if (Strings.isNullOrEmpty(channel.getTopic())) {
149
-                final StringBuffer messageType = new StringBuffer("channelNoTopic");
150
-                triggerAction(messageType, CoreActionType.CHANNEL_NOTOPIC);
151
-                owner.doNotification(date, messageType.toString());
155
+                final DisplayableEvent event = new ChannelNotopicEvent(owner);
156
+                final String format = EventUtils.postDisplayable(eventBus, event, "channelNoTopic");
157
+                owner.doNotification(date, format);
152 158
             } else {
153 159
                 final Topic newTopic = new Topic(channel.getTopic(), channel.getTopicSetter(),
154 160
                         channel.getTopicTime());
155
-                final StringBuffer messageType = new StringBuffer("channelTopicDiscovered");
156
-                triggerAction(messageType, CoreActionType.CHANNEL_GOTTOPIC, newTopic);
157
-                owner.doNotification(date, messageType.toString(), newTopic);
161
+                final DisplayableEvent event = new ChannelGottopicEvent(owner, newTopic);
162
+                final String format = EventUtils.postDisplayable(eventBus, event,
163
+                        "channelTopicDiscovered");
164
+                owner.doNotification(date, format, newTopic);
158 165
             }
159 166
         } else {
160
-            final StringBuffer messageType = new StringBuffer(
161
-                    Strings.isNullOrEmpty(channel.getTopic())
162
-                    ? "channelTopicRemoved" : "channelTopicChanged");
163 167
             final DisplayableEvent event = new ChannelTopicChangeEvent(owner,
164 168
                     channel.getChannelClient(channel.getTopicSetter(), true),
165 169
                     channel.getTopic());
166
-            event.setDisplayFormat(messageType.toString());
170
+            final String format = EventUtils.postDisplayable(eventBus, event,
171
+                    Strings.isNullOrEmpty(channel.getTopic())
172
+                    ? "channelTopicRemoved" : "channelTopicChanged");
167 173
             eventBus.post(event);
168
-            owner.doNotification(date, messageType.toString(),
169
-                    channel.getChannelClient(channel.getTopicSetter(), true), channel.getTopic());
174
+            owner.doNotification(date, format, channel.getChannelClient(channel.getTopicSetter(),
175
+                    true), channel.getTopic());
170 176
         }
171 177
 
172 178
         final Optional<Topic> currentTopic = owner.getCurrentTopic();
@@ -189,9 +195,9 @@ public class ChannelEventHandler extends EventHandler implements
189 195
             final ChannelClientInfo client) {
190 196
         checkParser(parser);
191 197
 
192
-        final StringBuffer messageType = new StringBuffer("channelJoin");
193
-        triggerAction(messageType, CoreActionType.CHANNEL_JOIN, client);
194
-        owner.doNotification(date, messageType.toString(), client);
198
+        final DisplayableEvent event = new ChannelJoinEvent(owner, client);
199
+        final String format = EventUtils.postDisplayable(eventBus, event, "channelJoin");
200
+        owner.doNotification(date, format, client);
195 201
         owner.addClient(client);
196 202
     }
197 203
 
@@ -200,13 +206,12 @@ public class ChannelEventHandler extends EventHandler implements
200 206
             final ChannelClientInfo client, final String reason) {
201 207
         checkParser(parser);
202 208
 
203
-        final StringBuffer messageType = new StringBuffer(
209
+        final DisplayableEvent event = new ChannelPartEvent(owner, client, reason);
210
+        final String format = EventUtils.postDisplayable(eventBus, event,
204 211
                 "channel"
205 212
                 + (isMyself(client) ? "Self" : "") + "Part"
206 213
                 + (reason.isEmpty() ? "" : "Reason"));
207
-
208
-        triggerAction(messageType, CoreActionType.CHANNEL_PART, client, reason);
209
-        owner.doNotification(date, messageType.toString(), client, reason);
214
+        owner.doNotification(date, format, client, reason);
210 215
         owner.removeClient(client);
211 216
     }
212 217
 
@@ -216,11 +221,10 @@ public class ChannelEventHandler extends EventHandler implements
216 221
             final String reason, final String host) {
217 222
         checkParser(parser);
218 223
 
219
-        final StringBuffer messageType = new StringBuffer(
224
+        final DisplayableEvent event = new ChannelKickEvent(owner, client, kickedClient, reason);
225
+        final String format = EventUtils.postDisplayable(eventBus, event,
220 226
                 "channelKick" + (reason.isEmpty() ? "" : "Reason"));
221
-        triggerAction(messageType,
222
-                CoreActionType.CHANNEL_KICK, client, kickedClient, reason);
223
-        owner.doNotification(date, messageType.toString(), client, kickedClient, reason);
227
+        owner.doNotification(date, format, client, kickedClient, reason);
224 228
         owner.removeClient(kickedClient);
225 229
     }
226 230
 
@@ -229,10 +233,10 @@ public class ChannelEventHandler extends EventHandler implements
229 233
             final ChannelClientInfo client, final String reason) {
230 234
         checkParser(parser);
231 235
 
232
-        final StringBuffer messageType = new StringBuffer(
236
+        final DisplayableEvent event = new ChannelQuitEvent(owner, client, reason);
237
+        final String format = EventUtils.postDisplayable(eventBus, event,
233 238
                 "channelQuit" + (reason.isEmpty() ? "" : "Reason"));
234
-        triggerAction(messageType, CoreActionType.CHANNEL_QUIT, client, reason);
235
-        owner.doNotification(date, messageType.toString(), client, reason);
239
+        owner.doNotification(date, format, client, reason);
236 240
         owner.removeClient(client);
237 241
     }
238 242
 
@@ -242,10 +246,10 @@ public class ChannelEventHandler extends EventHandler implements
242 246
             final String host) {
243 247
         checkParser(parser);
244 248
 
245
-        final StringBuffer messageType = new StringBuffer(
249
+        final DisplayableEvent event = new ChannelActionEvent(owner, client, message);
250
+        final String format = EventUtils.postDisplayable(eventBus, event,
246 251
                 isMyself(client) ? "channelSelfExternalAction" : "channelAction");
247
-        triggerAction(messageType, CoreActionType.CHANNEL_ACTION, client, message);
248
-        owner.doNotification(date, messageType.toString(), client, message);
252
+        owner.doNotification(date, format, client, message);
249 253
     }
250 254
 
251 255
     @Override
@@ -253,13 +257,10 @@ public class ChannelEventHandler extends EventHandler implements
253 257
             final ChannelInfo channel, final ChannelClientInfo client, final String oldNick) {
254 258
         checkParser(parser);
255 259
 
256
-        final StringBuffer messageType = new StringBuffer(
257
-                isMyself(client) ? "channelSelfNickChange" : "channelNickChange");
258
-
259 260
         final DisplayableEvent event = new ChannelNickchangeEvent(owner, client, oldNick);
260
-        event.setDisplayFormat(messageType.toString());
261
-        eventBus.post(event);
262
-        owner.doNotification(date, messageType.toString(), client, oldNick);
261
+        final String format = EventUtils.postDisplayable(eventBus, event,
262
+                isMyself(client) ? "channelSelfNickChange" : "channelNickChange");
263
+        owner.doNotification(date, format, client, oldNick);
263 264
         owner.renameClient(oldNick, client.getClient().getNickname());
264 265
     }
265 266
 
@@ -272,21 +273,16 @@ public class ChannelEventHandler extends EventHandler implements
272 273
         if (!owner.getConfigManager().getOptionBool("channel", "splitusermodes")
273 274
                 || !owner.getConfigManager().getOptionBool("channel", "hideduplicatemodes")) {
274 275
             if (host.isEmpty()) {
275
-                final StringBuffer messageType = new StringBuffer(
276
-                        modes.length() <= 1 ? "channelNoModes" : "channelModeDiscovered");
277 276
                 final DisplayableEvent event = new ChannelModesdiscoveredEvent(owner,
278 277
                         modes.length() <= 1 ? "" : modes);
279
-                event.setDisplayFormat(host);
280
-                eventBus.post(event);
281
-                owner.doNotification(date, messageType.toString(),
282
-                        modes.length() <= 1 ? "" : modes);
278
+                final String format = EventUtils.postDisplayable(eventBus, event,
279
+                        modes.length() <= 1 ? "channelNoModes" : "channelModeDiscovered");
280
+                owner.doNotification(date, format, modes.length() <= 1 ? "" : modes);
283 281
             } else {
284
-                final StringBuffer messageType = new StringBuffer(
285
-                        isMyself(client) ? "channelSelfModeChanged" : "channelModeChanged");
286 282
                 final DisplayableEvent event = new ChannelModechangeEvent(owner, client, modes);
287
-                event.setDisplayFormat(messageType.toString());
288
-                eventBus.post(event);
289
-                owner.doNotification(date, messageType.toString(), client, modes);
283
+                final String format = EventUtils.postDisplayable(eventBus, event,
284
+                        isMyself(client) ? "channelSelfModeChanged" : "channelModeChanged");
285
+                owner.doNotification(date, format, client, modes);
290 286
             }
291 287
         }
292 288
 
@@ -306,12 +302,10 @@ public class ChannelEventHandler extends EventHandler implements
306 302
                 format = "channelSplitUserMode_default";
307 303
             }
308 304
 
309
-            final StringBuffer messageType = new StringBuffer(format);
310 305
             final DisplayableEvent event = new ChannelUsermodechangeEvent(owner, client,
311 306
                     targetClient, mode);
312
-            event.setDisplayFormat(format);
313
-            eventBus.post(event);
314
-            owner.doNotification(date, messageType.toString(), client, targetClient, mode);
307
+            final String result = EventUtils.postDisplayable(eventBus, event, format);
308
+            owner.doNotification(date, result, client, targetClient, mode);
315 309
         }
316 310
     }
317 311
 
@@ -321,12 +315,12 @@ public class ChannelEventHandler extends EventHandler implements
321 315
             final String type, final String message, final String host) {
322 316
         checkParser(parser);
323 317
 
324
-        final StringBuffer messageType = new StringBuffer("channelCTCP");
325
-        if (triggerAction(messageType, CoreActionType.CHANNEL_CTCP, client, type, message)) {
326
-            owner.getConnection().sendCTCPReply(client.getClient().getNickname(),
327
-                    type, message);
318
+        final ChannelCtcpEvent event = new ChannelCtcpEvent(owner, client, type, message);
319
+        final String format = EventUtils.postDisplayable(eventBus, event, "channelCTCP");
320
+        if (!event.isHandled()) {
321
+            owner.getConnection().sendCTCPReply(client.getClient().getNickname(), type, message);
328 322
         }
329
-        owner.doNotification(date, messageType.toString(), client, type, message);
323
+        owner.doNotification(date, format, client, type, message);
330 324
     }
331 325
 
332 326
     @Override
@@ -357,9 +351,9 @@ public class ChannelEventHandler extends EventHandler implements
357 351
             final String message, final String host) {
358 352
         checkParser(parser);
359 353
 
360
-        final StringBuffer messageType = new StringBuffer("channelNotice");
361
-        triggerAction(messageType, CoreActionType.CHANNEL_NOTICE, client, message);
362
-        owner.doNotification(date, messageType.toString(), client, message);
354
+        final DisplayableEvent event = new ChannelNoticeEvent(owner, client, message);
355
+        final String format = EventUtils.postDisplayable(eventBus, event, "channelNotice");
356
+        owner.doNotification(date, format, client, message);
363 357
     }
364 358
 
365 359
     @Override
@@ -371,21 +365,16 @@ public class ChannelEventHandler extends EventHandler implements
371 365
         if (owner.getConfigManager().getOptionBool("channel", "splitusermodes")
372 366
                 && owner.getConfigManager().getOptionBool("channel", "hideduplicatemodes")) {
373 367
             if (host.isEmpty()) {
374
-                final StringBuffer messageType = new StringBuffer(
375
-                        modes.length() <= 1 ? "channelNoModes" : "channelModeDiscovered");
376 368
                 final DisplayableEvent event = new ChannelModesdiscoveredEvent(owner,
377 369
                         modes.length() <= 1 ? "" : modes);
378
-                event.setDisplayFormat(host);
379
-                eventBus.post(event);
380
-                owner.doNotification(date, messageType.toString(),
381
-                        modes.length() <= 1 ? "" : modes);
370
+                final String format = EventUtils.postDisplayable(eventBus, event,
371
+                        modes.length() <= 1 ? "channelNoModes" : "channelModeDiscovered");
372
+                owner.doNotification(date, format, modes.length() <= 1 ? "" : modes);
382 373
             } else {
383
-                final StringBuffer messageType = new StringBuffer(
384
-                        isMyself(client) ? "channelSelfModeChanged" : "channelModeChanged");
385 374
                 final DisplayableEvent event = new ChannelModechangeEvent(owner, client, modes);
386
-                event.setDisplayFormat(messageType.toString());
387
-                eventBus.post(event);
388
-                owner.doNotification(date, messageType.toString(), client, modes);
375
+                final String format = EventUtils.postDisplayable(eventBus, event,
376
+                        isMyself(client) ? "channelSelfModeChanged" : "channelModeChanged");
377
+                owner.doNotification(date, format, client, modes);
389 378
             }
390 379
         }
391 380
 
@@ -399,11 +388,10 @@ public class ChannelEventHandler extends EventHandler implements
399 388
             final String host) {
400 389
         checkParser(parser);
401 390
 
402
-        final StringBuffer messageType = new StringBuffer("channelModeNotice");
403
-        triggerAction(messageType, CoreActionType.CHANNEL_MODE_NOTICE, client, String.
404
-                valueOf(prefix), message);
405
-        owner.doNotification(date, messageType.toString(),
406
-                client, String.valueOf(prefix), message);
391
+        final DisplayableEvent event = new ChannelModeNoticeEvent(owner, client,
392
+                String.valueOf(prefix), message);
393
+        final String format = EventUtils.postDisplayable(eventBus, event, "channelModeNotice");
394
+        owner.doNotification(date, format, client, String.valueOf(prefix), message);
407 395
     }
408 396
 
409 397
     @Override
@@ -412,18 +400,9 @@ public class ChannelEventHandler extends EventHandler implements
412 400
         checkParser(parser);
413 401
 
414 402
         final DisplayableEvent event = new ChannelListmodesretrievedEvent(owner, mode);
415
-        event.setDisplayFormat("channelListModeRetrieved");
416
-        eventBus.post(event);
417
-        owner.doNotification(date, "channelListModeRetrieved", mode);
418
-    }
419
-
420
-    private boolean triggerAction(final StringBuffer messageType, final ActionType actionType,
421
-            final Object... args) {
422
-        final List<Object> actionArgs = new ArrayList<>();
423
-        actionArgs.add(owner);
424
-        actionArgs.addAll(Arrays.asList(args));
425
-        return ActionManager.getActionManager().triggerEvent(actionType, messageType,
426
-                actionArgs.toArray());
403
+        final String format = EventUtils.postDisplayable(eventBus, event,
404
+                "channelListModeRetrieved");
405
+        owner.doNotification(date, format, mode);
427 406
     }
428 407
 
429 408
 }

+ 15
- 3
src/com/dmdirc/actions/CoreActionType.java Переглянути файл

@@ -150,35 +150,47 @@ public enum CoreActionType implements ActionType {
150 150
     /** Channel window closed. */
151 151
     CHANNEL_CLOSED(ChannelEvents.CHANNEL_EVENT, "Channel window closed"),
152 152
     /** Names reply received. */
153
+    @Deprecated
153 154
     CHANNEL_GOTNAMES(ChannelEvents.CHANNEL_EVENT, "Channel names reply received"),
154 155
     /** Channel topic is not set. */
156
+    @Deprecated
155 157
     CHANNEL_NOTOPIC(ChannelEvents.CHANNEL_EVENT, "Channel topic is not set"),
156 158
     /** Channel topic received. */
159
+    @Deprecated
157 160
     CHANNEL_GOTTOPIC(ChannelEvents.CHANNEL_TOPICEVENT, "Channel topic received"),
158 161
     /** Channel message sent. */
162
+    @Deprecated
159 163
     CHANNEL_SELF_MESSAGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel message sent"),
160 164
     /** Channel action sent. */
165
+    @Deprecated
161 166
     CHANNEL_SELF_ACTION(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel action sent"),
162 167
     /** Channel message received. */
168
+    @Deprecated
163 169
     CHANNEL_MESSAGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel message received"),
164 170
     /** Channel actions received. */
171
+    @Deprecated
165 172
     CHANNEL_ACTION(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel action received"),
166 173
     /** Channel notice received. */
174
+    @Deprecated
167 175
     CHANNEL_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel notice received"),
168
-    /** Channel mode notice received.
169
-     *
170
-     * @since 0.6.3m2 */
176
+    /** Channel mode notice received. */
177
+    @Deprecated
171 178
     CHANNEL_MODE_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_CHARARG,
172 179
             "Channel mode notice received"),
173 180
     /** Channel CTCP received. */
181
+    @Deprecated
174 182
     CHANNEL_CTCP(ChannelEvents.CHANNEL_CTCP, "Channel CTCP received"),
175 183
     /** Someone joined a channel. */
184
+    @Deprecated
176 185
     CHANNEL_JOIN(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone joined a channel"),
177 186
     /** Someone left a channel. */
187
+    @Deprecated
178 188
     CHANNEL_PART(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone left a channel"),
179 189
     /** Someone quit. */
190
+    @Deprecated
180 191
     CHANNEL_QUIT(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone quit IRC"),
181 192
     /** Someone was kicked. */
193
+    @Deprecated
182 194
     CHANNEL_KICK(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_VICTIM, "Someone kicked someone"),
183 195
     /** Someone marked as away. */
184 196
     @Deprecated

+ 1
- 1
src/com/dmdirc/events/ChannelGotnamesEvent.java Переглянути файл

@@ -27,7 +27,7 @@ import com.dmdirc.Channel;
27 27
 /**
28 28
  * Fired when a channel names event is received.
29 29
  */
30
-public class ChannelGotnamesEvent extends ChannelDisplayableEvent {
30
+public class ChannelGotnamesEvent extends ChannelEvent {
31 31
 
32 32
     public ChannelGotnamesEvent(final long timestamp, final Channel channel) {
33 33
         super(timestamp, channel);

+ 40
- 0
src/com/dmdirc/events/ChannelNotopicEvent.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.Channel;
26
+
27
+/**
28
+ * Fired when a topic is unset on a channel.
29
+ */
30
+public class ChannelNotopicEvent extends ChannelDisplayableEvent {
31
+
32
+    public ChannelNotopicEvent(final long timestamp, final Channel channel) {
33
+        super(timestamp, channel);
34
+    }
35
+
36
+    public ChannelNotopicEvent(final Channel channel) {
37
+        super(channel);
38
+    }
39
+
40
+}

Завантаження…
Відмінити
Зберегти