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 considers 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.
U.S. confirms ISIS computer expert killed in air strike (Reuters)
from the article: Hamas leader embarks on visit to Iran, Gulf states