mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 05:06:53 +00:00
style: Reformat with nightly
This commit is contained in:
11 files changed
+56
-47
No files matched your search
@@ -146,8 +146,8 @@ impl crate::Service for Service {
|
||||
.redirect(redirect::Policy::limited(2))
|
||||
.build()?,
|
||||
|
||||
// MSC4174 recommends against following redirects, since the destination
|
||||
// is only checked before the request is sent.
|
||||
// MSC4174 recommends against following redirects, since the
|
||||
// destination is only checked before the request is sent.
|
||||
webpush: base(config)?
|
||||
.connect_timeout(Duration::from_secs(config.pusher_conn_timeout))
|
||||
.timeout(Duration::from_secs(config.pusher_timeout))
|
||||
|
||||
+26
-24
@@ -109,35 +109,37 @@ migration!(stringify!($name) => $name)
|
||||
migration!(fix_readreceiptid_readreceipt_duplicates),
|
||||
// End pre-fork logic.
|
||||
|
||||
// v18: `fix_corrupt_msc4133_fields` will change the `us.cloke.msc4175.tz` field
|
||||
// in a way that old versions don't understand.
|
||||
// v18: `fix_corrupt_msc4133_fields` will change the
|
||||
// `us.cloke.msc4175.tz` field in a way that old versions don't
|
||||
// understand.
|
||||
VersionBump(18),
|
||||
migration!(fix_corrupt_msc4133_fields),
|
||||
// v19: `populate_userroomid_leftstate_table` will put data in the values of
|
||||
// `userroomid_leftstate` that old versions will fail to deserialize because
|
||||
// they expect the values to be empty.
|
||||
// v19: `populate_userroomid_leftstate_table` will put data in the
|
||||
// values of `userroomid_leftstate` that old versions will fail to
|
||||
// deserialize because they expect the values to be empty.
|
||||
VersionBump(19),
|
||||
migration!(populate_userroomid_leftstate_table),
|
||||
// This is backwards compatible because it fixes some data that clients care about but we
|
||||
// don't.
|
||||
// This is backwards compatible because it fixes some data that clients
|
||||
// care about but we don't.
|
||||
migration!(fix_local_invite_state),
|
||||
// v20: Old versions expect remote users to be tracked in `userid_password`. This
|
||||
// migration moves them to a different keyspace.
|
||||
// v20: Old versions expect remote users to be tracked in
|
||||
// `userid_password`. This migration moves them to a different keyspace.
|
||||
VersionBump(20),
|
||||
migration!(split_userid_password),
|
||||
// This is backwards compatible because old versions will recreate the keyspace if it's
|
||||
// missing.
|
||||
// This is backwards compatible because old versions will recreate the
|
||||
// keyspace if it's missing.
|
||||
migration!("drop_roomsynctoken_shortstatehash" => obliterate_roomsynctoken_shortstatehash_with_extreme_prejudice),
|
||||
// v21: `unembed_unsigned_info` will remove `unsigned` data from PDUs that old versions
|
||||
// expect to be embedded.
|
||||
// v21: `unembed_unsigned_info` will remove `unsigned` data from PDUs
|
||||
// that old versions expect to be embedded.
|
||||
VersionBump(21),
|
||||
// This migration can take several hours on old databases, so we run it in the background
|
||||
// to keep the service manager from killing us for taking too long to start.
|
||||
// Future maintainers: !!! BE VERY CAREFUL !!! if you need to write more migrations like
|
||||
// this! This one is fine because it deletes data that we don't check anymore,
|
||||
// but migrations which replace existing data that we do check should NOT run in
|
||||
// the background. If they do, the server will finish starting up and might
|
||||
// access data that the migration hasn't gotten to yet.
|
||||
// This migration can take several hours on old databases, so we run it
|
||||
// in the background to keep the service manager from killing us for
|
||||
// taking too long to start. Future maintainers: !!! BE VERY CAREFUL !!!
|
||||
// if you need to write more migrations like this! This one is fine
|
||||
// because it deletes data that we don't check anymore, but migrations
|
||||
// which replace existing data that we do check should NOT run in
|
||||
// the background. If they do, the server will finish starting up and
|
||||
// might access data that the migration hasn't gotten to yet.
|
||||
Migration("unembed_unsigned_info", |services| {
|
||||
Box::pin(async {
|
||||
if services.db["global"]
|
||||
@@ -158,11 +160,11 @@ migration!(stringify!($name) => $name)
|
||||
Ok(())
|
||||
})
|
||||
}),
|
||||
// This is backwards compatible because old versions will recreate the keyspace if it's
|
||||
// missing.
|
||||
// This is backwards compatible because old versions will recreate the
|
||||
// keyspace if it's missing.
|
||||
migration!(drop_server_signingkeys),
|
||||
// v22: Old versions will fail to deserialize the fixed OAuth scope names,
|
||||
// preventing users from signing in.
|
||||
// v22: Old versions will fail to deserialize the fixed OAuth scope
|
||||
// names, preventing users from signing in.
|
||||
VersionBump(22),
|
||||
migration!(fix_oauth_scope_names),
|
||||
]
|
||||
|
||||
@@ -203,8 +203,8 @@ impl super::Service {
|
||||
"GET_MISSING_EVENTS_MAX_BATCH_SIZE (usize) should fit in u16 (<=65536)",
|
||||
))
|
||||
.max(
|
||||
// This max call ensures we fetch *at least* all the prev events the
|
||||
// head has.
|
||||
// This max call ensures we fetch *at least* all the prev
|
||||
// events the head has.
|
||||
u16::try_from(head.prev_events.len())
|
||||
.expect("cannot have more than 20 prev events, which fits in u16"),
|
||||
);
|
||||
|
||||
@@ -756,11 +756,13 @@ impl Service {
|
||||
let join_rule = self.services.state_accessor.get_join_rules(room_id).await;
|
||||
|
||||
match (join_rule, querying_user) {
|
||||
// Anyone can view summaries for `public`, `knock`, and `knock_restricted` rooms.
|
||||
// Anyone can view summaries for `public`, `knock`, and
|
||||
// `knock_restricted` rooms.
|
||||
| (JoinRule::Public | JoinRule::Knock | JoinRule::KnockRestricted(_), _) => true,
|
||||
|
||||
// The user may be able to view the summary for a `restricted` room, even if they
|
||||
// aren't invited, provided they fulfill the join rules.
|
||||
// The user may be able to view the summary for a `restricted` room,
|
||||
// even if they aren't invited, provided they fulfill the join
|
||||
// rules.
|
||||
| (JoinRule::Restricted(conditions), Some(querying_user)) =>
|
||||
self.services
|
||||
.membership
|
||||
|
||||
@@ -193,7 +193,8 @@ impl super::Service {
|
||||
let redacts = match redacts {
|
||||
// If this isn't a real redaction event, there's no redacts field.
|
||||
| _ if event_type != TimelineEventType::RoomRedaction || state_key.is_some() => None,
|
||||
// If the redaction is itself in the event content, we don't set the top-level field.
|
||||
// If the redaction is itself in the event content, we don't set the
|
||||
// top-level field.
|
||||
| Some(_) if room_version_rules.redaction.content_field_redacts => None,
|
||||
// Otherwise, we do if it's present
|
||||
| other => other,
|
||||
|
||||
@@ -124,8 +124,9 @@ impl Service {
|
||||
let mut sessions = self.sessions.lock().await;
|
||||
|
||||
let session = match sessions.get_session_by_client_secret(client_secret) {
|
||||
// If a validation session already exists for this client secret, we can either
|
||||
// reuse it with a new token or return early because it's already valid.
|
||||
// If a validation session already exists for this client secret, we
|
||||
// can either reuse it with a new token or return early because it's
|
||||
// already valid.
|
||||
| Some(session) => {
|
||||
if session.email != recipient.email {
|
||||
return Err!(Request(InvalidParam("Wrong email for session.")));
|
||||
|
||||
Reference in new issue
Block a user