implement chatoob messages command

This commit is contained in:
Christophe Benz 2010-05-16 17:42:27 +02:00
commit a4a74eda4f
4 changed files with 40 additions and 5 deletions

View file

@ -16,6 +16,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import datetime
from .cap import ICap
@ -26,7 +28,7 @@ class ChatException(Exception):
pass
class Contact(object):
class ChatContact(object):
def __init__(self, _id, pseudo, online, name=None, avatar_url=None, age=None):
self.id = _id
self.pseudo = pseudo
@ -36,6 +38,14 @@ class Contact(object):
self.age = age
class ChatMessage(object):
def __init__(self, id_from, id_to, message, date=None):
self.id_from = id_from
self.id_to = id_to
self.message = message
self.date = datetime.datetime.utcnow() if date is None else date
class ICapChat(ICap):
def iter_chat_contacts(self, online=True, offline=True):
raise NotImplementedError()