|
@@ -79,11 +79,11 @@ import javax.annotation.Nonnull;
|
79
|
79
|
import javax.annotation.Nullable;
|
80
|
80
|
import javax.net.ssl.SSLException;
|
81
|
81
|
|
|
82
|
+import net.engio.mbassy.listener.Handler;
|
|
83
|
+
|
82
|
84
|
import org.slf4j.Logger;
|
83
|
85
|
import org.slf4j.LoggerFactory;
|
84
|
86
|
|
85
|
|
-import net.engio.mbassy.listener.Handler;
|
86
|
|
-
|
87
|
87
|
import static com.dmdirc.util.LogUtils.APP_ERROR;
|
88
|
88
|
import static com.google.common.base.Preconditions.checkNotNull;
|
89
|
89
|
|
|
@@ -144,7 +144,7 @@ public class Server implements Connection {
|
144
|
144
|
private final ServerEventHandler eventHandler;
|
145
|
145
|
/** Our ignore list. */
|
146
|
146
|
private final IgnoreList ignoreList = new IgnoreList();
|
147
|
|
- /** Our string convertor. */
|
|
147
|
+ /** Our string converter. */
|
148
|
148
|
private StringConverter converter = new DefaultStringConverter();
|
149
|
149
|
/** ParserFactory we use for creating parsers. */
|
150
|
150
|
private final ParserFactory parserFactory;
|
|
@@ -483,15 +483,23 @@ public class Server implements Connection {
|
483
|
483
|
return queries.get(lnick);
|
484
|
484
|
}
|
485
|
485
|
|
486
|
|
- @Override
|
487
|
|
- public void updateQuery(final Query query, final String oldNick, final String newNick) {
|
488
|
|
- windowModel.getInputModel().get().getTabCompleter()
|
489
|
|
- .removeEntry(TabCompletionType.QUERY_NICK, oldNick);
|
490
|
|
- windowModel.getInputModel().get().getTabCompleter()
|
491
|
|
- .addEntry(TabCompletionType.QUERY_NICK, newNick);
|
|
486
|
+ /**
|
|
487
|
+ * Updates tab completer and queries after a user changes their nickname.
|
|
488
|
+ *
|
|
489
|
+ * @param client The client that changed nickname
|
|
490
|
+ * @param oldNick The old nickname they used.
|
|
491
|
+ */
|
|
492
|
+ void handleNickChange(final ClientInfo client, final String oldNick) {
|
|
493
|
+ if (queries.containsKey(converter.toLowerCase(oldNick))) {
|
|
494
|
+ windowModel.getInputModel().get().getTabCompleter()
|
|
495
|
+ .removeEntry(TabCompletionType.QUERY_NICK, oldNick);
|
|
496
|
+ windowModel.getInputModel().get().getTabCompleter()
|
|
497
|
+ .addEntry(TabCompletionType.QUERY_NICK, client.getNickname());
|
492
|
498
|
|
493
|
|
- queries.put(converter.toLowerCase(newNick), query);
|
494
|
|
- queries.remove(converter.toLowerCase(oldNick));
|
|
499
|
+ queries.put(
|
|
500
|
+ converter.toLowerCase(client.getNickname()),
|
|
501
|
+ queries.remove(converter.toLowerCase(oldNick)));
|
|
502
|
+ }
|
495
|
503
|
}
|
496
|
504
|
|
497
|
505
|
@Override
|
|
@@ -1005,7 +1013,7 @@ public class Server implements Connection {
|
1005
|
1013
|
* {@code orElse} value.
|
1006
|
1014
|
*/
|
1007
|
1015
|
private <T> T withParserReadLock(
|
1008
|
|
- final Function<? super Parser, ? extends T> func,
|
|
1016
|
+ final Function<Parser, T> func,
|
1009
|
1017
|
final T orElse) {
|
1010
|
1018
|
try {
|
1011
|
1019
|
parserLock.readLock().lock();
|