@@ -842,7 +842,7 @@ class WebhookHandler < Goliath::API
case jparams['direction']
when 'in'
text = ''
- case jparams['eventType']
+ case type
when 'sms'
text = jparams['text']
when 'mms'
@@ -888,8 +888,11 @@ class WebhookHandler < Goliath::API
end
return [200, {}, "OK"]
+ when 'message-received'
+ # TODO: handle group chat, and fix above
+ text = jparams['text']
else
- text = "unknown type (#{jparams['eventType']})"\
+ text = "unknown type (#{type})"\
" with text: " + jparams['text']
# TODO: log/notify of this properly