Package org.jivesoftware.smack.packet

Examples of org.jivesoftware.smack.packet.Message.addExtension()


            }

            Message message = chat.createMessage();
            if (secureExtension.getData() != null) {
                message.setBody("[This message is encrypted]");
                message.addExtension(secureExtension);
            } else {
                message.setBody(text);
            }
            if (signedExtension.getData() != null) {
                message.addExtension(signedExtension);
View Full Code Here


                message.addExtension(secureExtension);
            } else {
                message.setBody(text);
            }
            if (signedExtension.getData() != null) {
                message.addExtension(signedExtension);
            }


            if (buddy.isAskForDelivered()) {
                BuddyList.getInstance().putEventMessage(message.getPacketID(), message.getTo(), getDate(null), 1);
View Full Code Here

                  .getFrom());
              MessageEvent replyEvent = new MessageEvent();
              replyEvent.setPacketID(lastReceivedMessage
                  .getPacketID());
              replyEvent.setComposing(false);
              reply.addExtension(replyEvent);
              account.xmpp.getConnection().sendPacket(reply);
            }
          } else {
            if (!sentComposing) {
              sentComposing = true;
View Full Code Here

                  .getFrom());
              MessageEvent replyEvent = new MessageEvent();
              replyEvent.setPacketID(lastReceivedMessage
                  .getPacketID());
              replyEvent.setComposing(true);
              reply.addExtension(replyEvent);
              account.xmpp.getConnection().sendPacket(reply);
            }
          }
        } else if ((e.stateMask & SWT.CONTROL) != 0 && e.keyCode == 'b') {
          makeInputSelectionBold();
View Full Code Here

         */
        try {
            Message message = muc.createMessage();
            message.setBody("");
            ChatStateExtension extension = new ChatStateExtension(newState);
            message.addExtension(extension);
            muc.sendMessage(message);
        } catch (Exception e1) {
            log.debug("Couldn't send state (" + e1.getMessage() + ")");
        }

View Full Code Here

  msg.setBody("Hey John, this is my new green!!!!");
  // Create a XHTMLExtension Package and add it to the message
  XHTMLExtension xhtmlExtension = new XHTMLExtension();
  xhtmlExtension.addBody(
  "<body><p style='font-size:large'>Hey John, this is my new <span style='color:green'>green</span><em>!!!!</em></p></body>");
  msg.addExtension(xhtmlExtension);

  // User1 sends the message that contains the XHTML to user2
  try {
      chat1.sendMessage(msg);
      Thread.sleep(200);
View Full Code Here

  msg.setBody("Hey John, this is my new green!!!!");
  // Create a XHTMLExtension Package and add it to the message
  XHTMLExtension xhtmlExtension = new XHTMLExtension();
  xhtmlExtension.addBody(
  "<body><p style='font-size:large'>Hey John, this is my new <span style='color:green'>green</span><em>!!!!</em></p></body>");
  msg.addExtension(xhtmlExtension);

  // User1 sends the message that contains the XHTML to user2
  try {
      chat1.sendMessage(msg);
  }
View Full Code Here

        XHTMLExtension xhtmlExtension = new XHTMLExtension();
        xhtmlExtension.addBody(
                "<body xml:lang=\"es-ES\"><h1>impresionante!</h1><p>Como Emerson dijo una vez:</p><blockquote><p>Una consistencia ridicula es el espantajo de mentes pequenas.</p></blockquote></body>");
        xhtmlExtension.addBody(
                "<body xml:lang=\"en-US\"><h1>awesome!</h1><p>As Emerson once said:</p><blockquote><p>A foolish consistency is the hobgoblin of little minds.</p></blockquote></body>");
        msg.addExtension(xhtmlExtension);

  // User1 sends the message that contains the XHTML to user2
  try {
      bodiesSent = xhtmlExtension.getBodiesCount();
      bodiesReceived = 0;
View Full Code Here

        if(!updateChatState(chat, newState)) {
            return;
        }
        Message message = new Message();
        ChatStateExtension extension = new ChatStateExtension(newState);
        message.addExtension(extension);

        chat.sendMessage(message);
    }

View Full Code Here

            Chat chat = connection.getChatManager().getThreadChat(message.getThread());
            if (chat == null) {
                return;
            }
            if (updateChatState(chat, ChatState.active)) {
                message.addExtension(new ChatStateExtension(ChatState.active));
            }
        }
    }

    private class IncomingMessageInterceptor implements ChatManagerListener, MessageListener {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.