2023-06-06 16:27:22 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
pub mod build_response;
|
2023-10-09 10:46:12 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
pub mod claims;
|
2021-03-25 19:19:40 +00:00
|
|
|
pub mod comment;
|
|
|
|
pub mod community;
|
2022-11-28 14:29:33 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
pub mod context;
|
2023-03-20 21:32:31 +00:00
|
|
|
pub mod custom_emoji;
|
2021-03-25 19:19:40 +00:00
|
|
|
pub mod person;
|
|
|
|
pub mod post;
|
2022-09-19 22:58:42 +00:00
|
|
|
pub mod private_message;
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
pub mod request;
|
2023-07-19 13:49:41 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
pub mod send_activity;
|
2022-05-06 20:55:07 +00:00
|
|
|
pub mod sensitive;
|
2021-03-25 19:19:40 +00:00
|
|
|
pub mod site;
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
pub mod utils;
|
2022-06-08 15:30:20 +00:00
|
|
|
|
|
|
|
pub extern crate lemmy_db_schema;
|
|
|
|
pub extern crate lemmy_db_views;
|
|
|
|
pub extern crate lemmy_db_views_actor;
|
|
|
|
pub extern crate lemmy_db_views_moderator;
|
2023-10-09 10:46:12 +00:00
|
|
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
2023-11-06 21:07:04 +00:00
|
|
|
use std::time::Duration;
|
2023-10-09 10:46:12 +00:00
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(ts_rs::TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
/// Saves settings for your user.
|
|
|
|
pub struct SuccessResponse {
|
|
|
|
pub success: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for SuccessResponse {
|
|
|
|
fn default() -> Self {
|
|
|
|
SuccessResponse { success: true }
|
|
|
|
}
|
|
|
|
}
|
2023-11-06 21:07:04 +00:00
|
|
|
|
|
|
|
/// how long to sleep based on how many retries have already happened
|
|
|
|
pub fn federate_retry_sleep_duration(retry_count: i32) -> Duration {
|
|
|
|
Duration::from_secs_f64(10.0 * 2.0_f64.powf(f64::from(retry_count)))
|
|
|
|
}
|