Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

Events.kt 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. @file:Suppress("ArrayInDataClass")
  2. package com.dmdirc.ktirc.events
  3. import com.dmdirc.ktirc.model.ServerFeatureMap
  4. import com.dmdirc.ktirc.model.User
  5. sealed class IrcEvent
  6. /** Raised when the server initially welcomes us to the IRC network. */
  7. data class ServerWelcome(val localNick: String) : IrcEvent()
  8. /** Raised when the features supported by the server have changed. This may occur numerous times. */
  9. data class ServerFeaturesUpdated(val serverFeatures: ServerFeatureMap) : IrcEvent()
  10. /** Raised when the connection to the server has been established, configuration information has been received, etc. */
  11. // TODO: Implement
  12. object ServerConnected : IrcEvent()
  13. /** Raised whenever a PING is received from the server. */
  14. data class PingReceived(val nonce: ByteArray) : IrcEvent()
  15. /** Raised when a user joins a channel. */
  16. data class ChannelJoined(val user: User, val channel: String) : IrcEvent()
  17. /** Raised when a user leaves a channel. */
  18. data class ChannelParted(val user: User, val channel: String, val reason: String = "") : IrcEvent()
  19. /** Raised when a batch of the channel's member list has been received. More batches may follow. */
  20. data class ChannelNamesReceived(val channel: String, val names: List<String>) : IrcEvent()
  21. /** Raised when the entirety of the channel's member list has been received. */
  22. data class ChannelNamesFinished(val channel: String) : IrcEvent()
  23. /** Raised when a message is received. */
  24. data class MessageReceived(val user: User, val target: String, val message: String) : IrcEvent()
  25. /** Raised when a user quits. */
  26. data class UserQuit(val user: User, val reason: String = "") : IrcEvent()