PgConnection,
};
use lemmy_api_common::{comment::*, post::*};
-use lemmy_db_schema::{CommunityId, LocalUserId, PostId};
+use lemmy_db_schema::{source::secret::Secret, CommunityId, LocalUserId, PostId};
use lemmy_utils::{
location_info,
rate_limit::RateLimit,
+ settings::structs::Settings,
ApiError,
ConnectionId,
IpAddr,
/// The DB Pool
pub(super) pool: Pool<ConnectionManager<PgConnection>>,
+ /// The Settings
+ pub(super) settings: Settings,
+
+ /// The Secrets
+ pub(super) secret: Secret,
+
/// Rate limiting based on rate type and IP addr
pub(super) rate_limiter: RateLimit,
/// And manages available rooms. Peers send messages to other peers in same
/// room through `ChatServer`.
impl ChatServer {
+ #![allow(clippy::too_many_arguments)]
pub fn startup(
pool: Pool<ConnectionManager<PgConnection>>,
rate_limiter: RateLimit,
message_handler_crud: MessageHandlerCrudType,
client: Client,
activity_queue: QueueHandle,
+ settings: Settings,
+ secret: Secret,
) -> ChatServer {
ChatServer {
sessions: HashMap::new(),
message_handler_crud,
client,
activity_queue,
+ settings,
+ secret,
}
}
chat_server: ctx.address(),
client: self.client.to_owned(),
activity_queue: self.activity_queue.to_owned(),
+ settings: self.settings.to_owned(),
+ secret: self.secret.to_owned(),
};
let message_handler_crud = self.message_handler_crud;
let message_handler = self.message_handler;