* returns the message and the time received
* @return
*/
public Message getMessage()
{
MessageBuilder builder = new MessageBuilder();
builder.body = message.getBody();
builder.from = message.getFrom();
builder.to = message.getTo();
builder.thread = message.getThread();
builder.type = message.getType();
boolean delayed=false;
if(message.hasExtensions())
{
for (Iterator iter = message.getExtensions(); iter.hasNext();)
{
Extension extension = (Extension)iter.next();
builder.addExtension(extension);
if(extension instanceof XDelay)delayed=true;
};
}
if(!delayed)
{
builder.addExtension(new XDelay( dateFormat.format(new Date(time)),message.getFrom()));
}
return (Message) builder.build();
}