mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
Create correct shareable for RSS blogs.
Also removed "personal blog" wording that doesn't apply to RSS blogs.
This commit is contained in:
@@ -226,8 +226,8 @@ public class BlogFragment extends BaseFragment
|
|||||||
|
|
||||||
private void loadBlogPosts(final boolean reload) {
|
private void loadBlogPosts(final boolean reload) {
|
||||||
blogController.loadBlogPosts(
|
blogController.loadBlogPosts(
|
||||||
new UiResultExceptionHandler<Collection<BlogPostItem>, DbException>(
|
new UiResultExceptionHandler<Collection<BlogPostItem>,
|
||||||
this) {
|
DbException>(this) {
|
||||||
@Override
|
@Override
|
||||||
public void onResultUi(Collection<BlogPostItem> posts) {
|
public void onResultUi(Collection<BlogPostItem> posts) {
|
||||||
if (posts.isEmpty()) {
|
if (posts.isEmpty()) {
|
||||||
@@ -265,13 +265,13 @@ public class BlogFragment extends BaseFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setToolbarTitle(Author a) {
|
private void setToolbarTitle(Author a) {
|
||||||
String title = getString(R.string.blogs_personal_blog, a.getName());
|
getActivity().setTitle(a.getName());
|
||||||
getActivity().setTitle(title);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadSharedContacts() {
|
private void loadSharedContacts() {
|
||||||
blogController.loadSharingContacts(
|
blogController.loadSharingContacts(
|
||||||
new UiResultExceptionHandler<Collection<ContactId>, DbException>(this) {
|
new UiResultExceptionHandler<Collection<ContactId>,
|
||||||
|
DbException>(this) {
|
||||||
@Override
|
@Override
|
||||||
public void onResultUi(Collection<ContactId> contacts) {
|
public void onResultUi(Collection<ContactId> contacts) {
|
||||||
sharingController.addAll(contacts);
|
sharingController.addAll(contacts);
|
||||||
|
|||||||
@@ -268,7 +268,6 @@
|
|||||||
<string name="blogs_blog_post_received">New Blog Post Received</string>
|
<string name="blogs_blog_post_received">New Blog Post Received</string>
|
||||||
<string name="blogs_blog_post_scroll_to">Scroll To</string>
|
<string name="blogs_blog_post_scroll_to">Scroll To</string>
|
||||||
<string name="blogs_feed_empty_state">This is the global blog feed.\n\nIt looks like nobody blogged anything, yet.\n\nBe the first and tap the pen icon to write a new blog post.</string>
|
<string name="blogs_feed_empty_state">This is the global blog feed.\n\nIt looks like nobody blogged anything, yet.\n\nBe the first and tap the pen icon to write a new blog post.</string>
|
||||||
<string name="blogs_personal_blog">%s\'s Personal Blog</string>
|
|
||||||
<string name="blogs_remove_blog">Remove Blog</string>
|
<string name="blogs_remove_blog">Remove Blog</string>
|
||||||
<string name="blogs_remove_blog_dialog_message">Are you sure that you want to remove this blog and all posts?\nNote that this will not remove the blog from other people\'s devices.</string>
|
<string name="blogs_remove_blog_dialog_message">Are you sure that you want to remove this blog and all posts?\nNote that this will not remove the blog from other people\'s devices.</string>
|
||||||
<string name="blogs_remove_blog_ok">Remove Blog</string>
|
<string name="blogs_remove_blog_ok">Remove Blog</string>
|
||||||
@@ -285,8 +284,8 @@
|
|||||||
<string name="blogs_sharing_response_declined_sent">You declined the blog invitation from %s.</string>
|
<string name="blogs_sharing_response_declined_sent">You declined the blog invitation from %s.</string>
|
||||||
<string name="blogs_sharing_response_accepted_received">%s accepted the blog invitation.</string>
|
<string name="blogs_sharing_response_accepted_received">%s accepted the blog invitation.</string>
|
||||||
<string name="blogs_sharing_response_declined_received">%s declined the blog invitation.</string>
|
<string name="blogs_sharing_response_declined_received">%s declined the blog invitation.</string>
|
||||||
<string name="blogs_sharing_invitation_received">%1$s has shared the personal blog of %2$s with you.</string>
|
<string name="blogs_sharing_invitation_received">%1$s has shared the blog \"%2$s\" with you.</string>
|
||||||
<string name="blogs_sharing_invitation_sent">You have shared the personal blog of %1$s with %2$s.</string>
|
<string name="blogs_sharing_invitation_sent">You have shared the blog \"%1$s\" with %2$s.</string>
|
||||||
<string name="blogs_sharing_invitations_title">Blog Invitations</string>
|
<string name="blogs_sharing_invitations_title">Blog Invitations</string>
|
||||||
<string name="blogs_sharing_joined_toast">Subscribed to Blog</string>
|
<string name="blogs_sharing_joined_toast">Subscribed to Blog</string>
|
||||||
<string name="blogs_sharing_declined_toast">Blog Invitation Declined</string>
|
<string name="blogs_sharing_declined_toast">Blog Invitation Declined</string>
|
||||||
|
|||||||
@@ -32,8 +32,10 @@ class BlogMessageParserImpl extends MessageParserImpl<Blog> {
|
|||||||
throws FormatException {
|
throws FormatException {
|
||||||
String name = descriptor.getString(0);
|
String name = descriptor.getString(0);
|
||||||
byte[] publicKey = descriptor.getRaw(1);
|
byte[] publicKey = descriptor.getRaw(1);
|
||||||
|
boolean rssFeed = descriptor.getBoolean(2);
|
||||||
Author author = authorFactory.createAuthor(name, publicKey);
|
Author author = authorFactory.createAuthor(name, publicKey);
|
||||||
return blogFactory.createBlog(author);
|
if (rssFeed) return blogFactory.createFeedBlog(author);
|
||||||
|
else return blogFactory.createBlog(author);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,12 +139,11 @@ abstract class SharingManagerImpl<S extends Shareable>
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initializeSharedSession(Transaction txn, Contact c,
|
void initializeSharedSession(Transaction txn, Contact c, S shareable)
|
||||||
S shareable) throws DbException, FormatException {
|
throws DbException, FormatException {
|
||||||
GroupId contactGroupId = getContactGroup(c).getId();
|
GroupId contactGroupId = getContactGroup(c).getId();
|
||||||
Session session =
|
Session session = new Session(SHARING, contactGroupId,
|
||||||
new Session(SHARING, contactGroupId, shareable.getId(), null,
|
shareable.getId(), null, null, 0, 0);
|
||||||
null, 0, 0);
|
|
||||||
MessageId storageId = createStorageId(txn, contactGroupId);
|
MessageId storageId = createStorageId(txn, contactGroupId);
|
||||||
storeSession(txn, storageId, session);
|
storeSession(txn, storageId, session);
|
||||||
}
|
}
|
||||||
@@ -442,8 +441,7 @@ abstract class SharingManagerImpl<S extends Shareable>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removingShareable(Transaction txn, S shareable)
|
void removingShareable(Transaction txn, S shareable) throws DbException {
|
||||||
throws DbException {
|
|
||||||
SessionId sessionId = getSessionId(shareable.getId());
|
SessionId sessionId = getSessionId(shareable.getId());
|
||||||
// If we have any sessions in progress, tell the contacts we're leaving
|
// If we have any sessions in progress, tell the contacts we're leaving
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user