git ssb

16+

cel / patchfoo



Commit 98a0c27c7dc3ced9d3093ff713ed4ac3b40bea67

Render room alias messages

Charles E. Lehner committed on 3/31/2022, 8:12:14 PM
Parent: d80baa241c094e68e1635399ac5019eec9010a71

Files changed

lib/render-msg.jschanged
lib/render-msg.jsView
@@ -394,8 +394,9 @@
394394 case 'cesium_geoPoint.lat':
395395 case 'cesium_geoPoint.lon': return this.astroport(cb)
396396 case 'delete': return this.delete(cb)
397397 case 'patchgraph-update': return this.patchgraphUpdate(cb)
398 + case 'room/alias': return this.roomAlias(cb)
398399 default: return this.object(cb)
399400 }
400401 }
401402
@@ -2612,4 +2613,30 @@
26122613 h('div', 'patchgraph update:'),
26132614 self.valueTable(query, 1, function () {})
26142615 ]), cb)
26152616 }
2617 +
2618 +RenderMsg.prototype.roomAlias = function (cb) {
2619 + var self = this
2620 + const url = u.toString(self.c.aliasURL || '')
2621 + self.link(self.c.room, function (err, roomLink) {
2622 + return self.wrapMini([
2623 + self.c.action === 'registered' ? 'registered'
2624 + : ('did something with' + (self.c.action ? ' (' + self.c.action + ')' : '')),
2625 + ' ',
2626 + self.c.alias ? [
2627 + 'room alias ',
2628 + h('q', u.toString(self.c.alias)),
2629 + ] : 'a room alias',
2630 + ' ',
2631 + self.c.room ? [
2632 + 'with room ',
2633 + roomLink || u.toString(roomLink)
2634 + ] : '',
2635 + ' ',
2636 + url ? [
2637 + 'at ',
2638 + h('a', {href: url}, url)
2639 + ] : ''
2640 + ], cb)
2641 + })
2642 +}

Built with git-ssb-web