- let rate_limiter = RateLimit {
- rate_limiter: Arc::new(Mutex::new(RateLimiter::default())),
- rate_limit_config,
- };
-
- let chat_server = ChatServer::startup(
- pool.clone(),
- rate_limiter,
- |_, _, _, _| Box::pin(x()),
- |_, _, _, _| Box::pin(x()),
- client.clone(),
- settings.clone(),
- secret.clone(),
- )
- .start();
- LemmyContext::create(pool, chat_server, client, settings, secret)
+ let context = LemmyContext::create(pool, client, secret, rate_limit_cell.clone());
+ let config = FederationConfig::builder()
+ .domain("example.com")
+ .app_data(context)
+ .build()
+ .await
+ .unwrap();
+ config.to_request_data()