Commit 2d8e9764 authored by Alejandro Domínguez's avatar Alejandro Domínguez Committed by Julian Sparber

API: use global variable for device name

parent dc924b1b
Pipeline #59532 passed with stages
in 27 minutes and 59 seconds
......@@ -55,7 +55,12 @@ pub fn login(bk: &Backend, user: String, password: String, server: &str) -> Resu
bk.data.lock().unwrap().server_url = Url::parse(server)?;
let url = bk.url("login", vec![])?;
let attrs = LoginRequest::new(user.clone(), password, Some(String::from("Fractal")), None);
let attrs = LoginRequest::new(
user.clone(),
password,
Some(globals::DEVICE_NAME.into()),
None,
);
let attrs_json = serde_json::to_value(attrs).expect("Failed to serialize login request");
let data = bk.data.clone();
......
......@@ -5,6 +5,7 @@ pub static TIMEOUT: u64 = 80;
pub static PAGE_LIMIT: i32 = 40;
pub static ROOM_DIRECTORY_LIMIT: i32 = 20;
pub static THUMBNAIL_SIZE: i32 = 128;
pub static DEVICE_NAME: &str = "Fractal";
lazy_static! {
pub static ref MATRIX_RE: Regex = Regex::new(r"mxc://(?P<server>[^/]+)/(?P<media>.+)").unwrap();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment