use of com.xabber.xmpp.archive.ItemRemove in project xabber-android by redsolution.
the class MessageArchiveManager method sendItemRemove.
private void sendItemRemove(String account, String user) throws NetworkException {
Item extension = new Item();
extension.setJid(user);
ItemRemove packet = new ItemRemove();
packet.addItem(extension);
packet.setType(Type.set);
ConnectionManager.getInstance().sendStanza(account, packet);
}
use of com.xabber.xmpp.archive.ItemRemove in project xabber-android by redsolution.
the class MessageArchiveManager method onPacket.
@Override
public void onPacket(ConnectionItem connection, final String bareAddress, Stanza packet) {
if (!(connection instanceof AccountItem))
return;
String account = ((AccountItem) connection).getAccount();
if (AccountManager.getInstance().getArchiveMode(account) != ArchiveMode.server)
return;
if (bareAddress != null && !Jid.getServer(account).equals(bareAddress))
return;
if (!(packet instanceof IQ))
return;
IQ iq = (IQ) packet;
if (iq.getType() == Type.set && packet instanceof Pref && ((Pref) packet).isValid())
onPreferenceReceived(account, (Pref) packet);
else if (iq.getType() == Type.set && packet instanceof ItemRemove && ((ItemRemove) packet).isValid())
onItemRemoveReceived(account, (ItemRemove) packet);
else if (iq.getType() == Type.set && packet instanceof SessionRemove && ((SessionRemove) packet).isValid())
onSessionRemoveReceived(account, (SessionRemove) packet);
else if (iq.getType() == Type.result && packet instanceof List && ((List) packet).isValid())
onListReceived(account, (List) packet);
else if (iq.getType() == Type.result && packet instanceof Chat && ((Chat) packet).isValid())
onChatReceived(account, (Chat) packet);
}
Aggregations