diff --git a/Manifest.toml b/Manifest.toml index 2f41a95..264227f 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -13,12 +13,6 @@ git-tree-sha1 = "b530fbeb6f41ab5a83fbe3db1fcbe879334bcd2d" uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" version = "0.4.2" -[[Codecs]] -deps = ["Test"] -git-tree-sha1 = "70885e5e038cba1c4c17a84ad6c40756e10a4fb5" -uuid = "19ecbf4d-ef7c-5e4b-b54a-0a0ff23c5aed" -version = "0.5.0" - [[Compat]] deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] git-tree-sha1 = "ae262fa91da6a74e8937add6b613f58cd56cdad4" @@ -144,9 +138,3 @@ uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [[Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[YAML]] -deps = ["Codecs", "Compat", "Pkg"] -git-tree-sha1 = "3bde77cee95cce0c0b9b18813d85e18e8ed4f415" -uuid = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" -version = "0.3.2" diff --git a/Project.toml b/Project.toml index 979faaa..08e66f0 100644 --- a/Project.toml +++ b/Project.toml @@ -11,4 +11,3 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Nettle = "49dea1ee-f6fa-5aa6-9a11-8816cee7d4b9" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" URIParser = "30578b45-9adc-5946-b283-645ec420af67" -YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" diff --git a/src/MatrixChat.jl b/src/MatrixChat.jl index bc34605..c299c37 100644 --- a/src/MatrixChat.jl +++ b/src/MatrixChat.jl @@ -2,7 +2,6 @@ module MatrixChat using HTTP using JSON -using YAML using Nettle using Dates diff --git a/src/repl.jl b/src/repl.jl index d5db453..a7dc736 100644 --- a/src/repl.jl +++ b/src/repl.jl @@ -742,9 +742,14 @@ function repl_init(repl) return end -function load_config_file(; configfile::String = expanduser("~/matrix/config.yaml")) +function load_config_file(; configfile::String = expanduser("~/matrix/config.jl")) if isfile(configfile) - config = YAML.load_file(configfile) + config = try + include(configfile) + catch e + @error "Malformed config file!" + throw(e) + end else # First run, create a new user/login and create the config file @error "First run not implemented!" diff --git a/src/users.jl b/src/users.jl index 951e68c..298d12f 100644 --- a/src/users.jl +++ b/src/users.jl @@ -26,6 +26,7 @@ function new_user(s::MatrixServer, parsed = String(raw_response.body) write("$(username).json", parsed) + parsed = JSON.json(parsed) MatrixUser(s, parsed["user_id"], parsed["access_token"], parsed["device_id"])