Telegram will provide authorities with user data in response to legal requests, in a major policy shift.