The workers must struggle against Capitalism and against Fascism and must extricate themselves from their grasp; they must have their own independent policy. In flattering ourselves on having found this, we only ask to be refuted, corrected or helped by all comrades, workers and those who wish to live in honor and freedom and want to spare the world the insult of a new slavery.
I am not able to understand the bolded passage. I thought that "flatter on" is a phrasal verb. But this is not that case. Can you tell me please what "In flattering ourselves on having found this" means in the context?