Fix Elm warnings
parent
885da04383
commit
3bdcba13bc
|
@ -1,6 +1,5 @@
|
||||||
module Internal.Values.Credentials exposing (..)
|
module Internal.Values.Credentials exposing (..)
|
||||||
|
|
||||||
import Dict exposing (Dict)
|
|
||||||
import Internal.Tools.Hashdict as Hashdict exposing (Hashdict)
|
import Internal.Tools.Hashdict as Hashdict exposing (Hashdict)
|
||||||
import Internal.Values.Room as Room exposing (Room)
|
import Internal.Values.Room as Room exposing (Room)
|
||||||
|
|
||||||
|
@ -14,6 +13,7 @@ type AccessToken
|
||||||
| NoAccess
|
| NoAccess
|
||||||
| UsernameAndPassword { username : String, password : String, accessToken : Maybe String }
|
| UsernameAndPassword { username : String, password : String, accessToken : Maybe String }
|
||||||
|
|
||||||
|
|
||||||
defaultCredentials : String -> Credentials
|
defaultCredentials : String -> Credentials
|
||||||
defaultCredentials homeserver =
|
defaultCredentials homeserver =
|
||||||
Credentials
|
Credentials
|
||||||
|
@ -22,18 +22,21 @@ defaultCredentials homeserver =
|
||||||
, rooms = Hashdict.empty Room.roomId
|
, rooms = Hashdict.empty Room.roomId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fromAccessToken : { accessToken : String, homeserver : String } -> Credentials
|
fromAccessToken : { accessToken : String, homeserver : String } -> Credentials
|
||||||
fromAccessToken { accessToken, homeserver } =
|
fromAccessToken { accessToken, homeserver } =
|
||||||
case defaultCredentials homeserver of
|
case defaultCredentials homeserver of
|
||||||
Credentials c ->
|
Credentials c ->
|
||||||
Credentials { c | access = AccessToken accessToken }
|
Credentials { c | access = AccessToken accessToken }
|
||||||
|
|
||||||
|
|
||||||
fromLoginCredentials : { username : String, password : String, homeserver : String } -> Credentials
|
fromLoginCredentials : { username : String, password : String, homeserver : String } -> Credentials
|
||||||
fromLoginCredentials { username, password, homeserver } =
|
fromLoginCredentials { username, password, homeserver } =
|
||||||
case defaultCredentials homeserver of
|
case defaultCredentials homeserver of
|
||||||
Credentials c ->
|
Credentials c ->
|
||||||
Credentials { c | access = UsernameAndPassword { username = username, password = password, accessToken = Nothing } }
|
Credentials { c | access = UsernameAndPassword { username = username, password = password, accessToken = Nothing } }
|
||||||
|
|
||||||
|
|
||||||
getRoomById : String -> Credentials -> Maybe Room
|
getRoomById : String -> Credentials -> Maybe Room
|
||||||
getRoomById roomId (Credentials cred) =
|
getRoomById roomId (Credentials cred) =
|
||||||
Hashdict.get roomId cred.rooms
|
Hashdict.get roomId cred.rooms
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
module Internal.Values.Room exposing (..)
|
module Internal.Values.Room exposing (..)
|
||||||
|
|
||||||
import Dict exposing (Dict)
|
import Dict exposing (Dict)
|
||||||
import Internal.Tools.Fold as Fold
|
|
||||||
import Internal.Tools.SpecEnums exposing (SessionDescriptionType(..))
|
import Internal.Tools.SpecEnums exposing (SessionDescriptionType(..))
|
||||||
import Internal.Values.Event as Event exposing (BlindEvent, Event)
|
import Internal.Values.Event as Event exposing (BlindEvent, Event)
|
||||||
import Internal.Values.StateManager as StateManager exposing (StateManager)
|
import Internal.Values.StateManager exposing (StateManager)
|
||||||
import Internal.Values.Timeline as Timeline exposing (Timeline)
|
import Internal.Values.Timeline as Timeline exposing (Timeline)
|
||||||
import Json.Encode as E
|
import Json.Encode as E
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ module Internal.Values.Timeline exposing (..)
|
||||||
import Internal.Config.Leaking as Leaking
|
import Internal.Config.Leaking as Leaking
|
||||||
import Internal.Tools.Fold as Fold
|
import Internal.Tools.Fold as Fold
|
||||||
import Internal.Values.Event as Event exposing (Event)
|
import Internal.Values.Event as Event exposing (Event)
|
||||||
import Internal.Values.Room exposing (stateAtEvent)
|
|
||||||
import Internal.Values.StateManager as StateManager exposing (StateManager)
|
import Internal.Values.StateManager as StateManager exposing (StateManager)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue