fix mastodon publish
This commit is contained in:
@@ -25,7 +25,7 @@ const botController = {
|
|||||||
})
|
})
|
||||||
console.log(botController.bots)
|
console.log(botController.bots)
|
||||||
},
|
},
|
||||||
add (user) {
|
add (user, token) {
|
||||||
const bot = new Mastodon({ access_token: user.mastodon_auth.access_token, api_url: `https://${user.mastodon_instance}/api/v1/` })
|
const bot = new Mastodon({ access_token: user.mastodon_auth.access_token, api_url: `https://${user.mastodon_instance}/api/v1/` })
|
||||||
const listener = bot.stream('streaming/direct')
|
const listener = bot.stream('streaming/direct')
|
||||||
listener.on('message', botController.message)
|
listener.on('message', botController.message)
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ const userController = {
|
|||||||
const mastodon_auth = { client_id, client_secret, access_token: token }
|
const mastodon_auth = { client_id, client_secret, access_token: token }
|
||||||
req.user.mastodon_auth = mastodon_auth
|
req.user.mastodon_auth = mastodon_auth
|
||||||
await req.user.save()
|
await req.user.save()
|
||||||
await bot.add(token)
|
await bot.add(req.user, token)
|
||||||
res.json(req.user)
|
res.json(req.user)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
res.json(e)
|
res.json(e)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default {
|
|||||||
|
|
||||||
const user = await api.getUser()
|
const user = await api.getUser()
|
||||||
this.user = user
|
this.user = user
|
||||||
this.mastodon_instance = user.instance
|
this.mastodon_instance = user.mastodon_instance
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async associate () {
|
async associate () {
|
||||||
|
|||||||
Reference in New Issue
Block a user