This commit is contained in:
lesion 2025-01-08 18:01:41 +01:00
parent 8ef52db372
commit 19c50527f8
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 4 additions and 4 deletions

View file

@ -19,7 +19,7 @@ module.exports = (sequelize, DataTypes) => {
/**
* @description WIP -> https://codeberg.org/fediverse/fep/src/commit/4a75a1bc50bc6d19fc1e6112f02c52621bc178fe/fep/8a8e/fep-8a8e.md#location
* @todo support PlaceAddress type
* @todo support PostalAddress type
* @returns ActivityStream location representation
*/
Place.prototype.toAP = function () {
@ -28,8 +28,7 @@ module.exports = (sequelize, DataTypes) => {
type: 'Place',
name: this.name,
address: this.address,
latitude: this.latitude,
longitude: this.longitude
...( this.latitude && this.longitude && ({ latitude: this.latitude, longitude: this.longitude}))
}
}

View file

@ -178,6 +178,7 @@ const Helpers = {
async parsePlace (APEvent) {
const eventController = require('../api/controller/event')
let place
if (APEvent?.location) {
place = {
place_name: APEvent.location?.name,
@ -233,7 +234,7 @@ const Helpers = {
const APEvent = message.object
// validate coming events
// validate incoming events
const required_fields = ['name', 'startTime', 'id']
let missing_field = required_fields.find(required_field => !APEvent[required_field])
if (missing_field) {