accept fixes
This commit is contained in:
parent
0cabdde59a
commit
970e53304c
|
@ -131,7 +131,9 @@ checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
|
|||
|
||||
[[package]]
|
||||
name = "libcwtch"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "25c487f128e73d0c8a18f421f67efa7cf0b3ee913dbd2b1ef49b0854e25abf85"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"libc",
|
||||
|
|
|
@ -93,10 +93,7 @@ impl UpdateBot {
|
|||
Some(last_offered) => last_offered != self.version,
|
||||
None => true,
|
||||
},
|
||||
Err(e) => {
|
||||
println!("Error parsing attribute: {}", e);
|
||||
false
|
||||
}
|
||||
Err(e) => false
|
||||
};
|
||||
if do_offer {
|
||||
self.offer(cwtch, profile_opt, convo_id);
|
||||
|
@ -132,19 +129,19 @@ impl imp::EventHandler for UpdateBot {
|
|||
let event_type = Event::from(event.event_type.as_str());
|
||||
match event_type {
|
||||
Event::ContactCreated => {
|
||||
if event.data["ConnectionState"] == "Authenticated" {
|
||||
let convo_id = event.data["ConversationID"].parse::<i32>().unwrap();
|
||||
self.greet(cwtch, profile_opt, convo_id);
|
||||
}
|
||||
}
|
||||
Event::PeerStateChange => {
|
||||
if event.data["ConnectionState"] == "Authenticated" {
|
||||
match profile_opt.as_ref() {
|
||||
Some(profile) => {
|
||||
if profile.conversations.contains_key(&event.data["RemotePeer"]) {
|
||||
let conversation =
|
||||
&profile.conversations[&event.data["RemotePeer"]];
|
||||
self.greet(cwtch, profile_opt, conversation.identifier);
|
||||
}
|
||||
}
|
||||
None => (),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue