Package nu.fw.jeti.jabber.elements

Examples of nu.fw.jeti.jabber.elements.MessageBuilder


     * 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();
    }
View Full Code Here


     */
    public boolean sendMap(String mapID, String originID, JID jid, String subject, String body) {
        if (mapID == null || originID == null || jid == null)
            return false;
       
        MessageBuilder msgBuilder = new MessageBuilder();
       
        if (!addMapIntoMessage(msgBuilder, mapID, originID, true))
            return false;
       
        msgBuilder.subject =subject;
        msgBuilder.body = body;
        msgBuilder.to = jid;
        backend.send(msgBuilder.build());
       
        return true;
    }
View Full Code Here

TOP

Related Classes of nu.fw.jeti.jabber.elements.MessageBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.