Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/scripts/make-channel-private.js
// @flow | // @flow | ||||
import ashoat from 'lib/facts/ashoat.js'; | import ashoat from 'lib/facts/ashoat.js'; | ||||
import { threadTypes } from 'lib/types/thread-types.js'; | import { threadTypes } from 'lib/types/thread-types-enum.js'; | ||||
import { main } from './utils.js'; | import { main } from './utils.js'; | ||||
import { createScriptViewer } from '../session/scripts.js'; | import { createScriptViewer } from '../session/scripts.js'; | ||||
import { updateThread } from '../updaters/thread-updaters.js'; | import { updateThread } from '../updaters/thread-updaters.js'; | ||||
const channelID = '-1'; | const channelID = '-1'; | ||||
async function makeChannelPrivate() { | async function makeChannelPrivate() { | ||||
const viewer = createScriptViewer(ashoat.id); | const viewer = createScriptViewer(ashoat.id); | ||||
await updateThread(viewer, { | await updateThread(viewer, { | ||||
threadID: channelID, | threadID: channelID, | ||||
changes: { type: threadTypes.COMMUNITY_SECRET_SUBTHREAD }, | changes: { type: threadTypes.COMMUNITY_SECRET_SUBTHREAD }, | ||||
}); | }); | ||||
} | } | ||||
main([makeChannelPrivate]); | main([makeChannelPrivate]); |