Differentiation between COD (direct object) and COI (indirect object) can be tedious, but once you've understood the basic rules, things get a lot simpler!
Indirect object pronouns are the same as direct object pronouns, apart from lui (to him/her) and leur (to them.) ...