mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
No need to unwrap Bytes before adding to dictionary.
This commit is contained in:
@@ -61,15 +61,14 @@ class ForumManagerImpl implements ForumManager {
|
||||
try {
|
||||
BdfDictionary meta = new BdfDictionary();
|
||||
meta.put("timestamp", p.getMessage().getTimestamp());
|
||||
if (p.getParent() != null)
|
||||
meta.put("parent", p.getParent().getBytes());
|
||||
if (p.getParent() != null) meta.put("parent", p.getParent());
|
||||
if (p.getAuthor() != null) {
|
||||
Author a = p.getAuthor();
|
||||
BdfDictionary author = new BdfDictionary();
|
||||
author.put("id", a.getId().getBytes());
|
||||
author.put("name", a.getName());
|
||||
author.put("publicKey", a.getPublicKey());
|
||||
meta.put("author", author);
|
||||
BdfDictionary authorMeta = new BdfDictionary();
|
||||
authorMeta.put("id", a.getId());
|
||||
authorMeta.put("name", a.getName());
|
||||
authorMeta.put("publicKey", a.getPublicKey());
|
||||
meta.put("author", authorMeta);
|
||||
}
|
||||
meta.put("contentType", p.getContentType());
|
||||
meta.put("local", true);
|
||||
|
||||
@@ -82,7 +82,7 @@ class ForumPostValidator extends BdfMessageValidator {
|
||||
KeyParser keyParser = crypto.getSignatureKeyParser();
|
||||
PublicKey key = keyParser.parsePublicKey(author.getPublicKey());
|
||||
// Serialise the data to be signed
|
||||
BdfList signed = BdfList.of(g.getId(), timestamp, parentId,
|
||||
BdfList signed = BdfList.of(g.getId(), timestamp, parent,
|
||||
authorList, contentType, body);
|
||||
// Verify the signature
|
||||
Signature signature = crypto.getSignature();
|
||||
@@ -100,10 +100,10 @@ class ForumPostValidator extends BdfMessageValidator {
|
||||
// Return the metadata
|
||||
BdfDictionary meta = new BdfDictionary();
|
||||
meta.put("timestamp", timestamp);
|
||||
if (parentId != null) meta.put("parent", parentId);
|
||||
if (parent != null) meta.put("parent", parent);
|
||||
if (author != null) {
|
||||
BdfDictionary authorMeta = new BdfDictionary();
|
||||
authorMeta.put("id", author.getId().getBytes());
|
||||
authorMeta.put("id", author.getId());
|
||||
authorMeta.put("name", author.getName());
|
||||
authorMeta.put("publicKey", author.getPublicKey());
|
||||
meta.put("author", authorMeta);
|
||||
|
||||
@@ -83,8 +83,7 @@ class MessagingManagerImpl implements MessagingManager, AddContactHook,
|
||||
try {
|
||||
BdfDictionary meta = new BdfDictionary();
|
||||
meta.put("timestamp", m.getMessage().getTimestamp());
|
||||
if (m.getParent() != null)
|
||||
meta.put("parent", m.getParent().getBytes());
|
||||
if (m.getParent() != null) meta.put("parent", m.getParent());
|
||||
meta.put("contentType", m.getContentType());
|
||||
meta.put("local", true);
|
||||
meta.put("read", true);
|
||||
|
||||
Reference in New Issue
Block a user