- debug("xmpp: %s -- jid=[%s] from=[%s] chan=[%s]",
- start,
- srv->msg_jid, srv->msg_from,
- srv->msg_chan->channel.name);
- }
+ /* Ignore presence errors (federated remote timeout, etc) */
+ if (match(type, "error"))
+ return;
+
+ strncpy(srv->msg_id, id ?: "", ID_LEN);
+
+ srv->msg_chan = find_channel(srv, from, is_muc);
+ srv->msg_usr = find_user(srv, from, is_muc);
+
+ if (match(start, "iq"))
+ srv->state = XMPP_IN_IQ;
+ if (match(start, "message"))
+ srv->state = XMPP_IN_MESSAGE;
+ if (match(start, "presence"))
+ srv->state = XMPP_IN_PRESENCE;
+
+ if (srv->state != XMPP_READY)
+ debug("xmpp: ready -> in_%s -- "
+ "from=[%s] -> chan=[%s:%s] user=[%s]",
+ start, from,
+ srv->msg_chan->type,
+ srv->msg_chan->channel.name,
+ srv->msg_usr ? srv->msg_usr->user.name : "(none)");