*
* @see com.sissi.pipeline.Input#input(com.sissi.context.JIDContext, com.sissi.protocol.Protocol)
*/
@Override
public boolean input(JIDContext context, Protocol protocol) {
XMuc x = protocol.cast(Presence.class).findField(XMuc.NAME, XMuc.class);
if (x.hasHistory()) {
JID group = super.build(protocol.getTo());
Room room = this.room.build(group);
for (Element message : this.recover.pull(group, x.history())) {
Delay delay = Message.class.cast(message).getDelay();
delay.setFrom(room.allowed(context.jid(), RoomConfig.WHOISALLOW, super.build(delay.getFrom())) ? super.build(message.getFrom()).asStringWithBare() : delay.getFrom());
context.write(message);
}
}