protected FbBotMillEventType eventKind ( MessageEnvelope envelope ) { IncomingMessage message = envelope . getMessage ( ) ; if ( message != null ) { if ( message instanceof ReceivedMessage ) { if ( getLocationMessage ( envelope ) != null ) { return FbBotMillEventType . LOCATION ; } if ( getImageMessage ( envelope ) != null ) { return FbBotMillEventType . IMAGE ; } if ( getVideoMessage ( envelope ) != null ) { return FbBotMillEventType . VIDEO ; } if ( getAudioMessage ( envelope ) != null ) { return FbBotMillEventType . AUDIO ; } if ( getFileMessage ( envelope ) != null ) { return FbBotMillEventType . FILE ; } return FbBotMillEventType . MESSAGE ; } if ( message instanceof EchoMessage ) { return FbBotMillEventType . ECHO ; } } if ( envelope . getPostback ( ) != null ) { return FbBotMillEventType . POSTBACK ; } if ( envelope . getDelivery ( ) != null ) { return FbBotMillEventType . DELIVERY ; } if ( envelope . getRead ( ) != null ) { return FbBotMillEventType . READ ; } if ( envelope . getAccountLinking ( ) != null ) { return FbBotMillEventType . ACCOUNT_LINKING ; } if ( envelope . getOptin ( ) != null ) { return FbBotMillEventType . AUTHENTICATION ; } if ( envelope . getCheckoutUpdate ( ) != null ) { return FbBotMillEventType . CHECKOUT_UPDATE ; } if ( envelope . getReferral ( ) != null ) { return FbBotMillEventType . REFERRAL ; } if ( envelope . getPayment ( ) != null ) { return FbBotMillEventType . PAYMENT ; } if ( envelope . getPreCheckout ( ) != null ) { return FbBotMillEventType . PRE_CHECKOUT ; } return FbBotMillEventType . ANY ; }
Returns the kind of callback received for the current envelope .