Kaynağa Gözat

Oasis release 0.8.0

psy 4 saat önce
ebeveyn
işleme
f649b4dba8

+ 1 - 1
src/backend/backend.js

@@ -584,7 +584,7 @@ const padsModel = require('../models/pads_model')({ cooler, cipherModel, tribeCr
 const tagsModel = require('../models/tags_model')({ cooler, isPublic: config.public, padsModel, tribesModel });
 const tribesContentModel = require('../models/tribes_content_model')({ cooler, isPublic: config.public, tribeCrypto, tribesModel });
 const searchModel = require('../models/search_model')({ cooler, isPublic: config.public, padsModel, tribeCrypto, tribesModel });
-const activityModel = require('../models/activity_model')({ cooler, isPublic: config.public, tribeCrypto, tribesModel });
+const activityModel = require('../models/activity_model')({ cooler, isPublic: config.public, tribeCrypto, tribesModel, padsModel });
 const pixeliaModel = require('../models/pixelia_model')({ cooler, isPublic: config.public });
 const melodyModel = require('../models/melody_model')({ cooler });
 const marketModel = require('../models/market_model')({ cooler, isPublic: config.public, tribeCrypto });

BIN
src/models/activity_model.js


+ 16 - 0
src/models/pads_model.js

@@ -287,6 +287,22 @@ module.exports = ({ cooler, cipherModel, tribeCrypto, padCrypto, tribesModel })
       return decryptPadFields(content, rootId, tKeys)
     },
 
+    decryptContentPublicSync(content) {
+      if (!content) return null
+      if (content.encrypted !== true) {
+        return { title: safeText(content.title), deadline: content.deadline ? String(content.deadline) : "", tags: normalizeTags(content.tags) }
+      }
+      if (content.tribeId) return null
+      const keyHex = tryDecryptPublicInviteKey(content.invites)
+      if (!keyHex) return null
+      try {
+        const title = content.title ? decryptField(content.title, keyHex) : ""
+        const deadline = content.deadline ? decryptField(content.deadline, keyHex) : ""
+        const tagsRaw = content.tags ? decryptField(content.tags, keyHex) : ""
+        return { title, deadline, tags: normalizeTags(tagsRaw) }
+      } catch (_) { return null }
+    },
+
     async resolveRootId(id) {
       const ssbClient = await openSsb()
       const messages = await readAll(ssbClient)

+ 3 - 1
src/views/activity_view.js

@@ -606,9 +606,11 @@ function renderActionCards(actions, userId, allActions, spreadMap = new Map()) {
     }
 
     if (type === 'map') {
-      const { lat, lng, mapType } = content;
+      const { lat, lng, mapType, title } = content;
+      const mapKey = action.id || action.key || '';
       cardBody.push(
         div({ class: 'card-section map' },
+          title ? div({ class: 'card-field' }, span({ class: 'card-label' }, (i18n.mapTitle || 'Map') + ':'), span({ class: 'card-value' }, mapKey ? a({ href: `/maps/${encodeURIComponent(mapKey)}`, class: 'user-link' }, title) : title)) : "",
           div({ class: 'map-card-info' },
             span({ class: 'map-type-badge' }, mapType || 'SINGLE'),
             span({ class: 'map-coords' }, `${(parseFloat(lat) || 0).toFixed(4)}, ${(parseFloat(lng) || 0).toFixed(4)}`)