Skip to content

Commit

Permalink
Pass along options given to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Powersource committed Nov 17, 2023
1 parent 53375b9 commit d6bce5a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,19 @@ function init (ssb, config) {
const getMembersTangle = GetGroupTangle(ssb, null, 'members')

const tribePublish = (content, cb) => {
// e.g. ssb-recps-guard hides options in .options, we should pass those along
const passAlongOpts = content.options ? {options: content.options} : {}

if (!content.recps) {
return ssb.db.create({
...passAlongOpts,
content
}, cb)
}

if (!isGroup(content.recps[0])) {
return ssb.db.create({
...passAlongOpts,
content,
encryptionFormat: 'box2'
}, cb)
Expand All @@ -229,6 +234,7 @@ function init (ssb, config) {
// we only want to have to calculate the members tangle if it's gonna be used
if (!isMemberType(content.type)) {
return ssb.db.create({
...passAlongOpts,
content,
encryptionFormat: 'box2'
}, cb)
Expand All @@ -241,6 +247,7 @@ function init (ssb, config) {
tanglePrune(content, 'members')

ssb.db.create({
...passAlongOpts,
content,
encryptionFormat: 'box2'
}, cb)
Expand Down

0 comments on commit d6bce5a

Please sign in to comment.