mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 23:16:30 +03:00
Parse QR codes without using Param
Param should only be used to parse dictionaries stored in SQL database, not external data. Since Param parser has been extended to escape newlines with newlines, QR-codes parser started to treat && as escaped &, which is wrong. This change also uses String keys like "n" for "name" instead of completely unrelated constants like Param::SetLongitude.
This commit is contained in:
17
src/param.rs
17
src/param.rs
@@ -127,15 +127,6 @@ pub enum Param {
|
||||
/// For Chats
|
||||
Devicetalk = b'D',
|
||||
|
||||
/// For QR
|
||||
Auth = b's',
|
||||
|
||||
/// For QR
|
||||
GroupId = b'x',
|
||||
|
||||
/// For QR
|
||||
GroupName = b'g',
|
||||
|
||||
/// For MDN-sending job
|
||||
MsgId = b'I',
|
||||
}
|
||||
@@ -431,14 +422,6 @@ mod tests {
|
||||
assert_eq!(params.to_string().parse::<Params>().unwrap(), params);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_regression() {
|
||||
let p1: Params = "a=cli%40deltachat.de\nn=\ni=TbnwJ6lSvD5\ns=0ejvbdFSQxB"
|
||||
.parse()
|
||||
.unwrap();
|
||||
assert_eq!(p1.get(Param::Forwarded).unwrap(), "cli%40deltachat.de");
|
||||
}
|
||||
|
||||
#[async_std::test]
|
||||
async fn test_params_file_fs_path() {
|
||||
let t = TestContext::new().await;
|
||||
|
||||
Reference in New Issue
Block a user