Browse Source

Add channel ctcp event.

Change-Id: If5a01bc68f57f30f3ab2b4d9e55acbb8104e1ad6
Reviewed-on: http://gerrit.dmdirc.com/3476
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
pull/1/head
Greg Holmes 10 years ago
parent
commit
258cd58b2e
1 changed files with 74 additions and 0 deletions
  1. 74
    0
      src/com/dmdirc/events/ChannelCtcpEvent.java

+ 74
- 0
src/com/dmdirc/events/ChannelCtcpEvent.java View File

@@ -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.Channel;
26
+import com.dmdirc.parser.interfaces.ChannelClientInfo;
27
+
28
+/**
29
+ * Fired on receiving a channel CTCP request.
30
+ */
31
+public class ChannelCtcpEvent extends ChannelDisplayableEvent {
32
+
33
+    private final ChannelClientInfo client;
34
+    private final String type;
35
+    private final String message;
36
+    private boolean handled;
37
+
38
+    public ChannelCtcpEvent(final long timestamp, final Channel channel,
39
+            final ChannelClientInfo client, final String type, final String message) {
40
+        super(timestamp, channel);
41
+        this.client = client;
42
+        this.type = type;
43
+        this.message = message;
44
+    }
45
+
46
+    public ChannelCtcpEvent(final Channel channel, final ChannelClientInfo client,
47
+            final String type, final String message) {
48
+        super(channel);
49
+        this.client = client;
50
+        this.type = type;
51
+        this.message = message;
52
+    }
53
+
54
+    public ChannelClientInfo getClient() {
55
+        return client;
56
+    }
57
+
58
+    public String getType() {
59
+        return type;
60
+    }
61
+
62
+    public String getMessage() {
63
+        return message;
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
+}

Loading…
Cancel
Save