mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Show blog posts from RSS feeds with a dedicated icon
This adds a field to the post headers and some more tests.
This commit is contained in:
@@ -26,7 +26,7 @@ public class BlogCommentHeader extends BlogPostHeader {
|
||||
Status authorStatus, boolean read) {
|
||||
|
||||
super(type, groupId, id, parent.getId(), timestamp,
|
||||
timeReceived, author, authorStatus, read);
|
||||
timeReceived, author, authorStatus, false, read);
|
||||
|
||||
if (type != COMMENT && type != WRAPPED_COMMENT)
|
||||
throw new IllegalArgumentException("Incompatible Message Type");
|
||||
@@ -41,6 +41,9 @@ public class BlogCommentHeader extends BlogPostHeader {
|
||||
}
|
||||
|
||||
public BlogPostHeader getParent() {
|
||||
if (parent instanceof BlogCommentHeader)
|
||||
return ((BlogCommentHeader) parent).getParent();
|
||||
return parent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ public interface BlogConstants {
|
||||
String KEY_AUTHOR_NAME = "name";
|
||||
String KEY_PUBLIC_KEY = "publicKey";
|
||||
String KEY_AUTHOR = "author";
|
||||
String KEY_RSS_FEED = "rssFeed";
|
||||
String KEY_READ = "read";
|
||||
String KEY_COMMENT = "comment";
|
||||
String KEY_ORIGINAL_MSG_ID = "originalMessageId";
|
||||
|
||||
@@ -17,21 +17,23 @@ public class BlogPostHeader extends PostHeader {
|
||||
private final MessageType type;
|
||||
private final GroupId groupId;
|
||||
private final long timeReceived;
|
||||
private final boolean rssFeed;
|
||||
|
||||
public BlogPostHeader(MessageType type, GroupId groupId, MessageId id,
|
||||
@Nullable MessageId parentId, long timestamp, long timeReceived,
|
||||
Author author, Status authorStatus, boolean read) {
|
||||
Author author, Status authorStatus, boolean rssFeed, boolean read) {
|
||||
super(id, parentId, timestamp, author, authorStatus, read);
|
||||
this.type = type;
|
||||
this.groupId = groupId;
|
||||
this.timeReceived = timeReceived;
|
||||
this.rssFeed = rssFeed;
|
||||
}
|
||||
|
||||
public BlogPostHeader(MessageType type, GroupId groupId, MessageId id,
|
||||
long timestamp, long timeReceived, Author author,
|
||||
Status authorStatus, boolean read) {
|
||||
Status authorStatus, boolean rssFeed, boolean read) {
|
||||
this(type, groupId, id, null, timestamp, timeReceived, author,
|
||||
authorStatus, read);
|
||||
authorStatus, rssFeed, read);
|
||||
}
|
||||
|
||||
public MessageType getType() {
|
||||
@@ -45,4 +47,9 @@ public class BlogPostHeader extends PostHeader {
|
||||
public long getTimeReceived() {
|
||||
return timeReceived;
|
||||
}
|
||||
|
||||
public boolean isRssFeed() {
|
||||
return rssFeed;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user