Package com.valhalla.jbother.jabber.smack

Examples of com.valhalla.jbother.jabber.smack.LastActivity


    public void run() {
        if( dialog.cancelled ) return;

        XMPPConnection con = BuddyList.getInstance().getConnection();

        LastActivity request = new LastActivity();
        request.setType(IQ.Type.GET);
        request.setTo(dialog.getUser());

        // Create a packet collector to listen for a response.
        PacketCollector collector = con
                .createPacketCollector(new PacketIDFilter(request.getPacketID()));

        con.sendPacket(request);

        // Wait up to 5 seconds for a result.
        IQ result = (IQ) collector.nextResult(SmackConfiguration
                .getPacketReplyTimeout());
        if( dialog.cancelled ) return;

        if (result != null && result.getType() == IQ.Type.RESULT) {
            LastActivity t = (LastActivity) result;

            field.setText(t.showTime());
        } else
            field.setText("N/A");
        field.validate();
    }
View Full Code Here

TOP

Related Classes of com.valhalla.jbother.jabber.smack.LastActivity

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.