Examples of PresenceListener


Examples of nu.fw.jeti.events.PresenceListener

  //----------------------------------Presence----------------------------------------------------\\
  private void presence(Presence presence)
  {
    //presence for groupchat eg
    PresenceListener presenceListener = backend.getPresenceListener(presence.getFrom());
    if(presenceListener != null)
    {
      presenceListener.presenceChanged(presence);
       return;
    }
   
    String type = presence.getType();
    if(!"error".equals(type))
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

                });
            }
        };
        xmppSession.addSessionStatusListener(connectionListener);

        final PresenceListener presenceListener = new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                if (!e.isIncoming()) {
                    final Presence presence = e.getPresence();
                    if (presence.getTo() == null) {
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

    @Test
    public void testLastActivityInAwayPresence() {
        final TestXmppSession xmppSession1 = new TestXmppSession(ROMEO, new MockServer());
        xmppSession1.getExtensionManager(AvatarManager.class).setEnabled(false);
        xmppSession1.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                xmppSession1.removePresenceListener(this);
                Assert.assertTrue(e.getPresence().getExtension(LastActivity.class) != null);
            }
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

    @Test
    public void testLastActivityInXAPresence() {
        TestXmppSession xmppSession1 = new TestXmppSession(ROMEO, new MockServer());
        xmppSession1.getExtensionManager(AvatarManager.class).setEnabled(false);
        xmppSession1.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                Assert.assertTrue(e.getPresence().getExtension(LastActivity.class) != null);
            }
        });
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

    @Test
    public void testLastActivityInChatPresence() {
        TestXmppSession xmppSession1 = new TestXmppSession(ROMEO, new MockServer());
        xmppSession1.getExtensionManager(AvatarManager.class).setEnabled(false);
        xmppSession1.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                Assert.assertFalse(e.getPresence().getExtension(LastActivity.class) != null);
            }
        });
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

    @Test
    public void testLastActivityInDndPresence() {
        TestXmppSession xmppSession1 = new TestXmppSession(ROMEO, new MockServer());
        xmppSession1.getExtensionManager(AvatarManager.class).setEnabled(false);
        xmppSession1.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                Assert.assertFalse(e.getPresence().getExtension(LastActivity.class) != null);
            }
        });
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

    @Test
    public void testLastActivityInInitialPresence() {
        TestXmppSession xmppSession1 = new TestXmppSession(ROMEO, new MockServer());
        xmppSession1.getExtensionManager(AvatarManager.class).setEnabled(false);
        xmppSession1.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                Assert.assertFalse(e.getPresence().getExtension(LastActivity.class) != null);
            }
        });
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

    public PresenceManager(final XmppSession xmppSession) {

        this.xmppSession = xmppSession;

        xmppSession.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                Presence presence = e.getPresence();
                if (e.isIncoming()) {
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

                        }
                    }
                }
            }
        });
        xmppSession.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                if (e.isIncoming()) {
                    // A client SHOULD "unlock" after having received a <message/> or <presence/> stanza from any other resource controlled by the peer (or a presence stanza from the locked resource); as a result, it SHOULD address its next message(s) in the chat session to the bare JID of the peer (thus "unlocking" the previous "lock") until it receives a message from one of the peer's full JIDs.
                    AbstractPresence presence = e.getPresence();
View Full Code Here

Examples of rocks.xmpp.core.stanza.PresenceListener

                                    }
                                });
                            }
                        });

                        xmppSession.addPresenceListener(new PresenceListener() {
                            @Override
                            public void handle(final PresenceEvent e) {
                                if (e.isIncoming()) {
                                    if (e.getPresence().isAvailable()) {
                                        Platform.runLater(new Runnable() {
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.