From 50a3f51c10557fa7ba7f1ba9db0d0ef1e5f9b582 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Wed, 28 Jun 2017 15:09:38 +0930 Subject: [PATCH] Check authorship when opening message ply's --- message_ply.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/message_ply.c b/message_ply.c index 6b2c1c6b..47585ebd 100644 --- a/message_ply.c +++ b/message_ply.c @@ -203,7 +203,13 @@ int message_ply_read_open(struct message_ply_read *ply, const rhizome_bid_t *bid assert(m->filesize != RHIZOME_SIZE_UNSET); ply->bundle_id = m->keypair.public_key; - ply->author = m->author; + rhizome_lookup_author(m); + if (m->authorship == AUTHOR_LOCAL || m->authorship == AUTHOR_REMOTE) + ply->author = m->author; + else if(m->has_sender) + ply->author = m->sender; + else + bzero(&ply->author, sizeof(ply->author)); ply->read.offset = ply->read.length = m->filesize; if (m->name && *m->name) ply->name = str_edup(m->name);