diff --git a/src/api/auth/login.rs b/src/api/auth/login.rs
index 34a873b..d5d96e6 100644
--- a/src/api/auth/login.rs
+++ b/src/api/auth/login.rs
@@ -8,7 +8,7 @@ use serde_json::to_string;
use crate::api::LimitType;
use crate::errors::ChorusResult;
use crate::gateway::Gateway;
-use crate::instance::{Instance, UserMeta};
+use crate::instance::{ChorusUser, Instance};
use crate::ratelimiter::ChorusRequest;
use crate::types::{GatewayIdentifyPayload, LoginResult, LoginSchema};
@@ -17,7 +17,7 @@ impl Instance {
///
/// # Reference
/// See
- pub async fn login_account(&mut self, login_schema: &LoginSchema) -> ChorusResult {
+ pub async fn login_account(&mut self, login_schema: &LoginSchema) -> ChorusResult {
let endpoint_url = self.urls.api.clone() + "/auth/login";
let chorus_request = ChorusRequest {
request: Client::new()
@@ -30,7 +30,7 @@ impl Instance {
// request (since login is an instance wide limit), which is why we are just cloning the
// instances' limits to pass them on as user_rate_limits later.
let mut shell =
- UserMeta::shell(Rc::new(RefCell::new(self.clone())), "None".to_string()).await;
+ ChorusUser::shell(Rc::new(RefCell::new(self.clone())), "None".to_string()).await;
let login_result = chorus_request
.deserialize_response::(&mut shell)
.await?;
@@ -42,7 +42,7 @@ impl Instance {
let gateway = Gateway::new(self.urls.wss.clone()).await.unwrap();
identify.token = login_result.token.clone();
gateway.send_identify(identify).await;
- let user = UserMeta::new(
+ let user = ChorusUser::new(
Rc::new(RefCell::new(self.clone())),
login_result.token,
self.clone_limits_if_some(),
diff --git a/src/api/auth/register.rs b/src/api/auth/register.rs
index b4350d2..43292d9 100644
--- a/src/api/auth/register.rs
+++ b/src/api/auth/register.rs
@@ -9,7 +9,7 @@ use crate::types::GatewayIdentifyPayload;
use crate::{
api::policies::instance::LimitType,
errors::ChorusResult,
- instance::{Instance, Token, UserMeta},
+ instance::{ChorusUser, Instance, Token},
ratelimiter::ChorusRequest,
types::RegisterSchema,
};
@@ -22,7 +22,7 @@ impl Instance {
pub async fn register_account(
&mut self,
register_schema: &RegisterSchema,
- ) -> ChorusResult {
+ ) -> ChorusResult {
let endpoint_url = self.urls.api.clone() + "/auth/register";
let chorus_request = ChorusRequest {
request: Client::new()
@@ -35,7 +35,7 @@ impl Instance {
// request (since register is an instance wide limit), which is why we are just cloning
// the instances' limits to pass them on as user_rate_limits later.
let mut shell =
- UserMeta::shell(Rc::new(RefCell::new(self.clone())), "None".to_string()).await;
+ ChorusUser::shell(Rc::new(RefCell::new(self.clone())), "None".to_string()).await;
let token = chorus_request
.deserialize_response::(&mut shell)
.await?
@@ -44,12 +44,12 @@ impl Instance {
self.limits_information.as_mut().unwrap().ratelimits = shell.limits.unwrap();
}
let user_object = self.get_user(token.clone(), None).await.unwrap();
- let settings = UserMeta::get_settings(&token, &self.urls.api.clone(), self).await?;
+ let settings = ChorusUser::get_settings(&token, &self.urls.api.clone(), self).await?;
let mut identify = GatewayIdentifyPayload::common();
let gateway = Gateway::new(self.urls.wss.clone()).await.unwrap();
identify.token = token.clone();
gateway.send_identify(identify).await;
- let user = UserMeta::new(
+ let user = ChorusUser::new(
Rc::new(RefCell::new(self.clone())),
token.clone(),
self.clone_limits_if_some(),
diff --git a/src/api/channels/channels.rs b/src/api/channels/channels.rs
index 518de59..6fd0d79 100644
--- a/src/api/channels/channels.rs
+++ b/src/api/channels/channels.rs
@@ -5,7 +5,7 @@ use crate::types::{AddChannelRecipientSchema, ModifyChannelPositionsSchema};
use crate::{
api::LimitType,
errors::{ChorusError, ChorusResult},
- instance::UserMeta,
+ instance::ChorusUser,
ratelimiter::ChorusRequest,
types::{Channel, ChannelModifySchema, GetChannelMessagesSchema, Message, Snowflake},
};
@@ -15,7 +15,7 @@ impl Channel {
///
/// # Reference
/// See
- pub async fn get(user: &mut UserMeta, channel_id: Snowflake) -> ChorusResult {
+ pub async fn get(user: &mut ChorusUser, channel_id: Snowflake) -> ChorusResult {
let url = user.belongs_to.borrow().urls.api.clone();
let chorus_request = ChorusRequest {
request: Client::new()
@@ -33,7 +33,7 @@ impl Channel {
///
/// # Reference
/// See
- pub async fn delete(self, user: &mut UserMeta) -> ChorusResult<()> {
+ pub async fn delete(self, user: &mut ChorusUser) -> ChorusResult<()> {
let chorus_request = ChorusRequest {
request: Client::new()
.delete(format!(
@@ -64,7 +64,7 @@ impl Channel {
pub async fn modify(
&self,
modify_data: ChannelModifySchema,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult {
let channel_id = self.id;
let chorus_request = ChorusRequest {
@@ -94,7 +94,7 @@ impl Channel {
pub async fn messages(
range: GetChannelMessagesSchema,
channel_id: Snowflake,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> Result, ChorusError> {
let chorus_request = ChorusRequest {
request: Client::new()
@@ -120,7 +120,7 @@ impl Channel {
pub async fn add_channel_recipient(
&self,
recipient_id: Snowflake,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
add_channel_recipient_schema: Option,
) -> ChorusResult<()> {
let mut request = Client::new()
@@ -150,7 +150,7 @@ impl Channel {
pub async fn remove_channel_recipient(
&self,
recipient_id: Snowflake,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult<()> {
let request = Client::new()
.delete(format!(
@@ -176,7 +176,7 @@ impl Channel {
pub async fn modify_positions(
schema: Vec,
guild_id: Snowflake,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult<()> {
let request = Client::new()
.patch(format!(
diff --git a/src/api/channels/messages.rs b/src/api/channels/messages.rs
index 053ee75..2011c40 100644
--- a/src/api/channels/messages.rs
+++ b/src/api/channels/messages.rs
@@ -5,7 +5,7 @@ use serde_json::{from_value, to_string, Value};
use crate::api::LimitType;
use crate::errors::{ChorusError, ChorusResult};
-use crate::instance::UserMeta;
+use crate::instance::ChorusUser;
use crate::ratelimiter::ChorusRequest;
use crate::types::{
Channel, CreateGreetMessage, Message, MessageAck, MessageModifySchema, MessageSearchEndpoint,
@@ -19,7 +19,7 @@ impl Message {
/// # Reference
/// See
pub async fn send(
- user: &mut UserMeta,
+ user: &mut ChorusUser,
channel_id: Snowflake,
mut message: MessageSendSchema,
) -> ChorusResult {
@@ -87,7 +87,7 @@ impl Message {
pub(crate) async fn search(
endpoint: MessageSearchEndpoint,
query: MessageSearchQuery,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult> {
let limit_type = match &endpoint {
MessageSearchEndpoint::Channel(id) => LimitType::Channel(*id),
@@ -136,7 +136,7 @@ impl Message {
/// See:
pub async fn get_sticky(
channel_id: Snowflake,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult> {
let chorus_request = ChorusRequest {
request: Client::new()
@@ -162,7 +162,7 @@ impl Message {
pub async fn sticky(
channel_id: Snowflake,
message_id: Snowflake,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult<()> {
let chorus_request = ChorusRequest {
request: Client::new()
@@ -185,7 +185,7 @@ impl Message {
pub async fn unsticky(
channel_id: Snowflake,
message_id: Snowflake,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult<()> {
let chorus_request = ChorusRequest {
request: Client::new()
@@ -209,7 +209,7 @@ impl Message {
pub async fn get(
channel_id: Snowflake,
message_id: Snowflake,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult {
let chorus_request = ChorusRequest {
request: Client::new()
@@ -232,7 +232,7 @@ impl Message {
pub async fn create_greet(
channel_id: Snowflake,
schema: CreateGreetMessage,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult {
let chorus_request = ChorusRequest {
request: Client::new()
@@ -263,7 +263,7 @@ impl Message {
channel_id: Snowflake,
message_id: Snowflake,
schema: MessageAck,
- user: &mut UserMeta,
+ user: &mut ChorusUser,
) -> ChorusResult