The US president’s very public scolding of both Israel and Hamas for being difficult about his peace plan may have paid off.