v3.9.2.3 (2023.07.10)
This commit is contained in:
parent
703c2f62d2
commit
3cd4d97a2c
@ -21,9 +21,10 @@ enum Functions {
|
|||||||
FUNC_DISABLE_RECV_TXT = 0x40;
|
FUNC_DISABLE_RECV_TXT = 0x40;
|
||||||
FUNC_EXEC_DB_QUERY = 0x50;
|
FUNC_EXEC_DB_QUERY = 0x50;
|
||||||
FUNC_ACCEPT_FRIEND = 0x51;
|
FUNC_ACCEPT_FRIEND = 0x51;
|
||||||
FUNC_ADD_ROOM_MEMBERS = 0x52;
|
FUNC_RECV_TRANSFER = 0x52;
|
||||||
FUNC_RECV_TRANSFER = 0x53;
|
|
||||||
FUNC_DECRYPT_IMAGE = 0x60;
|
FUNC_DECRYPT_IMAGE = 0x60;
|
||||||
|
FUNC_ADD_ROOM_MEMBERS = 0x70;
|
||||||
|
FUNC_DEL_ROOM_MEMBERS = 0x71;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Request
|
message Request
|
||||||
@ -167,5 +168,6 @@ message DecPath
|
|||||||
message Transfer
|
message Transfer
|
||||||
{
|
{
|
||||||
string wxid = 1; // 转账人
|
string wxid = 1; // 转账人
|
||||||
string tid = 2; // 转账id transferid
|
string tfid = 2; // 转账id transferid
|
||||||
}
|
string taid = 3; // Transaction id
|
||||||
|
}
|
@ -305,7 +305,10 @@ pub struct Transfer {
|
|||||||
pub wxid: ::prost::alloc::string::String,
|
pub wxid: ::prost::alloc::string::String,
|
||||||
/// 转账id transferid
|
/// 转账id transferid
|
||||||
#[prost(string, tag = "2")]
|
#[prost(string, tag = "2")]
|
||||||
pub tid: ::prost::alloc::string::String,
|
pub tfid: ::prost::alloc::string::String,
|
||||||
|
/// Transaction id
|
||||||
|
#[prost(string, tag = "3")]
|
||||||
|
pub taid: ::prost::alloc::string::String,
|
||||||
}
|
}
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
@ -327,9 +330,10 @@ pub enum Functions {
|
|||||||
FuncDisableRecvTxt = 64,
|
FuncDisableRecvTxt = 64,
|
||||||
FuncExecDbQuery = 80,
|
FuncExecDbQuery = 80,
|
||||||
FuncAcceptFriend = 81,
|
FuncAcceptFriend = 81,
|
||||||
FuncAddRoomMembers = 82,
|
FuncRecvTransfer = 82,
|
||||||
FuncRecvTransfer = 83,
|
|
||||||
FuncDecryptImage = 96,
|
FuncDecryptImage = 96,
|
||||||
|
FuncAddRoomMembers = 112,
|
||||||
|
FuncDelRoomMembers = 113,
|
||||||
}
|
}
|
||||||
impl Functions {
|
impl Functions {
|
||||||
/// String value of the enum field names used in the ProtoBuf definition.
|
/// String value of the enum field names used in the ProtoBuf definition.
|
||||||
@ -355,9 +359,10 @@ impl Functions {
|
|||||||
Functions::FuncDisableRecvTxt => "FUNC_DISABLE_RECV_TXT",
|
Functions::FuncDisableRecvTxt => "FUNC_DISABLE_RECV_TXT",
|
||||||
Functions::FuncExecDbQuery => "FUNC_EXEC_DB_QUERY",
|
Functions::FuncExecDbQuery => "FUNC_EXEC_DB_QUERY",
|
||||||
Functions::FuncAcceptFriend => "FUNC_ACCEPT_FRIEND",
|
Functions::FuncAcceptFriend => "FUNC_ACCEPT_FRIEND",
|
||||||
Functions::FuncAddRoomMembers => "FUNC_ADD_ROOM_MEMBERS",
|
|
||||||
Functions::FuncRecvTransfer => "FUNC_RECV_TRANSFER",
|
Functions::FuncRecvTransfer => "FUNC_RECV_TRANSFER",
|
||||||
Functions::FuncDecryptImage => "FUNC_DECRYPT_IMAGE",
|
Functions::FuncDecryptImage => "FUNC_DECRYPT_IMAGE",
|
||||||
|
Functions::FuncAddRoomMembers => "FUNC_ADD_ROOM_MEMBERS",
|
||||||
|
Functions::FuncDelRoomMembers => "FUNC_DEL_ROOM_MEMBERS",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Creates an enum from field names used in the ProtoBuf definition.
|
/// Creates an enum from field names used in the ProtoBuf definition.
|
||||||
@ -380,9 +385,10 @@ impl Functions {
|
|||||||
"FUNC_DISABLE_RECV_TXT" => Some(Self::FuncDisableRecvTxt),
|
"FUNC_DISABLE_RECV_TXT" => Some(Self::FuncDisableRecvTxt),
|
||||||
"FUNC_EXEC_DB_QUERY" => Some(Self::FuncExecDbQuery),
|
"FUNC_EXEC_DB_QUERY" => Some(Self::FuncExecDbQuery),
|
||||||
"FUNC_ACCEPT_FRIEND" => Some(Self::FuncAcceptFriend),
|
"FUNC_ACCEPT_FRIEND" => Some(Self::FuncAcceptFriend),
|
||||||
"FUNC_ADD_ROOM_MEMBERS" => Some(Self::FuncAddRoomMembers),
|
|
||||||
"FUNC_RECV_TRANSFER" => Some(Self::FuncRecvTransfer),
|
"FUNC_RECV_TRANSFER" => Some(Self::FuncRecvTransfer),
|
||||||
"FUNC_DECRYPT_IMAGE" => Some(Self::FuncDecryptImage),
|
"FUNC_DECRYPT_IMAGE" => Some(Self::FuncDecryptImage),
|
||||||
|
"FUNC_ADD_ROOM_MEMBERS" => Some(Self::FuncAddRoomMembers),
|
||||||
|
"FUNC_DEL_ROOM_MEMBERS" => Some(Self::FuncDelRoomMembers),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ impl WeChat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn start(wcf_path: PathBuf, debug: bool) -> Result<(), Box<dyn std::error::Error>> {
|
fn start(wcf_path: PathBuf, debug: bool) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let mut args = vec!["start"];
|
let mut args = vec!["start", "10086"];
|
||||||
if debug {
|
if debug {
|
||||||
args.push("debug");
|
args.push("debug");
|
||||||
}
|
}
|
||||||
@ -389,14 +389,15 @@ pub fn send_text(
|
|||||||
if response.is_none() {
|
if response.is_none() {
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
match response.unwrap() {
|
return Ok(true);
|
||||||
wcf::response::Msg::Status(status) => {
|
// match response.unwrap() {
|
||||||
return Ok(1 == status);
|
// wcf::response::Msg::Status(status) => {
|
||||||
}
|
// return Ok(1 == status);
|
||||||
_ => {
|
// }
|
||||||
return Ok(false);
|
// _ => {
|
||||||
}
|
// return Ok(false);
|
||||||
};
|
// }
|
||||||
|
// };
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn send_image(
|
pub fn send_image(
|
||||||
@ -419,17 +420,19 @@ pub fn send_image(
|
|||||||
return Err("图片发送失败".into());
|
return Err("图片发送失败".into());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
println!("{:?}", response);
|
||||||
if response.is_none() {
|
if response.is_none() {
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
match response.unwrap() {
|
return Ok(true);
|
||||||
wcf::response::Msg::Status(status) => {
|
// match response.unwrap() {
|
||||||
return Ok(1 == status);
|
// wcf::response::Msg::Status(status) => {
|
||||||
}
|
// return Ok(1 == status);
|
||||||
_ => {
|
// }
|
||||||
return Ok(false);
|
// _ => {
|
||||||
}
|
// return Ok(false);
|
||||||
};
|
// }
|
||||||
|
// };
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn send_file(
|
pub fn send_file(
|
||||||
@ -731,13 +734,15 @@ pub fn decrypt_image(
|
|||||||
pub fn recv_transfer(
|
pub fn recv_transfer(
|
||||||
wxid: String,
|
wxid: String,
|
||||||
transferid: String,
|
transferid: String,
|
||||||
|
transcationid: String,
|
||||||
wechat: &mut WeChat,
|
wechat: &mut WeChat,
|
||||||
) -> Result<bool, Box<dyn std::error::Error>> {
|
) -> Result<bool, Box<dyn std::error::Error>> {
|
||||||
let req = wcf::Request {
|
let req = wcf::Request {
|
||||||
func: wcf::Functions::FuncRecvTransfer.into(),
|
func: wcf::Functions::FuncRecvTransfer.into(),
|
||||||
msg: Some(wcf::request::Msg::Tf(wcf::Transfer {
|
msg: Some(wcf::request::Msg::Tf(wcf::Transfer {
|
||||||
wxid,
|
wxid: wxid,
|
||||||
tid: transferid,
|
taid: transferid,
|
||||||
|
tfid: transcationid,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
let response = match send_cmd(wechat, req) {
|
let response = match send_cmd(wechat, req) {
|
||||||
@ -799,7 +804,7 @@ mod test {
|
|||||||
let status = crate::wechat::send_text(
|
let status = crate::wechat::send_text(
|
||||||
&mut wechat,
|
&mut wechat,
|
||||||
String::from("Hello, wcferry!"),
|
String::from("Hello, wcferry!"),
|
||||||
String::from("******@chatroom"),
|
String::from("filehelper"),
|
||||||
String::from(""),
|
String::from(""),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -814,7 +819,7 @@ mod test {
|
|||||||
let status = crate::wechat::send_image(
|
let status = crate::wechat::send_image(
|
||||||
&mut wechat,
|
&mut wechat,
|
||||||
PathBuf::from("C:\\Users\\Administrator\\Pictures\\1.jpg"),
|
PathBuf::from("C:\\Users\\Administrator\\Pictures\\1.jpg"),
|
||||||
String::from("****@chatroom"),
|
String::from("filehelper"),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
println!("Success: {}", status);
|
println!("Success: {}", status);
|
||||||
@ -824,7 +829,7 @@ mod test {
|
|||||||
fn test_recv_msg() {
|
fn test_recv_msg() {
|
||||||
let mut wechat = crate::wechat::WeChat::default();
|
let mut wechat = crate::wechat::WeChat::default();
|
||||||
let mut socket = crate::wechat::enable_listen(&mut wechat).unwrap();
|
let mut socket = crate::wechat::enable_listen(&mut wechat).unwrap();
|
||||||
for _ in 1..100 {
|
for _ in 1..5 {
|
||||||
let msg = crate::wechat::recv_msg(&mut socket).unwrap();
|
let msg = crate::wechat::recv_msg(&mut socket).unwrap();
|
||||||
println!("WxMsg: {:?}", msg);
|
println!("WxMsg: {:?}", msg);
|
||||||
}
|
}
|
||||||
@ -871,7 +876,8 @@ mod test {
|
|||||||
let mut wechat = crate::wechat::WeChat::default();
|
let mut wechat = crate::wechat::WeChat::default();
|
||||||
let status = crate::wechat::recv_transfer(
|
let status = crate::wechat::recv_transfer(
|
||||||
String::from("****"),
|
String::from("****"),
|
||||||
String::from("1000050001202305070217704377865"),
|
String::from("1000050001202306300415889890620"),
|
||||||
|
String::from("100005000123063000081247810011296088"),
|
||||||
&mut wechat,
|
&mut wechat,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user