deal with prosodys muc namespace tagging of messages

This commit is contained in:
Daniel Gultsch 2015-01-04 12:37:22 +01:00
parent e32a927300
commit 5c190487bc

View file

@ -245,6 +245,10 @@ public class MessageParser extends AbstractParser implements
return null; return null;
} }
} }
if (message.hasChild("x","http://jabber.org/protocol/muc#user")
&& "chat".equals(message.getAttribute("type"))) {
return null;
}
Conversation conversation = mXmppConnectionService Conversation conversation = mXmppConnectionService
.findOrCreateConversation(account, fullJid.toBareJid(), false); .findOrCreateConversation(account, fullJid.toBareJid(), false);
String pgpBody = getPgpBody(message); String pgpBody = getPgpBody(message);
@ -482,7 +486,6 @@ public class MessageParser extends AbstractParser implements
public void onMessagePacketReceived(Account account, MessagePacket packet) { public void onMessagePacketReceived(Account account, MessagePacket packet) {
Message message = null; Message message = null;
this.parseNick(packet, account); this.parseNick(packet, account);
if ((packet.getType() == MessagePacket.TYPE_CHAT || packet.getType() == MessagePacket.TYPE_NORMAL)) { if ((packet.getType() == MessagePacket.TYPE_CHAT || packet.getType() == MessagePacket.TYPE_NORMAL)) {
if ((packet.getBody() != null) if ((packet.getBody() != null)
&& (packet.getBody().startsWith("?OTR"))) { && (packet.getBody().startsWith("?OTR"))) {
@ -490,9 +493,7 @@ public class MessageParser extends AbstractParser implements
if (message != null) { if (message != null) {
message.markUnread(); message.markUnread();
} }
} else if (packet.hasChild("body") } else if (packet.hasChild("body")) {
&& !(packet.hasChild("x",
"http://jabber.org/protocol/muc#user"))) {
message = this.parseChat(packet, account); message = this.parseChat(packet, account);
if (message != null) { if (message != null) {
message.markUnread(); message.markUnread();