So basically, it was The End of Time, the bit where Ten is going around to say goodbye to all his companions, but instead of finding Jack on some space cruiser, he finds him being all emo in some desolate landscape, and his "gift" to Jack, instead of sexytiems with Alonso, is removing all of Jack's memories of Ianto (Donna-style). So the Doctor buggers off to regenerate, and leaves Jack all alone, not knowing that even though all Jack's memories of Ianto are gone, all the grief is still there*, AND IT WON'T GO AWAY, BECAUSE JACK DOESN'T KNOW WHY IT'S THERE.
And then a few centuries down the track, Jack meets some indirect descendant of Ianto's who looks just like him, and together they have to piece together the mystery of who Ianto was for Reasons That My Dream Wasn't Very Clear On.
BUT IT WAS REALLY SAD, YOU GUYS.
*Like Amy with Rory, except I didn't draw that parallel in my dream.