Compare commits

...
Author SHA1 Message Date
Zomatree 8976273410 feat: initial work on discord template importer 2026-02-16 22:28:51 +00:00
stoat-release[bot]andgithub-actions[bot] 74f0c537e6 chore(main): release 0.11.3 (#562)
* chore(main): release 0.11.3

* chore: update Cargo.lock

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: stoat-release[bot] <245062572+stoat-release[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-13 19:50:32 +00:00
Paul Makles 1f8ea963ad fix: cut presence traffic too while we engineer a new events architecture (#561)
Signed-off-by: izzy <me@insrt.uk>
2026-02-13 19:49:23 +00:00
stoat-release[bot]andgithub-actions[bot] 7c7f4f24de chore(main): release 0.11.2 (#560)
* chore(main): release 0.11.2

* chore: update Cargo.lock

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: stoat-release[bot] <245062572+stoat-release[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-13 19:42:13 +00:00
Paul Makles a11986ba1a fix: cut events traffic while we engineer a new events architecture (#559)
Signed-off-by: izzy <me@insrt.uk>
2026-02-13 19:40:51 +00:00
stoat-release[bot] 2e87696c83 chore(main): release 0.11.1 (#554) 2026-02-13 00:21:29 +00:00
Angelo Kontaxis 94cb916231 fix: bots in multiple voice channel logic (#544) 2026-02-13 00:11:15 +00:00
Paul Makles 95c7dbc793 ci: do not interpolate directly into release workflows (#545) 2026-02-12 16:47:05 +00:00
35 changed files with 567 additions and 145 deletions
+2 -1
View File
@@ -45,8 +45,9 @@ jobs:
if: ${{ steps.rp.outputs.prs_created == 'true' || steps.rp.outputs.prs_updated == 'true' }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
RP_PR_OUTPUT_JSON: ${{ steps.rp.outputs.prs }}
run: |
PR_NUMBER=$(echo '${{ steps.rp.outputs.prs }}' | jq -r '.[0].number')
PR_NUMBER=$(echo "$RP_PR_OUTPUT_JSON" | jq -r '.[0].number')
gh pr checkout "$PR_NUMBER"
cargo update -w
+6 -2
View File
@@ -12,8 +12,12 @@ jobs:
steps:
- name: Send release notification webhook
env:
TAG_NAME: ${{ github.event.release.tag_name }}
REPOSITORY: ${{ github.repository }}
WEBHOOK_URL: ${{ secrets.STOAT_WEBHOOK_UPDATES_URL }}
run: |
RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }}"
curl -X POST "${{ secrets.STOAT_WEBHOOK_UPDATES_URL }}" \
RELEASE_URL="https://github.com/${REPOSITORY}/releases/tag/${TAG_NAME}"
curl -X POST "$WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "{\"content\": \"$RELEASE_URL\"}"
+1 -1
View File
@@ -1,3 +1,3 @@
{
".": "0.11.0"
".": "0.11.3"
}
+21
View File
@@ -1,5 +1,26 @@
# Changelog
## [0.11.3](https://github.com/stoatchat/stoatchat/compare/v0.11.2...v0.11.3) (2026-02-13)
### Bug Fixes
* cut presence traffic too while we engineer a new events architecture ([#561](https://github.com/stoatchat/stoatchat/issues/561)) ([1f8ea96](https://github.com/stoatchat/stoatchat/commit/1f8ea963ad742f693f405e6438f1c343c81e6579))
## [0.11.2](https://github.com/stoatchat/stoatchat/compare/v0.11.1...v0.11.2) (2026-02-13)
### Bug Fixes
* cut events traffic while we engineer a new events architecture ([#559](https://github.com/stoatchat/stoatchat/issues/559)) ([a11986b](https://github.com/stoatchat/stoatchat/commit/a11986ba1ad16b672ff1080913a684567d88adbb))
## [0.11.1](https://github.com/stoatchat/stoatchat/compare/v0.11.0...v0.11.1) (2026-02-13)
### Bug Fixes
* bots in multiple voice channel logic ([#544](https://github.com/stoatchat/stoatchat/issues/544)) ([94cb916](https://github.com/stoatchat/stoatchat/commit/94cb916231b9b8befb2e94065917ff40815bec52))
## [0.11.0](https://github.com/stoatchat/stoatchat/compare/v0.10.3...v0.11.0) (2026-02-10)
Generated
+32 -18
View File
@@ -6798,7 +6798,7 @@ dependencies = [
[[package]]
name = "revolt-autumn"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"axum",
"axum-macros",
@@ -6836,7 +6836,7 @@ dependencies = [
[[package]]
name = "revolt-bonfire"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"async-channel 2.5.0",
"async-std",
@@ -6867,7 +6867,7 @@ dependencies = [
[[package]]
name = "revolt-coalesced"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"indexmap 2.13.0",
"lru 0.16.3",
@@ -6876,7 +6876,7 @@ dependencies = [
[[package]]
name = "revolt-config"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"async-std",
"cached",
@@ -6893,7 +6893,7 @@ dependencies = [
[[package]]
name = "revolt-crond"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"log",
"revolt-config",
@@ -6905,7 +6905,7 @@ dependencies = [
[[package]]
name = "revolt-database"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"amqprs",
"async-lock 2.8.0",
@@ -6955,7 +6955,7 @@ dependencies = [
[[package]]
name = "revolt-delta"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"amqprs",
"async-channel 1.9.0",
@@ -6983,6 +6983,7 @@ dependencies = [
"reqwest 0.11.27",
"revolt-config",
"revolt-database",
"revolt-discord",
"revolt-models",
"revolt-permissions",
"revolt-presence",
@@ -7003,9 +7004,22 @@ dependencies = [
"vergen",
]
[[package]]
name = "revolt-discord"
version = "0.11.3"
dependencies = [
"reqwest 0.12.23",
"revolt-database",
"revolt-models",
"revolt-permissions",
"revolt-result",
"serde",
"serde_json",
]
[[package]]
name = "revolt-files"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"aes-gcm",
"anyhow",
@@ -7033,7 +7047,7 @@ dependencies = [
[[package]]
name = "revolt-gifbox"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"axum",
"axum-extra",
@@ -7056,7 +7070,7 @@ dependencies = [
[[package]]
name = "revolt-january"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"async-recursion",
"axum",
@@ -7084,7 +7098,7 @@ dependencies = [
[[package]]
name = "revolt-models"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"indexmap 1.9.3",
"iso8601-timestamp",
@@ -7103,14 +7117,14 @@ dependencies = [
[[package]]
name = "revolt-parser"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"logos",
]
[[package]]
name = "revolt-permissions"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"async-std",
"async-trait",
@@ -7125,7 +7139,7 @@ dependencies = [
[[package]]
name = "revolt-presence"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"async-std",
"log",
@@ -7137,7 +7151,7 @@ dependencies = [
[[package]]
name = "revolt-pushd"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"amqprs",
"anyhow",
@@ -7165,7 +7179,7 @@ dependencies = [
[[package]]
name = "revolt-ratelimits"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"async-trait",
"authifier",
@@ -7182,7 +7196,7 @@ dependencies = [
[[package]]
name = "revolt-result"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"axum",
"log",
@@ -7198,7 +7212,7 @@ dependencies = [
[[package]]
name = "revolt-voice-ingress"
version = "0.11.0"
version = "0.11.3"
dependencies = [
"amqprs",
"async-std",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-bonfire"
version = "0.11.0"
version = "0.11.3"
license = "AGPL-3.0-or-later"
edition = "2021"
publish = false
+22 -20
View File
@@ -169,7 +169,9 @@ impl State {
}) {
if let Ok(Some(voice_state)) = get_channel_voice_state(channel).await {
if let Some(server) = channel.server() {
let set = voice_state_server_members.entry(server.to_string()).or_default();
let set = voice_state_server_members
.entry(server.to_string())
.or_default();
for participant in &voice_state.participants {
user_ids.insert(participant.id.clone());
@@ -397,27 +399,27 @@ impl State {
/// Push presence change to the user and all associated server topics
pub async fn broadcast_presence_change(&self, target: bool) {
if if let Some(status) = &self.cache.users.get(&self.cache.user_id).unwrap().status {
status.presence != Some(Presence::Invisible)
} else {
true
} {
let event = EventV1::UserUpdate {
id: self.cache.user_id.clone(),
data: v0::PartialUser {
online: Some(target),
..Default::default()
},
clear: vec![],
event_id: Some(ulid::Ulid::new().to_string()),
};
// if if let Some(status) = &self.cache.users.get(&self.cache.user_id).unwrap().status {
// status.presence != Some(Presence::Invisible)
// } else {
// true
// } {
// let event = EventV1::UserUpdate {
// id: self.cache.user_id.clone(),
// data: v0::PartialUser {
// online: Some(target),
// ..Default::default()
// },
// clear: vec![],
// event_id: Some(ulid::Ulid::new().to_string()),
// };
for server in self.cache.servers.keys() {
event.clone().p(server.clone()).await;
}
// for server in self.cache.servers.keys() {
// event.clone().p(server.clone()).await;
// }
event.p(self.cache.user_id.clone()).await;
}
// event.p(self.cache.user_id.clone()).await;
// }
}
/// Handle an incoming event for protocol version 1
+2 -24
View File
@@ -457,30 +457,8 @@ async fn worker(
};
match payload {
ClientMessage::BeginTyping { channel } => {
if !subscribed.read().await.contains(&channel) {
continue;
}
EventV1::ChannelStartTyping {
id: channel.clone(),
user: user_id.clone(),
}
.p(channel.clone())
.await;
}
ClientMessage::EndTyping { channel } => {
if !subscribed.read().await.contains(&channel) {
continue;
}
EventV1::ChannelStopTyping {
id: channel.clone(),
user: user_id.clone(),
}
.p(channel.clone())
.await;
}
ClientMessage::BeginTyping { .. } => {}
ClientMessage::EndTyping { .. } => {}
ClientMessage::Subscribe { server_id } => {
let mut servers = active_servers.lock().await;
let has_item = servers.contains_key(&server_id);
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-coalesced"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "MIT"
authors = ["Paul Makles <me@insrt.uk>", "Zomatree <me@zomatree.live>"]
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-config"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "MIT"
authors = ["Paul Makles <me@insrt.uk>"]
@@ -38,4 +38,4 @@ sentry = { version = "0.31.5", optional = true }
sentry-anyhow = { version = "0.38.1", optional = true }
# Core
revolt-result = { version = "0.11.0", path = "../result", optional = true }
revolt-result = { version = "0.11.3", path = "../result", optional = true }
+7 -7
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-database"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <me@insrt.uk>"]
@@ -32,19 +32,19 @@ default = ["mongodb", "async-std-runtime", "tasks"]
[dependencies]
# Core
revolt-config = { version = "0.11.0", path = "../config", features = [
revolt-config = { version = "0.11.3", path = "../config", features = [
"report-macros",
] }
revolt-result = { version = "0.11.0", path = "../result" }
revolt-models = { version = "0.11.0", path = "../models", features = [
revolt-result = { version = "0.11.3", path = "../result" }
revolt-models = { version = "0.11.3", path = "../models", features = [
"validator",
] }
revolt-presence = { version = "0.11.0", path = "../presence" }
revolt-permissions = { version = "0.11.0", path = "../permissions", features = [
revolt-presence = { version = "0.11.3", path = "../presence" }
revolt-permissions = { version = "0.11.3", path = "../permissions", features = [
"serde",
"bson",
] }
revolt-parser = { version = "0.11.0", path = "../parser" }
revolt-parser = { version = "0.11.3", path = "../parser" }
# Utility
log = "0.4"
@@ -3,8 +3,8 @@ use revolt_permissions::{calculate_channel_permissions, ChannelPermission};
use revolt_result::{create_error, Result};
use crate::{
events::client::EventV1, util::permissions::DatabasePermissionQuery, Channel,
Database, File, Server, SystemMessage, User,
events::client::EventV1, util::permissions::DatabasePermissionQuery, Channel, Database, File,
Server, SystemMessage, User,
};
fn default_true() -> bool {
@@ -332,6 +332,7 @@ mod tests {
name: "Server".to_string(),
description: None,
nsfw: None,
discord_template_id: None,
},
&owner,
false,
@@ -653,14 +653,14 @@ impl User {
self.apply_options(partial.clone());
db.update_user(&self.id, &partial, remove.clone()).await?;
EventV1::UserUpdate {
id: self.id.clone(),
data: partial.into(),
clear: remove.into_iter().map(|v| v.into()).collect(),
event_id: Some(Ulid::new().to_string()),
}
.p_user(self.id.clone(), db)
.await;
// EventV1::UserUpdate {
// id: self.id.clone(),
// data: partial.into(),
// clear: remove.into_iter().map(|v| v.into()).collect(),
// event_id: Some(Ulid::new().to_string()),
// }
// .p_user(self.id.clone(), db)
// .await;
Ok(())
}
+11 -9
View File
@@ -22,23 +22,25 @@ async fn get_connection() -> Result<Conn> {
pub async fn raise_if_in_voice(user: &User, channel_id: &str) -> Result<()> {
let mut conn = get_connection().await?;
if user.bot.is_some()
// bots can be in as many voice channels as it wants so we just check if its already connected to the one its trying to connect to
&& conn.sismember(format!("vc:{}", &user.id), channel_id)
if user.bot.is_some() {
// bots can be in as many voice channels as it wants so we just check if its already connected to the one its trying to connect to
if conn
.sismember(format!("vc:{}", &user.id), channel_id)
.await
.to_internal_error()?
{
Err(create_error!(AlreadyConnected))
{
return Err(create_error!(AlreadyConnected));
};
} else if conn
.scard::<_, u32>(format!("vc:{}", &user.id)) // check if the current vc set is empty
.await
.to_internal_error()?
> 0
{
Err(create_error!(AlreadyConnected))
} else {
Ok(())
}
return Err(create_error!(AlreadyConnected));
};
Ok(())
}
pub async fn set_channel_node(channel: &str, node: &str) -> Result<()> {
+27
View File
@@ -0,0 +1,27 @@
[package]
name = "revolt-discord"
version = "0.11.3"
edition = "2021"
license = "MIT"
authors = ["Zomatree <me@zomatree.live>"]
description = "Revolt Backend: Discord Compatibility"
repository = "https://github.com/stoatchat/stoatchat"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
[dependencies]
# Core
revolt-result = { version = "0.11.3", path = "../result" }
revolt-database = { version = "0.11.3", path = "../database" }
revolt-permissions = { version = "0.11.3", path = "../permissions" }
revolt-models = { version = "0.11.3", path = "../models" }
# Serialisation
serde_json = { version = "1" }
serde = { version = "1", features = ["derive"] }
# Http
reqwest = { version = "0.12", features = ["json"] }
+2
View File
@@ -0,0 +1,2 @@
pub mod types;
pub mod template;
+275
View File
@@ -0,0 +1,275 @@
use std::collections::HashMap;
use revolt_models::v0;
use revolt_permissions::OverrideField;
use crate::types as discord;
use revolt_database::{
Category, Channel, Database, PartialChannel, PartialRole, PartialServer, Role, Server,
SystemMessageChannels,
};
use revolt_result::{Result, ToRevoltError};
pub async fn fetch_template(template_id: &str) -> Result<discord::GuildTemplate> {
reqwest::get(format!(
"https://discord.com/api/v10/guilds/templates/{template_id}"
))
.await
.to_internal_error()?
.json()
.await
.to_internal_error()
}
pub async fn import_template(
db: &Database,
server: &mut Server,
template: discord::GuildTemplate,
) -> Result<Vec<Channel>> {
let mut role_mapping = HashMap::new();
let mut channel_mapping = HashMap::new();
let mut categories = HashMap::new();
for discord_channel in &template.serialized_source_guild.channels {
if discord_channel.channel_type == discord::ChannelType::Category as u32 {
categories.insert(discord_channel.id, discord_channel.clone());
};
}
let mut role_positions = template.serialized_source_guild.roles
.iter()
.filter(|r| r.id != 0)
.collect::<Vec<_>>();
role_positions.sort_by(|a, b| b.id.cmp(&a.id));
let role_positions = role_positions
.into_iter()
.enumerate()
.map(|(i, r)| (r.id, i as i64))
.collect::<HashMap<_, _>>();
for discord_role in template.serialized_source_guild.roles.clone() {
if discord_role.id == 0 {
continue;
};
role_mapping.insert(
discord_role.id,
convert_role(db, server, role_positions[&discord_role.id], discord_role).await?,
);
};
for discord_channel in template.serialized_source_guild.channels.clone() {
if discord_channel.channel_type == discord::ChannelType::Category as u32 {
continue;
};
channel_mapping.insert(
discord_channel.id,
convert_channel(db, server, &categories, &role_mapping, discord_channel).await?,
);
}
convert_server(db, server, &channel_mapping, template.serialized_source_guild).await?;
Ok(channel_mapping.into_values().collect())
}
pub async fn convert_role(db: &Database, server: &mut Server, rank: i64, role: discord::Role) -> Result<Role> {
let mut role_payload = Role::create(db, server, role.name).await?;
let mut partial = PartialRole {
rank: Some(rank),
..Default::default()
};
if role.hoist {
partial.hoist = Some(true)
};
if let Some(colors) = role.colors {
if colors.primary_color != 0 {
partial.colour = Some(format!("#{:x}", colors.primary_color))
};
};
if &role.permissions != "0" {
let allow = convert_permissions(&role.permissions);
partial.permissions = Some(OverrideField { a: allow, d: 0 });
};
role_payload
.update(db, &server.id, partial, Vec::new())
.await?;
server.roles.insert(role_payload.id.clone(), role_payload.clone());
Ok(role_payload)
}
static PERMISSION_MAPPING: &[(i64, i64)] = &[];
pub fn convert_permissions(permissions: &str) -> i64 {
let value = permissions.parse::<i64>().unwrap();
let mut output = 0;
for (discord_perm, perm) in PERMISSION_MAPPING {
if (value & *discord_perm) == *discord_perm {
output |= *perm
};
}
output
}
pub async fn convert_channel(
db: &Database,
server: &mut Server,
categories: &HashMap<u32, discord::Channel>,
role_mapping: &HashMap<u32, Role>,
channel: discord::Channel,
) -> Result<Channel> {
let mut channel_payload = Channel::create_server_channel(
db,
server,
v0::DataCreateServerChannel {
channel_type: v0::LegacyServerChannelType::Text,
name: channel.name,
description: channel.topic,
nsfw: channel.nsfw,
voice: if channel.channel_type == discord::ChannelType::Voice as u32
|| channel.channel_type == discord::ChannelType::StageVoice as u32
{
Some(v0::VoiceInformation {
max_users: channel.user_limit.map(|limit| limit as usize),
})
} else {
None
},
},
true,
)
.await?;
let mut partial = PartialChannel::default();
let mut role_permissions = HashMap::new();
if let Some(parent_id) = channel.parent_id {
let category = categories.get(&parent_id).unwrap();
for discord_overwrite in category.permission_overwrites.iter().flatten() {
if discord_overwrite.overwrite_type == discord::OverwriteType::Member as u32 {
continue;
};
let overwrite = OverrideField {
a: convert_permissions(&discord_overwrite.allow),
d: convert_permissions(&discord_overwrite.deny),
};
if discord_overwrite.id == 0 {
partial.default_permissions = Some(overwrite)
} else {
role_permissions.insert(
role_mapping.get(&discord_overwrite.id).unwrap().id.clone(),
overwrite,
);
};
}
};
for discord_overwrite in channel.permission_overwrites.iter().flatten() {
if discord_overwrite.overwrite_type == discord::OverwriteType::Member as u32 {
continue;
};
let overwrite = OverrideField {
a: convert_permissions(&discord_overwrite.allow),
d: convert_permissions(&discord_overwrite.deny),
};
if discord_overwrite.id == 0 {
if let Some(default_permissions) = &mut partial.default_permissions {
default_permissions.a |= overwrite.a;
default_permissions.d |= overwrite.d;
} else {
partial.default_permissions = Some(overwrite)
}
} else {
let id = &role_mapping.get(&discord_overwrite.id).unwrap().id;
if let Some(role_permission) = role_permissions.get_mut(id) {
role_permission.a |= overwrite.a;
role_permission.d |= overwrite.d;
} else {
role_permissions.insert(id.clone(), overwrite);
};
};
}
partial.role_permissions = Some(role_permissions);
channel_payload.update(db, partial, Vec::new()).await?;
Ok(channel_payload)
}
pub async fn convert_server(
db: &Database,
server: &mut Server,
channel_mapping: &HashMap<u32, Channel>,
guild: discord::Guild,
) -> Result<()> {
let mut partial = PartialServer {
categories: Some(
guild
.channels
.iter()
.filter(|c| c.channel_type == discord::ChannelType::Category as u32)
.map(|category| {
let mut channels = guild
.channels
.iter()
.filter(|c| c.parent_id.as_ref() == Some(&category.id))
.collect::<Vec<_>>();
channels.sort_by(|a, b| a.position.cmp(&b.position));
Category {
id: category.id.to_string(),
title: category.name.clone(),
channels: channels
.into_iter()
.map(|c| channel_mapping.get(&c.id).unwrap().id().to_string())
.collect(),
}
})
.collect(),
),
..Default::default()
};
// TODO: banner
if let Some(system_channel_id) = &guild.system_channel_id {
let channel_id = channel_mapping
.get(system_channel_id)
.unwrap()
.id()
.to_string();
partial.system_messages = Some(SystemMessageChannels {
user_banned: Some(channel_id.clone()),
user_joined: Some(channel_id.clone()),
user_kicked: Some(channel_id.clone()),
user_left: Some(channel_id),
});
};
let default_role = guild.roles.iter().find(|r| r.id == 0).unwrap();
partial.default_permissions = Some(convert_permissions(&default_role.permissions));
server.update(db, partial, Vec::new()).await?;
Ok(())
}
+81
View File
@@ -0,0 +1,81 @@
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
pub struct GuildTemplate {
pub serialized_source_guild: Guild
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Guild {
pub name: String,
pub banner: Option<String>,
pub roles: Vec<Role>,
pub channels: Vec<Channel>,
pub system_channel_id: Option<u32>,
pub description: Option<String>,
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Role {
pub id: u32,
pub name: String,
pub colors: Option<RoleColor>,
pub hoist: bool,
pub icon: Option<String>,
pub position: Option<u32>,
pub permissions: String,
pub mentionable: bool
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct RoleColor {
pub primary_color: u64,
pub secondary_color: Option<u64>,
pub tertiary_color: Option<u64>,
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Channel {
pub id: u32,
#[serde(rename = "type")]
pub channel_type: u32,
pub position: u32,
pub permission_overwrites: Option<Vec<Overwrite>>,
pub name: String,
pub topic: Option<String>,
pub nsfw: Option<bool>,
pub user_limit: Option<u32>,
pub parent_id: Option<u32>,
}
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum ChannelType {
Text = 0,
DM = 1,
Voice = 2,
Group = 3,
Category = 4,
Announcement = 5,
AnnouncementThread = 10,
PublicThread = 11,
PrivateThread = 12,
StageVoice = 13,
Directory = 14,
Forum = 15,
Media = 16,
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Overwrite {
pub id: u32,
#[serde(rename = "type")]
pub overwrite_type: u32,
pub allow: String,
pub deny: String,
}
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum OverwriteType {
Role = 0,
Member = 1,
}
+3 -3
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-files"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <me@insrt.uk>"]
@@ -27,10 +27,10 @@ typenum = "1.17.0"
aws-config = "1.5.5"
aws-sdk-s3 = { version = "1.46.0", features = ["behavior-version-latest"] }
revolt-config = { version = "0.11.0", path = "../config", features = [
revolt-config = { version = "0.11.3", path = "../config", features = [
"report-macros",
] }
revolt-result = { version = "0.11.0", path = "../result" }
revolt-result = { version = "0.11.3", path = "../result" }
# image processing
jxl-oxide = { workspace = true }
+3 -3
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-models"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "MIT"
authors = ["Paul Makles <me@insrt.uk>"]
@@ -21,8 +21,8 @@ default = ["serde", "partials", "rocket"]
[dependencies]
# Core
revolt-config = { version = "0.11.0", path = "../config" }
revolt-permissions = { version = "0.11.0", path = "../permissions" }
revolt-config = { version = "0.11.3", path = "../config" }
revolt-permissions = { version = "0.11.3", path = "../permissions" }
# Utility
regex = "1.11"
+3
View File
@@ -167,6 +167,9 @@ auto_derived!(
/// Whether this server is age-restricted
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub nsfw: Option<bool>,
/// Discord guild template to import from
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub discord_template_id: Option<String>,
}
/// Information about new role to create
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-parser"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "MIT"
authors = ["Zomatree <me@zomatree.live>", "Paul Makles <me@insrt.uk>"]
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-permissions"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "MIT"
authors = ["Paul Makles <me@insrt.uk>"]
@@ -22,7 +22,7 @@ async-std = { version = "1.8.0", features = ["attributes"] }
[dependencies]
# Core
revolt-result = { version = "0.11.0", path = "../result" }
revolt-result = { version = "0.11.3", path = "../result" }
# Utility
auto_ops = "0.3.0"
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-presence"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <me@insrt.uk>"]
@@ -17,7 +17,7 @@ redis-is-patched = []
async-std = { version = "1.8.0", features = ["attributes"] }
# Config for loading Redis URI
revolt-config = { version = "0.11.0", path = "../config" }
revolt-config = { version = "0.11.3", path = "../config" }
[dependencies]
# Utility
+4 -4
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-ratelimits"
version = "0.11.0"
version = "0.11.3"
edition = "2024"
license = "MIT"
authors = ["Zomatree <me@zomatree.live>", "Paul Makles <me@insrt.uk>"]
@@ -18,9 +18,9 @@ axum = ["dep:axum", "revolt-database/axum-impl"]
default = ["rocket", "axum"]
[dependencies]
revolt-database = { version = "0.11.0", path = "../database" }
revolt-result = { version = "0.11.0", path = "../result" }
revolt-config = { version = "0.11.0", path = "../config" }
revolt-database = { version = "0.11.3", path = "../database" }
revolt-result = { version = "0.11.3", path = "../result" }
revolt-config = { version = "0.11.3", path = "../config" }
rocket = { version = "0.5.1", optional = true }
revolt_rocket_okapi = { version = "0.10.0", optional = true }
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-result"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "MIT"
authors = ["Paul Makles <me@insrt.uk>"]
+5 -5
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-crond"
version = "0.11.0"
version = "0.11.3"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <me@insrt.uk>"]
edition = "2021"
@@ -17,7 +17,7 @@ log = "0.4"
tokio = { version = "1" }
# Core
revolt-database = { version = "0.11.0", path = "../../core/database" }
revolt-result = { version = "0.11.0", path = "../../core/result" }
revolt-config = { version = "0.11.0", path = "../../core/config" }
revolt-files = { version = "0.11.0", path = "../../core/files" }
revolt-database = { version = "0.11.3", path = "../../core/database" }
revolt-result = { version = "0.11.3", path = "../../core/result" }
revolt-config = { version = "0.11.3", path = "../../core/config" }
revolt-files = { version = "0.11.3", path = "../../core/files" }
+6 -6
View File
@@ -1,21 +1,21 @@
[package]
name = "revolt-pushd"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "AGPL-3.0-or-later"
publish = false
[dependencies]
revolt-result = { version = "0.11.0", path = "../../core/result" }
revolt-config = { version = "0.11.0", path = "../../core/config", features = [
revolt-result = { version = "0.11.3", path = "../../core/result" }
revolt-config = { version = "0.11.3", path = "../../core/config", features = [
"report-macros",
"anyhow",
] }
revolt-database = { version = "0.11.0", path = "../../core/database" }
revolt-models = { version = "0.11.0", path = "../../core/models", features = [
revolt-database = { version = "0.11.3", path = "../../core/database" }
revolt-models = { version = "0.11.3", path = "../../core/models", features = [
"validator",
] }
revolt-presence = { version = "0.11.0", path = "../../core/presence", features = [
revolt-presence = { version = "0.11.3", path = "../../core/presence", features = [
"redis-is-patched",
] }
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-voice-ingress"
version = "0.11.0"
version = "0.11.3"
license = "AGPL-3.0-or-later"
edition = "2021"
publish = false
+2 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-delta"
version = "0.11.0"
version = "0.11.3"
license = "AGPL-3.0-or-later"
authors = ["Paul Makles <paulmakles@gmail.com>"]
edition = "2018"
@@ -84,6 +84,7 @@ revolt-presence = { path = "../core/presence" }
revolt-result = { path = "../core/result", features = ["rocket", "okapi"] }
revolt-permissions = { path = "../core/permissions", features = ["schemas"] }
revolt-ratelimits = { path = "../core/ratelimits", features = ["rocket"] }
revolt-discord = { path = "../core/discord" }
# voice
livekit-api = "0.4.4"
@@ -29,7 +29,17 @@ pub async fn create_server(
user.can_acquire_server(db).await?;
let (server, channels) = Server::create(db, data, &user, true).await?;
let (server, channels) = if let Some(discord_template_id) = data.discord_template_id.clone() {
let (mut server, _) = Server::create(db, data, &user, false).await?;
let template = revolt_discord::template::fetch_template(&discord_template_id).await?;
let channels = revolt_discord::template::import_template(db, &mut server, template).await?;
(server, channels)
} else {
Server::create(db, data, &user, true).await?
};
let (_, channels) = Member::create(db, &server, &user, Some(channels)).await?;
Ok(Json(v0::CreateServerLegacyResponse {
+6 -6
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-autumn"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "AGPL-3.0-or-later"
publish = false
@@ -44,16 +44,16 @@ tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Core crates
revolt-files = { version = "0.11.0", path = "../../core/files" }
revolt-config = { version = "0.11.0", path = "../../core/config" }
revolt-database = { version = "0.11.0", path = "../../core/database", features = [
revolt-files = { version = "0.11.3", path = "../../core/files" }
revolt-config = { version = "0.11.3", path = "../../core/config" }
revolt-database = { version = "0.11.3", path = "../../core/database", features = [
"axum-impl",
] }
revolt-result = { version = "0.11.0", path = "../../core/result", features = [
revolt-result = { version = "0.11.3", path = "../../core/result", features = [
"utoipa",
"axum",
] }
revolt-ratelimits = { version = "0.11.0", path = "../../core/ratelimits", features = ["axum"] }
revolt-ratelimits = { version = "0.11.3", path = "../../core/ratelimits", features = ["axum"] }
# Axum / web server
tempfile = "3.12.0"
+7 -7
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-gifbox"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "AGPL-3.0-or-later"
publish = false
@@ -17,19 +17,19 @@ tokio = { version = "1.0", features = ["full"] }
reqwest = { version = "0.12", features = ["json"] }
# Core crates
revolt-config = { version = "0.11.0", path = "../../core/config" }
revolt-models = { version = "0.11.0", path = "../../core/models" }
revolt-result = { version = "0.11.0", path = "../../core/result", features = [
revolt-config = { version = "0.11.3", path = "../../core/config" }
revolt-models = { version = "0.11.3", path = "../../core/models" }
revolt-result = { version = "0.11.3", path = "../../core/result", features = [
"utoipa",
"axum",
] }
revolt-coalesced = { version = "0.11.0", path = "../../core/coalesced", features = [
revolt-coalesced = { version = "0.11.3", path = "../../core/coalesced", features = [
"queue",
] }
revolt-database = { version = "0.11.0", path = "../../core/database", features = [
revolt-database = { version = "0.11.3", path = "../../core/database", features = [
"axum-impl",
] }
revolt-ratelimits = { version = "0.11.0", path = "../../core/ratelimits", features = [
revolt-ratelimits = { version = "0.11.3", path = "../../core/ratelimits", features = [
"axum",
] }
+5 -5
View File
@@ -1,6 +1,6 @@
[package]
name = "revolt-january"
version = "0.11.0"
version = "0.11.3"
edition = "2021"
license = "AGPL-3.0-or-later"
publish = false
@@ -33,13 +33,13 @@ tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Core crates
revolt-config = { version = "0.11.0", path = "../../core/config" }
revolt-models = { version = "0.11.0", path = "../../core/models" }
revolt-result = { version = "0.11.0", path = "../../core/result", features = [
revolt-config = { version = "0.11.3", path = "../../core/config" }
revolt-models = { version = "0.11.3", path = "../../core/models" }
revolt-result = { version = "0.11.3", path = "../../core/result", features = [
"utoipa",
"axum",
] }
revolt-files = { version = "0.11.0", path = "../../core/files" }
revolt-files = { version = "0.11.3", path = "../../core/files" }
# Axum / web server
axum = { version = "0.7.5" }
+1 -1
View File
@@ -1 +1 @@
0.11.0
0.11.3