private boolean isMessageFromUser(Message message,User user){
  String userId=null;
  boolean isMyMessage=false;
  if (message.user != null && message.user.userID != null) {
    userId=message.user.userID;
  }
 else {
    userId=message.userID;
  }
  if (userId.equals(user.userID)) {
    isMyMessage=true;
  }
  if (message.type == Const.MessageType.TYPE_NEW_USER || message.type == Const.MessageType.TYPE_USER_LEAVE) {
    isMyMessage=false;
  }
  return isMyMessage;
}

private boolean isMessageFromUser ( Message message , User user ) { String userId = null ; boolean isMyMessage = false ; if ( message . user != null && message . user . userID != null ) { userId = message . user . userID ; } else { userId = message . userID ; } if ( userId . equals ( user . userID ) ) { isMyMessage = true ; } if ( message . type == Const . MessageType . TYPE_NEW_USER || message . type == Const . MessageType . TYPE_USER_LEAVE ) { isMyMessage = false ; } return isMyMessage ; }
check is message from user
