I find this sentence having a flaw. Let me analyse it to expose the flaw.
The old, discredited leaders of the Party had been used to gather there before they were finally purged.
- Let poopflies = {old, discredited leaders of the Party}
- Let familiar with = {used to}
Defective construction exposed:
- The {poopflies} had been {familiar with} {eat horse dung}
- The {poopflies} had been {familiar with} {gather there}
Corrected:
- The {poopflies} had been {familiar with} {eating horse dung}
- The {poopflies} had been {familiar with} {gathering there}
Therefore,
- The {poopflies} had been {used to} {eating horse dung}
- The {poopflies} had been {used to} {gathering there}
- The {poopflies} had been {used to} {gathering there} before they were exterminated with insecticide.
- The {old, discredited leaders of the Party} had been {used to} {gathering there} before they were finally purged from the party.
I am unable to validate that {gather there} without being a gerund would contribute stability to the construction of that sentence.
If the writer of the sentence insists in such a construction, then it could only mean
- The {poopflies} had been {used to} {gather horse dung}
- The {poopflies} had been {exploited to} {gather horse dung}
- The {poopflies} had been {exploited} {to gather horse dung}
- The {old, discredited leaders of the Party} had been {exploited} {to gather there} before they were finally purged from the party.
Which I don't think is the intention of the writer.
The acceptable construction is
The {old, discredited leaders of the Party} had been {used to} {gathering there} before they were finally purged from the party.