summaryrefslogtreecommitdiff
path: root/src/contact.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-10-27 22:49:52 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-10-27 22:49:52 +0000
commitc091e0c16fb1dbcf5c2a3789c8960e5384a480c0 (patch)
tree1062ae42331f58a1a89cc20d7836910bfe0998d5 /src/contact.py
parentd6e3788305a6e0c68156b00a1ae5c0f4aee9aff7 (diff)
downloadpoezio-c091e0c16fb1dbcf5c2a3789c8960e5384a480c0.tar.gz
poezio-c091e0c16fb1dbcf5c2a3789c8960e5384a480c0.tar.bz2
poezio-c091e0c16fb1dbcf5c2a3789c8960e5384a480c0.tar.xz
poezio-c091e0c16fb1dbcf5c2a3789c8960e5384a480c0.zip
Command mode in roster tab, toggle offline contacts with 'o' and sort contacts by show
Diffstat (limited to 'src/contact.py')
-rw-r--r--src/contact.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/contact.py b/src/contact.py
index 5fa0a17d..35a4a4a8 100644
--- a/src/contact.py
+++ b/src/contact.py
@@ -14,6 +14,11 @@
# You should have received a copy of the GNU General Public License
# along with Poezio. If not, see <http://www.gnu.org/licenses/>.
+
+"""
+Defines the Resource and Contact classes
+"""
+
from sleekxmpp.xmlstream.stanzabase import JID
class Resource(object):
@@ -55,7 +60,7 @@ class Resource(object):
class Contact(object):
"""
This a way to gather multiple resources from the same bare JID.
- This class contains zero or more esource class and useful methods
+ This class contains zero or more Resource object and useful methods
to get the resource with the highest priority, etc
"""
def __init__(self, bare_jid):
@@ -116,6 +121,7 @@ class Contact(object):
if resource.get_jid().full == fulljid:
return resource
return None
+
def toggle_folded(self):
"""
Fold if it's unfolded, and vice versa
@@ -148,7 +154,7 @@ class Contact(object):
def get_resources(self):
"""
- Return all resources
+ Return all resources, sorted by priority
"""
compare_resources = lambda x: x.get_priority()
return sorted(self._resources, key=compare_resources)