Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. /** Base class for all events. */
  7. sealed class IrcEvent(val time: LocalDateTime)
  8. /** Raised when the connection to the server has been established. The server will not be ready for use yet. */
  9. class ServerConnected(time: LocalDateTime) : IrcEvent(time)
  10. /** Raised when the server is ready for use. */
  11. class ServerReady(time: LocalDateTime) : IrcEvent(time)
  12. /** Raised when the server initially welcomes us to the IRC network. */
  13. class ServerWelcome(time: LocalDateTime, val server: String, val localNick: String) : IrcEvent(time)
  14. /** Raised when the features supported by the server have changed. This may occur numerous times. */
  15. class ServerFeaturesUpdated(time: LocalDateTime, val serverFeatures: ServerFeatureMap) : IrcEvent(time)
  16. /** Raised whenever a PING is received from the server. */
  17. class PingReceived(time: LocalDateTime, val nonce: ByteArray) : IrcEvent(time)
  18. /** Raised when a user joins a channel. */
  19. class ChannelJoined(time: LocalDateTime, val user: User, val channel: String) : IrcEvent(time)
  20. /** Raised when a user leaves a channel. */
  21. class ChannelParted(time: LocalDateTime, val user: User, val channel: String, val reason: String = "") : IrcEvent(time)
  22. /** Raised when a user quits, and is in a channel. */
  23. class ChannelQuit(time: LocalDateTime, val user: User, val channel: String, val reason: String = "") : IrcEvent(time)
  24. /** Raised when a batch of the channel's member list has been received. More batches may follow. */
  25. class ChannelNamesReceived(time: LocalDateTime, val channel: String, val names: List<String>) : IrcEvent(time)
  26. /** Raised when the entirety of the channel's member list has been received. */
  27. class ChannelNamesFinished(time: LocalDateTime, val channel: String) : IrcEvent(time)
  28. /** Raised when a message is received. */
  29. class MessageReceived(time: LocalDateTime, val user: User, val target: String, val message: String) : IrcEvent(time)
  30. /** Raised when an action is received. */
  31. class ActionReceived(time: LocalDateTime, val user: User, val target: String, val action: String) : IrcEvent(time)
  32. /** Raised when a CTCP is received. */
  33. class CtcpReceived(time: LocalDateTime, val user: User, val target: String, val type: String, val content: String) : IrcEvent(time)
  34. /** Raised when a user quits. */
  35. class UserQuit(time: LocalDateTime, val user: User, val reason: String = "") : IrcEvent(time)
  36. /** Raised when available server capabilities are received. More batches may follow. */
  37. class ServerCapabilitiesReceived(time: LocalDateTime, val capabilities: Map<Capability, String>) : IrcEvent(time)
  38. /** Raised when our requested capabilities are acknowledged. More batches may follow. */
  39. class ServerCapabilitiesAcknowledged(time: LocalDateTime, val capabilities: Map<Capability, String>) : IrcEvent(time)
  40. /** Raised when the server has finished sending us capabilities. */
  41. class ServerCapabilitiesFinished(time: LocalDateTime) : IrcEvent(time)
  42. /** Raised when a Message Of the Day has completed. */
  43. class MotdFinished(time: LocalDateTime, val missing: Boolean = false): IrcEvent(time)