|
@@ -24,9 +24,9 @@ package com.dmdirc.addons.parser_msn;
|
24
|
24
|
|
25
|
25
|
import com.dmdirc.parser.common.BaseParser;
|
26
|
26
|
import com.dmdirc.parser.common.ChannelJoinRequest;
|
|
27
|
+import com.dmdirc.parser.common.ChildImplementations;
|
27
|
28
|
import com.dmdirc.parser.common.DefaultStringConverter;
|
28
|
29
|
import com.dmdirc.parser.common.QueuePriority;
|
29
|
|
-import com.dmdirc.parser.interfaces.ChannelClientInfo;
|
30
|
30
|
import com.dmdirc.parser.interfaces.ChannelInfo;
|
31
|
31
|
import com.dmdirc.parser.interfaces.ClientInfo;
|
32
|
32
|
import com.dmdirc.parser.interfaces.LocalClientInfo;
|
|
@@ -46,11 +46,12 @@ import net.sf.jml.impl.MsnMessengerFactory;
|
46
|
46
|
/**
|
47
|
47
|
* A parser which can understand the MSN protocol.
|
48
|
48
|
*/
|
|
49
|
+@ChildImplementations({
|
|
50
|
+ MSNClientInfo.class, MSNLocalClientInfo.class, MSNFakeChannel.class,
|
|
51
|
+ MSNChannelClientInfo.class
|
|
52
|
+})
|
49
|
53
|
public class MSNParser extends BaseParser {
|
50
|
54
|
|
51
|
|
- /** A map of this parser's implementations of common interfaces. */
|
52
|
|
- private static final Map<Class<?>, Class<?>> IMPL_MAP
|
53
|
|
- = new HashMap<Class<?>, Class<?>>();
|
54
|
55
|
/** MSN Connection. */
|
55
|
56
|
private MsnMessenger msn;
|
56
|
57
|
/** A cache of known clients. */
|
|
@@ -61,21 +62,13 @@ public class MSNParser extends BaseParser {
|
61
|
62
|
/** The fake channel to use is useFakeChannel is enabled. */
|
62
|
63
|
private MSNFakeChannel fakeChannel;
|
63
|
64
|
|
64
|
|
- /** Creates map of this parser's implementations of common interfaces. */
|
65
|
|
- static {
|
66
|
|
- IMPL_MAP.put(ClientInfo.class, MSNClientInfo.class);
|
67
|
|
- IMPL_MAP.put(LocalClientInfo.class, MSNLocalClientInfo.class);
|
68
|
|
- IMPL_MAP.put(ChannelInfo.class, MSNFakeChannel.class);
|
69
|
|
- IMPL_MAP.put(ChannelClientInfo.class, MSNChannelClientInfo.class);
|
70
|
|
- }
|
71
|
|
-
|
72
|
65
|
/**
|
73
|
66
|
* Creates a new parser for the specified address.
|
74
|
67
|
*
|
75
|
68
|
* @param address The address to connect to
|
76
|
69
|
*/
|
77
|
70
|
public MSNParser(final URI address) {
|
78
|
|
- super(address, IMPL_MAP);
|
|
71
|
+ super(address);
|
79
|
72
|
|
80
|
73
|
useFakeChannel = address.getQuery().matches(
|
81
|
74
|
"(?i).*(^|&)showchannel($|&).*");
|