make use of the gen_id() method in relevant plugins

Emmanuel Gil Peyrot created

Change summary

src/plugins/messaging.rs | 3 +--
src/plugins/ping.rs      | 3 +--
src/plugins/presence.rs  | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)

Detailed changes

src/plugins/messaging.rs 🔗

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

src/plugins/ping.rs 🔗

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

src/plugins/presence.rs 🔗

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