"I had told you when we were at dinner."
Translation:Te l'avevo detto quando eravamo a cena.
When there are two pronouns in a row, the first (indirect object) pronoun changes its 'i' to 'e';
mi -> me ti - > te si -> se ci-> ce vi -> ve gli -> glie
and glie runs together with the direct object pronoun eg Gliel'ho dato - I gave it to him.
At the end of an imperative, infinitive or gerund, the same thing happens eg dammelo (give it to me, you double the m) non posso darglielo (I can't give it to him, you drop the e on the infinitive) dandomelo (giving it to me).
See for example http://dante-learning.com/eng/2013/07/combining-italian-direct-and-indirect-pronouns-pronomi-combinati-quiz/. for full explanation