diff --git a/weboob/backends/aum/backend.py b/weboob/backends/aum/backend.py index b97033c8..a4b62eb6 100644 --- a/weboob/backends/aum/backend.py +++ b/weboob/backends/aum/backend.py @@ -23,6 +23,7 @@ from __future__ import with_statement from datetime import datetime from weboob.backend import BaseBackend +from weboob.capabilities.chat import ICapChat from weboob.capabilities.messages import ICapMessages, ICapMessagesReply, Message from weboob.capabilities.dating import ICapDating from weboob.tools.browser import BrowserUnavailable @@ -31,7 +32,11 @@ from .browser import AdopteUnMec from .exceptions import AdopteCantPostMail from .optim.profiles_walker import ProfilesWalker -class AuMBackend(BaseBackend, ICapMessages, ICapMessagesReply, ICapDating): + +__all__ = ['AuMBackend'] + + +class AuMBackend(BaseBackend, ICapMessages, ICapMessagesReply, ICapDating, ICapChat): NAME = 'aum' MAINTAINER = 'Romain Bignon' EMAIL = 'romain@peerfuse.org' @@ -128,3 +133,9 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesReply, ICapDating): if self._profiles_walker: self._profiles_walker.stop() self._profiles_walker = None + + def iter_chat_contacts(self, online=True, offline=True): + return self.browser.iter_chat_contacts(online=online, offline=offline) + + def send_chat_message(self, _id, message): + return self.browser.send_chat_message(_id, message) diff --git a/weboob/backends/aum/browser.py b/weboob/backends/aum/browser.py index 5e34c88d..9317a895 100644 --- a/weboob/backends/aum/browser.py +++ b/weboob/backends/aum/browser.py @@ -1,25 +1,25 @@ # -*- coding: utf-8 -*- -""" -Copyright(C) 2008-2010 Romain Bignon +# Copyright(C) 2008-2010 Romain Bignon, Christophe Benz +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 3 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -""" import time from logging import warning +import random +import simplejson from weboob.tools.browser import BaseBrowser from weboob.tools.parsers.html5libparser import Html5libParser @@ -36,6 +36,12 @@ from weboob.backends.aum.pages.login import LoginPage, RedirectPage, BanPage, Er from weboob.backends.aum.pages.edit import EditPhotoPage, EditPhotoCbPage, EditAnnouncePage, EditDescriptionPage, EditSexPage, EditPersonalityPage from weboob.backends.aum.pages.wait import WaitPage +from weboob.capabilities.chat import Contact + + +__all__ = ['AdopteUnMec'] + + class AdopteUnMec(BaseBrowser): DOMAIN = 'www.adopteunmec.com' PROTOCOL = 'http' @@ -262,3 +268,29 @@ class AdopteUnMec(BaseBrowser): r = result.find('