((SoneShell) friendSone).setRequestUri(new FreenetURI(friendKey)).setName(friendName);
}
addRemoteSone(friendSone);
- sone.addFriendSone(sone);
+ sone.addFriend(sone);
}
sone.setModificationCounter(modificationCounter);
configuration.getStringValue(sonePrefix + "/Reply." + replyId + "/ID").setValue(null);
int friendId = 0;
- for (Sone friend : sone.getFriendSones()) {
+ for (Sone friend : sone.getFriends()) {
String friendPrefix = sonePrefix + "/Friend." + friendId++;
configuration.getStringValue(friendPrefix + "/ID").setValue(friend.getId());
configuration.getStringValue(friendPrefix + "/Key").setValue(friend.getRequestUri().toString());
*
* @return The friend Sones of this Sone
*/
- public Set<Sone> getFriendSones() {
+ public Set<Sone> getFriends() {
return Collections.unmodifiableSet(friendSones);
}
* @return {@code true} if this Sone has the given Sone as a friend,
* {@code false} otherwise
*/
- public boolean hasFriendSone(Sone friendSone) {
+ public boolean hasFriend(Sone friendSone) {
return friendSones.contains(friendSone);
}
* The friend Sone to add
* @return This Sone (for method chaining)
*/
- public synchronized Sone addFriendSone(Sone friendSone) {
+ public synchronized Sone addFriend(Sone friendSone) {
if (friendSones.add(friendSone)) {
modificationCounter++;
}
* The friend Sone to remove
* @return This Sone (for method chaining)
*/
- public synchronized Sone removeFriendSone(Sone friendSone) {
+ public synchronized Sone removeFriend(Sone friendSone) {
if (friendSones.remove(friendSone)) {
modificationCounter++;
}
* @return The friend Sones of this Sone
*/
@Override
- public Set<Sone> getFriendSones() {
+ public Set<Sone> getFriends() {
return Collections.unmodifiableSet(friendSones);
}
* {@code false} otherwise
*/
@Override
- public boolean hasFriendSone(Sone friendSone) {
+ public boolean hasFriend(Sone friendSone) {
return friendSones.contains(friendSone);
}
* @return This Sone (for method chaining)
*/
@Override
- public Sone addFriendSone(Sone friendSone) {
+ public Sone addFriend(Sone friendSone) {
friendSones.add(friendSone);
return this;
}
* @return This Sone (for method chaining)
*/
@Override
- public Sone removeFriendSone(Sone friendSone) {
+ public Sone removeFriend(Sone friendSone) {
friendSones.remove(friendSone);
return this;
}
Sone sone = new Sone(id, name, requestUri);
sone.setProfile(profile);
for (Sone friendSone : friendSones) {
- sone.addFriendSone(friendSone);
+ sone.addFriend(friendSone);
}
for (Post post : posts) {
sone.addPost(post);
return getNiceName(sone);
} else if (member.equals("isFriend")) {
Sone currentSone = (Sone) dataProvider.getData("currentSone");
- return currentSone.hasFriendSone(sone) ? true : null;
+ return currentSone.hasFriend(sone) ? true : null;
} else if (member.equals("isCurrent")) {
Sone currentSone = (Sone) dataProvider.getData("currentSone");
return currentSone.equals(sone);
Sone currentSone = getCurrentSone(request.getToadletContext());
Sone sone = webInterface.core().getSone(soneId);
if (!(sone instanceof SoneShell) && !sone.equals(currentSone)) {
- currentSone.addFriendSone(sone);
+ currentSone.addFriend(sone);
}
throw new RedirectException("viewSone.html?sone=" + soneId);
}
Sone sone = getCurrentSone(request.getToadletContext());
List<Post> allPosts = new ArrayList<Post>();
allPosts.addAll(sone.getPosts());
- for (Sone friendSone : sone.getFriendSones()) {
+ for (Sone friendSone : sone.getFriends()) {
allPosts.addAll(friendSone.getPosts());
}
Collections.sort(allPosts, new Comparator<Post>() {