I'm not sure about what sentence is right (and a little explanation why if it's not too much to ask would be nice):

1) Everybody was irritated when they were told they wouldn't be paid.
2) Everybody was irritated when they had been told they wouldn't be paid.

Either sentence could be right, depending on the meaning you're trying to convey. "Were" refers to a past continuous sense, i.e. the "when" is "at the same time that they were told." "Had been" refers to a past perfect sense, i.e. the "when" is "after the telling had been done." Was everyone irritated during the telling (1), or only after the telling (2)?