While Iran is unhappy with Hamas at present, due to them not demonstrating publicly their support for Assad (not that their support would make any difference), Iran cannot really afford to lose Hamas because they are one of their key legs in the Middle East; this is how Iran applies pressure on Israel and the West. But Hamas has other options too. Israel's self-destructive diplomacy made Turkey seriously consider supporting Hamas. I take it that Egypt will soon also enjoy such good options, deciding on being aligned with the West or with Iran, which will try to befriend them. Israel can only be envious of this embarrassment of riches.
Italian FM arrives in Iran to promote economic, political ties (Reuters)