API: use global variable for device name
This commit is contained in:
parent
dc924b1be0
commit
2d8e9764e3
2 changed files with 7 additions and 1 deletions
|
@ -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)?;
|
bk.data.lock().unwrap().server_url = Url::parse(server)?;
|
||||||
let url = bk.url("login", vec![])?;
|
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 attrs_json = serde_json::to_value(attrs).expect("Failed to serialize login request");
|
||||||
let data = bk.data.clone();
|
let data = bk.data.clone();
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ pub static TIMEOUT: u64 = 80;
|
||||||
pub static PAGE_LIMIT: i32 = 40;
|
pub static PAGE_LIMIT: i32 = 40;
|
||||||
pub static ROOM_DIRECTORY_LIMIT: i32 = 20;
|
pub static ROOM_DIRECTORY_LIMIT: i32 = 20;
|
||||||
pub static THUMBNAIL_SIZE: i32 = 128;
|
pub static THUMBNAIL_SIZE: i32 = 128;
|
||||||
|
pub static DEVICE_NAME: &str = "Fractal";
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref MATRIX_RE: Regex = Regex::new(r"mxc://(?P<server>[^/]+)/(?P<media>.+)").unwrap();
|
pub static ref MATRIX_RE: Regex = Regex::new(r"mxc://(?P<server>[^/]+)/(?P<media>.+)").unwrap();
|
||||||
|
|
Loading…
Reference in a new issue