mirror of
https://github.com/balzack/databag.git
synced 2025-04-23 18:15:19 +00:00
avoid unsealing unconfirmed topics
This commit is contained in:
parent
2103dd6ec6
commit
b4777e87b5
@ -414,14 +414,12 @@ export class FocusModule implements Focus {
|
||||
for (const asset of files) {
|
||||
for (const transform of asset.transforms) {
|
||||
if (transform.type === TransformType.Thumb && transform.thumb) {
|
||||
console.log("GET THUMB??");
|
||||
const assetItem = {
|
||||
assetId: `${assetItems.length}`,
|
||||
encrytped: true,
|
||||
hosting: HostingMode.Inline,
|
||||
inline: await transform.thumb(),
|
||||
}
|
||||
console.log("GOT THUMB!!");
|
||||
appAsset.push({appId: transform.appId, assetId: assetItem.assetId});
|
||||
assetItems.push(assetItem);
|
||||
} else if (transform.type === TransformType.Copy) {
|
||||
@ -591,7 +589,6 @@ console.log("GOT THUMB!!");
|
||||
await this.setRemoteChannelTopicSubject(topicId, type, updated);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("THROWING!");
|
||||
this.log.error(err);
|
||||
await this.removeRemoteChannelTopic(topicId);
|
||||
throw new Error('failed to add topic');
|
||||
@ -866,7 +863,7 @@ console.log("THROWING!");
|
||||
}
|
||||
|
||||
private async unsealTopicDetail(item: TopicItem): Promise<boolean> {
|
||||
if (item.detail.sealed && !item.unsealedDetail && this.sealEnabled && this.channelKey && this.crypto) {
|
||||
if (item.detail.status === 'confirmed' && item.detail.sealed && !item.unsealedDetail && this.sealEnabled && this.channelKey && this.crypto) {
|
||||
try {
|
||||
const { messageEncrypted, messageIv } = item.detail.data;
|
||||
if (!messageEncrypted || !messageIv) {
|
||||
|
@ -657,7 +657,7 @@ export class StreamModule {
|
||||
}
|
||||
|
||||
private async unsealChannelSummary(channelId: string, item: ChannelItem): Promise<boolean> {
|
||||
if (item.unsealedSummary == null && item.summary.dataType === 'sealedtopic' && this.seal && this.crypto) {
|
||||
if (item.unsealedSummary == null && item.summary.status === 'confirmed' && item.summary.dataType === 'sealedtopic' && this.seal && this.crypto) {
|
||||
try {
|
||||
if (!item.channelKey) {
|
||||
const { seals } = JSON.parse(item.detail.data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user