git ssb

16+

Dominic / patchbay



Commit caf3a5f8775fcebb0f0d23acfa6071301fd2031f

Enable private messages in local lite client

cel committed on 11/15/2016, 7:53:10 PM
Parent: 615ba51a344df64e9c77f4a1acd2c6bfb85ff581

Files changed

modules_basic/private.jschanged
modules_basic/private.jsView
@@ -9,8 +9,9 @@
99 var message_render = plugs.first(exports.message_render = [])
1010 var message_compose = plugs.first(exports.message_compose = [])
1111 var message_unbox = plugs.first(exports.message_unbox = [])
1212 var sbot_log = plugs.first(exports.sbot_log = [])
13 +var sbot_whoami = plugs.first(exports.sbot_whoami = [])
1314 var avatar_image_link = plugs.first(exports.avatar_image_link = [])
1415
1516 function unbox () {
1617 return pull(
@@ -24,15 +25,22 @@
2425 )
2526 }
2627
2728 exports.screen_view = function (path) {
29 + if(path !== '/private') return
2830
29- if(path === '/private') {
30- if(process.title === 'browser')
31- return h('div', h('h4', 'Private messages are not supported in the lite client.'))
31 + var div = h('div.column.scroller',
32 + {style: {'overflow':'auto'}})
3233
34 + // if local id is different from sbot id, sbot won't have indexes of
35 + // private threads
36 + var id = require('../keys').id
37 + sbot_whoami(function (err, feed) {
38 + if (err) return console.error(err)
39 + if(id !== feed.id)
40 + return div.appendChild(h('h4',
41 + 'Private messages are not supported in the lite client.'))
3342
34- var id = require('../keys').id
3543 var compose = message_compose(
3644 {type: 'post', recps: [], private: true},
3745 {
3846 prepublish: function (msg) {
@@ -47,12 +55,9 @@
4755 }
4856 )
4957
5058 var content = h('div.column.scroller__content')
51- var div = h('div.column.scroller',
52- {style: {'overflow':'auto'}},
53- h('div.scroller__wrapper', compose, content)
54- )
59 + div.appendChild(h('div.scroller__wrapper', compose, content))
5560
5661 pull(
5762 u.next(sbot_log, {old: false, limit: 100}),
5863 unbox(),
@@ -65,11 +70,11 @@
6570 Scroller(div, content, message_render, false, false, function (err) {
6671 if(err) throw err
6772 })
6873 )
74 + })
6975
70- return div
71- }
76 + return div
7277 }
7378
7479 function map(ary, iter) {
7580 if(Array.isArray(ary)) return ary.map(iter)

Built with git-ssb-web