'Retrieve the presence information of a JID.
May return either all online resources\' status, or
a single resource\'s status.
Arguments:
jid      -- The JID to lookup.
resource -- Optional resource for returning
only the status of a single connection.'

def presence(self, jid, resource=None):

    if (resource is None):
        return self[jid].resources
    default_presence = {'status': '', 'priority': 0, 'show': ''}
    return self[jid].resources.get(resource, default_presence)
