recognize muc self presence on nimbuzz.com
Apparently nimbuzz.com doesn't include status code 110 in muc self presence It does however include the full real jid in the presence’s item. We can use that as a work around to detect a self presence.
This commit is contained in:
parent
c86134e523
commit
483304c697
|
@ -54,6 +54,7 @@ public class PresenceParser extends AbstractParser implements
|
|||
|
||||
private void processConferencePresence(PresencePacket packet, Conversation conversation) {
|
||||
MucOptions mucOptions = conversation.getMucOptions();
|
||||
final Jid jid = conversation.getAccount().getJid();
|
||||
final Jid from = packet.getFrom();
|
||||
if (!from.isBareJid()) {
|
||||
final String type = packet.getAttribute("type");
|
||||
|
@ -66,7 +67,7 @@ public class PresenceParser extends AbstractParser implements
|
|||
if (item != null && !from.isBareJid()) {
|
||||
mucOptions.setError(MucOptions.Error.NONE);
|
||||
MucOptions.User user = parseItem(conversation, item, from);
|
||||
if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE)) {
|
||||
if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE) || (codes.isEmpty() && jid.equals(item.getAttributeAsJid("jid")))) {
|
||||
mucOptions.setOnline();
|
||||
mucOptions.setSelf(user);
|
||||
if (mucOptions.onRenameListener != null) {
|
||||
|
@ -108,8 +109,7 @@ public class PresenceParser extends AbstractParser implements
|
|||
}
|
||||
}
|
||||
} else if (type.equals("unavailable")) {
|
||||
if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE) ||
|
||||
packet.getFrom().equals(mucOptions.getConversation().getJid())) {
|
||||
if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE)) {
|
||||
if (codes.contains(MucOptions.STATUS_CODE_KICKED)) {
|
||||
mucOptions.setError(MucOptions.Error.KICKED);
|
||||
} else if (codes.contains(MucOptions.STATUS_CODE_BANNED)) {
|
||||
|
|
Loading…
Reference in New Issue