Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.MessageListener


                LogLog.debug("About to create ChatGroup");
                groupchat = new MultiUserChat(con, recipient);
                LogLog.debug("About to join room");
                groupchat.join(nickname != null ? nickname : username);
            } else {
                chat = con.getChatManager().createChat(recipient, new MessageListener(){
                  public void processMessage(Chat chat, Message message) {
                    //do nothing
                  }
                });
            }
View Full Code Here


            ChatManager chatmanager = conn.getChatManager();
            chatmanager.addChatListener(new ChatManagerListener() {
                @Override
                public void chatCreated(Chat chat, boolean createdLocally) {
                    if (!createdLocally) {
                        chat.addMessageListener(new MessageListener() {
                            @Override
                            public void processMessage(Chat chat, Message message) {
                                try {
                                    // the user is in my list, OK accepc messages
                                    LOG.info(chat.getParticipant());
View Full Code Here

        this.getRootPane().setDefaultButton(jbtSendMessage);
        changeGUI();
        jbtSendMessage.setMnemonic('s');
      
        chatmanager = xmppconnection.getChatManager();
        chat = chatmanager.createChat(this.getTitle(), new MessageListener() {
            public void processMessage(Chat chat, Message message) {
                txtAreaChat.setText(txtAreaChat.getText() + message.getFrom() + ": " + message.getBody().toString() + "\n");
                setVisible(true);
            }
        });
View Full Code Here

        jbtSendMessage.setMnemonic('s');

        txtAreaChat.setText( strFrom + ": " + message.getBody().toString() + "\n");

        chatmanager = xmppconnection.getChatManager();
        chat = chatmanager.createChat(message.getFrom(), new MessageListener() {
            public void processMessage(Chat chat, Message msg) {
                txtAreaChat.setText(txtAreaChat.getText() + msg.getFrom() + ": " + msg.getBody().toString() + "\n");
                setVisible(true);
            }
        });
View Full Code Here

        synchronized (this.chats) {
            Chat chat = this.chats.get(jid);

            if (chat == null) {
                chat = this.chatmanager.createChat(jid.toString(),
                    new MessageListener() {
                        public void processMessage(Chat arg0, Message arg1) {
                            /*
                             * We don't care about the messages here, because we
                             * are registered as a PacketListener
                             */
 
View Full Code Here

        }

        ChatManager chatManager = connection.getChatManager();
        Chat chat = chatManager.getThreadChat(threadId);
        if (chat == null) {
            chat = chatManager.createChat(getParticipant(), threadId, new MessageListener() {
                public void processMessage(Chat chat, Message message) {
                    // not here to do conversation
                }
            });
        }
View Full Code Here

            // SmackConfiguration.setPacketReplyTimeout(1000);
            XMPPConnection con = new XMPPConnection(config);
            con.connect();
            con.login("amq-user", "amq-pwd");
            ChatManager chatManager = con.getChatManager();
            Chat chat = chatManager.createChat("test@localhost", new MessageListener() {
                public void processMessage(Chat chat, Message message) {
                    System.out.println("Got XMPP message from chat " + chat.getParticipant() + " message - " + message.getBody());
                }
            });
            for (int i = 0; i < 10; i++) {
View Full Code Here

            public boolean accept(Packet packet) {
                return true;
            }
        });

        Chat chat = producerCon.getChatManager().createChat("consumer", new MessageListener() {
            public void processMessage(Chat chat, Message message) {
                System.out.println("Got XMPP message from chat " + chat.getParticipant() + " message - " + message.getBody());
            }
        });
View Full Code Here

        producerCon.connect();
        addLoggingListeners("PRODUCER", producerCon);
        producerCon.login("producer", "producer");

        //create the chat and send some messages
        Chat chat = producerCon.getChatManager().createChat("consumer", new MessageListener() {
            public void processMessage(Chat chat, Message message) {
                System.out.println("Got XMPP message from chat " + chat.getParticipant() + " message - " + message.getBody());
            }
        });
       
View Full Code Here

            // SmackConfiguration.setPacketReplyTimeout(1000);
            XMPPConnection con = new XMPPConnection(config);
            con.connect();
            con.login("amq-user", "amq-pwd");
            ChatManager chatManager = con.getChatManager();
            Chat chat = chatManager.createChat("test@localhost", new MessageListener() {
                public void processMessage(Chat chat, Message message) {
                    LOG.info("Got XMPP message from chat " + chat.getParticipant() + " message - " + message.getBody());
                }
            });
            for (int i = 0; i < 10; i++) {
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.MessageListener

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.