|
@@ -27,6 +27,7 @@ import com.dmdirc.parser.interfaces.ChannelClientInfo;
|
27
|
27
|
import com.dmdirc.parser.interfaces.LocalClientInfo;
|
28
|
28
|
import com.dmdirc.parser.interfaces.Parser;
|
29
|
29
|
import com.dmdirc.plugins.Plugin;
|
|
30
|
+
|
30
|
31
|
import java.util.ArrayList;
|
31
|
32
|
import java.util.HashMap;
|
32
|
33
|
import java.util.List;
|
|
@@ -74,21 +75,23 @@ public class TwitterClientInfo implements LocalClientInfo {
|
74
|
75
|
* @param plugin Plugin to use to get domain from.
|
75
|
76
|
* @return String array of nick, ident and host.
|
76
|
77
|
*/
|
77
|
|
- static String[] parseHostFull(String hostname, final Plugin plugin, final Twitter parser) {
|
|
78
|
+ static String[] parseHostFull(final String hostname, final Plugin plugin, final Twitter parser) {
|
78
|
79
|
boolean hadAt = false;
|
79
|
|
- if (plugin != null && parser != null && parser.getConfigManager().getOptionBool(plugin.getDomain(), "autoAt")) {
|
80
|
|
- if (!hostname.isEmpty() && hostname.charAt(0) == '@') {
|
81
|
|
- hostname = hostname.substring(1);
|
82
|
|
- hadAt = true;
|
83
|
|
- }
|
|
80
|
+ String sanitisedHostname = hostname;
|
|
81
|
+
|
|
82
|
+ if (plugin != null && parser != null
|
|
83
|
+ && parser.getConfigManager().getOptionBool(plugin.getDomain(), "autoAt")
|
|
84
|
+ && !sanitisedHostname.isEmpty() && sanitisedHostname.charAt(0) == '@') {
|
|
85
|
+ sanitisedHostname = sanitisedHostname.substring(1);
|
|
86
|
+ hadAt = true;
|
84
|
87
|
}
|
85
|
88
|
|
86
|
89
|
String[] temp = null;
|
87
|
90
|
final String[] result = new String[3];
|
88
|
|
- if (!hostname.isEmpty() && hostname.charAt(0) == ':') {
|
89
|
|
- hostname = hostname.substring(1);
|
|
91
|
+ if (!sanitisedHostname.isEmpty() && sanitisedHostname.charAt(0) == ':') {
|
|
92
|
+ sanitisedHostname = sanitisedHostname.substring(1);
|
90
|
93
|
}
|
91
|
|
- temp = hostname.split("@", 2);
|
|
94
|
+ temp = sanitisedHostname.split("@", 2);
|
92
|
95
|
if (temp.length == 1) {
|
93
|
96
|
result[2] = "";
|
94
|
97
|
} else {
|
|
@@ -153,11 +156,7 @@ public class TwitterClientInfo implements LocalClientInfo {
|
153
|
156
|
/** {@inheritDoc} */
|
154
|
157
|
@Override
|
155
|
158
|
public void setNickname(final String name) {
|
156
|
|
- if (this == myParser.getLocalClient()) {
|
157
|
|
- // TODO: throw new UnsupportedOperationException("Not supported yet.");
|
158
|
|
- } else {
|
159
|
|
- // TODO: throw new UnsupportedOperationException("Can not set nickname on non-local clients");
|
160
|
|
- }
|
|
159
|
+ // TODO: Implement?
|
161
|
160
|
}
|
162
|
161
|
|
163
|
162
|
/**
|
|
@@ -217,25 +216,25 @@ public class TwitterClientInfo implements LocalClientInfo {
|
217
|
216
|
/** {@inheritDoc} */
|
218
|
217
|
@Override
|
219
|
218
|
public void setAway(final String reason) {
|
220
|
|
- return;
|
|
219
|
+ // Do nothing
|
221
|
220
|
}
|
222
|
221
|
|
223
|
222
|
/** {@inheritDoc} */
|
224
|
223
|
@Override
|
225
|
224
|
public void setBack() {
|
226
|
|
- return;
|
|
225
|
+ // Do nothing
|
227
|
226
|
}
|
228
|
227
|
|
229
|
228
|
/** {@inheritDoc} */
|
230
|
229
|
@Override
|
231
|
230
|
public void alterMode(final boolean add, final Character mode) {
|
232
|
|
- return;
|
|
231
|
+ // Do nothing
|
233
|
232
|
}
|
234
|
233
|
|
235
|
234
|
/** {@inheritDoc} */
|
236
|
235
|
@Override
|
237
|
236
|
public void flushModes() {
|
238
|
|
- return;
|
|
237
|
+ // Do nothing
|
239
|
238
|
}
|
240
|
239
|
|
241
|
240
|
/** {@inheritDoc} */
|
|
@@ -278,7 +277,7 @@ public class TwitterClientInfo implements LocalClientInfo {
|
278
|
277
|
|
279
|
278
|
/**
|
280
|
279
|
* Get a list of all the channel clients associated with this user.
|
281
|
|
- *
|
|
280
|
+ *
|
282
|
281
|
* @return Channel Clients for this Client.
|
283
|
282
|
*/
|
284
|
283
|
public List<ChannelClientInfo> getChannelClients() {
|
|
@@ -301,7 +300,7 @@ public class TwitterClientInfo implements LocalClientInfo {
|
301
|
300
|
|
302
|
301
|
/**
|
303
|
302
|
* Add a channelClient to this Client.
|
304
|
|
- *
|
|
303
|
+ *
|
305
|
304
|
* @param channelClient channelClient to add as us.
|
306
|
305
|
*/
|
307
|
306
|
public void addChannelClient(final TwitterChannelClientInfo channelClient) {
|