make use of the gen_id() method in relevant plugins

This commit is contained in:
Emmanuel Gil Peyrot 2017-05-29 04:51:01 +01:00
parent 8839c4eea8
commit 785f717f91
3 changed files with 3 additions and 5 deletions

View file

@ -67,8 +67,7 @@ impl MessagingPlugin {
from: None, from: None,
to: Some(to.clone()), to: Some(to.clone()),
type_: MessageType::Chat, type_: MessageType::Chat,
// TODO: always use an id. id: Some(self.proxy.gen_id()),
id: None,
bodies: { bodies: {
let mut bodies = BTreeMap::new(); let mut bodies = BTreeMap::new();
bodies.insert(String::new(), String::from(body)); bodies.insert(String::new(), String::from(body));

View file

@ -53,8 +53,7 @@ impl PingPlugin {
self.proxy.send(Iq { self.proxy.send(Iq {
from: None, from: None,
to: Some(to), to: Some(to),
// TODO: use a generic way to generate ids. id: Some(self.proxy.gen_id()),
id: Some(String::from("id")),
payload: IqType::Get(IqPayload::Ping(Ping).into()), payload: IqType::Get(IqPayload::Ping(Ping).into()),
}.into()); }.into());
Ok(()) Ok(())

View file

@ -20,7 +20,7 @@ impl PresencePlugin {
let presence = Presence { let presence = Presence {
from: None, from: None,
to: None, to: None,
id: None, id: Some(self.proxy.gen_id()),
type_: type_, type_: type_,
show: show, show: show,
priority: 0i8, priority: 0i8,