Right. That's a more advanced concept. The "whoever" / "whomever" choice works a little differently. In this case, the function of "whoever" / "whomever" within its own clause governs the choice, and the preceding preposition, if any, has nothing to do with the choice.
(I hope I haven't lost you now!)