Browse Source

Remove MSN Parser.

Change-Id: I2a6e24b15ec160736a3e11003401dda36f96bae3
Reviewed-on: http://gerrit.dmdirc.com/3103
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.8
Greg Holmes 10 years ago
parent
commit
ec20477568

+ 0
- 5
build.xml View File

@@ -145,11 +145,6 @@ version:
145 145
             <zipfileset src="${plugins.lib}/main/smackx.jar" includes="org/** com/**"/>
146 146
         </jar>
147 147
 
148
-       <jar destfile="${plugins.dist}/parser_msn.jar" update="true">
149
-            <zipfileset src="${plugins.lib}/main/jml.jar" includes="net/** org/**"/>
150
-            <zipfileset src="${plugins.lib}/main/httpcore.jar" includes="org/**"/>
151
-        </jar>
152
-
153 148
         <jar destfile="${plugins.dist}/windowflashing.jar" update="true">
154 149
             <zipfileset src="${plugins.lib}/main/jna.jar" includes="com/**"/>
155 150
             <zipfileset src="${plugins.lib}/main/platform.jar" includes="com/**"/>

+ 0
- 1
ivy.xml View File

@@ -28,7 +28,6 @@
28 28
         <dependency org="com.greboid.libraries" name="locksupport" rev="latest.release" conf="main->default" />
29 29
         <dependency org="com.greboid.libraries" name="menuscroller" rev="latest.release" conf="main->default" />
30 30
         <dependency org="org.mortbay.jetty" name="jetty" rev="6.+" conf="main->default" />
31
-        <dependency org="net.sourceforge.java-jml" name="jml" rev="1.+" conf="main->default" />
32 31
         <dependency org="commons-lang" name="commons-lang" rev="latest.release" conf="main->default" />
33 32
     </dependencies>
34 33
 </ivy-module>

+ 0
- 82
src/com/dmdirc/addons/parser_msn/MSNChannelClientInfo.java View File

@@ -1,82 +0,0 @@
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.addons.parser_msn;
24
-
25
-import com.dmdirc.parser.common.BaseChannelClientInfo;
26
-import com.dmdirc.parser.interfaces.ChannelClientInfo;
27
-import com.dmdirc.parser.interfaces.ChannelInfo;
28
-import com.dmdirc.parser.interfaces.ClientInfo;
29
-
30
-/**
31
- * An MSN-specific channel client info object.
32
- */
33
-public class MSNChannelClientInfo extends BaseChannelClientInfo {
34
-
35
-    /**
36
-     * Creates a new client info object for the specified channel and client.
37
-     *
38
-     * @param channel The channel the association is with
39
-     * @param client The user that holds the association
40
-     */
41
-    public MSNChannelClientInfo(final ChannelInfo channel,
42
-            final ClientInfo client) {
43
-        super(channel, client);
44
-    }
45
-
46
-    /** {@inheritDoc} */
47
-    @Override
48
-    public String getImportantModePrefix() {
49
-        return "";
50
-    }
51
-
52
-    /** {@inheritDoc} */
53
-    @Override
54
-    public String getImportantMode() {
55
-        return "";
56
-    }
57
-
58
-    /** {@inheritDoc} */
59
-    @Override
60
-    public String getAllModes() {
61
-        return "";
62
-    }
63
-
64
-    /** {@inheritDoc} */
65
-    @Override
66
-    public String getAllModesPrefix() {
67
-        return "";
68
-    }
69
-
70
-    /** {@inheritDoc} */
71
-    @Override
72
-    public void kick(final String message) {
73
-        //Ignore
74
-    }
75
-
76
-    /** {@inheritDoc} */
77
-    @Override
78
-    public int compareTo(final ChannelClientInfo o) {
79
-        return 0;
80
-    }
81
-
82
-}

+ 0
- 91
src/com/dmdirc/addons/parser_msn/MSNClientInfo.java View File

@@ -1,91 +0,0 @@
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.addons.parser_msn;
24
-
25
-import com.dmdirc.parser.common.AwayState;
26
-import com.dmdirc.parser.common.BaseClientInfo;
27
-
28
-import net.sf.jml.MsnUser;
29
-import net.sf.jml.MsnUserStatus;
30
-
31
-/**
32
- * An MSN-specific client info object.
33
- */
34
-public class MSNClientInfo extends BaseClientInfo {
35
-
36
-    /** MSN contact. */
37
-    private final MsnUser contact;
38
-
39
-    /**
40
-     * Creates a new client info object with the specified details.
41
-     *
42
-     * @param contact The contact this object represents
43
-     * @param parser The parser that owns this client info object
44
-     * @param nick The nickname of the user this object represents
45
-     * @param user The username of the user this object represents
46
-     * @param host The hostname of the user this object represents
47
-     */
48
-    public MSNClientInfo(final MsnUser contact, final MSNParser parser,
49
-            final String nick, final String user, final String host) {
50
-        super(parser, nick, user, host);
51
-
52
-        this.contact = contact;
53
-    }
54
-
55
-    /** {@inheritDoc} */
56
-    @Override
57
-    public int getChannelCount() {
58
-        return 0;
59
-    }
60
-
61
-    /** {@inheritDoc} */
62
-    @Override
63
-    public AwayState getAwayState() {
64
-        if (contact.getStatus() == MsnUserStatus.ONLINE) {
65
-            return AwayState.HERE;
66
-        }
67
-        return AwayState.AWAY;
68
-    }
69
-
70
-    /** {@inheritDoc} */
71
-    @Override
72
-    public MSNParser getParser() {
73
-        return (MSNParser) super.getParser();
74
-    }
75
-
76
-    /** {@inheritDoc} */
77
-    @Override
78
-    public String getRealname() {
79
-        return contact.getDisplayName();
80
-    }
81
-
82
-    /**
83
-     * Returns the contact for this client info object
84
-     *
85
-     * @return MSN contact for this client
86
-     */
87
-    public MsnUser getContact() {
88
-        return contact;
89
-    }
90
-
91
-}

+ 0
- 188
src/com/dmdirc/addons/parser_msn/MSNFakeChannel.java View File

@@ -1,188 +0,0 @@
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.addons.parser_msn;
24
-
25
-import com.dmdirc.parser.common.BaseChannelInfo;
26
-import com.dmdirc.parser.common.ChannelListModeItem;
27
-import com.dmdirc.parser.interfaces.ChannelClientInfo;
28
-import com.dmdirc.parser.interfaces.ClientInfo;
29
-import com.dmdirc.parser.interfaces.Parser;
30
-import com.dmdirc.parser.interfaces.callbacks.ChannelNamesListener;
31
-
32
-import java.util.Collection;
33
-import java.util.Collections;
34
-
35
-/**
36
- * A 'fake' local channel used to display contact lists.
37
- */
38
-public class MSNFakeChannel extends BaseChannelInfo {
39
-
40
-    /**
41
-     * Creates a new fake channel belonging to the specified parser and
42
-     * with the given name.
43
-     *
44
-     * @param parser The parser that owns this channel
45
-     * @param name The name of the channel
46
-     */
47
-    public MSNFakeChannel(final Parser parser, final String name) {
48
-        super(parser, name);
49
-    }
50
-
51
-    /** {@inheritDoc} */
52
-    @Override
53
-    public void setTopic(final String topic) {
54
-        //Ignore
55
-    }
56
-
57
-    /** {@inheritDoc} */
58
-    @Override
59
-    public String getTopic() {
60
-        return "";
61
-    }
62
-
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public long getTopicTime() {
66
-        return 0;
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public String getTopicSetter() {
72
-        return "";
73
-    }
74
-
75
-    /** {@inheritDoc} */
76
-    @Override
77
-    public String getModes() {
78
-        return "";
79
-    }
80
-
81
-    /** {@inheritDoc} */
82
-    @Override
83
-    public String getMode(final char mode) {
84
-        return "";
85
-    }
86
-
87
-    /** {@inheritDoc} */
88
-    @Override
89
-    public Collection<ChannelListModeItem> getListMode(final char mode) {
90
-        return Collections.<ChannelListModeItem>emptyList();
91
-    }
92
-
93
-    /** {@inheritDoc} */
94
-    @Override
95
-    public void part(final String reason) {
96
-        throw new UnsupportedOperationException("Not supported yet.");
97
-    }
98
-
99
-    /** {@inheritDoc} */
100
-    @Override
101
-    public void sendWho() {
102
-        //Ignore
103
-    }
104
-
105
-    /** {@inheritDoc} */
106
-    @Override
107
-    public void alterMode(final boolean add,
108
-            final Character mode, final String parameter) {
109
-        //Ignore
110
-    }
111
-
112
-    /** {@inheritDoc} */
113
-    @Override
114
-    public void flushModes() {
115
-        //Ignore
116
-    }
117
-
118
-    /** {@inheritDoc} */
119
-    @Override
120
-    public void requestListModes() {
121
-        //Ignore
122
-    }
123
-
124
-    /** {@inheritDoc} */
125
-    @Override
126
-    public ChannelClientInfo getChannelClient(final ClientInfo client) {
127
-        return getClient(client.getNickname());
128
-    }
129
-
130
-    /** {@inheritDoc} */
131
-    @Override
132
-    public ChannelClientInfo getChannelClient(final String client,
133
-            final boolean create) {
134
-        final String[] parts = getParser().parseHostmask(client);
135
-        if (create && getClient(parts[0]) == null) {
136
-            return new MSNChannelClientInfo(this, getParser().getClient(client));
137
-        }
138
-        return getClient(parts[0]);
139
-    }
140
-
141
-    /**
142
-     * Replaces the clients in this channel with a the new list of clients.
143
-     *
144
-     * @param clients client list
145
-     */
146
-    public void replaceContacts(final Collection<ClientInfo> clients) {
147
-        for (ChannelClientInfo client : getChannelClients()) {
148
-            removeClient(client.getClient().getNickname());
149
-        }
150
-        for (ClientInfo client : clients) {
151
-            addClient(client.getNickname(), new MSNChannelClientInfo(this,
152
-                    client));
153
-        }
154
-
155
-        getParser().getCallbackManager().getCallbackType(
156
-                ChannelNamesListener.class).call(this);
157
-    }
158
-
159
-    /**
160
-     * Adds the specified clients to this channel
161
-     *
162
-     * @param clients client list
163
-     */
164
-    public void addContacts(final Collection<ClientInfo> clients) {
165
-        for (ClientInfo client : clients) {
166
-            addClient(client.getNickname(), new MSNChannelClientInfo(this,
167
-                    client));
168
-        }
169
-
170
-        getParser().getCallbackManager().getCallbackType(
171
-                ChannelNamesListener.class).call(this);
172
-    }
173
-
174
-    /**
175
-     * Removes the specified clients from this channel
176
-     *
177
-     * @param clients client list
178
-     */
179
-    public void removeContacts(final Collection<ClientInfo> clients) {
180
-        for (ClientInfo client : clients) {
181
-            removeClient(client.getNickname());
182
-        }
183
-
184
-        getParser().getCallbackManager().getCallbackType(
185
-                ChannelNamesListener.class).call(this);
186
-    }
187
-
188
-}

+ 0
- 205
src/com/dmdirc/addons/parser_msn/MSNListener.java View File

@@ -1,205 +0,0 @@
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.addons.parser_msn;
24
-
25
-import com.dmdirc.parser.common.AwayState;
26
-import com.dmdirc.parser.common.ParserError;
27
-import com.dmdirc.parser.interfaces.ChannelInfo;
28
-import com.dmdirc.parser.interfaces.ClientInfo;
29
-import com.dmdirc.parser.interfaces.callbacks.AwayStateListener;
30
-import com.dmdirc.parser.interfaces.callbacks.ChannelSelfJoinListener;
31
-import com.dmdirc.parser.interfaces.callbacks.ConnectErrorListener;
32
-import com.dmdirc.parser.interfaces.callbacks.ErrorInfoListener;
33
-import com.dmdirc.parser.interfaces.callbacks.OtherAwayStateListener;
34
-import com.dmdirc.parser.interfaces.callbacks.PasswordRequiredListener;
35
-import com.dmdirc.parser.interfaces.callbacks.PrivateMessageListener;
36
-import com.dmdirc.parser.interfaces.callbacks.ServerNoticeListener;
37
-import com.dmdirc.parser.interfaces.callbacks.ServerReadyListener;
38
-import com.dmdirc.parser.interfaces.callbacks.SocketCloseListener;
39
-
40
-import java.net.ConnectException;
41
-import java.util.ArrayList;
42
-import java.util.Arrays;
43
-import java.util.Collection;
44
-import java.util.List;
45
-
46
-import net.sf.jml.MsnContact;
47
-import net.sf.jml.MsnList;
48
-import net.sf.jml.MsnMessenger;
49
-import net.sf.jml.MsnSwitchboard;
50
-import net.sf.jml.MsnUserStatus;
51
-import net.sf.jml.event.MsnAdapter;
52
-import net.sf.jml.exception.IncorrectPasswordException;
53
-import net.sf.jml.exception.LoginException;
54
-import net.sf.jml.message.MsnInstantMessage;
55
-import net.sf.jml.message.MsnSystemMessage;
56
-import net.sf.jml.message.MsnUnknownMessage;
57
-
58
-/**
59
- * Listener object acting on events from the MSN connection.
60
- */
61
-public class MSNListener extends MsnAdapter {
62
-
63
-    /** MSN Parser. */
64
-    private final MSNParser parser;
65
-    /** Switchboard ID. */
66
-    private final Object object = new Object();
67
-
68
-    /**
69
-     * Creates a new MSN listener.
70
-     *
71
-     * @param parser Parent parser
72
-     */
73
-    public MSNListener(final MSNParser parser) {
74
-        this.parser = parser;
75
-    }
76
-
77
-    /** {@inheritDoc} */
78
-    @Override
79
-    public void contactAddCompleted(final MsnMessenger mm, final MsnContact mc, final MsnList ml) {
80
-        parser.addClient(mc);
81
-        parser.addClients(parser.getFakeChannel(), Arrays.asList(
82
-                new ClientInfo[]{ parser.getClient(mc), }));
83
-    }
84
-
85
-    /** {@inheritDoc} */
86
-    @Override
87
-    public void contactListSyncCompleted(final MsnMessenger mm) {
88
-        final Collection<MsnContact> contacts = Arrays.asList(mm.getContactList().getContacts());
89
-        final List<ClientInfo> clients = new ArrayList<>();
90
-        for (MsnContact contact : contacts) {
91
-            parser.addClient(contact);
92
-            clients.add(parser.getClient(contact));
93
-        }
94
-    }
95
-
96
-    /** {@inheritDoc} */
97
-    @Override
98
-    public void contactStatusChanged(final MsnMessenger mm, final MsnContact mc) {
99
-        if (mc.getStatus() != MsnUserStatus.OFFLINE) {
100
-            parser.addClients(parser.getFakeChannel(), Arrays.asList(
101
-                    new ClientInfo[]{ parser.getClient(mc), }));
102
-        } else if (mc.getStatus() == MsnUserStatus.OFFLINE) {
103
-            parser.removeClients(parser.getFakeChannel(), Arrays.asList(
104
-                    new ClientInfo[]{ parser.getClient(mc), }));
105
-        }
106
-        final boolean isBack = mc.getStatus().equals(MsnUserStatus.ONLINE);
107
-        parser.getCallbackManager().getCallbackType(
108
-                OtherAwayStateListener.class).call(parser.getClient(mc),
109
-                isBack ? AwayState.AWAY : AwayState.HERE,
110
-                isBack ? AwayState.HERE : AwayState.AWAY);
111
-    }
112
-
113
-    /** {@inheritDoc} */
114
-    @Override
115
-    public void exceptionCaught(final MsnMessenger mm, final Throwable thrwbl) {
116
-        final ParserError error = new ParserError(ParserError.ERROR_ERROR,
117
-                thrwbl.getMessage(), "");
118
-        error.setException(new Exception(thrwbl)); //NOPMD
119
-        if (thrwbl instanceof LoginException) {
120
-            parser.getCallbackManager().getCallbackType(
121
-                    ConnectErrorListener.class).call(error);
122
-        } else if (thrwbl instanceof IncorrectPasswordException) {
123
-            parser.getCallbackManager().getCallbackType(
124
-                    PasswordRequiredListener.class).call(error);
125
-        } else if (thrwbl instanceof ConnectException) {
126
-            parser.getCallbackManager().getCallbackType(
127
-                    SocketCloseListener.class).call(error);
128
-            parser.removeMSNParser();
129
-        } else {
130
-            parser.getCallbackManager().getCallbackType(
131
-                    ErrorInfoListener.class).call(error);
132
-        }
133
-    }
134
-
135
-    /** {@inheritDoc} */
136
-    @Override
137
-    public void instantMessageReceived(final MsnSwitchboard ms,
138
-            final MsnInstantMessage mim, final MsnContact mc) {
139
-        parser.getCallbackManager().getCallbackType(
140
-                PrivateMessageListener.class).call(mim.getContent(),
141
-                mc.getEmail().getEmailAddress());
142
-    }
143
-
144
-    /** {@inheritDoc} */
145
-    @Override
146
-    public void loginCompleted(final MsnMessenger mm) {
147
-        mm.newSwitchboard(object);
148
-        parser.getCallbackManager().getCallbackType(ServerReadyListener.class)
149
-                .call();
150
-        final ChannelInfo channel = parser.getFakeChannel();
151
-        if (channel != null) {
152
-            parser.getCallbackManager().getCallbackType(
153
-                    ChannelSelfJoinListener.class).call(channel);
154
-        }
155
-    }
156
-
157
-    /** {@inheritDoc} */
158
-    @Override
159
-    public void logout(final MsnMessenger mm) {
160
-        parser.getCallbackManager().getCallbackType(SocketCloseListener.class)
161
-                .call();
162
-    }
163
-
164
-    /** {@inheritDoc} */
165
-    @Override
166
-    public void offlineMessageReceived(final String body,
167
-            final String contentType, final String encoding,
168
-            final MsnContact mc) {
169
-        parser.getCallbackManager().getCallbackType(
170
-                PrivateMessageListener.class).call(body,
171
-                mc.getEmail().getEmailAddress());
172
-    }
173
-
174
-    /** {@inheritDoc} */
175
-    @Override
176
-    public void ownerStatusChanged(final MsnMessenger mm) {
177
-        if (mm.getOwner().getStatus() == MsnUserStatus.ONLINE) {
178
-            parser.getCallbackManager().getCallbackType(AwayStateListener.class)
179
-                    .call(AwayState.AWAY, AwayState.HERE, null);
180
-        } else {
181
-            parser.getCallbackManager().getCallbackType(AwayStateListener.class)
182
-                    .call(AwayState.HERE, AwayState.AWAY, mm.getOwner()
183
-                    .getStatus().getDisplayStatus());
184
-        }
185
-    }
186
-
187
-    /** {@inheritDoc} */
188
-    @Override
189
-    public void systemMessageReceived(final MsnMessenger mm,
190
-            final MsnSystemMessage msm) {
191
-        if (msm.getContent() != null) {
192
-            parser.getCallbackManager().getCallbackType(
193
-                    ServerNoticeListener.class).call(msm.getContent(), "MSN");
194
-        }
195
-    }
196
-
197
-    /** {@inheritDoc} */
198
-    @Override
199
-    public void unknownMessageReceived(final MsnSwitchboard ms,
200
-            final MsnUnknownMessage mum, final MsnContact mc) {
201
-        parser.getCallbackManager().getCallbackType(
202
-                ServerNoticeListener.class).call("Unknown message: "
203
-                + mum.getContent(), "MSN");
204
-    }
205
-}

+ 0
- 112
src/com/dmdirc/addons/parser_msn/MSNLocalClientInfo.java View File

@@ -1,112 +0,0 @@
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.addons.parser_msn;
24
-
25
-import com.dmdirc.parser.interfaces.LocalClientInfo;
26
-
27
-import net.sf.jml.MsnOwner;
28
-import net.sf.jml.MsnUserStatus;
29
-
30
-/**
31
- * A representation of the local MSN client.
32
- */
33
-public class MSNLocalClientInfo extends MSNClientInfo implements LocalClientInfo {
34
-
35
-    /** MSN user. */
36
-    private final MsnOwner owner;
37
-
38
-    /**
39
-     * Creates a new local client info object with the specified details.
40
-     *
41
-     * @param owner The client this object represents
42
-     * @param parser The parser that owns this client info object
43
-     * @param nick The nickname of the user this object represents
44
-     * @param user The username of the user this object represents
45
-     * @param host The hostname of the user this object represents
46
-     */
47
-    public MSNLocalClientInfo(final MsnOwner owner, final MSNParser parser,
48
-            final String nick, final String user, final String host) {
49
-        super(owner, parser, nick, user, host);
50
-
51
-        this.owner = owner;
52
-    }
53
-
54
-    /** {@inheritDoc} */
55
-    @Override
56
-    public void setNickname(final String name) {
57
-        owner.setDisplayName(name);
58
-    }
59
-
60
-    /** {@inheritDoc} */
61
-    @Override
62
-    public String getModes() {
63
-        return "";
64
-    }
65
-
66
-    /** {@inheritDoc} */
67
-    @Override
68
-    public void setAway(final String reason) {
69
-        if ("Busy".equalsIgnoreCase(reason)) {
70
-            owner.setStatus(MsnUserStatus.BUSY);
71
-        } else if ("Idle".equalsIgnoreCase(reason)) {
72
-            owner.setStatus(MsnUserStatus.IDLE);
73
-        } else if ("BRB".equalsIgnoreCase(reason)) {
74
-            owner.setStatus(MsnUserStatus.BE_RIGHT_BACK);
75
-        } else if ("Be Right Back".equalsIgnoreCase(reason)) {
76
-            owner.setStatus(MsnUserStatus.BE_RIGHT_BACK);
77
-        } else if ("phone".equalsIgnoreCase(reason)) {
78
-            owner.setStatus(MsnUserStatus.ON_THE_PHONE);
79
-        } else if ("on the phone".equalsIgnoreCase(reason)) {
80
-            owner.setStatus(MsnUserStatus.ON_THE_PHONE);
81
-        } else if ("on phone".equalsIgnoreCase(reason)) {
82
-            owner.setStatus(MsnUserStatus.ON_THE_PHONE);
83
-        } else if ("Out to lunch".equalsIgnoreCase(reason)) {
84
-            owner.setStatus(MsnUserStatus.OUT_TO_LUNCH);
85
-        } else if ("Lunch".equalsIgnoreCase(reason)) {
86
-            owner.setStatus(MsnUserStatus.OUT_TO_LUNCH);
87
-        } else if ("Hide".equalsIgnoreCase(reason)) {
88
-            owner.setStatus(MsnUserStatus.HIDE);
89
-        } else {
90
-            owner.setStatus(MsnUserStatus.AWAY);
91
-        }
92
-    }
93
-
94
-    /** {@inheritDoc} */
95
-    @Override
96
-    public void setBack() {
97
-        owner.setStatus(MsnUserStatus.ONLINE);
98
-    }
99
-
100
-    /** {@inheritDoc} */
101
-    @Override
102
-    public void alterMode(final boolean add, final Character mode) {
103
-        //Ignore
104
-    }
105
-
106
-    /** {@inheritDoc} */
107
-    @Override
108
-    public void flushModes() {
109
-        //Ignore
110
-    }
111
-
112
-}

+ 0
- 467
src/com/dmdirc/addons/parser_msn/MSNParser.java View File

@@ -1,467 +0,0 @@
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.addons.parser_msn;
24
-
25
-import com.dmdirc.parser.common.BaseParser;
26
-import com.dmdirc.parser.common.ChannelJoinRequest;
27
-import com.dmdirc.parser.common.ChildImplementations;
28
-import com.dmdirc.parser.common.CompositionState;
29
-import com.dmdirc.parser.common.DefaultStringConverter;
30
-import com.dmdirc.parser.common.QueuePriority;
31
-import com.dmdirc.parser.interfaces.ChannelInfo;
32
-import com.dmdirc.parser.interfaces.ClientInfo;
33
-import com.dmdirc.parser.interfaces.LocalClientInfo;
34
-import com.dmdirc.parser.interfaces.StringConverter;
35
-
36
-import java.net.URI;
37
-import java.util.Collection;
38
-import java.util.Collections;
39
-import java.util.HashMap;
40
-import java.util.List;
41
-import java.util.Map;
42
-
43
-import net.sf.jml.MsnContact;
44
-import net.sf.jml.MsnMessenger;
45
-import net.sf.jml.impl.MsnMessengerFactory;
46
-
47
-/**
48
- * A parser which can understand the MSN protocol.
49
- */
50
-@ChildImplementations({
51
-    MSNClientInfo.class, MSNLocalClientInfo.class, MSNFakeChannel.class,
52
-    MSNChannelClientInfo.class
53
-})
54
-public class MSNParser extends BaseParser {
55
-
56
-    /** MSN Connection. */
57
-    private MsnMessenger msn;
58
-    /** A cache of known clients. */
59
-    private final Map<String, MSNClientInfo> clients = new HashMap<>();
60
-    /** Whether or not to use a channel for contact lists. */
61
-    private final boolean useFakeChannel;
62
-    /** The fake channel to use is useFakeChannel is enabled. */
63
-    private MSNFakeChannel fakeChannel;
64
-    /** MSN Listener. */
65
-    private MSNListener listener;
66
-
67
-    /**
68
-     * Creates a new parser for the specified address.
69
-     *
70
-     * @param address The address to connect to
71
-     */
72
-    public MSNParser(final URI address) {
73
-        super(address);
74
-
75
-        if (address.getQuery() == null) {
76
-            useFakeChannel = false;
77
-        } else {
78
-            useFakeChannel = address.getQuery().matches(
79
-                    "(?i).*(^|&)showchannel($|&).*");
80
-        }
81
-    }
82
-
83
-    /** {@inheritDoc} */
84
-    @Override
85
-    public void disconnect(final String message) {
86
-        super.disconnect(message);
87
-        try {
88
-            msn.logout();
89
-        } catch (Exception ex) {
90
-            //Fallthrough to finally block
91
-        } finally {
92
-            removeMSNParser();
93
-        }
94
-    }
95
-
96
-    /** {@inheritDoc} */
97
-    @Override
98
-    public void joinChannels(final ChannelJoinRequest... channels) {
99
-        //Ignore
100
-    }
101
-
102
-    /** {@inheritDoc} */
103
-    @Override
104
-    public ChannelInfo getChannel(final String channel) {
105
-        if ("&contacts".equalsIgnoreCase(channel)) {
106
-            return fakeChannel;
107
-        }
108
-        return null;
109
-    }
110
-
111
-    /** {@inheritDoc} */
112
-    @Override
113
-    public Collection<? extends ChannelInfo> getChannels() {
114
-        return Collections.<ChannelInfo>emptyList();
115
-    }
116
-
117
-    /** {@inheritDoc} */
118
-    @Override
119
-    public int getMaxLength(final String type, final String target) {
120
-        return -1;
121
-    }
122
-
123
-    /** {@inheritDoc} */
124
-    @Override
125
-    public int getMaxLength() {
126
-        return -1;
127
-    }
128
-
129
-    /** {@inheritDoc} */
130
-    @Override
131
-    public LocalClientInfo getLocalClient() {
132
-        final String[] parts = parseHostmask(msn.getOwner().getEmail().getEmailAddress());
133
-        return new MSNLocalClientInfo(msn.getOwner(), this, parts[0], parts[2], parts[1]);
134
-    }
135
-
136
-    /** {@inheritDoc} */
137
-    @Override
138
-    public MSNClientInfo getClient(final String details) {
139
-        final String[] parts = parseHostmask(details);
140
-        return clients.get(parts[0]);
141
-    }
142
-
143
-    /**
144
-     * Retrieves a {@link ClientInfo} object which corresponds to the specified
145
-     * contact. If the client wasn't previously known, it will be created.
146
-     *
147
-     * @param contact The contact to look up
148
-     *
149
-     * @return A corresponding client info object
150
-     */
151
-    public MSNClientInfo getClient(final MsnContact contact) {
152
-        return getClient(contact.getEmail().getEmailAddress());
153
-    }
154
-
155
-    /** {@inheritDoc} */
156
-    @Override
157
-    public void sendRawMessage(final String message) {
158
-        //Ignore
159
-    }
160
-
161
-    /** {@inheritDoc} */
162
-    @Override
163
-    public void sendRawMessage(final String message, final QueuePriority priority) {
164
-        //Ignore
165
-    }
166
-
167
-    /** {@inheritDoc} */
168
-    @Override
169
-    public StringConverter getStringConverter() {
170
-        return new DefaultStringConverter();
171
-    }
172
-
173
-    /** {@inheritDoc} */
174
-    @Override
175
-    public boolean isValidChannelName(final String name) {
176
-        return false;
177
-    }
178
-
179
-    /** {@inheritDoc} */
180
-    @Override
181
-    public boolean compareURI(final URI uri) {
182
-        throw new UnsupportedOperationException("Not supported yet.");
183
-    }
184
-
185
-    /** {@inheritDoc} */
186
-    @Override
187
-    public Collection<? extends ChannelJoinRequest> extractChannels(final URI uri) {
188
-        return Collections.<ChannelJoinRequest>emptyList();
189
-    }
190
-
191
-    /** {@inheritDoc} */
192
-    @Override
193
-    public String getServerName() {
194
-        return "MSN";
195
-    }
196
-
197
-    /** {@inheritDoc} */
198
-    @Override
199
-    public String getNetworkName() {
200
-        return "MSN";
201
-    }
202
-
203
-    /** {@inheritDoc} */
204
-    @Override
205
-    public String getServerSoftware() {
206
-        return "MSN";
207
-    }
208
-
209
-    /** {@inheritDoc} */
210
-    @Override
211
-    public String getServerSoftwareType() {
212
-        return "MSN";
213
-    }
214
-
215
-    /** {@inheritDoc} */
216
-    @Override
217
-    public List<String> getServerInformationLines() {
218
-        return Collections.<String>emptyList();
219
-    }
220
-
221
-    /** {@inheritDoc} */
222
-    @Override
223
-    public int getMaxTopicLength() {
224
-        return 0;
225
-    }
226
-
227
-    /** {@inheritDoc} */
228
-    @Override
229
-    public String getBooleanChannelModes() {
230
-        return "";
231
-    }
232
-
233
-    /** {@inheritDoc} */
234
-    @Override
235
-    public String getListChannelModes() {
236
-        return "";
237
-    }
238
-
239
-    /** {@inheritDoc} */
240
-    @Override
241
-    public int getMaxListModes(final char mode) {
242
-        return 0;
243
-    }
244
-
245
-    /** {@inheritDoc} */
246
-    @Override
247
-    public boolean isUserSettable(final char mode) {
248
-        return false;
249
-    }
250
-
251
-    /** {@inheritDoc} */
252
-    @Override
253
-    public String getParameterChannelModes() {
254
-        return "";
255
-    }
256
-
257
-    /** {@inheritDoc} */
258
-    @Override
259
-    public String getDoubleParameterChannelModes() {
260
-        return "";
261
-    }
262
-
263
-    /** {@inheritDoc} */
264
-    @Override
265
-    public String getUserModes() {
266
-        return "";
267
-    }
268
-
269
-    /** {@inheritDoc} */
270
-    @Override
271
-    public String getChannelUserModes() {
272
-        return "";
273
-    }
274
-
275
-    /** {@inheritDoc} */
276
-    @Override
277
-    public String getChannelPrefixes() {
278
-        return "#";
279
-    }
280
-
281
-    /** {@inheritDoc} */
282
-    @Override
283
-    public long getServerLatency() {
284
-        return 0;
285
-    }
286
-
287
-    /** {@inheritDoc} */
288
-    @Override
289
-    public void sendCTCP(final String target, final String type, final String message) {
290
-        throw new UnsupportedOperationException("Not supported yet.");
291
-    }
292
-
293
-    /** {@inheritDoc} */
294
-    @Override
295
-    public void sendCTCPReply(final String target, final String type, final String message) {
296
-        throw new UnsupportedOperationException("Not supported yet.");
297
-    }
298
-
299
-    /** {@inheritDoc} */
300
-    @Override
301
-    public void sendMessage(final String target, final String message) {
302
-        msn.sendText(getClient(target).getContact().getEmail(), message);
303
-
304
-    }
305
-
306
-    /** {@inheritDoc} */
307
-    @Override
308
-    public void sendNotice(final String target, final String message) {
309
-        throw new UnsupportedOperationException("Not supported yet.");
310
-    }
311
-
312
-    /** {@inheritDoc} */
313
-    @Override
314
-    public void sendAction(final String target, final String message) {
315
-        throw new UnsupportedOperationException("Not supported yet.");
316
-    }
317
-
318
-    /** {@inheritDoc} */
319
-    @Override
320
-    public void sendInvite(final String channel, final String user) {
321
-        throw new UnsupportedOperationException("Not supported yet.");
322
-    }
323
-
324
-    /** {@inheritDoc} */
325
-    @Override
326
-    public String getLastLine() {
327
-        return "";
328
-    }
329
-
330
-    /** {@inheritDoc} */
331
-    @Override
332
-    public String[] parseHostmask(final String hostmask) {
333
-        return new MSNProtocolDescription().parseHostmask(hostmask);
334
-    }
335
-
336
-    /** {@inheritDoc} */
337
-    @Override
338
-    public long getPingTime() {
339
-        return 0;
340
-    }
341
-
342
-    /** Destroys the existing MSN object. */
343
-    protected void removeMSNParser() {
344
-        if (msn != null && listener != null) {
345
-            msn.removeListener(listener);
346
-        }
347
-        msn = null;
348
-        listener = null;
349
-    }
350
-
351
-    /** Creates a new MSN object. */
352
-    protected void setupMSNParser() {
353
-        if (msn != null) {
354
-            removeMSNParser();
355
-        }
356
-        final String[] userInfoParts = getURI().getUserInfo().split(":", 2);
357
-        msn = MsnMessengerFactory.createMsnMessenger(userInfoParts[0], userInfoParts[1]);
358
-        listener = new MSNListener(this);
359
-        msn.addListener(listener);
360
-    }
361
-
362
-    /** {@inheritDoc} */
363
-    @Override
364
-    public void run() {
365
-        setupMSNParser();
366
-        msn.login();
367
-        if (useFakeChannel) {
368
-            fakeChannel = new MSNFakeChannel(this, "&contacts");
369
-        }
370
-    }
371
-
372
-    /**
373
-     * Updates the clients in the specified channel.
374
-     *
375
-     * @param channel Channel to update
376
-     * @param clients Clients to use in the channel
377
-     */
378
-    public void updateClients(final ChannelInfo channel, final Collection<ClientInfo> clients) {
379
-        if (channel == fakeChannel) {
380
-            fakeChannel.replaceContacts(clients);
381
-        }
382
-    }
383
-
384
-    /**
385
-     * Adds the clients in the specified channel.
386
-     *
387
-     * @param channel Channel to update
388
-     * @param clients Clients to add in the channel
389
-     */
390
-    public void addClients(final ChannelInfo channel, final Collection<ClientInfo> clients) {
391
-        if (channel == fakeChannel) {
392
-            fakeChannel.addContacts(clients);
393
-        }
394
-    }
395
-
396
-    /**
397
-     * Removes the clients in the specified channel.
398
-     *
399
-     * @param channel Channel to update
400
-     * @param clients Clients to add in the channel
401
-     */
402
-    public void removeClients(final ChannelInfo channel, final Collection<ClientInfo> clients) {
403
-        if (channel == fakeChannel) {
404
-            fakeChannel.removeContacts(clients);
405
-        }
406
-    }
407
-
408
-    /**
409
-     * Returns the fake channel for this parser, this will be null if the
410
-     * user has opted not to use the fake channel.
411
-     *
412
-     * @return Fake channel or null
413
-     */
414
-    public ChannelInfo getFakeChannel() {
415
-        return fakeChannel;
416
-    }
417
-
418
-    /** {@inheritDoc} */
419
-    @Override
420
-    public String getBindIP() {
421
-        return msn.getConnection().getInternalIP();
422
-    }
423
-
424
-    /** {@inheritDoc} */
425
-    @Override
426
-    public void setBindIP(final String ip) {
427
-        //Ignore
428
-    }
429
-
430
-    /** {@inheritDoc} */
431
-    @Override
432
-    public int getLocalPort() {
433
-        return msn.getConnection().getInternalPort();
434
-    }
435
-
436
-    /**
437
-     * Adds a contact to the list of known clients.
438
-     *
439
-     * @param contact Contact to add
440
-     */
441
-    public void addClient(final MsnContact contact) {
442
-        final String email = contact.getEmail().getEmailAddress();
443
-        final String[] parts = parseHostmask(email);
444
-        clients.put(email, new MSNClientInfo(contact, this, parts[0], parts[1], parts[2]));
445
-    }
446
-
447
-    /**
448
-     * Removes a contact from the list of known clients.
449
-     *
450
-     * @param contact Contact to remove
451
-     */
452
-    public void removeClient(final MsnContact contact) {
453
-        clients.remove(contact.getEmail().getEmailAddress());
454
-    }
455
-
456
-    /** {@inheritDoc} */
457
-    @Override
458
-    public void setCompositionState(final String host, final CompositionState state) {
459
-        // Do nothing
460
-    }
461
-
462
-    /** {@inheritDoc} */
463
-    @Override
464
-    public void requestGroupList(final String searchTerms) {
465
-        // Do nothing
466
-    }
467
-}

+ 0
- 76
src/com/dmdirc/addons/parser_msn/MSNPlugin.java View File

@@ -1,76 +0,0 @@
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.addons.parser_msn;
24
-
25
-import com.dmdirc.parser.common.MyInfo;
26
-import com.dmdirc.parser.interfaces.Parser;
27
-import com.dmdirc.parser.interfaces.ProtocolDescription;
28
-import com.dmdirc.plugins.Exported;
29
-import com.dmdirc.plugins.implementations.BasePlugin;
30
-
31
-import java.net.URI;
32
-
33
-/**
34
- * Plugin that provides a parser to connect to MSN services.
35
- */
36
-public class MSNPlugin extends BasePlugin {
37
-
38
-    /** Protocol descriptor. */
39
-    private final MSNProtocolDescription protocol
40
-            = new MSNProtocolDescription();
41
-
42
-    /** {@inheritDoc} */
43
-    @Override
44
-    public void onLoad() {
45
-        // Do nothing
46
-    }
47
-
48
-    /** {@inheritDoc} */
49
-    @Override
50
-    public void onUnload() {
51
-        // Do nothing
52
-    }
53
-
54
-    /**
55
-     * Creates a new MSN parser for the specified client info and address.
56
-     *
57
-     * @param myInfo The settings for the local client
58
-     * @param address The address to connect to
59
-     *
60
-     * @return An appropriately configured parser
61
-     */
62
-    @Exported
63
-    public Parser getParser(final MyInfo myInfo, final URI address) {
64
-        return new MSNParser(address);
65
-    }
66
-
67
-    /**
68
-     * Retrieves an object describing the properties of the MSN  protocol.
69
-     *
70
-     * @return A relevant protocol description object
71
-     */
72
-    @Exported
73
-    public ProtocolDescription getDescription() {
74
-        return protocol;
75
-    }
76
-}

+ 0
- 52
src/com/dmdirc/addons/parser_msn/MSNProtocolDescription.java View File

@@ -1,52 +0,0 @@
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.addons.parser_msn;
24
-
25
-import com.dmdirc.parser.interfaces.ProtocolDescription;
26
-
27
-import java.net.URI;
28
-
29
-/**
30
- * A description of the MSN protocol.
31
- */
32
-class MSNProtocolDescription implements ProtocolDescription {
33
-
34
-    /** {@inheritDoc} */
35
-    @Override
36
-    public int getDefaultPort() {
37
-        return 1863;
38
-    }
39
-
40
-    /** {@inheritDoc} */
41
-    @Override
42
-    public String[] parseHostmask(final String hostmask) {
43
-        return new String[] { hostmask, hostmask, hostmask, };
44
-    }
45
-
46
-    /** {@inheritDoc} */
47
-    @Override
48
-    public boolean isSecure(final URI uri) {
49
-        return true;
50
-    }
51
-
52
-}

+ 0
- 34
src/com/dmdirc/addons/parser_msn/plugin.config View File

@@ -1,34 +0,0 @@
1
-# This is a DMDirc configuration file.
2
-
3
-# This section indicates which sections below take key/value
4
-# pairs, rather than a simple list. It should be placed above
5
-# any sections that take key/values.
6
-keysections:
7
-  metadata
8
-  updates
9
-  version
10
-  defaults
11
-  icons
12
-
13
-metadata:
14
-  author=Greg <greg@dmdirc.com>
15
-  mainclass=com.dmdirc.addons.parser_msn.MSNPlugin
16
-  description=Provides MSN access for DMDirc.
17
-  name=msn
18
-  nicename=MSN Plugin
19
-
20
-updates:
21
-  id=68
22
-
23
-version:
24
-  number=1
25
-  friendly=0.1
26
-
27
-provides:
28
-  msn parser
29
-  msns parser
30
-
31
-
32
-exports:
33
-  getParser in com.dmdirc.addons.parser_msn.MSNPlugin as getParser
34
-  getDescription in com.dmdirc.addons.parser_msn.MSNPlugin as getProtocolDescription

Loading…
Cancel
Save