Merge branch 'refs/heads/siacs-master' into development
This commit is contained in:
commit
2e8c46981c
3 changed files with 127 additions and 132 deletions
|
@ -152,6 +152,7 @@ public class MessageGenerator extends AbstractGenerator {
|
||||||
packet.setFrom(account.getJid());
|
packet.setFrom(account.getJid());
|
||||||
Element received = packet.addChild("displayed","urn:xmpp:chat-markers:0");
|
Element received = packet.addChild("displayed","urn:xmpp:chat-markers:0");
|
||||||
received.setAttribute("id", id);
|
received.setAttribute("id", id);
|
||||||
|
packet.addChild("store", "urn:xmpp:hints");
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -304,17 +304,17 @@ public class MessageParser extends AbstractParser implements
|
||||||
final Jid from = packet.getFrom();
|
final Jid from = packet.getFrom();
|
||||||
final String remoteMsgId = packet.getId();
|
final String remoteMsgId = packet.getId();
|
||||||
|
|
||||||
if (from == null || to == null) {
|
if (from == null) {
|
||||||
Log.d(Config.LOGTAG,"no to or from in: "+packet.toString());
|
Log.d(Config.LOGTAG,"no from in: "+packet.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isTypeGroupChat = packet.getType() == MessagePacket.TYPE_GROUPCHAT;
|
boolean isTypeGroupChat = packet.getType() == MessagePacket.TYPE_GROUPCHAT;
|
||||||
boolean isProperlyAddressed = !to.isBareJid() || account.countPresences() == 1;
|
boolean isProperlyAddressed = (to != null ) && (!to.isBareJid() || account.countPresences() == 1);
|
||||||
boolean isMucStatusMessage = from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status");
|
boolean isMucStatusMessage = from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status");
|
||||||
if (packet.fromAccount(account)) {
|
if (packet.fromAccount(account)) {
|
||||||
status = Message.STATUS_SEND;
|
status = Message.STATUS_SEND;
|
||||||
counterpart = to;
|
counterpart = to != null ? to : account.getJid();
|
||||||
} else {
|
} else {
|
||||||
status = Message.STATUS_RECEIVED;
|
status = Message.STATUS_RECEIVED;
|
||||||
counterpart = from;
|
counterpart = from;
|
||||||
|
|
|
@ -479,13 +479,7 @@ public class XmppConnection implements Runnable {
|
||||||
}
|
}
|
||||||
nextTag = tagReader.readTag();
|
nextTag = tagReader.readTag();
|
||||||
}
|
}
|
||||||
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": last tag was " + nextTag);
|
throw new IOException("reached end of stream. last tag was "+nextTag);
|
||||||
if (account.getStatus() == Account.State.ONLINE) {
|
|
||||||
account. setStatus(Account.State.OFFLINE);
|
|
||||||
if (statusListener != null) {
|
|
||||||
statusListener.onStatusChanged(account);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void acknowledgeStanzaUpTo(int serverCount) {
|
private void acknowledgeStanzaUpTo(int serverCount) {
|
||||||
|
|
Reference in a new issue