Add account data viewer
parent
01f97255fe
commit
e2dd69c5d2
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue