I'm having a little bit of trouble understanding the following sentence (namely the って言った and そういうことだった):

>「メル、トレガーの養女になってお城に上がったんだってね。
>
>僕のうちに来られない、って言ったのはそういうことだったんだ…」

I think the speaker might be quoting a third-party because it looks like "he said" and then followed by "it was said". Is that about right...?

メル: a female character

トレガー: male character

The speaker is a 3rd character.

Edit: Funny to come back to this over 2 years later and be able to understand it without it having to be explained to me! I guess practice really does bear fruit :)