protected Attachment getImageMessage ( MessageEnvelope envelope ) { if ( envelope != null && envelope . getMessage ( ) != null && envelope . getMessage ( ) . getAttachments ( ) != null && envelope . getMessage ( ) . getAttachments ( ) . get ( 0 ) != null && envelope . getMessage ( ) . getAttachments ( ) . get ( 0 ) . getType ( ) == AttachmentType . IMAGE ) { return envelope . getMessage ( ) . getAttachments ( ) . get ( 0 ) ; } return null ; }
Gets the image message .