Remove redundant constant for max blog name length.

This commit is contained in:
akwizgran
2018-01-16 17:39:49 +00:00
parent e474042af7
commit 699b037a3e
2 changed files with 2 additions and 8 deletions

View File

@@ -1,15 +1,9 @@
package org.briarproject.briar.api.blog; package org.briarproject.briar.api.blog;
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
import static org.briarproject.bramble.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH; import static org.briarproject.bramble.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH;
public interface BlogConstants { public interface BlogConstants {
/**
* The maximum length of a blogs's name in UTF-8 bytes.
*/
int MAX_BLOG_NAME_LENGTH = MAX_AUTHOR_NAME_LENGTH;
/** /**
* The maximum length of a blog post's body in bytes. * The maximum length of a blog post's body in bytes.
*/ */

View File

@@ -20,7 +20,7 @@ import org.briarproject.briar.api.feed.Feed;
import javax.inject.Inject; import javax.inject.Inject;
import static org.briarproject.briar.api.blog.BlogConstants.MAX_BLOG_NAME_LENGTH; import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
import static org.briarproject.briar.api.feed.FeedConstants.KEY_FEED_ADDED; import static org.briarproject.briar.api.feed.FeedConstants.KEY_FEED_ADDED;
import static org.briarproject.briar.api.feed.FeedConstants.KEY_FEED_AUTHOR; import static org.briarproject.briar.api.feed.FeedConstants.KEY_FEED_AUTHOR;
import static org.briarproject.briar.api.feed.FeedConstants.KEY_FEED_DESC; import static org.briarproject.briar.api.feed.FeedConstants.KEY_FEED_DESC;
@@ -53,7 +53,7 @@ class FeedFactoryImpl implements FeedFactory {
public Feed createFeed(String url, SyndFeed syndFeed) { public Feed createFeed(String url, SyndFeed syndFeed) {
String title = syndFeed.getTitle(); String title = syndFeed.getTitle();
if (title == null) title = "RSS"; if (title == null) title = "RSS";
else title = StringUtils.truncateUtf8(title, MAX_BLOG_NAME_LENGTH); else title = StringUtils.truncateUtf8(title, MAX_AUTHOR_NAME_LENGTH);
KeyPair keyPair = cryptoComponent.generateSignatureKeyPair(); KeyPair keyPair = cryptoComponent.generateSignatureKeyPair();
LocalAuthor localAuthor = authorFactory.createLocalAuthor(title, LocalAuthor localAuthor = authorFactory.createLocalAuthor(title,