new MessageHandler(eventBus, this, prefixHandler),
new CtcpHandler(eventBus, this),
new ChannelNickHandler(eventBus, this, prefixHandler),
- new SimpleCommandHandler()
- .addCommand("431", (s, p) -> eventBus.post(
- new NoNicknameGivenReceived(this)))
- .addCommand("NICK", (s, p) -> eventBus.post(
- new NicknameChanged(this, s.get(),
- p.get(0))))
- .addCommand("JOIN", (s, p) -> eventBus.post(
- new ChannelJoined(this, p.get(0),
- s.get()))),
+ new SimpleCommandHandler(eventBus)
+ .addCommand("431",
+ (s, p) -> new NoNicknameGivenReceived(
+ this))
+ .addCommand("NICK",
+ (s, p) -> new NicknameChanged(this,
+ s.get(), p.get(0)))
+ .addCommand("JOIN",
+ (s, p) -> new ChannelJoined(this,
+ p.get(0), s.get()))
+ .addCommand("332",
+ (s, p) -> new ChannelTopic(this, p.get(1),
+ p.get(2))),
new MotdHandler(eventBus, this),
new ChannelNotJoinedHandler(eventBus, this),
new ConnectionEstablishHandler(eventBus, this),
/* channel stuff. */
} else if (command.equals("331")) {
/* no topic is set. */
- } else if (command.equals("332")) {
- eventBus.post(new ChannelTopic(this, parameters.get(1), parameters.get(2)));
} else if (command.equalsIgnoreCase("PART")) {
eventBus.post(new ChannelLeft(this, parameters.get(0), reply.source().get(), getOptional(parameters, 1)));
} else if (command.equalsIgnoreCase("QUIT")) {