git ssb

16+

cel / patchfoo



Commit 4d1395740db1ddebaa558f2c27d29ab772e74936

Render private about messages more compactly

cel committed on 4/8/2019, 9:45:10 PM
Parent: 5c782b79a38d0ec6a29c019a55ef66a1b6000acf

Files changed

lib/render-msg.jschanged
lib/render-msg.jsView
@@ -559,8 +559,9 @@
559559 var knownAboutProps = {
560560 channel: true,
561561 type: true,
562562 root: true,
563 + recps: true,
563564 branch: true,
564565 about: true,
565566 attendee: true,
566567 about: true,
@@ -585,21 +586,23 @@
585586 'talenet-version': true,
586587 }
587588
588589 RenderMsg.prototype.about = function (cb) {
589- var keys = Object.keys(this.c).sort().join()
590 + var keys = Object.keys(this.c).filter(function (k) {
591 + return k !== 'about' && k !== 'type' && k !== 'recps'
592 + }).sort().join()
590593 var isSelf = this.c.about === this.msg.value.author
591594
592- if (keys === 'about,name,type') {
595 + if (keys === 'name') {
593596 return this.wrapMini([
594597 isSelf ?
595598 'self-identifies as ' :
596599 ['identifies ', h('a', {href: this.toUrl(this.c.about)}, u.truncate(this.c.about, 10)), ' as '],
597600 h('ins', String(this.c.name))
598601 ], cb)
599602 }
600603
601- if (keys === 'about,publicWebHosting,type') {
604 + if (keys === 'publicWebHosting') {
602605 var public = this.c.publicWebHosting && this.c.publicWebHosting !== 'false'
603606 return this.wrapMini([
604607 isSelf ?
605608 public ? 'is okay with being hosted publicly'
@@ -614,9 +617,9 @@
614617 var done = multicb({pluck: 1, spread: true})
615618 var elCb = done()
616619
617620 var isAttendingMsg = u.linkDest(this.c.attendee) === this.msg.value.author
618- && keys === 'about,attendee,type'
621 + && keys === 'attendee'
619622 if (isAttendingMsg) {
620623 var attending = !this.c.attendee.remove
621624 this.wrapMini([
622625 attending ? ' is attending' : ' is not attending', ' ',

Built with git-ssb-web