Compare commits

..

1 Commits

Author SHA1 Message Date
BramvdnHeuvel 24f006d301
Merge f714438dd4 into f7837a91c8 2024-06-03 09:07:12 +00:00
5 changed files with 8 additions and 26 deletions

View File

@ -18,9 +18,8 @@ supported for which spec versions.
- ✅ **One way to do things** instead of having multiple functions that are - ✅ **One way to do things** instead of having multiple functions that are
considered deprecated. considered deprecated.
Follow us on [Mastodon](https://social.noordstar.me/@elm_matrix_sdk) or join the Follow us on [Mastodon](https://social.noordstar.me/@elm_matrix_sdk) at
conversation on [Matrix](https://matrix.to/#/#elm-sdk:matrix.org) to stay @elm_matrix_sdk@social.noordstar.me to stay up-to-date on the latest changes.
up-to-date on the latest changes.
## How to install ## How to install

View File

@ -3,7 +3,7 @@
"name": "noordstar/elm-matrix-sdk-beta", "name": "noordstar/elm-matrix-sdk-beta",
"summary": "Matrix SDK for instant communication. Unstable beta version for testing only.", "summary": "Matrix SDK for instant communication. Unstable beta version for testing only.",
"license": "EUPL-1.1", "license": "EUPL-1.1",
"version": "3.3.1", "version": "3.3.0",
"exposed-modules": [ "exposed-modules": [
"Matrix", "Matrix",
"Matrix.Event", "Matrix.Event",

View File

@ -35,10 +35,9 @@ import Internal.Api.Request as Request
import Internal.Api.SendMessageEvent.Api import Internal.Api.SendMessageEvent.Api
import Internal.Api.Versions.Api import Internal.Api.Versions.Api
import Internal.Config.Log exposing (Log, log) import Internal.Config.Log exposing (Log, log)
import Internal.Config.Text as Text
import Internal.Tools.Json as Json import Internal.Tools.Json as Json
import Internal.Values.Context as Context exposing (APIContext) import Internal.Values.Context as Context exposing (APIContext)
import Internal.Values.Envelope as E exposing (EnvelopeUpdate(..)) import Internal.Values.Envelope exposing (EnvelopeUpdate(..))
import Internal.Values.Room exposing (RoomUpdate(..)) import Internal.Values.Room exposing (RoomUpdate(..))
import Internal.Values.Vault exposing (VaultUpdate(..)) import Internal.Values.Vault exposing (VaultUpdate(..))
import Task import Task
@ -112,20 +111,7 @@ getBaseUrl c =
Nothing -> Nothing ->
Internal.Api.BaseUrl.Api.baseUrl Internal.Api.BaseUrl.Api.baseUrl
{ url = Context.fromApiFormat c |> .serverName } { url = Context.fromApiFormat c |> .serverName }
|> C.catchWith c
(\_ ->
let
url : String
url =
Context.fromApiFormat c
|> .serverName
in
{ contextChange = Context.setBaseUrl url
, logs = [ log.warn (Text.logs.baseUrlFailed url) ]
, messages = [ E.SetBaseUrl url ]
}
)
|> (|>) c
{-| Get the current timestamp {-| Get the current timestamp

View File

@ -29,7 +29,7 @@ will assume until overriden by the user.
-} -}
currentVersion : String currentVersion : String
currentVersion = currentVersion =
"beta 3.3.1" "beta 3.3.0"
{-| The default device name that is being communicated with the Matrix API. {-| The default device name that is being communicated with the Matrix API.

View File

@ -609,8 +609,7 @@ happened. Most of these unexpected results, are taken account of by the Elm SDK,
but logged so that the programmer can do something about it. but logged so that the programmer can do something about it.
-} -}
logs : logs :
{ baseUrlFailed : String -> String { baseUrlFound : String -> String -> String
, baseUrlFound : String -> String -> String
, getEventId : String -> String , getEventId : String -> String
, getNow : Int -> String , getNow : Int -> String
, httpRequest : String -> String -> String , httpRequest : String -> String -> String
@ -622,9 +621,7 @@ logs :
, serverReturnedUnknownJSON : String -> String , serverReturnedUnknownJSON : String -> String
} }
logs = logs =
{ baseUrlFailed = { baseUrlFound =
(++) "Failed to find .well-known, using default server address: "
, baseUrlFound =
\url baseUrl -> \url baseUrl ->
String.concat [ "Found baseURL of ", url, " at address ", baseUrl ] String.concat [ "Found baseURL of ", url, " at address ", baseUrl ]
, getEventId = (++) "Received event with id = " , getEventId = (++) "Received event with id = "