Introduce xmpp client

[?]
Oct 28, 2018, 2:10 PM
AXDOLAOAMIKZQMYKXVTMKKOQXLTWOKRONBFSEA4KCBK3DCSDD7ZQC

Dependencies

  • [2] F5UQL2FB Manage xmpp connection in cmd processing loop
  • [3] PHPCAQ6Z Use env logger. Implement command loop
  • [*] AVBHYHOA Stop xmpp thread by shudown

Change contents

  • edit in src/xmpp.rs at line 3
    [3.117]
    [2.0]
    use tokio_xmpp::Client;
  • replacement in src/xmpp.rs at line 9
    [2.68][2.68:91]()
    inner: Option<()>,
    [2.68]
    [2.91]
    inner: Option<Client>,
  • replacement in src/xmpp.rs at line 24
    [2.445][2.445:499]()
    let inner = self.inner.unwrap_or_else(|| ());
    [2.445]
    [2.499]
    let XmppConnection {
    jid,
    password,
    inner,
    } = self;
    let inner = inner.unwrap_or_else(|| {
    let mut res_client = Client::new(&jid, &password);
    while let Err(e) = res_client {
    error!("Cann't init xmpp client: {}", e);
    res_client = Client::new(&jid, &password);
    }
    let client = res_client.expect("Cann't init xmpp client");
    info!("xmpp initialized");
    client
    });
  • replacement in src/xmpp.rs at line 41
    [2.536][2.536:600]()
    jid: self.jid,
    password: self.password,
    [2.536]
    [2.600]
    jid,
    password,