Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Events.kt 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.dmdirc.ktirc.events
  2. import com.dmdirc.ktirc.model.Capability
  3. import com.dmdirc.ktirc.model.ServerFeatureMap
  4. import com.dmdirc.ktirc.model.User
  5. import java.time.LocalDateTime
  6. sealed class IrcEvent(val time: LocalDateTime)
  7. /** Raised when the server initially welcomes us to the IRC network. */
  8. class ServerWelcome(time: LocalDateTime, val localNick: String) : IrcEvent(time)
  9. /** Raised when the features supported by the server have changed. This may occur numerous times. */
  10. class ServerFeaturesUpdated(time: LocalDateTime, val serverFeatures: ServerFeatureMap) : IrcEvent(time)
  11. /** Raised when the connection to the server has been established, configuration information has been received, etc. */
  12. // TODO: Implement
  13. class ServerConnected(time: LocalDateTime) : IrcEvent(time)
  14. /** Raised whenever a PING is received from the server. */
  15. class PingReceived(time: LocalDateTime, val nonce: ByteArray) : IrcEvent(time)
  16. /** Raised when a user joins a channel. */
  17. class ChannelJoined(time: LocalDateTime, val user: User, val channel: String) : IrcEvent(time)
  18. /** Raised when a user leaves a channel. */
  19. class ChannelParted(time: LocalDateTime, val user: User, val channel: String, val reason: String = "") : IrcEvent(time)
  20. /** Raised when a batch of the channel's member list has been received. More batches may follow. */
  21. class ChannelNamesReceived(time: LocalDateTime, val channel: String, val names: List<String>) : IrcEvent(time)
  22. /** Raised when the entirety of the channel's member list has been received. */
  23. class ChannelNamesFinished(time: LocalDateTime, val channel: String) : IrcEvent(time)
  24. /** Raised when a message is received. */
  25. class MessageReceived(time: LocalDateTime, val user: User, val target: String, val message: String) : IrcEvent(time)
  26. /** Raised when a user quits. */
  27. class UserQuit(time: LocalDateTime, val user: User, val reason: String = "") : IrcEvent(time)
  28. /** Raised when available server capabilities are received. More batches may follow. */
  29. class ServerCapabilitiesReceived(time: LocalDateTime, val capabilities: Map<Capability, String>) : IrcEvent(time)
  30. /** Raised when our requested capabilities are acknowledged. More batches may follow. */
  31. class ServerCapabilitiesAcknowledged(time: LocalDateTime, val capabilities: Map<Capability, String>) : IrcEvent(time)
  32. /** Raised when the server has finished sending us capabilities. */
  33. class ServerCapabilitiesFinished(time: LocalDateTime) : IrcEvent(time)