Status class

Help
2008-11-26
2013-03-25
  • Alejandro Alliana

    Hi Alex,

      I would like to extend the Status class to include an status message.  I.e. "Out to a very long lunch", etc.

      Right now I'm working on the smack library, but as I understand AIM, Yahoo, MSN and Jabber all implement this feature.

      What woud your approach to this issue be?  I would like to make the feature as undisruptive as possible.

      Thanks in advance.

    pd.

    The away status is not working properly in SmackConnection: 

    In my sources, I changed the presenceChanged method in the anonimous inner class in SmackConnection to:

                public void presenceChanged(Presence presence) {
                    Contact contact = getContactFactory().create(normalizeName(presence.getFrom()), SmackConnection.this);
                    Status status = (Status) contact.getStatus().clone();
                    contact.getStatus().setOnline(presence.isAvailable());
                    //isAway also includes do not disturb (dnd), so we should not update in that case.
                    contact.getStatus().setAway(presence.isAway() && Presence.Mode.dnd != presence.getMode());
                    contact.getStatus().setIdleTime(0);
                    notifyStatusChanged(contact, status);
                }

    because away includes do not disturb.  In the same method, I'd like to use:

                    presence.getStatus()

    to get the status of the contact and use it.

      Thanks in advance.  Have a nice day.

     
    • Alex

      Alex - 2008-11-26

      yeah, go ahead, add status message to status. we may as well.  though in many protocols - it's a separate call to get it.

       

Log in to post a comment.