git ssb

3+

dangerousbeans / scuttle-vue



Commit 8581d6b0616fcc78fc397b1529105c5dde79c69b

Merge branch 'master' of github.com:ProjectEntropy/scuttle-vue

Joran committed on 11/15/2017, 6:05:58 AM
Parent: fe2d16aa6ea53293f876bfca14020babfd4236ab
Parent: 4e9c401a1458a4b9aa5de62cb415f9ea63670383

Files changed

modules/sbot.jschanged
src/components/Message.vuechanged
modules/sbot.jsView
@@ -51,9 +51,10 @@
5151 sbot_publish: true,
5252 sbot_whoami: true,
5353 sbot_stream: true,
5454 sbot_friends_get: true,
55- sbot_signs_get: true
55 + sbot_signs_get: true,
56 + sbot_relatedMessages_get: true
5657 },
5758
5859 create: function (api) {
5960
@@ -169,8 +170,17 @@
169170 }),
170171 sbot_friends_get: rec.async(function (opts, cb) {
171172 return sbot.friends.get(opts, cb)
172173 }),
174 + sbot_relatedMessages_get: rec.async(function (opts, cb) {
175 + // debugger
176 + return sbot.relatedMessages(opts, cb)
177 + }),
178 + // relatedMessages({ id: "%A8H47IPGp2sxPYYFunKU+9mU52R7pvs8eKEsuFzaWXI=.sha256", count: true }, function (err, msgs) {
179 +
180 + // console.log(JSON.stringify(msgs, null, 2))
181 +
182 + // })
173183 sbot_signs_get: rec.async(function (opts, cb) {
174184 return sbot.signs.get(opts, cb)
175185 }),
176186 }
src/components/Message.vueView
@@ -28,18 +28,37 @@
2828 props: ['message'],
2929 data () {
3030 return {
3131 author: "...",
32- image_url: "http://via.placeholder.com/90x90"
32 + image_url: "http://via.placeholder.com/90x90",
33 + relatedMessages: {}
3334 }
3435 },
36 +
3537 methods: {
3638 setAuthor(err, a){
3739 if(a[0] == null)
3840 return
3941 this.author = nn( a[0] ).name()
4042 },
4143
44 + setRelatedMessages(err, a){
45 + debugger
46 + if(err) {
47 + console.log('message.vue.setRelatedMessages.err', err)
48 + }
49 + if(a === null) { return }
50 +
51 + debugger
52 + this.relatedMessages = a[0]
53 + },
54 +
55 + set_image_url(err, a){
56 + console.log("Set image URL")
57 + console.log(err, a)
58 + // this.image_url = a
59 + },
60 +
4261 // Get markdown formatted version of message content
4362 content_text()
4463 {
4564 return md.block( this.message.value.content.text() )
@@ -48,10 +67,14 @@
4867 updated() {
4968 // author name
5069 this.$depject_api.signifier[0](
5170 this.message.value.author(), this.setAuthor
52- ),
71 + )
5372
73 + this.$depject_api.sbot_relatedMessages_get[0](
74 + this.message.key(), this.setRelatedMessages
75 + )
76 +
5477 this.image_url = this.$depject_api.avatar_image[0](
5578 this.message.value.author()
5679 )
5780 }

Built with git-ssb-web