The president did not attend this year’s annual gathering in South Africa, which has been a frequent target of his attacks.