aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/serve.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 31a07cf..41ff025 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -236,6 +236,7 @@ Serve.prototype.path = function (url) {
case '/channels': return this.channels(m[2])
case '/friends': return this.friends(m[2])
case '/live': return this.live(m[2])
+ case '/compose': return this.compose(m[2])
}
m = /^(\/?[^\/]*)(\/.*)?$/.exec(url)
switch (m[1]) {
@@ -460,6 +461,22 @@ Serve.prototype.live = function (ext) {
)
}
+Serve.prototype.compose = function (ext) {
+ var self = this
+ self.composer({
+ channel: '',
+ }, function (err, composer) {
+ if (err) return cb(err)
+ pull(
+ pull.once(u.toHTML(composer)),
+ self.wrapPage('compose'),
+ self.respondSink(200, {
+ 'Content-Type': ctype(ext)
+ })
+ )
+ })
+}
+
Serve.prototype.peers = function (ext) {
var self = this
if (self.data.action === 'connect') {
@@ -969,6 +986,7 @@ Serve.prototype.wrapPage = function (title, searchQ) {
h('a', {href: render.toUrl('/friends')}, 'friends'), ' ',
h('a', {href: render.toUrl('/advsearch')}, 'search'), ' ',
h('a', {href: render.toUrl('/live')}, 'live'), ' ',
+ h('a', {href: render.toUrl('/compose')}, 'compose'), ' ',
render.idLink(self.app.sbot.id, done()), ' ',
h('input.search-input', {name: 'q', value: searchQ,
placeholder: 'search'})