This commit is contained in:
iNPUTmice 2014-08-15 13:11:33 +02:00
parent 8358a513f0
commit 2ab14a6ff2

View file

@ -189,7 +189,7 @@ public class MessageParser extends AbstractParser implements
} }
Element message = forwarded.findChild("message"); Element message = forwarded.findChild("message");
if ((message == null) || (!message.hasChild("body"))) { if ((message == null) || (!message.hasChild("body"))) {
if (status == Message.STATUS_RECIEVED) { if (status == Message.STATUS_RECIEVED && message.getAttribute("from")!=null) {
parseNormal(message, account); parseNormal(message, account);
} }
return null; return null;
@ -296,17 +296,19 @@ public class MessageParser extends AbstractParser implements
if (node != null) { if (node != null) {
if (node.equals("urn:xmpp:avatar:metadata")) { if (node.equals("urn:xmpp:avatar:metadata")) {
Avatar avatar = Avatar.parseMetadata(items); Avatar avatar = Avatar.parseMetadata(items);
avatar.owner = from; if (avatar!=null) {
if (mXmppConnectionService.getFileBackend().isAvatarCached( avatar.owner = from;
avatar)) { if (mXmppConnectionService.getFileBackend().isAvatarCached(
if (account.getJid().equals(from)) { avatar)) {
account.setAvatar(avatar.getFilename()); if (account.getJid().equals(from)) {
account.setAvatar(avatar.getFilename());
} else {
Contact contact = account.getRoster().getContact(from);
contact.setAvatar(avatar.getFilename());
}
} else { } else {
Contact contact = account.getRoster().getContact(from); mXmppConnectionService.fetchAvatar(account, avatar);
contact.setAvatar(avatar.getFilename());
} }
} else {
mXmppConnectionService.fetchAvatar(account, avatar);
} }
} else { } else {
Log.d("xmppService", account.getJid() + ": " + node + " from " Log.d("xmppService", account.getJid() + ": " + node + " from "