comment from mastodon to gancio
This commit is contained in:
@@ -72,7 +72,12 @@ ${event.description.length > 200 ? event.description.substr(0, 200) + '...' : ev
|
||||
// const comment = await Comment.findOne( {where: { }})
|
||||
return
|
||||
}
|
||||
const comment = await Comment.create({activitypub_id: msg.data.last_status.id, text: msg.data.last_status.content, author: msg.data.accounts[0].username })
|
||||
const comment = await Comment.create({
|
||||
activitypub_id: msg.data.last_status.id,
|
||||
text: msg.data.last_status.content,
|
||||
data: msg.data,
|
||||
author: msg.data.accounts[0].username
|
||||
})
|
||||
event.addComment(comment)
|
||||
console.log(event)
|
||||
// const comment = await Comment.findOne( { where: {activitypub_id: msg.data.in_reply_to}} )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Sequelize = require('sequelize')
|
||||
const conf = require('./config.js')
|
||||
const db = new Sequelize(conf.db)
|
||||
// db.sync({force: true})
|
||||
db.sync()
|
||||
module.exports = db
|
||||
|
||||
@@ -10,7 +10,7 @@ const Event = db.define('event', {
|
||||
end_datetime: { type: Sequelize.DATE, index: true },
|
||||
image_path: Sequelize.STRING,
|
||||
is_visible: Sequelize.BOOLEAN,
|
||||
activitypub_id: { type: Sequelize.INTEGER, index: true },
|
||||
activitypub_id: { type: Sequelize.STRING, index: true },
|
||||
// activitypub_ids: { type: Sequelize.ARRAY, index}
|
||||
})
|
||||
|
||||
@@ -20,9 +20,9 @@ const Tag = db.define('tag', {
|
||||
})
|
||||
|
||||
const Comment = db.define('comment', {
|
||||
activitypub_id: { type: Sequelize.INTEGER, index: true },
|
||||
activitypub_id: { type: Sequelize.STRING, index: true },
|
||||
data: Sequelize.JSON,
|
||||
url: Sequelize.STRING,
|
||||
media_attachments: { type: Sequelize.ARRAY(Sequelize.STRING) },
|
||||
author: Sequelize.STRING,
|
||||
text: Sequelize.STRING
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user