Timestamp and uuid for chat messages
This commit is contained in:
parent
19ce9fd219
commit
635e3f408b
5 changed files with 31 additions and 7 deletions
|
@ -19,6 +19,8 @@ import Data.Aeson
|
|||
defaultOptions,
|
||||
genericParseJSON,
|
||||
)
|
||||
import Data.Time.Clock.POSIX (POSIXTime)
|
||||
import Data.UUID (UUID)
|
||||
import Types.User (User)
|
||||
|
||||
data WebSocketMessage = ClientInfoMessage SetClientInfo | JoinRoomMessage JoinRoom | AllChatMessageIncomingMessage AllChatMessageIncoming
|
||||
|
@ -50,7 +52,9 @@ instance FromJSON AllChatMessageIncoming
|
|||
|
||||
data AllChatMessageOutgoing = AllChatMessageOutgoing
|
||||
{ content :: Text,
|
||||
sender :: User
|
||||
sender :: User,
|
||||
uuid :: UUID,
|
||||
timestamp :: POSIXTime
|
||||
}
|
||||
deriving (Generic, Show)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue