1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.plugin.limewire;
21
22 import javax.swing.Action;
23
24 import org.xnap.chat.AbstractChannel;
25 import org.xnap.chat.ChatProvider;
26 import org.xnap.peer.Peer;
27
28 import com.limegroup.gnutella.chat.Chatter;
29
30 /***
31 * Implements a limewire search session.
32 */
33 public class LimeWireChatChannel extends AbstractChannel {
34
35
36
37
38
39 private LimeWireServant remotePeer;
40
41 private Chatter chatter;
42
43
44
45 public LimeWireChatChannel(Chatter chatter)
46 {
47 super(chatter.getHost());
48
49 this.chatter = chatter;
50 this.remotePeer
51 = new LimeWireServant(chatter.getHost(), chatter.getPort());
52
53 add(LimeWirePlugin.getChatManager().getLocalPeer());
54 add(remotePeer);
55 }
56
57
58
59 /***
60 * @see xnap.chat.Channel#close()
61 */
62 public void close()
63 {
64
65 }
66
67 /***
68 * @see xnap.chat.Channel#getActions()
69 */
70 public Action[] getActions() {
71 return null;
72 }
73
74 /***
75 * @see xnap.chat.Channel#getPeerActions(xnap.peer.Peer)
76 */
77 public Action[] getPeerActions(Peer peer)
78 {
79 return null;
80 }
81
82 /***
83 * @see xnap.chat.Channel#getProvider()
84 */
85 public ChatProvider getProvider()
86 {
87 return null;
88 }
89
90 public LimeWireServant getRemotePeer()
91 {
92 return remotePeer;
93 }
94
95 /***
96 * @see xnap.chat.Channel#isLocal(xnap.peer.Peer)
97 */
98 public boolean isLocal(Peer peer)
99 {
100 return peer == LimeWirePlugin.getChatManager().getLocalPeer();
101 }
102
103 /***
104 * @see xnap.chat.Channel#isJoined()
105 */
106 public boolean isJoined()
107 {
108 return false;
109 }
110
111 /***
112 * @see xnap.chat.Channel#sendMessage(java.lang.String)
113 */
114 public void sendMessage(String message)
115 {
116 chatter.send(message);
117
118 messageReceived(LimeWirePlugin.getChatManager().getLocalPeer(),
119 message);
120 }
121
122 }
123