We want to return a Result<Blog>, instead of a QueryResult<Blog>.
We can use map_err() to map it to the desired error type.
thanks to review from @BaptisteGelez & @fdb-hiroshima.
we can use "first()" instead of limit(1).load().etc…
since on a UNIQUE field, we only expect 1 result.
first() returns QueryResult, which is Result<T, diesel::Error>, so we
need to implement a converter for that error type.
This commit addresses @fdb-hiroshima's review.
how this works: we use find_by_host() to find the Host in question, the
defer to the existing function!
Caveat: Currently, we, in that function, we do another lookup DB lookup
for the Blog, even thou we already know it.
It might be wise, to have both of those another wrapper here?!
this rewrites the URL to /custom_domain/<url>
(we have no route handlers for this path yet)
Lots of help from @fdb-hiroshima & @BaptisteGelez in dealing with the
borrow checker — thank you 💜️
we can use this to handle rocket Requests (from_request)
but we still have to figure out how to automatically assign the type to
custom_domain: Optional<Host>, and public_domain: Host.
* Bump activitystreams-derive from 0.1.0 to 0.1.1
* Bump tantivy from 0.9.1 to 0.10.1
* Bump rpassword from 3.0.2 to 4.0.1
* Bump num_cpus from 1.10.0 to 1.10.1
* Bump serde_qs from 0.4.6 to 0.5.0
* Bump stdweb-internal-runtime from 0.1.3 to 0.1.4
* [Security] Bump smallvec from 0.6.9 to 0.6.10
* Bump chrono from 0.4.6 to 0.4.7
* Bump bcrypt from 0.4.0 to 0.5.0
* Bump serde_json from 1.0.39 to 1.0.40
* Bump tokio from 0.1.21 to 0.1.22
* Bump scheduled-thread-pool from 0.2.0 to 0.2.2
* Bump stdweb from 0.4.14 to 0.4.18
* Bump hyper from 0.12.29 to 0.12.33
* Bump reqwest from 0.9.17 to 0.9.19
* Bump url from 1.7.2 to 2.1.0
* send scheme as part of webfinger remote follow template
fixtsileo/microblog.pub#49
* bump webfinger to 0.4.1
* cargo fmt
* revert translations
* Use group: prefix for blog webfinger queries
* initial RTL support
* fix dir in template-util
* fix dir in blogs new
* fix dir in blogs details
* fix dir in posts new
* fix dir in posts details
* fix dir in posts remote
* Fix dir in partials
some parts should be recheck carefully in real usage
* Use futures and tokio to send activities
* Reset .po files
* Cargo fmt + small enhancements
- better error messages
- removed a TODO
* Log all messages at the same time when federation succeeds
* Redirect to the code of conduct in the docs
To centralize it, and because the version in the docs is more up-to-date
* Remove obsolete issue template
* Rework README
* add enum containing all successful route returns
This enum derives `Responder`, so it can be used as route result.
We also implement `From`, so it can be converted
* disable clippy warning about this enum
There's no use trying to chase this warning.
The next warning will be about `Redirect`, which itself is 360 byte,
according to @fdb-hiroshima (thanks for the research!)
So, if anything, we can try to get Rocket to work on that!
* refactor routes/posts to only use one level of Result
* admin settings error is not an ErrorPage, so dont use Result<>
* refactor: use early return to remove indent of main logic
This diff is absolutely atrocious.
but the resulting readability is worth it
* refactor routes/post for early returns & RespondOrRedirect
* refactor routes/session for early returns & use RespondOrRedirect
* refactor routes/user -- add another field to enum
* refactor routes/blogs for early returns & RespondOrRedirect
* refactor routes/blogs for early returns & RespondOrRedirect
This is a final refactor of `pub fn update()` for readability.
We're removing at least one indentation level.