Bran tells Sam he's the Three-Eyed Raven. And Sam, speaking for all of Westeros, says "Oh! I don't know what that means."
Bran briefly explains and begins to tell Sam how he has to tell Jon, who's on his way back to Winterfell, that his true parents are Rhaegar Targaryen and Lyanna Stark. Bran says his real name is Jon Snow.
But Sam puts together the little, but very important, nugget of information that Gilly found in the High Septon's diary the last time we saw them. That's the revelation that Jon is actually not a bastard, because they were married, and Bran then witnesses the ceremony with his powers.
Jon is the legitimate heir to the Iron Throne.
In an excruciating sequence, we see Jon and Daenerys hook up, the true weight of their actions unknown to either — they are technically aunt and nephew. As one incestuous relationship ends, another begins! Meanwhile, Tyrion broods in the hallway outside.