mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
fix mtxchat.client_sync() url query contruction
This commit is contained in:
parent
b890c419c9
commit
b413345ac1
1 changed files with 4 additions and 10 deletions
|
|
@ -330,7 +330,6 @@ pub fn get_filter(
|
||||||
token: &str,
|
token: &str,
|
||||||
agent: &mut Agent,
|
agent: &mut Agent,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
|
|
||||||
let mut path = String::from("_matrix/client/v3/user/");
|
let mut path = String::from("_matrix/client/v3/user/");
|
||||||
path.push_str(&user);
|
path.push_str(&user);
|
||||||
path.push_str("/filter");
|
path.push_str("/filter");
|
||||||
|
|
@ -407,16 +406,11 @@ pub fn client_sync(
|
||||||
) -> Option<(String, Vec<Msg>)> {
|
) -> Option<(String, Vec<Msg>)> {
|
||||||
log::info!("heap usage: {}", crate::heap_usage());
|
log::info!("heap usage: {}", crate::heap_usage());
|
||||||
url.set_path("_matrix/client/r0/sync");
|
url.set_path("_matrix/client/r0/sync");
|
||||||
let mut filter_q = String::from("filter=");
|
url.query_pairs_mut().append_pair("filter", &filter);
|
||||||
filter_q.push_str(&filter);
|
url.query_pairs_mut()
|
||||||
url.set_query(Some(&filter_q));
|
.append_pair("timeout", &timeout.to_string());
|
||||||
let mut timeout_q = String::from("timeout=");
|
|
||||||
url.set_query(Some(&timeout_q));
|
|
||||||
timeout_q.push_str(&timeout.to_string());
|
|
||||||
let mut since_q = String::from("since=");
|
|
||||||
if let Some(since) = since {
|
if let Some(since) = since {
|
||||||
since_q.push_str(since);
|
url.query_pairs_mut().append_pair("since", since);
|
||||||
url.set_query(Some(&since_q));
|
|
||||||
}
|
}
|
||||||
log::info!("client_sync = {}", url.as_str());
|
log::info!("client_sync = {}", url.as_str());
|
||||||
if let Some(value) = handle_response(get_json_auth(&url, token, agent)) {
|
if let Some(value) = handle_response(get_json_auth(&url, token, agent)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue