when no avatar found show avatar of contact and not the muc user in conferences
This commit is contained in:
parent
aea664a0ec
commit
11e58607c9
|
@ -302,15 +302,15 @@ public class MucOptions {
|
||||||
return hasFeature("muc_moderated");
|
return hasFeature("muc_moderated");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteUser(String name) {
|
public User deleteUser(String name) {
|
||||||
synchronized (this.users) {
|
synchronized (this.users) {
|
||||||
for (int i = 0; i < users.size(); ++i) {
|
for (int i = 0; i < users.size(); ++i) {
|
||||||
if (users.get(i).getName().equals(name)) {
|
if (users.get(i).getName().equals(name)) {
|
||||||
users.remove(i);
|
return users.remove(i);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addUser(User user) {
|
public void addUser(User user) {
|
||||||
|
|
|
@ -110,7 +110,10 @@ public class PresenceParser extends AbstractParser implements
|
||||||
mucOptions.setError(MucOptions.ERROR_UNKNOWN);
|
mucOptions.setError(MucOptions.ERROR_UNKNOWN);
|
||||||
}
|
}
|
||||||
} else if (!from.isBareJid()){
|
} else if (!from.isBareJid()){
|
||||||
mucOptions.deleteUser(from.getResourcepart());
|
MucOptions.User user = mucOptions.deleteUser(from.getResourcepart());
|
||||||
|
if (user != null) {
|
||||||
|
mXmppConnectionService.getAvatarService().clear(user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (type.equals("error")) {
|
} else if (type.equals("error")) {
|
||||||
Element error = packet.findChild("error");
|
Element error = packet.findChild("error");
|
||||||
|
|
|
@ -77,7 +77,12 @@ public class AvatarService {
|
||||||
avatar = mXmppConnectionService.getFileBackend().getAvatar(user.getAvatar(), size);
|
avatar = mXmppConnectionService.getFileBackend().getAvatar(user.getAvatar(), size);
|
||||||
}
|
}
|
||||||
if (avatar == null) {
|
if (avatar == null) {
|
||||||
avatar = get(user.getName(), size, cachedOnly);
|
Contact contact = user.getContact();
|
||||||
|
if (contact != null) {
|
||||||
|
avatar = get(contact, size, cachedOnly);
|
||||||
|
} else {
|
||||||
|
avatar = get(user.getName(), size, cachedOnly);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.mXmppConnectionService.getBitmapCache().put(KEY, avatar);
|
this.mXmppConnectionService.getBitmapCache().put(KEY, avatar);
|
||||||
return avatar;
|
return avatar;
|
||||||
|
|
Loading…
Reference in a new issue