diff --git a/bin/mastodon-data.js b/bin/mastodon-data.js index ad51c8a..6d47265 100644 --- a/bin/mastodon-data.js +++ b/bin/mastodon-data.js @@ -1,5 +1,28 @@ import times from 'lodash/times' +function unrollThread(user, prefix, privacy, thread) { + let res = [] + + function unroll(node, parentKey) { + if (!node) { + return + } + for (let key of Object.keys(node)) { + res.push({ + user: user, + post: { + internalId: prefix + key, + text: key, + inReplyTo: parentKey && (prefix + parentKey) + } + }) + unroll(node[key], key) + } + } + unroll(thread) + return res +} + export const actions = times(30, i => ({ post: { text: '' + (i + 1) @@ -260,4 +283,44 @@ export const actions = times(30, i => ({ privacy: 'unlisted' } } -]) +].concat(unrollThread('baz', 'bazthread-', 'unlisted', { + 'thread 1' : { + 'thread 2': { + 'thread 2a': null, + 'thread 2b': { + 'thread 2b1': null + }, + 'thread 2c': null + }, + 'thread 3': { + 'thread 3a': null, + 'thread 3b': null, + 'thread 3c': null + } + } +})).concat([ + { + user: 'baz', + post: { + internalId: 'bazthread-thread 2b2', + text: 'thread 2b2', + inReplyTo: 'bazthread-thread 2b' + } + }, + { + user: 'baz', + post: { + internalId: 'bazthread-thread 2d', + text: 'thread 2d', + inReplyTo: 'bazthread-thread 2' + } + }, + { + user: 'baz', + post: { + internalId: 'bazthread-thread 2b2a', + text: 'thread 2b2a', + inReplyTo: 'bazthread-thread 2b2' + } + }, +])) diff --git a/bin/run-mastodon.js b/bin/run-mastodon.js index a8490a8..d4798b5 100644 --- a/bin/run-mastodon.js +++ b/bin/run-mastodon.js @@ -53,8 +53,7 @@ async function setupMastodonDatabase () { async function runMastodon () { console.log('Running mastodon...') let cmds = [ - 'gem install bundler', - 'gem install foreman', + 'gem install bundler foreman', 'bundle install', 'yarn --pure-lockfile' ] diff --git a/fixtures/dump.sql b/fixtures/dump.sql index 7a62d41..a2038b2 100644 Binary files a/fixtures/dump.sql and b/fixtures/dump.sql differ diff --git a/fixtures/system.tgz b/fixtures/system.tgz index 2eb1a08..acf3a07 100644 Binary files a/fixtures/system.tgz and b/fixtures/system.tgz differ diff --git a/routes/_components/Layout.html b/routes/_components/Layout.html index 3333665..0cc9740 100644 --- a/routes/_components/Layout.html +++ b/routes/_components/Layout.html @@ -1,4 +1,3 @@ -<:Window bind:online />