2014-10-22 16:38:44 +00:00
|
|
|
package eu.siacs.conversations.parser;
|
|
|
|
|
2016-02-01 11:11:40 +00:00
|
|
|
import android.util.Log;
|
|
|
|
|
2016-06-04 14:16:14 +00:00
|
|
|
import java.text.ParseException;
|
2015-02-21 21:19:10 +00:00
|
|
|
import java.util.ArrayList;
|
2015-12-03 17:18:34 +00:00
|
|
|
import java.util.List;
|
2015-02-21 21:19:10 +00:00
|
|
|
|
2016-02-01 11:11:40 +00:00
|
|
|
|
|
|
|
import eu.siacs.conversations.Config;
|
2014-10-22 16:38:44 +00:00
|
|
|
import eu.siacs.conversations.crypto.PgpEngine;
|
2017-06-28 07:49:24 +00:00
|
|
|
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
|
2014-10-22 16:38:44 +00:00
|
|
|
import eu.siacs.conversations.entities.Account;
|
2018-02-10 15:24:55 +00:00
|
|
|
import eu.siacs.conversations.entities.Bookmark;
|
2014-10-22 16:38:44 +00:00
|
|
|
import eu.siacs.conversations.entities.Contact;
|
|
|
|
import eu.siacs.conversations.entities.Conversation;
|
2015-11-05 02:56:45 +00:00
|
|
|
import eu.siacs.conversations.entities.Message;
|
2014-11-20 21:44:31 +00:00
|
|
|
import eu.siacs.conversations.entities.MucOptions;
|
2016-01-17 21:28:38 +00:00
|
|
|
import eu.siacs.conversations.entities.Presence;
|
2016-05-26 10:39:31 +00:00
|
|
|
import eu.siacs.conversations.generator.IqGenerator;
|
2014-10-22 16:38:44 +00:00
|
|
|
import eu.siacs.conversations.generator.PresenceGenerator;
|
|
|
|
import eu.siacs.conversations.services.XmppConnectionService;
|
|
|
|
import eu.siacs.conversations.xml.Element;
|
2017-03-20 16:58:58 +00:00
|
|
|
import eu.siacs.conversations.xml.Namespace;
|
2014-10-22 16:38:44 +00:00
|
|
|
import eu.siacs.conversations.xmpp.OnPresencePacketReceived;
|
2015-05-05 04:17:34 +00:00
|
|
|
import eu.siacs.conversations.xmpp.pep.Avatar;
|
2014-10-22 16:38:44 +00:00
|
|
|
import eu.siacs.conversations.xmpp.stanzas.PresencePacket;
|
2018-03-05 17:30:40 +00:00
|
|
|
import rocks.xmpp.addr.Jid;
|
2014-10-22 16:38:44 +00:00
|
|
|
|
|
|
|
public class PresenceParser extends AbstractParser implements
|
|
|
|
OnPresencePacketReceived {
|
|
|
|
|
|
|
|
public PresenceParser(XmppConnectionService service) {
|
|
|
|
super(service);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void parseConferencePresence(PresencePacket packet, Account account) {
|
2018-03-05 17:30:40 +00:00
|
|
|
final Conversation conversation = packet.getFrom() == null ? null : mXmppConnectionService.find(account, packet.getFrom().asBareJid());
|
2014-11-21 19:02:13 +00:00
|
|
|
if (conversation != null) {
|
|
|
|
final MucOptions mucOptions = conversation.getMucOptions();
|
|
|
|
boolean before = mucOptions.online();
|
2015-12-03 17:18:34 +00:00
|
|
|
int count = mucOptions.getUserCount();
|
|
|
|
final List<MucOptions.User> tileUserBefore = mucOptions.getUsers(5);
|
2016-11-13 18:25:58 +00:00
|
|
|
processConferencePresence(packet, conversation);
|
2015-12-03 17:18:34 +00:00
|
|
|
final List<MucOptions.User> tileUserAfter = mucOptions.getUsers(5);
|
2015-02-21 21:19:10 +00:00
|
|
|
if (!tileUserAfter.equals(tileUserBefore)) {
|
2015-12-04 20:36:48 +00:00
|
|
|
mXmppConnectionService.getAvatarService().clear(mucOptions);
|
2015-02-21 21:19:10 +00:00
|
|
|
}
|
2015-12-03 17:18:34 +00:00
|
|
|
if (before != mucOptions.online() || (mucOptions.online() && count != mucOptions.getUserCount())) {
|
2014-11-21 19:02:13 +00:00
|
|
|
mXmppConnectionService.updateConversationUi();
|
2014-11-23 14:19:44 +00:00
|
|
|
} else if (mucOptions.online()) {
|
|
|
|
mXmppConnectionService.updateMucRosterUi();
|
2014-10-22 16:38:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-13 18:25:58 +00:00
|
|
|
private void processConferencePresence(PresencePacket packet, Conversation conversation) {
|
|
|
|
MucOptions mucOptions = conversation.getMucOptions();
|
2017-04-15 13:14:08 +00:00
|
|
|
final Jid jid = conversation.getAccount().getJid();
|
2015-12-03 17:18:34 +00:00
|
|
|
final Jid from = packet.getFrom();
|
|
|
|
if (!from.isBareJid()) {
|
|
|
|
final String type = packet.getAttribute("type");
|
|
|
|
final Element x = packet.findChild("x", "http://jabber.org/protocol/muc#user");
|
|
|
|
Avatar avatar = Avatar.parsePresence(packet.findChild("x", "vcard-temp:x:update"));
|
|
|
|
final List<String> codes = getStatusCodes(x);
|
|
|
|
if (type == null) {
|
|
|
|
if (x != null) {
|
|
|
|
Element item = x.findChild("item");
|
|
|
|
if (item != null && !from.isBareJid()) {
|
2016-02-22 19:19:58 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.NONE);
|
2016-11-13 18:25:58 +00:00
|
|
|
MucOptions.User user = parseItem(conversation, item, from);
|
2018-02-10 18:06:31 +00:00
|
|
|
if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE) || (codes.contains(MucOptions.STATUS_CODE_ROOM_CREATED) && jid.equals(item.getAttributeAsJid("jid")))) {
|
2017-12-18 12:19:11 +00:00
|
|
|
if (mucOptions.setOnline()) {
|
|
|
|
mXmppConnectionService.getAvatarService().clear(mucOptions);
|
|
|
|
}
|
2015-12-03 17:18:34 +00:00
|
|
|
mucOptions.setSelf(user);
|
2018-02-10 15:24:55 +00:00
|
|
|
|
|
|
|
mXmppConnectionService.persistSelfNick(user);
|
2017-12-11 14:55:10 +00:00
|
|
|
invokeRenameListener(mucOptions, true);
|
2015-12-03 17:18:34 +00:00
|
|
|
}
|
2017-06-28 07:49:24 +00:00
|
|
|
boolean isNew = mucOptions.updateUser(user);
|
|
|
|
final AxolotlService axolotlService = conversation.getAccount().getAxolotlService();
|
2018-02-24 09:03:22 +00:00
|
|
|
Contact contact = user.getContact();
|
|
|
|
if (isNew
|
|
|
|
&& user.getRealJid() != null
|
|
|
|
&& mucOptions.isPrivateAndNonAnonymous()
|
|
|
|
&& (contact == null || !contact.mutualPresenceSubscription())
|
|
|
|
&& axolotlService.hasEmptyDeviceList(user.getRealJid())) {
|
2017-06-28 07:49:24 +00:00
|
|
|
axolotlService.fetchDeviceIds(user.getRealJid());
|
|
|
|
}
|
2016-05-27 08:35:00 +00:00
|
|
|
if (codes.contains(MucOptions.STATUS_CODE_ROOM_CREATED) && mucOptions.autoPushConfiguration()) {
|
2018-03-05 17:30:40 +00:00
|
|
|
Log.d(Config.LOGTAG,mucOptions.getAccount().getJid().asBareJid()
|
2016-05-26 10:39:31 +00:00
|
|
|
+": room '"
|
2018-03-05 17:30:40 +00:00
|
|
|
+mucOptions.getConversation().getJid().asBareJid()
|
2016-05-26 10:39:31 +00:00
|
|
|
+"' created. pushing default configuration");
|
|
|
|
mXmppConnectionService.pushConferenceConfiguration(mucOptions.getConversation(),
|
|
|
|
IqGenerator.defaultRoomConfiguration(),
|
|
|
|
null);
|
|
|
|
}
|
2015-12-03 17:18:34 +00:00
|
|
|
if (mXmppConnectionService.getPgpEngine() != null) {
|
|
|
|
Element signed = packet.findChild("x", "jabber:x:signed");
|
|
|
|
if (signed != null) {
|
|
|
|
Element status = packet.findChild("status");
|
|
|
|
String msg = status == null ? "" : status.getContent();
|
|
|
|
long keyId = mXmppConnectionService.getPgpEngine().fetchKeyId(mucOptions.getAccount(), msg, signed.getContent());
|
|
|
|
if (keyId != 0) {
|
|
|
|
user.setPgpKeyId(keyId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (avatar != null) {
|
|
|
|
avatar.owner = from;
|
|
|
|
if (mXmppConnectionService.getFileBackend().isAvatarCached(avatar)) {
|
2015-12-04 20:36:48 +00:00
|
|
|
if (user.setAvatar(avatar)) {
|
|
|
|
mXmppConnectionService.getAvatarService().clear(user);
|
|
|
|
}
|
2016-08-27 11:35:52 +00:00
|
|
|
} else if (mXmppConnectionService.isDataSaverDisabled()) {
|
2015-12-03 17:18:34 +00:00
|
|
|
mXmppConnectionService.fetchAvatar(mucOptions.getAccount(), avatar);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (type.equals("unavailable")) {
|
2017-11-30 12:21:03 +00:00
|
|
|
if (codes.contains(MucOptions.STATUS_CODE_SHUTDOWN) && from.equals(mucOptions.getSelf().getFullJid())) {
|
|
|
|
mucOptions.setError(MucOptions.Error.SHUTDOWN);
|
|
|
|
} else if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE)) {
|
2017-03-05 16:42:17 +00:00
|
|
|
if (codes.contains(MucOptions.STATUS_CODE_KICKED)) {
|
2016-02-22 19:19:58 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.KICKED);
|
2015-12-03 17:18:34 +00:00
|
|
|
} else if (codes.contains(MucOptions.STATUS_CODE_BANNED)) {
|
2016-02-22 19:19:58 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.BANNED);
|
2015-12-03 17:18:34 +00:00
|
|
|
} else if (codes.contains(MucOptions.STATUS_CODE_LOST_MEMBERSHIP)) {
|
2016-02-22 19:19:58 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.MEMBERS_ONLY);
|
|
|
|
} else if (codes.contains(MucOptions.STATUS_CODE_AFFILIATION_CHANGE)) {
|
|
|
|
mucOptions.setError(MucOptions.Error.MEMBERS_ONLY);
|
|
|
|
} else if (codes.contains(MucOptions.STATUS_CODE_SHUTDOWN)) {
|
|
|
|
mucOptions.setError(MucOptions.Error.SHUTDOWN);
|
2017-03-05 16:42:17 +00:00
|
|
|
} else if (!codes.contains(MucOptions.STATUS_CODE_CHANGED_NICK)) {
|
2016-02-22 19:19:58 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.UNKNOWN);
|
2016-02-01 11:11:40 +00:00
|
|
|
Log.d(Config.LOGTAG, "unknown error in conference: " + packet);
|
2015-12-03 17:18:34 +00:00
|
|
|
}
|
|
|
|
} else if (!from.isBareJid()){
|
2016-11-13 18:25:58 +00:00
|
|
|
Element item = x.findChild("item");
|
|
|
|
if (item != null) {
|
|
|
|
mucOptions.updateUser(parseItem(conversation, item, from));
|
|
|
|
}
|
2016-05-16 12:10:40 +00:00
|
|
|
MucOptions.User user = mucOptions.deleteUser(from);
|
2015-12-09 09:30:26 +00:00
|
|
|
if (user != null) {
|
|
|
|
mXmppConnectionService.getAvatarService().clear(user);
|
|
|
|
}
|
2015-12-03 17:18:34 +00:00
|
|
|
}
|
|
|
|
} else if (type.equals("error")) {
|
2017-12-11 14:55:10 +00:00
|
|
|
final Element error = packet.findChild("error");
|
|
|
|
if (error == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (error.hasChild("conflict")) {
|
2015-12-03 17:18:34 +00:00
|
|
|
if (mucOptions.online()) {
|
2017-12-11 14:55:10 +00:00
|
|
|
invokeRenameListener(mucOptions, false);
|
2015-12-03 17:18:34 +00:00
|
|
|
} else {
|
2016-02-22 19:19:58 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.NICK_IN_USE);
|
2015-12-03 17:18:34 +00:00
|
|
|
}
|
2017-12-11 14:55:10 +00:00
|
|
|
} else if (error.hasChild("not-authorized")) {
|
2016-02-22 19:19:58 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.PASSWORD_REQUIRED);
|
2017-12-11 14:55:10 +00:00
|
|
|
} else if (error.hasChild("forbidden")) {
|
2016-02-22 19:19:58 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.BANNED);
|
2017-12-11 14:55:10 +00:00
|
|
|
} else if (error.hasChild("registration-required")) {
|
2016-05-16 13:50:57 +00:00
|
|
|
mucOptions.setError(MucOptions.Error.MEMBERS_ONLY);
|
2017-12-11 14:55:10 +00:00
|
|
|
} else {
|
|
|
|
final String text = error.findChildContent("text");
|
|
|
|
if (text != null && text.contains("attribute 'to'")) {
|
|
|
|
if (mucOptions.online()) {
|
|
|
|
invokeRenameListener(mucOptions, false);
|
|
|
|
} else {
|
|
|
|
mucOptions.setError(MucOptions.Error.INVALID_NICK);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
mucOptions.setError(MucOptions.Error.UNKNOWN);
|
|
|
|
Log.d(Config.LOGTAG, "unknown error in conference: " + packet);
|
|
|
|
}
|
2015-12-03 17:18:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-11 14:55:10 +00:00
|
|
|
private static void invokeRenameListener(final MucOptions options, boolean success) {
|
|
|
|
if (options.onRenameListener != null) {
|
|
|
|
if (success) {
|
|
|
|
options.onRenameListener.onSuccess();
|
|
|
|
} else {
|
|
|
|
options.onRenameListener.onFailure();
|
|
|
|
}
|
|
|
|
options.onRenameListener = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-03 17:18:34 +00:00
|
|
|
private static List<String> getStatusCodes(Element x) {
|
|
|
|
List<String> codes = new ArrayList<>();
|
|
|
|
if (x != null) {
|
|
|
|
for (Element child : x.getChildren()) {
|
|
|
|
if (child.getName().equals("status")) {
|
|
|
|
String code = child.getAttribute("code");
|
|
|
|
if (code != null) {
|
|
|
|
codes.add(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return codes;
|
|
|
|
}
|
|
|
|
|
2015-11-05 02:56:45 +00:00
|
|
|
public void parseContactPresence(final PresencePacket packet, final Account account) {
|
|
|
|
final PresenceGenerator mPresenceGenerator = mXmppConnectionService.getPresenceGenerator();
|
2015-05-27 09:44:44 +00:00
|
|
|
final Jid from = packet.getFrom();
|
2016-05-13 09:20:27 +00:00
|
|
|
if (from == null || from.equals(account.getJid())) {
|
2014-10-22 16:38:44 +00:00
|
|
|
return;
|
|
|
|
}
|
2015-05-27 09:44:44 +00:00
|
|
|
final String type = packet.getAttribute("type");
|
|
|
|
final Contact contact = account.getRoster().getContact(from);
|
2014-12-20 16:23:03 +00:00
|
|
|
if (type == null) {
|
2018-03-05 17:30:40 +00:00
|
|
|
final String resource = from.isBareJid() ? "" : from.getResource();
|
2017-08-23 19:49:25 +00:00
|
|
|
if (contact.setPresenceName(packet.findChildContent("nick", Namespace.NICK))) {
|
|
|
|
mXmppConnectionService.getAvatarService().clear(contact);
|
|
|
|
}
|
2015-05-27 09:44:44 +00:00
|
|
|
Avatar avatar = Avatar.parsePresence(packet.findChild("x", "vcard-temp:x:update"));
|
2016-09-09 09:04:05 +00:00
|
|
|
if (avatar != null && (!contact.isSelf() || account.getAvatar() == null)) {
|
2018-03-05 17:30:40 +00:00
|
|
|
avatar.owner = from.asBareJid();
|
2015-05-27 09:44:44 +00:00
|
|
|
if (mXmppConnectionService.getFileBackend().isAvatarCached(avatar)) {
|
2018-03-05 17:30:40 +00:00
|
|
|
if (avatar.owner.equals(account.getJid().asBareJid())) {
|
2016-09-09 09:04:05 +00:00
|
|
|
account.setAvatar(avatar.getFilename());
|
|
|
|
mXmppConnectionService.databaseBackend.updateAccount(account);
|
|
|
|
mXmppConnectionService.getAvatarService().clear(account);
|
|
|
|
mXmppConnectionService.updateConversationUi();
|
|
|
|
mXmppConnectionService.updateAccountUi();
|
|
|
|
} else if (contact.setAvatar(avatar)) {
|
2015-05-27 09:44:44 +00:00
|
|
|
mXmppConnectionService.getAvatarService().clear(contact);
|
|
|
|
mXmppConnectionService.updateConversationUi();
|
|
|
|
mXmppConnectionService.updateRosterUi();
|
|
|
|
}
|
2016-08-27 11:35:52 +00:00
|
|
|
} else if (mXmppConnectionService.isDataSaverDisabled()){
|
2015-05-27 09:44:44 +00:00
|
|
|
mXmppConnectionService.fetchAvatar(account, avatar);
|
|
|
|
}
|
2014-10-22 16:38:44 +00:00
|
|
|
}
|
2014-12-20 16:23:03 +00:00
|
|
|
int sizeBefore = contact.getPresences().size();
|
2016-01-17 21:46:32 +00:00
|
|
|
|
2016-02-19 10:09:28 +00:00
|
|
|
final String show = packet.findChildContent("show");
|
2016-02-03 09:40:02 +00:00
|
|
|
final Element caps = packet.findChild("c", "http://jabber.org/protocol/caps");
|
2016-04-22 19:25:06 +00:00
|
|
|
final String message = packet.findChildContent("status");
|
|
|
|
final Presence presence = Presence.parse(show, caps, message);
|
2016-02-03 09:40:02 +00:00
|
|
|
contact.updatePresence(resource, presence);
|
2016-05-13 09:20:27 +00:00
|
|
|
if (presence.hasCaps()) {
|
2016-02-03 09:40:02 +00:00
|
|
|
mXmppConnectionService.fetchCaps(account, from, presence);
|
2016-01-17 22:11:00 +00:00
|
|
|
}
|
2016-01-17 21:46:32 +00:00
|
|
|
|
2017-03-20 16:58:58 +00:00
|
|
|
final Element idle = packet.findChild("idle", Namespace.IDLE);
|
2016-06-04 14:16:14 +00:00
|
|
|
if (idle != null) {
|
|
|
|
try {
|
2017-05-30 06:39:04 +00:00
|
|
|
final String since = idle.getAttribute("since");
|
2016-06-04 14:16:14 +00:00
|
|
|
contact.setLastseen(AbstractParser.parseTimestamp(since));
|
2017-05-30 06:39:04 +00:00
|
|
|
contact.flagInactive();
|
2017-11-16 11:47:49 +00:00
|
|
|
} catch (Throwable throwable) {
|
2017-05-30 06:39:04 +00:00
|
|
|
if (contact.setLastseen(AbstractParser.parseTimestamp(packet))) {
|
|
|
|
contact.flagActive();
|
|
|
|
}
|
2016-06-04 14:16:14 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-03-20 16:58:58 +00:00
|
|
|
if (contact.setLastseen(AbstractParser.parseTimestamp(packet))) {
|
|
|
|
contact.flagActive();
|
|
|
|
}
|
2016-06-04 14:16:14 +00:00
|
|
|
}
|
|
|
|
|
2014-12-20 16:23:03 +00:00
|
|
|
PgpEngine pgp = mXmppConnectionService.getPgpEngine();
|
2015-05-27 09:44:44 +00:00
|
|
|
Element x = packet.findChild("x", "jabber:x:signed");
|
|
|
|
if (pgp != null && x != null) {
|
|
|
|
Element status = packet.findChild("status");
|
|
|
|
String msg = status != null ? status.getContent() : "";
|
|
|
|
contact.setPgpKeyId(pgp.fetchKeyId(account, msg, x.getContent()));
|
2014-10-22 16:38:44 +00:00
|
|
|
}
|
2014-12-20 16:23:03 +00:00
|
|
|
boolean online = sizeBefore < contact.getPresences().size();
|
2015-01-03 12:01:38 +00:00
|
|
|
mXmppConnectionService.onContactStatusChanged.onContactStatusChanged(contact, online);
|
2014-12-20 16:23:03 +00:00
|
|
|
} else if (type.equals("unavailable")) {
|
2017-06-01 14:45:00 +00:00
|
|
|
if (contact.setLastseen(AbstractParser.parseTimestamp(packet,0L,true))) {
|
2017-03-20 16:58:58 +00:00
|
|
|
contact.flagInactive();
|
|
|
|
}
|
2014-12-20 16:23:03 +00:00
|
|
|
if (from.isBareJid()) {
|
|
|
|
contact.clearPresences();
|
|
|
|
} else {
|
2018-03-05 17:30:40 +00:00
|
|
|
contact.removePresence(from.getResource());
|
2014-12-20 16:23:03 +00:00
|
|
|
}
|
2015-05-27 09:44:44 +00:00
|
|
|
mXmppConnectionService.onContactStatusChanged.onContactStatusChanged(contact, false);
|
2014-12-20 16:23:03 +00:00
|
|
|
} else if (type.equals("subscribe")) {
|
|
|
|
if (contact.getOption(Contact.Options.PREEMPTIVE_GRANT)) {
|
|
|
|
mXmppConnectionService.sendPresencePacket(account,
|
|
|
|
mPresenceGenerator.sendPresenceUpdatesTo(contact));
|
|
|
|
} else {
|
|
|
|
contact.setOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST);
|
2015-12-09 11:18:06 +00:00
|
|
|
final Conversation conversation = mXmppConnectionService.findOrCreateConversation(
|
2018-03-05 17:30:40 +00:00
|
|
|
account, contact.getJid().asBareJid(), false, false);
|
2015-11-05 02:56:45 +00:00
|
|
|
final String statusMessage = packet.findChildContent("status");
|
2015-12-09 11:18:06 +00:00
|
|
|
if (statusMessage != null
|
|
|
|
&& !statusMessage.isEmpty()
|
|
|
|
&& conversation.countMessages() == 0) {
|
2015-11-05 02:56:45 +00:00
|
|
|
conversation.add(new Message(
|
|
|
|
conversation,
|
|
|
|
statusMessage,
|
|
|
|
Message.ENCRYPTION_NONE,
|
|
|
|
Message.STATUS_RECEIVED
|
|
|
|
));
|
|
|
|
}
|
2014-10-22 16:38:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
mXmppConnectionService.updateRosterUi();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onPresencePacketReceived(Account account, PresencePacket packet) {
|
|
|
|
if (packet.hasChild("x", "http://jabber.org/protocol/muc#user")) {
|
|
|
|
this.parseConferencePresence(packet, account);
|
|
|
|
} else if (packet.hasChild("x", "http://jabber.org/protocol/muc")) {
|
|
|
|
this.parseConferencePresence(packet, account);
|
|
|
|
} else {
|
|
|
|
this.parseContactPresence(packet, account);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|