Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/chat/BuddyList.py
diff options
context:
space:
mode:
Diffstat (limited to 'chat/BuddyList.py')
-rw-r--r--chat/BuddyList.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/chat/BuddyList.py b/chat/BuddyList.py
index e7cb7ca..9bc63ba 100644
--- a/chat/BuddyList.py
+++ b/chat/BuddyList.py
@@ -1,3 +1,5 @@
+# -*- tab-width: 4; indent-tabs-mode: t -*-
+
import presence
import avahi
@@ -14,6 +16,13 @@ class Buddy(object):
self._host = host
self._address = address
self._port = port
+ self._chat = None
+
+ def set_chat(self, chat):
+ self._chat = chat
+
+ def chat(self):
+ return self._chat
def nick(self):
return self._nick
@@ -66,6 +75,12 @@ class BuddyList(object):
return buddy
return None
+ def find_buddy_by_address(self, address):
+ for buddy in self._buddies.keys():
+ if buddy.address() == address:
+ return buddy
+ return None
+
def _notify_listeners(self, action, buddy):
for listener in self._listeners:
listener(action, buddy)