- 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)))
+ .addCommand("PART",
+ (s, p) -> new ChannelLeft(this, p.get(0),
+ s.get(), getOptional(p, 1)))
+ .addCommand("QUIT",
+ (s, p) -> new ClientQuit(this, s.get(),
+ p.get(0)))
+ .addCommand("KICK",
+ (s, p) -> new KickedFromChannel(this,
+ p.get(0), s.get(), p.get(1),
+ getOptional(p, 2))),