projects
/
Sone.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d100af6
)
Remove hasRecipient method.
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Mon, 28 Jan 2013 07:44:29 +0000
(08:44 +0100)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Mon, 28 Jan 2013 07:44:29 +0000
(08:44 +0100)
src/main/java/net/pterodactylus/sone/data/Post.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java
patch
|
blob
|
history
src/main/resources/templates/include/viewPost.html
patch
|
blob
|
history
diff --git
a/src/main/java/net/pterodactylus/sone/data/Post.java
b/src/main/java/net/pterodactylus/sone/data/Post.java
index
5269fe4
..
6523e9b
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/Post.java
+++ b/
src/main/java/net/pterodactylus/sone/data/Post.java
@@
-69,14
+69,6
@@
public interface Post {
public Sone getSone();
/**
public Sone getSone();
/**
- * Returns whether this post has a recipient.
- *
- * @return {@code true} if this post has a recipient, {@code false}
- * otherwise
- */
- public boolean hasRecipient();
-
- /**
* Returns the ID of the recipient {@link Sone}, or
* {@link Optional#absent()} if this post does not have a recipient.
*
* Returns the ID of the recipient {@link Sone}, or
* {@link Optional#absent()} if this post does not have a recipient.
*
diff --git
a/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
b/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
index
5d0d72a
..
2d25715
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
+++ b/
src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
@@
-103,14
+103,6
@@
public class PostImpl implements Post {
* {@inheritDocs}
*/
@Override
* {@inheritDocs}
*/
@Override
- public boolean hasRecipient() {
- return recipientId != null;
- }
-
- /**
- * {@inheritDocs}
- */
- @Override
public Optional<String> getRecipientId() {
return Optional.fromNullable(recipientId);
}
public Optional<String> getRecipientId() {
return Optional.fromNullable(recipientId);
}
diff --git
a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java
b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java
index
108a80f
..
8601a52
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java
+++ b/
src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java
@@
-301,7
+301,7
@@
public abstract class AbstractSoneCommand extends AbstractCommand {
postBuilder.put(prefix + "ID", post.getId());
postBuilder.put(prefix + "Sone", post.getSone().getId());
postBuilder.put(prefix + "ID", post.getId());
postBuilder.put(prefix + "Sone", post.getSone().getId());
- if (post.
hasRecipi
ent()) {
+ if (post.
getRecipientId().isPres
ent()) {
postBuilder.put(prefix + "Recipient", post.getRecipientId().get());
}
postBuilder.put(prefix + "Time", post.getTime());
postBuilder.put(prefix + "Recipient", post.getRecipientId().get());
}
postBuilder.put(prefix + "Time", post.getTime());
diff --git
a/src/main/resources/templates/include/viewPost.html
b/src/main/resources/templates/include/viewPost.html
index
b46532f
..
efc3d53
100644
(file)
--- a/
src/main/resources/templates/include/viewPost.html
+++ b/
src/main/resources/templates/include/viewPost.html
@@
-18,9
+18,9
@@
<div class="inner-part">
<div<%if !post.loaded> class="hidden"<%/if>>
<div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
<div class="inner-part">
<div<%if !post.loaded> class="hidden"<%/if>>
<div class="author profile-link"><a href="viewSone.html?sone=<% post.sone.id|html>"><% post.sone.niceName|html></a></div>
- <%if post.
hasRecipi
ent>
+ <%if post.
recipientId.pres
ent>
<span class="recipient-to">→</span>
<span class="recipient-to">→</span>
- <%if
null post.recipient.orNull
>
+ <%if
!post.recipient.present
>
<div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><%= View.Post.UnknownAuthor|l10n|html></a></div>
<%else>
<div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><% post.recipient.get.niceName|html></a></div>
<div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><%= View.Post.UnknownAuthor|l10n|html></a></div>
<%else>
<div class="recipient profile-link"><a href="viewSone.html?sone=<% post.recipientId.get|html>"><% post.recipient.get.niceName|html></a></div>