West Ham have signed the Senegal international on a long-term deal.