Send sessions experiment and quick query fix for embeds
This commit is contained in:
parent
13ef2318b4
commit
f8d85947d7
2 changed files with 10 additions and 6 deletions
|
@ -58,7 +58,7 @@ pub async fn dispatch_ready(
|
||||||
discriminator: user.discriminator,
|
discriminator: user.discriminator,
|
||||||
// FIXME: Same as "mobile"
|
// FIXME: Same as "mobile"
|
||||||
desktop: false,
|
desktop: false,
|
||||||
bio: user.bio.unwrap_or(String::new()),
|
bio: user.bio.unwrap_or_default(),
|
||||||
banner_color: user.banner_colour,
|
banner_color: user.banner_colour,
|
||||||
banner: user.banner,
|
banner: user.banner,
|
||||||
avatar_decoration: user.avatar_decoration,
|
avatar_decoration: user.avatar_decoration,
|
||||||
|
@ -88,8 +88,8 @@ pub async fn dispatch_ready(
|
||||||
session_id: session.session_id,
|
session_id: session.session_id,
|
||||||
client_info: SessionClientInfo {
|
client_info: SessionClientInfo {
|
||||||
version: 0,
|
version: 0,
|
||||||
os: session.os.unwrap_or(String::new()),
|
os: session.os.unwrap_or_default(),
|
||||||
client: match session.platform.unwrap_or(String::new()).as_str() {
|
client: match session.platform.unwrap_or_default().as_str() {
|
||||||
"Discord Client" => String::from("desktop"),
|
"Discord Client" => String::from("desktop"),
|
||||||
"Discord Android" => String::from("mobile"),
|
"Discord Android" => String::from("mobile"),
|
||||||
"Discord iOS" => String::from("mobile"),
|
"Discord iOS" => String::from("mobile"),
|
||||||
|
@ -242,11 +242,14 @@ pub async fn dispatch_ready(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let experiments = if EplOptions::get().pomelo {
|
let mut experiments = if EplOptions::get().pomelo {
|
||||||
vec![[268309827, 0, 1, -1, 7, 1071, 0, 0]]
|
vec![[268309827, 0, 1, -1, 7, 1071, 0, 0]]
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
vec![]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Enable sessions
|
||||||
|
experiments.push([1095779154, 0, 1, -1, 2, 183, 0, 0]);
|
||||||
|
|
||||||
send_message(
|
send_message(
|
||||||
thread_data,
|
thread_data,
|
||||||
|
|
|
@ -31,11 +31,12 @@ pub async fn process_embed(state: &AppState, message_id: i64) {
|
||||||
|
|
||||||
let captured_url = url.unwrap();
|
let captured_url = url.unwrap();
|
||||||
|
|
||||||
let call_url = format!("https://{}/embed/{}/{}/{}",
|
let call_url = format!("https://{}/embed/{}/{}{}?{}",
|
||||||
state.options.mediaproxy_url.clone().unwrap(),
|
state.options.mediaproxy_url.clone().unwrap(),
|
||||||
captured_url.scheme(),
|
captured_url.scheme(),
|
||||||
captured_url.host_str().unwrap(),
|
captured_url.host_str().unwrap(),
|
||||||
captured_url.path()
|
captured_url.path(),
|
||||||
|
captured_url.query().unwrap_or_default()
|
||||||
);
|
);
|
||||||
|
|
||||||
match ureq::get(&call_url).call() {
|
match ureq::get(&call_url).call() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue