mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Let clients decide whether to share messages or not
This commit is contained in:
@@ -162,6 +162,8 @@ class BlogManagerImpl extends BdfIncomingMessageHook implements BlogManager,
|
||||
protected void incomingMessage(Transaction txn, Message m, BdfList list,
|
||||
BdfDictionary meta) throws DbException, FormatException {
|
||||
|
||||
clientHelper.setMessageShared(txn, m, true);
|
||||
|
||||
GroupId groupId = m.getGroupId();
|
||||
BlogPostHeader h = getPostHeaderFromMetadata(txn, m.getId(), meta);
|
||||
BlogPostAddedEvent event =
|
||||
|
||||
@@ -239,6 +239,12 @@ class ClientHelperImpl implements ClientHelper {
|
||||
db.mergeMessageMetadata(txn, m, metadataEncoder.encode(metadata));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMessageShared(Transaction txn, Message m, boolean shared)
|
||||
throws DbException {
|
||||
db.setMessageShared(txn, m, shared);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] toByteArray(BdfDictionary dictionary) throws FormatException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
||||
@@ -78,6 +78,8 @@ class ForumManagerImpl extends BdfIncomingMessageHook implements ForumManager {
|
||||
protected void incomingMessage(Transaction txn, Message m, BdfList body,
|
||||
BdfDictionary meta) throws DbException, FormatException {
|
||||
|
||||
clientHelper.setMessageShared(txn, m, true);
|
||||
|
||||
ForumPostHeader post = getForumPostHeader(txn, m.getId(), meta);
|
||||
ForumPostReceivedEvent event =
|
||||
new ForumPostReceivedEvent(post, m.getGroupId());
|
||||
|
||||
@@ -358,8 +358,6 @@ class ValidationManagerImpl implements ValidationManager, Service,
|
||||
throw new InvalidMessageException(
|
||||
"Deleted by Client");
|
||||
}
|
||||
|
||||
db.setMessageShared(txn, m, true);
|
||||
db.setMessageState(txn, m, c, DELIVERED);
|
||||
|
||||
// deliver pending dependents
|
||||
|
||||
Reference in New Issue
Block a user