projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don’t store Sones in core.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
template
/
ProfileAccessor.java
diff --git
a/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java
b/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java
index
d215c82
..
9b0a7fc
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java
+++ b/
src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java
@@
-66,6
+66,9
@@
public class ProfileAccessor extends ReflectionAccessor {
/* avatar ID but no matching image? show nothing. */
return null;
}
/* avatar ID but no matching image? show nothing. */
return null;
}
+ if (!avatarImageBelongsToTheSameSoneAsTheProfile(profile, avatarId)) {
+ return null;
+ }
Sone remoteSone = profile.getSone();
if (remoteSone.isLocal()) {
/* always show your own avatars. */
Sone remoteSone = profile.getSone();
if (remoteSone.isLocal()) {
/* always show your own avatars. */
@@
-96,4
+99,8
@@
public class ProfileAccessor extends ReflectionAccessor {
return super.get(templateContext, object, member);
}
return super.get(templateContext, object, member);
}
+ private boolean avatarImageBelongsToTheSameSoneAsTheProfile(Profile profile, String avatarId) {
+ return core.getImage(avatarId).get().getSone().equals(profile.getSone());
+ }
+
}
}