fixups after review

This commit is contained in:
zzz
2017-07-13 15:46:37 +00:00
parent d2da262374
commit 5ddb4edd14
11 changed files with 29 additions and 16 deletions

View File

@ -1524,7 +1524,9 @@ class PeerCoordinator implements PeerListener
* @since 0.9.31
*/
public void gotCommentReq(Peer peer, int num) {
/* if disabled, return */
/* TODO cache per-torrent setting, use it instead */
if (!_util.utCommentsEnabled())
return;
CommentSet comments = snark.getComments();
if (comments != null) {
int lastSent = peer.getTotalCommentsSent();
@ -1547,7 +1549,9 @@ class PeerCoordinator implements PeerListener
* @since 0.9.31
*/
public void gotComments(Peer peer, List<Comment> comments) {
/* if disabled, return */
/* TODO cache per-torrent setting, use it instead */
if (!_util.utCommentsEnabled())
return;
if (!comments.isEmpty())
snark.addComments(comments);
}

View File

@ -797,6 +797,9 @@ public class SnarkManager implements CompleteListener, ClientApp {
updateConfig();
}
/**
* @since 0.9.31
*/
public boolean getUniversalTheming() {
return _context.getBooleanProperty(RC_PROP_UNIVERSAL_THEMING);
}

View File

@ -70,7 +70,7 @@ public class Comment implements Comparable<Comment> {
name = name.substring(0, MAX_NAME_LEN);
}
this.name = name;
if (rating < 0 || rating > 5)
if (rating < 0)
rating = 0;
else if (rating > 5)
rating = 5;