Despite military setbacks during the war, Tehran is presenting a narrative of victory before negotiations with Washington.