aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-08-15 13:11:33 +0200
committeriNPUTmice <daniel@gultsch.de>2014-08-15 13:11:33 +0200
commit2ab14a6ff2ad97f7b8dba94844219cdc83c09640 (patch)
tree4f1332ae1ea7afe678c3043d62ed47727ff66e31
parent8358a513f0ec45e2398fd0a43650264751f7119f (diff)
fixed #356
-rw-r--r--src/eu/siacs/conversations/parser/MessageParser.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java
index f1b326ac..7de7e9e1 100644
--- a/src/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/eu/siacs/conversations/parser/MessageParser.java
@@ -189,7 +189,7 @@ public class MessageParser extends AbstractParser implements
}
Element message = forwarded.findChild("message");
if ((message == null) || (!message.hasChild("body"))) {
- if (status == Message.STATUS_RECIEVED) {
+ if (status == Message.STATUS_RECIEVED && message.getAttribute("from")!=null) {
parseNormal(message, account);
}
return null;
@@ -296,17 +296,19 @@ public class MessageParser extends AbstractParser implements
if (node != null) {
if (node.equals("urn:xmpp:avatar:metadata")) {
Avatar avatar = Avatar.parseMetadata(items);
- avatar.owner = from;
- if (mXmppConnectionService.getFileBackend().isAvatarCached(
- avatar)) {
- if (account.getJid().equals(from)) {
- account.setAvatar(avatar.getFilename());
+ if (avatar!=null) {
+ avatar.owner = from;
+ if (mXmppConnectionService.getFileBackend().isAvatarCached(
+ avatar)) {
+ if (account.getJid().equals(from)) {
+ account.setAvatar(avatar.getFilename());
+ } else {
+ Contact contact = account.getRoster().getContact(from);
+ contact.setAvatar(avatar.getFilename());
+ }
} else {
- Contact contact = account.getRoster().getContact(from);
- contact.setAvatar(avatar.getFilename());
+ mXmppConnectionService.fetchAvatar(account, avatar);
}
- } else {
- mXmppConnectionService.fetchAvatar(account, avatar);
}
} else {
Log.d("xmppService", account.getJid() + ": " + node + " from "