String reply = "<iq id='" + id + "' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>" +
"<jid>" + jid.getUser() + "@" + jid.getServer() + "/" + resource + "</jid></bind></iq>";
write(e.getChannel(), reply);
jid.setResource(resource);
status.setJid(jid);
status.onEvent(new Event(message, Event.Type.BIND_RESOURCE));
} else if (message.contains("<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>")) {
String reply = "<iq id='" + id + "' type='result' from='" + to + "'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>";
write(e.getChannel(), reply);
} else if (message.contains("<query xmlns=\"violet:iq:sources\"><packet xmlns=\"violet:packet\" format=\"1.0\"/></query>")) {
String reply = "<iq from='net.violet.platform@xmpp.nabaztag.com/sources'" +
"to='" + from + "' id='" + id + "' type='result'>" +
"<query xmlns='violet:iq:sources'>" +
"<packet xmlns='violet:packet' format='1.0' ttl='604800'>fwQAAAx////+BAAFAA7/CAALAAABAP8=</packet>" +
"</query>" +
"</iq>";
write(e.getChannel(), reply);
} else if (message.contains("<unbind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>")) {
String reply = "<iq id='" + id + "' type='result'/>";
write(e.getChannel(), reply);
status.onEvent(new Event(message, Event.Type.UNBIND_RESOURCE));
}
}