Skip to content

Commit

Permalink
fixes typo on UserLocation
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Buret <[email protected]>
  • Loading branch information
vsct-jburet committed Jun 6, 2017
1 parent ae1093a commit e7bce1a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import fr.vsct.tock.bot.connector.messenger.model.webhook.FacebookLocation
import fr.vsct.tock.bot.connector.messenger.model.webhook.LocationPayload
import fr.vsct.tock.bot.connector.messenger.model.webhook.Payload
import fr.vsct.tock.bot.connector.messenger.model.webhook.UrlPayload
import fr.vsct.tock.bot.engine.user.UserLocation
import fr.vsct.tock.shared.jackson.JacksonDeserializer
import fr.vsct.tock.shared.jackson.read
import fr.vsct.tock.shared.jackson.readValue
Expand All @@ -40,7 +39,7 @@ internal class PayloadDeserializer : JacksonDeserializer<Payload>() {

override fun deserialize(jp: JsonParser, ctxt: DeserializationContext): Payload? {
data class PayloadFields(
var coordinates: UserLocation? = null,
var coordinates: FacebookLocation? = null,
var url: String? = null)

val (coordinates, url) = jp.read<PayloadFields> { fields, name ->
Expand All @@ -54,7 +53,7 @@ internal class PayloadDeserializer : JacksonDeserializer<Payload>() {
}

return if (coordinates != null) {
LocationPayload(FacebookLocation(coordinates))
LocationPayload(coordinates)
} else if (url != null) {
UrlPayload(url)
} else {
Expand Down

0 comments on commit e7bce1a

Please sign in to comment.