1 use crate::websocket::chat_server::ChatServer;
3 use lemmy_db_schema::{source::secret::Secret, utils::DbPool};
5 rate_limit::RateLimitCell,
6 settings::{structs::Settings, SETTINGS},
8 use reqwest_middleware::ClientWithMiddleware;
12 pub struct LemmyContext {
14 chat_server: Addr<ChatServer>,
15 client: Arc<ClientWithMiddleware>,
17 rate_limit_cell: RateLimitCell,
23 chat_server: Addr<ChatServer>,
24 client: ClientWithMiddleware,
26 rate_limit_cell: RateLimitCell,
31 client: Arc::new(client),
32 secret: Arc::new(secret),
36 pub fn pool(&self) -> &DbPool {
39 pub fn chat_server(&self) -> &Addr<ChatServer> {
42 pub fn client(&self) -> &ClientWithMiddleware {
45 pub fn settings(&self) -> &'static Settings {
48 pub fn secret(&self) -> &Secret {
51 pub fn settings_updated_channel(&self) -> &RateLimitCell {