package de.ypchat.android.data.model

sealed interface SocketEvent {
    data class Connected(val sessionId: String?, val loggedIn: Boolean, val user: UserDto?) : SocketEvent
    data class LoginSuccess(val sessionId: String?, val user: UserDto?) : SocketEvent
    data class UserList(val users: List<UserDto>) : SocketEvent
    data class IncomingMessage(val message: ChatMessageDto) : SocketEvent
    data class MessageSent(val messageId: String?, val to: String?) : SocketEvent
    data class Conversation(val withUserName: String, val messages: List<ChatMessageDto>) : SocketEvent
    data class SearchResults(val results: List<UserDto>) : SocketEvent
    data class HistoryResults(val results: List<HistoryItemDto>) : SocketEvent
    data class InboxResults(val results: List<InboxItemDto>) : SocketEvent
    data class UnreadChats(val count: Int) : SocketEvent
    data class UserBlocked(val userName: String) : SocketEvent
    data class UserUnblocked(val userName: String) : SocketEvent
    data class CommandResult(val lines: List<String>, val kind: String) : SocketEvent
    data class CommandTable(val title: String, val columns: List<String>, val rows: List<List<String>>) : SocketEvent
    data class Error(val message: String) : SocketEvent
    data class ConnectionChanged(val connected: Boolean, val reason: String? = null) : SocketEvent
}
