Add account data viewer

pull/1/head
Bram van den Heuvel 2023-03-31 13:50:43 +02:00
parent 01f97255fe
commit e2dd69c5d2
2 changed files with 16 additions and 2 deletions

View File

@ -19,6 +19,13 @@ type IRoom
}
{-| Get given account data from the room.
-}
accountData : String -> IRoom -> Maybe E.Value
accountData key (IRoom room) =
Dict.get key room.accountData
{-| Add the data of a single event to the hashdict of events.
-}
addEvent : IEvent -> IRoom -> IRoom

View File

@ -1,6 +1,6 @@
module Matrix.Room exposing
( Room, roomId, mostRecentEvents, findOlderEvents
, stateEvent
, stateEvent, accountData
, sendMessage, sendMessages, sendOneEvent, sendMultipleEvents
)
@ -16,7 +16,7 @@ A room represents a channel of communication within a Matrix home server.
# Exploring a room
@docs stateEvent
@docs stateEvent, accountData
# Sending events
@ -41,6 +41,13 @@ type alias Room =
Internal.Room
{-| Get any account data value that the user stores regarding this room.
-}
accountData : String -> Room -> Maybe E.Value
accountData =
Internal.accountData
{-| If you want more events as part of the most recent events, you can run this task to get more.
-}
findOlderEvents : { limit : Maybe Int, room : Room } -> Task X.Error VaultUpdate